@agent-team-foundation/first-tree-hub 0.11.0 → 0.11.1
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-DUeYbwm-.mjs → bootstrap-TJRy0B9m.mjs} +10 -2
- package/dist/chunk-BSw8zbkd.mjs +37 -0
- package/dist/cli/index.mjs +94 -35
- package/dist/client-BCaK653p-CZjDNcdM.mjs +516 -0
- package/dist/client-m1OM4Iag-HKWgB3Yk.mjs +4 -0
- package/dist/dist-BLY7Bu-l.mjs +430 -0
- package/dist/{dist-BoHl9HwW.mjs → dist-BkvrONSQ.mjs} +2 -22
- package/dist/drizzle/0031_drop_system_configs.sql +11 -0
- package/dist/drizzle/meta/_journal.json +7 -0
- package/dist/errors-BmyRwN0Y-CIZZ_sDc.mjs +92 -0
- package/dist/{esm-CYu4tXXn.mjs → esm-iadMkGbV.mjs} +2 -37
- package/dist/execAsync-CCyouKZM.mjs +10 -0
- package/dist/{execAsync-XMc-nFn-.mjs → execAsync-pImxPKN5.mjs} +1 -1
- package/dist/{feishu-Dxk6ArOK.mjs → feishu-AEMHwT6L.mjs} +2 -2
- package/dist/from-CaD373S1.mjs +3840 -0
- package/dist/{getMachineId-bsd-D0w3uAZa.mjs → getMachineId-bsd-DR4-Dysy.mjs} +3 -2
- package/dist/getMachineId-bsd-DjLgZlll.mjs +27 -0
- package/dist/getMachineId-darwin-B6WCAhc4.mjs +24 -0
- package/dist/{getMachineId-darwin-DOoYFb2_.mjs → getMachineId-darwin-CaD2juTg.mjs} +3 -2
- package/dist/getMachineId-linux-BeWHG1gK.mjs +20 -0
- package/dist/{getMachineId-linux-MlY63Zsw.mjs → getMachineId-linux-Dk3gWdQK.mjs} +2 -1
- package/dist/getMachineId-unsupported-BMJQItvF.mjs +15 -0
- package/dist/{getMachineId-unsupported-BS652RIy.mjs → getMachineId-unsupported-Bgz_Je1J.mjs} +2 -1
- package/dist/getMachineId-win-CdgcrzCW.mjs +26 -0
- package/dist/{getMachineId-win-B6hY8edq.mjs → getMachineId-win-vJ6VfDRI.mjs} +3 -2
- package/dist/index.mjs +9 -6
- package/dist/invitation-DWlyNb8x-DZTW9I26.mjs +4 -0
- package/dist/{invitation-B1pjAyOz-BaCA9PII.mjs → invitation-Dnn5gGGX-Ce7zbZpn.mjs} +4 -90
- package/dist/multipart-parser-BIksYTkk.mjs +294 -0
- package/dist/observability-C3nY6Jcz-Dpsi3eFk.mjs +96006 -0
- package/dist/observability-Co8OO0og.mjs +5 -0
- package/dist/{saas-connect-DLSyrQcC.mjs → saas-connect-Bd0g0v_b.mjs} +6442 -6923
- package/dist/src-DNBS5Yjj.mjs +735 -0
- package/dist/src-uVZSbShB.mjs +1176 -0
- package/dist/web/assets/{index-DDqPt6PI.css → index-7RvlJjJ9.css} +1 -1
- package/dist/web/assets/{index-COflQOwF.js → index-Dbwa40_B.js} +1 -1
- package/dist/web/assets/index-cpdSFHAJ.js +383 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/invitation-CBnQyB7o-TmnIj3kx.mjs +0 -3
- package/dist/observability-C08jUFsJ.mjs +0 -4
- package/dist/observability-DPyf745N-BSc8QNcR.mjs +0 -33897
- package/dist/web/assets/index-BxGzfDTS.js +0 -383
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
var K0=e=>{throw TypeError(e)};var Vm=(e,t,n)=>t.has(e)||K0("Cannot "+n);var M=(e,t,n)=>(Vm(e,t,"read from private field"),n?n.call(e):t.get(e)),ke=(e,t,n)=>t.has(e)?K0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,a)=>(Vm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Ie=(e,t,n)=>(Vm(e,t,"access private method"),n);var pd=(e,t,n,a)=>({set _(l){pe(e,t,l,n)},get _(){return M(e,t,a)}});function j2(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function uf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qm={exports:{}},Xo={};/**
|
|
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 G0;function C2(){if(G0)return Xo;G0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:u,ref:l!==void 0?l:null,props:o}}return Xo.Fragment=t,Xo.jsx=n,Xo.jsxs=n,Xo}var Y0;function E2(){return Y0||(Y0=1,Qm.exports=C2()),Qm.exports}var c=E2(),Km={exports:{}},$e={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var X0;function N2(){if(X0)return $e;X0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function E(L,P,A){this.props=L,this.context=P,this.refs=C,this.updater=A||k}E.prototype.isReactComponent={},E.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,P,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=E.prototype;function z(L,P,A){this.props=L,this.context=P,this.refs=C,this.updater=A||k}var I=z.prototype=new R;I.constructor=z,j(I,E.prototype),I.isPureReactComponent=!0;var B=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(L,P,A){var q=A.ref;return{$$typeof:e,type:L,key:P,ref:q!==void 0?q:null,props:A}}function F(L,P){return V(L.type,P,L.props)}function ne(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function oe(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(A){return P[A]})}var Se=/\/+/g;function G(L,P){return typeof L=="object"&&L!==null&&L.key!=null?oe(""+L.key):P.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function Z(L,P,A,q,X){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var xe=!1;if(L===null)xe=!0;else switch(ue){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(L.$$typeof){case e:case t:xe=!0;break;case y:return xe=L._init,Z(xe(L._payload),P,A,q,X)}}if(xe)return X=X(L),xe=q===""?"."+G(L,0):q,B(X)?(A="",xe!=null&&(A=xe.replace(Se,"$&/")+"/"),Z(X,P,A,"",function(ee){return ee})):X!=null&&(ne(X)&&(X=F(X,A+(X.key==null||L&&L.key===X.key?"":(""+X.key).replace(Se,"$&/")+"/")+xe)),P.push(X)),1;xe=0;var be=q===""?".":q+":";if(B(L))for(var fe=0;fe<L.length;fe++)q=L[fe],ue=be+G(q,fe),xe+=Z(q,P,A,ue,X);else if(fe=w(L),typeof fe=="function")for(L=fe.call(L),fe=0;!(q=L.next()).done;)q=q.value,ue=be+G(q,fe++),xe+=Z(q,P,A,ue,X);else if(ue==="object"){if(typeof L.then=="function")return Z(W(L),P,A,q,X);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return xe}function re(L,P,A){if(L==null)return L;var q=[],X=0;return Z(L,q,"","",function(ue){return P.call(A,ue,X++)}),q}function ve(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(A){(L._status===0||L._status===-1)&&(L._status=1,L._result=A)},function(A){(L._status===0||L._status===-1)&&(L._status=2,L._result=A)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var Re=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},_={map:re,forEach:function(L,P,A){re(L,function(){P.apply(this,arguments)},A)},count:function(L){var P=0;return re(L,function(){P++}),P},toArray:function(L){return re(L,function(P){return P})||[]},only:function(L){if(!ne(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return $e.Activity=g,$e.Children=_,$e.Component=E,$e.Fragment=n,$e.Profiler=l,$e.PureComponent=z,$e.StrictMode=a,$e.Suspense=m,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,$e.__COMPILER_RUNTIME={__proto__:null,c:function(L){return D.H.useMemoCache(L)}},$e.cache=function(L){return function(){return L.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(L,P,A){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var q=j({},L.props),X=L.key;if(P!=null)for(ue in P.key!==void 0&&(X=""+P.key),P)!U.call(P,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&P.ref===void 0||(q[ue]=P[ue]);var ue=arguments.length-2;if(ue===1)q.children=A;else if(1<ue){for(var xe=Array(ue),be=0;be<ue;be++)xe[be]=arguments[be+2];q.children=xe}return V(L.type,X,q)},$e.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},$e.createElement=function(L,P,A){var q,X={},ue=null;if(P!=null)for(q in P.key!==void 0&&(ue=""+P.key),P)U.call(P,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(X[q]=P[q]);var xe=arguments.length-2;if(xe===1)X.children=A;else if(1<xe){for(var be=Array(xe),fe=0;fe<xe;fe++)be[fe]=arguments[fe+2];X.children=be}if(L&&L.defaultProps)for(q in xe=L.defaultProps,xe)X[q]===void 0&&(X[q]=xe[q]);return V(L,ue,X)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(L){return{$$typeof:f,render:L}},$e.isValidElement=ne,$e.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ve}},$e.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},$e.startTransition=function(L){var P=D.T,A={};D.T=A;try{var q=L(),X=D.S;X!==null&&X(A,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(O,Re)}catch(ue){Re(ue)}finally{P!==null&&A.types!==null&&(P.types=A.types),D.T=P}},$e.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},$e.use=function(L){return D.H.use(L)},$e.useActionState=function(L,P,A){return D.H.useActionState(L,P,A)},$e.useCallback=function(L,P){return D.H.useCallback(L,P)},$e.useContext=function(L){return D.H.useContext(L)},$e.useDebugValue=function(){},$e.useDeferredValue=function(L,P){return D.H.useDeferredValue(L,P)},$e.useEffect=function(L,P){return D.H.useEffect(L,P)},$e.useEffectEvent=function(L){return D.H.useEffectEvent(L)},$e.useId=function(){return D.H.useId()},$e.useImperativeHandle=function(L,P,A){return D.H.useImperativeHandle(L,P,A)},$e.useInsertionEffect=function(L,P){return D.H.useInsertionEffect(L,P)},$e.useLayoutEffect=function(L,P){return D.H.useLayoutEffect(L,P)},$e.useMemo=function(L,P){return D.H.useMemo(L,P)},$e.useOptimistic=function(L,P){return D.H.useOptimistic(L,P)},$e.useReducer=function(L,P,A){return D.H.useReducer(L,P,A)},$e.useRef=function(L){return D.H.useRef(L)},$e.useState=function(L){return D.H.useState(L)},$e.useSyncExternalStore=function(L,P,A){return D.H.useSyncExternalStore(L,P,A)},$e.useTransition=function(){return D.H.useTransition()},$e.version="19.2.4",$e}var J0;function $g(){return J0||(J0=1,Km.exports=N2()),Km.exports}var b=$g();const _2=uf(b),Fg=j2({__proto__:null,default:_2},[b]);var Gm={exports:{}},Jo={},Ym={exports:{}},Xm={};/**
|
|
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 W0;function A2(){return W0||(W0=1,(function(e){function t(Z,re){var ve=Z.length;Z.push(re);e:for(;0<ve;){var Re=ve-1>>>1,_=Z[Re];if(0<l(_,re))Z[Re]=re,Z[ve]=_,ve=Re;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var re=Z[0],ve=Z.pop();if(ve!==re){Z[0]=ve;e:for(var Re=0,_=Z.length,L=_>>>1;Re<L;){var P=2*(Re+1)-1,A=Z[P],q=P+1,X=Z[q];if(0>l(A,ve))q<_&&0>l(X,A)?(Z[Re]=X,Z[q]=ve,Re=q):(Z[Re]=A,Z[P]=ve,Re=P);else if(q<_&&0>l(X,ve))Z[Re]=X,Z[q]=ve,Re=q;else break e}}return re}function l(Z,re){var ve=Z.sortIndex-re.sortIndex;return ve!==0?ve:Z.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],h=[],y=1,g=null,x=3,w=!1,k=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function I(Z){for(var re=n(h);re!==null;){if(re.callback===null)a(h);else if(re.startTime<=Z)a(h),re.sortIndex=re.expirationTime,t(m,re);else break;re=n(h)}}function B(Z){if(j=!1,I(Z),!k)if(n(m)!==null)k=!0,O||(O=!0,oe());else{var re=n(h);re!==null&&W(B,re.startTime-Z)}}var O=!1,D=-1,U=5,V=-1;function F(){return C?!0:!(e.unstable_now()-V<U)}function ne(){if(C=!1,O){var Z=e.unstable_now();V=Z;var re=!0;try{e:{k=!1,j&&(j=!1,R(D),D=-1),w=!0;var ve=x;try{t:{for(I(Z),g=n(m);g!==null&&!(g.expirationTime>Z&&F());){var Re=g.callback;if(typeof Re=="function"){g.callback=null,x=g.priorityLevel;var _=Re(g.expirationTime<=Z);if(Z=e.unstable_now(),typeof _=="function"){g.callback=_,I(Z),re=!0;break t}g===n(m)&&a(m),I(Z)}else a(m);g=n(m)}if(g!==null)re=!0;else{var L=n(h);L!==null&&W(B,L.startTime-Z),re=!1}}break e}finally{g=null,x=ve,w=!1}re=void 0}}finally{re?oe():O=!1}}}var oe;if(typeof z=="function")oe=function(){z(ne)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,G=Se.port2;Se.port1.onmessage=ne,oe=function(){G.postMessage(null)}}else oe=function(){E(ne,0)};function W(Z,re){D=E(function(){Z(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(Z){switch(x){case 1:case 2:case 3:var re=3;break;default:re=x}var ve=x;x=re;try{return Z()}finally{x=ve}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Z,re){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var ve=x;x=Z;try{return re()}finally{x=ve}},e.unstable_scheduleCallback=function(Z,re,ve){var Re=e.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?Re+ve:Re):ve=Re,Z){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=ve+_,Z={id:y++,callback:re,priorityLevel:Z,startTime:ve,expirationTime:_,sortIndex:-1},ve>Re?(Z.sortIndex=ve,t(h,Z),n(m)===null&&Z===n(h)&&(j?(R(D),D=-1):j=!0,W(B,ve-Re))):(Z.sortIndex=_,t(m,Z),k||w||(k=!0,O||(O=!0,oe()))),Z},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(Z){var re=x;return function(){var ve=x;x=re;try{return Z.apply(this,arguments)}finally{x=ve}}}})(Xm)),Xm}var e1;function T2(){return e1||(e1=1,Ym.exports=A2()),Ym.exports}var Jm={exports:{}},Sn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var t1;function R2(){if(t1)return Sn;t1=1;var e=$g();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Sn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Sn.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,y)},Sn.flushSync=function(m){var h=u.T,y=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=h,a.p=y,a.d.f()}},Sn.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},Sn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Sn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:x,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Sn.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=f(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},Sn.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin);a.d.L(m,y,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Sn.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=f(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},Sn.requestFormReset=function(m){a.d.r(m)},Sn.unstable_batchedUpdates=function(m,h){return m(h)},Sn.useFormState=function(m,h,y){return u.H.useFormState(m,h,y)},Sn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Sn.version="19.2.4",Sn}var n1;function $S(){if(n1)return Jm.exports;n1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Jm.exports=R2(),Jm.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 r1;function z2(){if(r1)return Jo;r1=1;var e=T2(),t=$g(),n=$S();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function u(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var S=!1,N=p.child;N;){if(N===s){S=!0,s=p,d=v;break}if(N===d){S=!0,d=p,s=v;break}N=N.sibling}if(!S){for(N=v.child;N;){if(N===s){S=!0,s=v,d=p;break}if(N===d){S=!0,d=v,s=p;break}N=N.sibling}if(!S)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),z=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function oe(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var Se=Symbol.for("react.client.reference");function G(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Se?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case B:return"Suspense";case O:return"SuspenseList";case V:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case z:return r.displayName||"Context";case R:return(r._context.displayName||"Context")+".Consumer";case I:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case D:return i=r.displayName||null,i!==null?i:G(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return G(r(i))}catch{}}return null}var W=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},Re=[],_=-1;function L(r){return{current:r}}function P(r){0>_||(r.current=Re[_],Re[_]=null,_--)}function A(r,i){_++,Re[_]=r.current,r.current=i}var q=L(null),X=L(null),ue=L(null),xe=L(null);function be(r,i){switch(A(ue,i),A(X,r),A(q,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?y0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=y0(i),r=v0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}P(q),A(q,r)}function fe(){P(q),P(X),P(ue)}function ee(r){r.memoizedState!==null&&A(xe,r);var i=q.current,s=v0(i,r.type);i!==s&&(A(X,r),A(q,s))}function me(r){X.current===r&&(P(q),P(X)),xe.current===r&&(P(xe),Qo._currentValue=ve)}var _e,Le;function it(r){if(_e===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);_e=i&&i[1]||"",Le=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+_e+r+Le}var pt=!1;function Pr(r,i){if(!r||pt)return"";pt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(te){var J=te}Reflect.construct(r,[],de)}else{try{de.call()}catch(te){J=te}r.call(de.prototype)}}else{try{throw Error()}catch(te){J=te}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(te){if(te&&J&&typeof te.stack=="string")return[te.stack,J.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),S=v[0],N=v[1];if(S&&N){var $=S.split(`
|
|
44
|
+
`),Y=N.split(`
|
|
45
|
+
`);for(p=d=0;d<$.length&&!$[d].includes("DetermineComponentFrameRoot");)d++;for(;p<Y.length&&!Y[p].includes("DetermineComponentFrameRoot");)p++;if(d===$.length||p===Y.length)for(d=$.length-1,p=Y.length-1;1<=d&&0<=p&&$[d]!==Y[p];)p--;for(;1<=d&&0<=p;d--,p--)if($[d]!==Y[p]){if(d!==1||p!==1)do if(d--,p--,0>p||$[d]!==Y[p]){var ae=`
|
|
46
|
+
`+$[d].replace(" at new "," at ");return r.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",r.displayName)),ae}while(1<=d&&0<=p);break}}}finally{pt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?it(s):""}function Oa(r,i){switch(r.tag){case 26:case 27:case 5:return it(r.type);case 16:return it("Lazy");case 13:return r.child!==i&&i!==null?it("Suspense Fallback"):it("Suspense");case 19:return it("SuspenseList");case 0:case 15:return Pr(r.type,!1);case 11:return Pr(r.type.render,!1);case 1:return Pr(r.type,!0);case 31:return it("Activity");default:return""}}function Cl(r){try{var i="",s=null;do i+=Oa(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
47
|
+
Error generating stack: `+d.message+`
|
|
48
|
+
`+d.stack}}var Da=Object.prototype.hasOwnProperty,Ma=e.unstable_scheduleCallback,Jr=e.unstable_cancelCallback,ro=e.unstable_shouldYield,ao=e.unstable_requestPaint,fn=e.unstable_now,io=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,Be=e.unstable_LowPriority,nt=e.unstable_IdlePriority,hn=e.log,ur=e.unstable_setDisableYieldValue,Wt=null,$t=null;function mn(r){if(typeof hn=="function"&&ur(r),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(Wt,r)}catch{}}var ft=Math.clz32?Math.clz32:ec,Nr=Math.log,Dn=Math.LN2;function ec(r){return r>>>=0,r===0?32:31-(Nr(r)/Dn|0)|0}var Mi=256,Ii=262144,Li=4194304;function Br(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Ui(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var N=d&134217727;return N!==0?(d=N&~v,d!==0?p=Br(d):(S&=N,S!==0?p=Br(S):s||(s=N&~r,s!==0&&(p=Br(s))))):(N=d&~v,N!==0?p=Br(N):S!==0?p=Br(S):s||(s=d&~r,s!==0&&(p=Br(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function Ia(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function tc(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function we(){var r=Li;return Li<<=1,(Li&62914560)===0&&(Li=4194304),r}function Ge(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function pn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Wr(r,i,s,d,p,v){var S=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var N=r.entanglements,$=r.expirationTimes,Y=r.hiddenUpdates;for(s=S&~s;0<s;){var ae=31-ft(s),de=1<<ae;N[ae]=0,$[ae]=-1;var J=Y[ae];if(J!==null)for(Y[ae]=null,ae=0;ae<J.length;ae++){var te=J[ae];te!==null&&(te.lane&=-536870913)}s&=~de}d!==0&&lo(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(S&~i))}function lo(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-ft(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function nc(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-ft(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function tv(r,i){var s=i&-i;return s=(s&42)!==0?1:Mf(s),(s&(r.suspendedLanes|i))!==0?0:s}function Mf(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function If(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function nv(){var r=re.p;return r!==0?r:(r=window.event,r===void 0?32:$0(r.type))}function rv(r,i){var s=re.p;try{return re.p=r,i()}finally{re.p=s}}var La=Math.random().toString(36).slice(2),gn="__reactFiber$"+La,Mn="__reactProps$"+La,El="__reactContainer$"+La,Lf="__reactEvents$"+La,hN="__reactListeners$"+La,mN="__reactHandles$"+La,av="__reactResources$"+La,so="__reactMarker$"+La;function Uf(r){delete r[gn],delete r[Mn],delete r[Lf],delete r[hN],delete r[mN]}function Nl(r){var i=r[gn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[El]||s[gn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=C0(r);r!==null;){if(s=r[gn])return s;r=C0(r)}return i}r=s,s=r.parentNode}return null}function _l(r){if(r=r[gn]||r[El]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function oo(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Al(r){var i=r[av];return i||(i=r[av]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ln(r){r[so]=!0}var iv=new Set,lv={};function Pi(r,i){Tl(r,i),Tl(r+"Capture",i)}function Tl(r,i){for(lv[r]=i,r=0;r<i.length;r++)iv.add(i[r])}var pN=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]*$"),sv={},ov={};function gN(r){return Da.call(ov,r)?!0:Da.call(sv,r)?!1:pN.test(r)?ov[r]=!0:(sv[r]=!0,!1)}function rc(r,i,s){if(gN(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function ac(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function ea(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function cr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function uv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function yN(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){s=""+S,v.call(this,S)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(S){s=""+S},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Pf(r){if(!r._valueTracker){var i=uv(r)?"checked":"value";r._valueTracker=yN(r,i,""+r[i])}}function cv(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=uv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function ic(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var vN=/[\n"\\]/g;function dr(r){return r.replace(vN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Bf(r,i,s,d,p,v,S,N){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+cr(i)):r.value!==""+cr(i)&&(r.value=""+cr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?$f(r,S,cr(i)):s!=null?$f(r,S,cr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.name=""+cr(N):r.removeAttribute("name")}function dv(r,i,s,d,p,v,S,N){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||s!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Pf(r);return}s=s!=null?""+cr(s):"",i=i!=null?""+cr(i):s,N||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=N?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Pf(r)}function $f(r,i,s){i==="number"&&ic(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Rl(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+cr(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function fv(r,i,s){if(i!=null&&(i=""+cr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+cr(s):""}function hv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(W(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=cr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Pf(r)}function zl(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var bN=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 mv(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||bN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function pv(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&mv(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&mv(r,v,i[v])}function Ff(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xN=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"]]),wN=/^[\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 lc(r){return wN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ta(){}var qf=null;function Hf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ol=null,Dl=null;function gv(r){var i=_l(r);if(i&&(r=i.stateNode)){var s=r[Mn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Bf(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+dr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Mn]||null;if(!p)throw Error(a(90));Bf(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&cv(d)}break e;case"textarea":fv(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Rl(r,!!s.multiple,i,!1)}}}var Zf=!1;function yv(r,i,s){if(Zf)return r(i,s);Zf=!0;try{var d=r(i);return d}finally{if(Zf=!1,(Ol!==null||Dl!==null)&&(Qc(),Ol&&(i=Ol,r=Dl,Dl=Ol=null,gv(i),r)))for(i=0;i<r.length;i++)gv(r[i])}}function uo(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Mn]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var na=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vf=!1;if(na)try{var co={};Object.defineProperty(co,"passive",{get:function(){Vf=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Vf=!1}var Ua=null,Qf=null,sc=null;function vv(){if(sc)return sc;var r,i=Qf,s=i.length,d,p="value"in Ua?Ua.value:Ua.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return sc=p.slice(r,1<d?1-d:void 0)}function oc(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function uc(){return!0}function bv(){return!1}function In(r){function i(s,d,p,v,S){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=S,this.currentTarget=null;for(var N in r)r.hasOwnProperty(N)&&(s=r[N],this[N]=s?s(v):v[N]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?uc:bv,this.isPropagationStopped=bv,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=uc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=uc)},persist:function(){},isPersistent:uc}),i}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cc=In(Bi),fo=g({},Bi,{view:0,detail:0}),SN=In(fo),Kf,Gf,ho,dc=g({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ho&&(ho&&r.type==="mousemove"?(Kf=r.screenX-ho.screenX,Gf=r.screenY-ho.screenY):Gf=Kf=0,ho=r),Kf)},movementY:function(r){return"movementY"in r?r.movementY:Gf}}),xv=In(dc),kN=g({},dc,{dataTransfer:0}),jN=In(kN),CN=g({},fo,{relatedTarget:0}),Yf=In(CN),EN=g({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),NN=In(EN),_N=g({},Bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),AN=In(_N),TN=g({},Bi,{data:0}),wv=In(TN),RN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zN={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"},ON={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DN(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=ON[r])?!!i[r]:!1}function Xf(){return DN}var MN=g({},fo,{key:function(r){if(r.key){var i=RN[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=oc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?zN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xf,charCode:function(r){return r.type==="keypress"?oc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?oc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),IN=In(MN),LN=g({},dc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sv=In(LN),UN=g({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xf}),PN=In(UN),BN=g({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),$N=In(BN),FN=g({},dc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),qN=In(FN),HN=g({},Bi,{newState:0,oldState:0}),ZN=In(HN),VN=[9,13,27,32],Jf=na&&"CompositionEvent"in window,mo=null;na&&"documentMode"in document&&(mo=document.documentMode);var QN=na&&"TextEvent"in window&&!mo,kv=na&&(!Jf||mo&&8<mo&&11>=mo),jv=" ",Cv=!1;function Ev(r,i){switch(r){case"keyup":return VN.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ml=!1;function KN(r,i){switch(r){case"compositionend":return Nv(i);case"keypress":return i.which!==32?null:(Cv=!0,jv);case"textInput":return r=i.data,r===jv&&Cv?null:r;default:return null}}function GN(r,i){if(Ml)return r==="compositionend"||!Jf&&Ev(r,i)?(r=vv(),sc=Qf=Ua=null,Ml=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return kv&&i.locale!=="ko"?null:i.data;default:return null}}var YN={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 _v(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!YN[r.type]:i==="textarea"}function Av(r,i,s,d){Ol?Dl?Dl.push(d):Dl=[d]:Ol=d,i=ed(i,"onChange"),0<i.length&&(s=new cc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var po=null,go=null;function XN(r){d0(r,0)}function fc(r){var i=oo(r);if(cv(i))return r}function Tv(r,i){if(r==="change")return i}var Rv=!1;if(na){var Wf;if(na){var eh="oninput"in document;if(!eh){var zv=document.createElement("div");zv.setAttribute("oninput","return;"),eh=typeof zv.oninput=="function"}Wf=eh}else Wf=!1;Rv=Wf&&(!document.documentMode||9<document.documentMode)}function Ov(){po&&(po.detachEvent("onpropertychange",Dv),go=po=null)}function Dv(r){if(r.propertyName==="value"&&fc(go)){var i=[];Av(i,go,r,Hf(r)),yv(XN,i)}}function JN(r,i,s){r==="focusin"?(Ov(),po=i,go=s,po.attachEvent("onpropertychange",Dv)):r==="focusout"&&Ov()}function WN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return fc(go)}function e_(r,i){if(r==="click")return fc(i)}function t_(r,i){if(r==="input"||r==="change")return fc(i)}function n_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Yn=typeof Object.is=="function"?Object.is:n_;function yo(r,i){if(Yn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Da.call(i,p)||!Yn(r[p],i[p]))return!1}return!0}function Mv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Iv(r,i){var s=Mv(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Mv(s)}}function Lv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Lv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Uv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=ic(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=ic(r.document)}return i}function th(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var r_=na&&"documentMode"in document&&11>=document.documentMode,Il=null,nh=null,vo=null,rh=!1;function Pv(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;rh||Il==null||Il!==ic(d)||(d=Il,"selectionStart"in d&&th(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),vo&&yo(vo,d)||(vo=d,d=ed(nh,"onSelect"),0<d.length&&(i=new cc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Il)))}function $i(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Ll={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},ah={},Bv={};na&&(Bv=document.createElement("div").style,"AnimationEvent"in window||(delete Ll.animationend.animation,delete Ll.animationiteration.animation,delete Ll.animationstart.animation),"TransitionEvent"in window||delete Ll.transitionend.transition);function Fi(r){if(ah[r])return ah[r];if(!Ll[r])return r;var i=Ll[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Bv)return ah[r]=i[s];return r}var $v=Fi("animationend"),Fv=Fi("animationiteration"),qv=Fi("animationstart"),a_=Fi("transitionrun"),i_=Fi("transitionstart"),l_=Fi("transitioncancel"),Hv=Fi("transitionend"),Zv=new Map,ih="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(" ");ih.push("scrollEnd");function _r(r,i){Zv.set(r,i),Pi(i,[r])}var hc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},fr=[],Ul=0,lh=0;function mc(){for(var r=Ul,i=lh=Ul=0;i<r;){var s=fr[i];fr[i++]=null;var d=fr[i];fr[i++]=null;var p=fr[i];fr[i++]=null;var v=fr[i];if(fr[i++]=null,d!==null&&p!==null){var S=d.pending;S===null?p.next=p:(p.next=S.next,S.next=p),d.pending=p}v!==0&&Vv(s,p,v)}}function pc(r,i,s,d){fr[Ul++]=r,fr[Ul++]=i,fr[Ul++]=s,fr[Ul++]=d,lh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function sh(r,i,s,d){return pc(r,i,s,d),gc(r)}function qi(r,i){return pc(r,null,null,i),gc(r)}function Vv(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,v=r.return;v!==null;)v.childLanes|=s,d=v.alternate,d!==null&&(d.childLanes|=s),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-ft(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function gc(r){if(50<Bo)throw Bo=0,gm=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Pl={};function s_(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(r,i,s,d){return new s_(r,i,s,d)}function oh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ra(r,i){var s=r.alternate;return s===null?(s=Xn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function Qv(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function yc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")oh(r)&&(S=1);else if(typeof r=="string")S=f2(r,s,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case V:return r=Xn(31,s,i,p),r.elementType=V,r.lanes=v,r;case j:return Hi(s.children,p,v,i);case C:S=8,p|=24;break;case E:return r=Xn(12,s,i,p|2),r.elementType=E,r.lanes=v,r;case B:return r=Xn(13,s,i,p),r.elementType=B,r.lanes=v,r;case O:return r=Xn(19,s,i,p),r.elementType=O,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case z:S=10;break e;case R:S=9;break e;case I:S=11;break e;case D:S=14;break e;case U:S=16,d=null;break e}S=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=Xn(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Hi(r,i,s,d){return r=Xn(7,r,d,i),r.lanes=s,r}function uh(r,i,s){return r=Xn(6,r,null,i),r.lanes=s,r}function Kv(r){var i=Xn(18,null,null,0);return i.stateNode=r,i}function ch(r,i,s){return i=Xn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var Gv=new WeakMap;function hr(r,i){if(typeof r=="object"&&r!==null){var s=Gv.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Cl(i)},Gv.set(r,i),i)}return{value:r,source:i,stack:Cl(i)}}var Bl=[],$l=0,vc=null,bo=0,mr=[],pr=0,Pa=null,$r=1,Fr="";function aa(r,i){Bl[$l++]=bo,Bl[$l++]=vc,vc=r,bo=i}function Yv(r,i,s){mr[pr++]=$r,mr[pr++]=Fr,mr[pr++]=Pa,Pa=r;var d=$r;r=Fr;var p=32-ft(d)-1;d&=~(1<<p),s+=1;var v=32-ft(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,$r=1<<32-ft(i)+p|s<<p|d,Fr=v+r}else $r=1<<v|s<<p|d,Fr=r}function dh(r){r.return!==null&&(aa(r,1),Yv(r,1,0))}function fh(r){for(;r===vc;)vc=Bl[--$l],Bl[$l]=null,bo=Bl[--$l],Bl[$l]=null;for(;r===Pa;)Pa=mr[--pr],mr[pr]=null,Fr=mr[--pr],mr[pr]=null,$r=mr[--pr],mr[pr]=null}function Xv(r,i){mr[pr++]=$r,mr[pr++]=Fr,mr[pr++]=Pa,$r=i.id,Fr=i.overflow,Pa=r}var yn=null,Et=null,rt=!1,Ba=null,gr=!1,hh=Error(a(519));function $a(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xo(hr(i,r)),hh}function Jv(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[gn]=r,i[Mn]=d,s){case"dialog":Xe("cancel",i),Xe("close",i);break;case"iframe":case"object":case"embed":Xe("load",i);break;case"video":case"audio":for(s=0;s<Fo.length;s++)Xe(Fo[s],i);break;case"source":Xe("error",i);break;case"img":case"image":case"link":Xe("error",i),Xe("load",i);break;case"details":Xe("toggle",i);break;case"input":Xe("invalid",i),dv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Xe("invalid",i);break;case"textarea":Xe("invalid",i),hv(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||p0(i.textContent,s)?(d.popover!=null&&(Xe("beforetoggle",i),Xe("toggle",i)),d.onScroll!=null&&Xe("scroll",i),d.onScrollEnd!=null&&Xe("scrollend",i),d.onClick!=null&&(i.onclick=ta),i=!0):i=!1,i||$a(r,!0)}function Wv(r){for(yn=r.return;yn;)switch(yn.tag){case 5:case 31:case 13:gr=!1;return;case 27:case 3:gr=!0;return;default:yn=yn.return}}function Fl(r){if(r!==yn)return!1;if(!rt)return Wv(r),rt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Rm(r.type,r.memoizedProps)),s=!s),s&&Et&&$a(r),Wv(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=j0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Et=j0(r)}else i===27?(i=Et,ti(r.type)?(r=Im,Im=null,Et=r):Et=i):Et=yn?vr(r.stateNode.nextSibling):null;return!0}function Zi(){Et=yn=null,rt=!1}function mh(){var r=Ba;return r!==null&&(Bn===null?Bn=r:Bn.push.apply(Bn,r),Ba=null),r}function xo(r){Ba===null?Ba=[r]:Ba.push(r)}var ph=L(null),Vi=null,ia=null;function Fa(r,i,s){A(ph,i._currentValue),i._currentValue=s}function la(r){r._currentValue=ph.current,P(ph)}function gh(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function yh(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var S=p.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=p;for(var $=0;$<i.length;$++)if(N.context===i[$]){v.lanes|=s,N=v.alternate,N!==null&&(N.lanes|=s),gh(v.return,s,r),d||(S=null);break e}v=N.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(a(341));S.lanes|=s,v=S.alternate,v!==null&&(v.lanes|=s),gh(S,s,r),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===r){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function ql(r,i,s,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var N=p.type;Yn(p.pendingProps.value,S.value)||(r!==null?r.push(N):r=[N])}}else if(p===xe.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Qo):r=[Qo])}p=p.return}r!==null&&yh(i,r,s,d),i.flags|=262144}function bc(r){for(r=r.firstContext;r!==null;){if(!Yn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Qi(r){Vi=r,ia=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function vn(r){return eb(Vi,r)}function xc(r,i){return Vi===null&&Qi(r),eb(r,i)}function eb(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ia===null){if(r===null)throw Error(a(308));ia=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ia=ia.next=i;return s}var o_=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},u_=e.unstable_scheduleCallback,c_=e.unstable_NormalPriority,Zt={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vh(){return{controller:new o_,data:new Map,refCount:0}}function wo(r){r.refCount--,r.refCount===0&&u_(c_,function(){r.controller.abort()})}var So=null,bh=0,Hl=0,Zl=null;function d_(r,i){if(So===null){var s=So=[];bh=0,Hl=Sm(),Zl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return bh++,i.then(tb,tb),i}function tb(){if(--bh===0&&So!==null){Zl!==null&&(Zl.status="fulfilled");var r=So;So=null,Hl=0,Zl=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function f_(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var nb=Z.S;Z.S=function(r,i){Px=fn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&d_(r,i),nb!==null&&nb(r,i)};var Ki=L(null);function xh(){var r=Ki.current;return r!==null?r:wt.pooledCache}function wc(r,i){i===null?A(Ki,Ki.current):A(Ki,i.pool)}function rb(){var r=xh();return r===null?null:{parent:Zt._currentValue,pool:r}}var Vl=Error(a(460)),wh=Error(a(474)),Sc=Error(a(542)),kc={then:function(){}};function ab(r){return r=r.status,r==="fulfilled"||r==="rejected"}function ib(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(ta,ta),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,sb(r),r;default:if(typeof i.status=="string")i.then(ta,ta);else{if(r=wt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,sb(r),r}throw Yi=i,Vl}}function Gi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Yi=s,Vl):s}}var Yi=null;function lb(){if(Yi===null)throw Error(a(459));var r=Yi;return Yi=null,r}function sb(r){if(r===Vl||r===Sc)throw Error(a(483))}var Ql=null,ko=0;function jc(r){var i=ko;return ko+=1,Ql===null&&(Ql=[]),ib(Ql,r,i)}function jo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Cc(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function ob(r){function i(Q,H){if(r){var K=Q.deletions;K===null?(Q.deletions=[H],Q.flags|=16):K.push(H)}}function s(Q,H){if(!r)return null;for(;H!==null;)i(Q,H),H=H.sibling;return null}function d(Q){for(var H=new Map;Q!==null;)Q.key!==null?H.set(Q.key,Q):H.set(Q.index,Q),Q=Q.sibling;return H}function p(Q,H){return Q=ra(Q,H),Q.index=0,Q.sibling=null,Q}function v(Q,H,K){return Q.index=K,r?(K=Q.alternate,K!==null?(K=K.index,K<H?(Q.flags|=67108866,H):K):(Q.flags|=67108866,H)):(Q.flags|=1048576,H)}function S(Q){return r&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,H,K,ce){return H===null||H.tag!==6?(H=uh(K,Q.mode,ce),H.return=Q,H):(H=p(H,K),H.return=Q,H)}function $(Q,H,K,ce){var Oe=K.type;return Oe===j?ae(Q,H,K.props.children,ce,K.key):H!==null&&(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===U&&Gi(Oe)===H.type)?(H=p(H,K.props),jo(H,K),H.return=Q,H):(H=yc(K.type,K.key,K.props,null,Q.mode,ce),jo(H,K),H.return=Q,H)}function Y(Q,H,K,ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==K.containerInfo||H.stateNode.implementation!==K.implementation?(H=ch(K,Q.mode,ce),H.return=Q,H):(H=p(H,K.children||[]),H.return=Q,H)}function ae(Q,H,K,ce,Oe){return H===null||H.tag!==7?(H=Hi(K,Q.mode,ce,Oe),H.return=Q,H):(H=p(H,K),H.return=Q,H)}function de(Q,H,K){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=uh(""+H,Q.mode,K),H.return=Q,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return K=yc(H.type,H.key,H.props,null,Q.mode,K),jo(K,H),K.return=Q,K;case k:return H=ch(H,Q.mode,K),H.return=Q,H;case U:return H=Gi(H),de(Q,H,K)}if(W(H)||oe(H))return H=Hi(H,Q.mode,K,null),H.return=Q,H;if(typeof H.then=="function")return de(Q,jc(H),K);if(H.$$typeof===z)return de(Q,xc(Q,H),K);Cc(Q,H)}return null}function J(Q,H,K,ce){var Oe=H!==null?H.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Oe!==null?null:N(Q,H,""+K,ce);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===Oe?$(Q,H,K,ce):null;case k:return K.key===Oe?Y(Q,H,K,ce):null;case U:return K=Gi(K),J(Q,H,K,ce)}if(W(K)||oe(K))return Oe!==null?null:ae(Q,H,K,ce,null);if(typeof K.then=="function")return J(Q,H,jc(K),ce);if(K.$$typeof===z)return J(Q,H,xc(Q,K),ce);Cc(Q,K)}return null}function te(Q,H,K,ce,Oe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Q=Q.get(K)||null,N(H,Q,""+ce,Oe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case w:return Q=Q.get(ce.key===null?K:ce.key)||null,$(H,Q,ce,Oe);case k:return Q=Q.get(ce.key===null?K:ce.key)||null,Y(H,Q,ce,Oe);case U:return ce=Gi(ce),te(Q,H,K,ce,Oe)}if(W(ce)||oe(ce))return Q=Q.get(K)||null,ae(H,Q,ce,Oe,null);if(typeof ce.then=="function")return te(Q,H,K,jc(ce),Oe);if(ce.$$typeof===z)return te(Q,H,K,xc(H,ce),Oe);Cc(H,ce)}return null}function je(Q,H,K,ce){for(var Oe=null,ot=null,Ae=H,He=H=0,et=null;Ae!==null&&He<K.length;He++){Ae.index>He?(et=Ae,Ae=null):et=Ae.sibling;var ut=J(Q,Ae,K[He],ce);if(ut===null){Ae===null&&(Ae=et);break}r&&Ae&&ut.alternate===null&&i(Q,Ae),H=v(ut,H,He),ot===null?Oe=ut:ot.sibling=ut,ot=ut,Ae=et}if(He===K.length)return s(Q,Ae),rt&&aa(Q,He),Oe;if(Ae===null){for(;He<K.length;He++)Ae=de(Q,K[He],ce),Ae!==null&&(H=v(Ae,H,He),ot===null?Oe=Ae:ot.sibling=Ae,ot=Ae);return rt&&aa(Q,He),Oe}for(Ae=d(Ae);He<K.length;He++)et=te(Ae,Q,He,K[He],ce),et!==null&&(r&&et.alternate!==null&&Ae.delete(et.key===null?He:et.key),H=v(et,H,He),ot===null?Oe=et:ot.sibling=et,ot=et);return r&&Ae.forEach(function(li){return i(Q,li)}),rt&&aa(Q,He),Oe}function Me(Q,H,K,ce){if(K==null)throw Error(a(151));for(var Oe=null,ot=null,Ae=H,He=H=0,et=null,ut=K.next();Ae!==null&&!ut.done;He++,ut=K.next()){Ae.index>He?(et=Ae,Ae=null):et=Ae.sibling;var li=J(Q,Ae,ut.value,ce);if(li===null){Ae===null&&(Ae=et);break}r&&Ae&&li.alternate===null&&i(Q,Ae),H=v(li,H,He),ot===null?Oe=li:ot.sibling=li,ot=li,Ae=et}if(ut.done)return s(Q,Ae),rt&&aa(Q,He),Oe;if(Ae===null){for(;!ut.done;He++,ut=K.next())ut=de(Q,ut.value,ce),ut!==null&&(H=v(ut,H,He),ot===null?Oe=ut:ot.sibling=ut,ot=ut);return rt&&aa(Q,He),Oe}for(Ae=d(Ae);!ut.done;He++,ut=K.next())ut=te(Ae,Q,He,ut.value,ce),ut!==null&&(r&&ut.alternate!==null&&Ae.delete(ut.key===null?He:ut.key),H=v(ut,H,He),ot===null?Oe=ut:ot.sibling=ut,ot=ut);return r&&Ae.forEach(function(k2){return i(Q,k2)}),rt&&aa(Q,He),Oe}function xt(Q,H,K,ce){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var Oe=K.key;H!==null;){if(H.key===Oe){if(Oe=K.type,Oe===j){if(H.tag===7){s(Q,H.sibling),ce=p(H,K.props.children),ce.return=Q,Q=ce;break e}}else if(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===U&&Gi(Oe)===H.type){s(Q,H.sibling),ce=p(H,K.props),jo(ce,K),ce.return=Q,Q=ce;break e}s(Q,H);break}else i(Q,H);H=H.sibling}K.type===j?(ce=Hi(K.props.children,Q.mode,ce,K.key),ce.return=Q,Q=ce):(ce=yc(K.type,K.key,K.props,null,Q.mode,ce),jo(ce,K),ce.return=Q,Q=ce)}return S(Q);case k:e:{for(Oe=K.key;H!==null;){if(H.key===Oe)if(H.tag===4&&H.stateNode.containerInfo===K.containerInfo&&H.stateNode.implementation===K.implementation){s(Q,H.sibling),ce=p(H,K.children||[]),ce.return=Q,Q=ce;break e}else{s(Q,H);break}else i(Q,H);H=H.sibling}ce=ch(K,Q.mode,ce),ce.return=Q,Q=ce}return S(Q);case U:return K=Gi(K),xt(Q,H,K,ce)}if(W(K))return je(Q,H,K,ce);if(oe(K)){if(Oe=oe(K),typeof Oe!="function")throw Error(a(150));return K=Oe.call(K),Me(Q,H,K,ce)}if(typeof K.then=="function")return xt(Q,H,jc(K),ce);if(K.$$typeof===z)return xt(Q,H,xc(Q,K),ce);Cc(Q,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,H!==null&&H.tag===6?(s(Q,H.sibling),ce=p(H,K),ce.return=Q,Q=ce):(s(Q,H),ce=uh(K,Q.mode,ce),ce.return=Q,Q=ce),S(Q)):s(Q,H)}return function(Q,H,K,ce){try{ko=0;var Oe=xt(Q,H,K,ce);return Ql=null,Oe}catch(Ae){if(Ae===Vl||Ae===Sc)throw Ae;var ot=Xn(29,Ae,null,Q.mode);return ot.lanes=ce,ot.return=Q,ot}finally{}}}var Xi=ob(!0),ub=ob(!1),qa=!1;function Sh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kh(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ha(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Za(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(dt&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=gc(r),Vv(r,null,s),i}return pc(r,d,i,s),gc(r)}function Co(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,nc(r,s)}}function jh(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,v=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};v===null?p=v=S:v=v.next=S,s=s.next}while(s!==null);v===null?p=v=i:v=v.next=i}else p=v=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Ch=!1;function Eo(){if(Ch){var r=Zl;if(r!==null)throw r}}function No(r,i,s,d){Ch=!1;var p=r.updateQueue;qa=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,N=p.shared.pending;if(N!==null){p.shared.pending=null;var $=N,Y=$.next;$.next=null,S===null?v=Y:S.next=Y,S=$;var ae=r.alternate;ae!==null&&(ae=ae.updateQueue,N=ae.lastBaseUpdate,N!==S&&(N===null?ae.firstBaseUpdate=Y:N.next=Y,ae.lastBaseUpdate=$))}if(v!==null){var de=p.baseState;S=0,ae=Y=$=null,N=v;do{var J=N.lane&-536870913,te=J!==N.lane;if(te?(We&J)===J:(d&J)===J){J!==0&&J===Hl&&(Ch=!0),ae!==null&&(ae=ae.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var je=r,Me=N;J=i;var xt=s;switch(Me.tag){case 1:if(je=Me.payload,typeof je=="function"){de=je.call(xt,de,J);break e}de=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Me.payload,J=typeof je=="function"?je.call(xt,de,J):je,J==null)break e;de=g({},de,J);break e;case 2:qa=!0}}J=N.callback,J!==null&&(r.flags|=64,te&&(r.flags|=8192),te=p.callbacks,te===null?p.callbacks=[J]:te.push(J))}else te={lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ae===null?(Y=ae=te,$=de):ae=ae.next=te,S|=J;if(N=N.next,N===null){if(N=p.shared.pending,N===null)break;te=N,N=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);ae===null&&($=de),p.baseState=$,p.firstBaseUpdate=Y,p.lastBaseUpdate=ae,v===null&&(p.shared.lanes=0),Ya|=S,r.lanes=S,r.memoizedState=de}}function cb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function db(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)cb(s[r],i)}var Kl=L(null),Ec=L(0);function fb(r,i){r=pa,A(Ec,r),A(Kl,i),pa=r|i.baseLanes}function Eh(){A(Ec,pa),A(Kl,Kl.current)}function Nh(){pa=Ec.current,P(Kl),P(Ec)}var Jn=L(null),yr=null;function Va(r){var i=r.alternate;A(Ft,Ft.current&1),A(Jn,r),yr===null&&(i===null||Kl.current!==null||i.memoizedState!==null)&&(yr=r)}function _h(r){A(Ft,Ft.current),A(Jn,r),yr===null&&(yr=r)}function hb(r){r.tag===22?(A(Ft,Ft.current),A(Jn,r),yr===null&&(yr=r)):Qa()}function Qa(){A(Ft,Ft.current),A(Jn,Jn.current)}function Wn(r){P(Jn),yr===r&&(yr=null),P(Ft)}var Ft=L(0);function Nc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Dm(s)||Mm(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var sa=0,qe=null,vt=null,Vt=null,_c=!1,Gl=!1,Ji=!1,Ac=0,_o=0,Yl=null,h_=0;function Lt(){throw Error(a(321))}function Ah(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!Yn(r[s],i[s]))return!1;return!0}function Th(r,i,s,d,p,v){return sa=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Yb:Zh,Ji=!1,v=s(d,p),Ji=!1,Gl&&(v=pb(i,s,d,p)),mb(r),v}function mb(r){Z.H=Ro;var i=vt!==null&&vt.next!==null;if(sa=0,Vt=vt=qe=null,_c=!1,_o=0,Yl=null,i)throw Error(a(300));r===null||Qt||(r=r.dependencies,r!==null&&bc(r)&&(Qt=!0))}function pb(r,i,s,d){qe=r;var p=0;do{if(Gl&&(Yl=null),_o=0,Gl=!1,25<=p)throw Error(a(301));if(p+=1,Vt=vt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=Xb,v=i(s,d)}while(Gl);return v}function m_(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?Ao(i):i,r=r.useState()[0],(vt!==null?vt.memoizedState:null)!==r&&(qe.flags|=1024),i}function Rh(){var r=Ac!==0;return Ac=0,r}function zh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Oh(r){if(_c){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}_c=!1}sa=0,Vt=vt=qe=null,Gl=!1,_o=Ac=0,Yl=null}function _n(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?qe.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function qt(){if(vt===null){var r=qe.alternate;r=r!==null?r.memoizedState:null}else r=vt.next;var i=Vt===null?qe.memoizedState:Vt.next;if(i!==null)Vt=i,vt=r;else{if(r===null)throw qe.alternate===null?Error(a(467)):Error(a(310));vt=r,r={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},Vt===null?qe.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function Tc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(r){var i=_o;return _o+=1,Yl===null&&(Yl=[]),r=ib(Yl,r,i),i=qe,(Vt===null?i.memoizedState:Vt.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Yb:Zh),r}function Rc(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ao(r);if(r.$$typeof===z)return vn(r)}throw Error(a(438,String(r)))}function Dh(r){var i=null,s=qe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=qe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Tc(),qe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=F;return i.index++,s}function oa(r,i){return typeof i=="function"?i(r):i}function zc(r){var i=qt();return Mh(i,vt,r)}function Mh(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var S=p.next;p.next=v.next,v.next=S}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var N=S=null,$=null,Y=i,ae=!1;do{var de=Y.lane&-536870913;if(de!==Y.lane?(We&de)===de:(sa&de)===de){var J=Y.revertLane;if(J===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),de===Hl&&(ae=!0);else if((sa&J)===J){Y=Y.next,J===Hl&&(ae=!0);continue}else de={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},$===null?(N=$=de,S=v):$=$.next=de,qe.lanes|=J,Ya|=J;de=Y.action,Ji&&s(v,de),v=Y.hasEagerState?Y.eagerState:s(v,de)}else J={lane:de,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},$===null?(N=$=J,S=v):$=$.next=J,qe.lanes|=de,Ya|=de;Y=Y.next}while(Y!==null&&Y!==i);if($===null?S=v:$.next=N,!Yn(v,r.memoizedState)&&(Qt=!0,ae&&(s=Zl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=$,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Ih(r){var i=qt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);Yn(v,i.memoizedState)||(Qt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function gb(r,i,s){var d=qe,p=qt(),v=rt;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!Yn((vt||p).memoizedState,s);if(S&&(p.memoizedState=s,Qt=!0),p=p.queue,Ph(bb.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Vt!==null&&Vt.memoizedState.tag&1){if(d.flags|=2048,Xl(9,{destroy:void 0},vb.bind(null,d,p,s,i),null),wt===null)throw Error(a(349));v||(sa&127)!==0||yb(d,i,s)}return s}function yb(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=Tc(),qe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function vb(r,i,s,d){i.value=s,i.getSnapshot=d,xb(i)&&wb(r)}function bb(r,i,s){return s(function(){xb(i)&&wb(r)})}function xb(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!Yn(r,s)}catch{return!0}}function wb(r){var i=qi(r,2);i!==null&&$n(i,r,2)}function Lh(r){var i=_n();if(typeof r=="function"){var s=r;if(r=s(),Ji){mn(!0);try{s()}finally{mn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:r},i}function Sb(r,i,s,d){return r.baseState=s,Mh(r,vt,typeof d=="function"?d:oa)}function p_(r,i,s,d,p){if(Mc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){v.listeners.push(S)}};Z.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,kb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function kb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,S={};Z.T=S;try{var N=s(p,d),$=Z.S;$!==null&&$(S,N),jb(r,i,N)}catch(Y){Uh(r,i,Y)}finally{v!==null&&S.types!==null&&(v.types=S.types),Z.T=v}}else try{v=s(p,d),jb(r,i,v)}catch(Y){Uh(r,i,Y)}}function jb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){Cb(r,i,d)},function(d){return Uh(r,i,d)}):Cb(r,i,s)}function Cb(r,i,s){i.status="fulfilled",i.value=s,Eb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,kb(r,s)))}function Uh(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,Eb(i),i=i.next;while(i!==d)}r.action=null}function Eb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Nb(r,i){return i}function _b(r,i){if(rt){var s=wt.formState;if(s!==null){e:{var d=qe;if(rt){if(Et){t:{for(var p=Et,v=gr;p.nodeType!==8;){if(!v){p=null;break t}if(p=vr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Et=vr(p.nextSibling),d=p.data==="F!";break e}}$a(d)}d=!1}d&&(i=s[0])}}return s=_n(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nb,lastRenderedState:i},s.queue=d,s=Qb.bind(null,qe,d),d.dispatch=s,d=Lh(!1),v=Hh.bind(null,qe,!1,d.queue),d=_n(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=p_.bind(null,qe,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Ab(r){var i=qt();return Tb(i,vt,r)}function Tb(r,i,s){if(i=Mh(r,i,Nb)[0],r=zc(oa)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Ao(i)}catch(S){throw S===Vl?Sc:S}else d=i;i=qt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,Xl(9,{destroy:void 0},g_.bind(null,p,s),null)),[d,v,r]}function g_(r,i){r.action=i}function Rb(r){var i=qt(),s=vt;if(s!==null)return Tb(i,s,r);qt(),i=i.memoizedState,s=qt();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Xl(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=qe.updateQueue,i===null&&(i=Tc(),qe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function zb(){return qt().memoizedState}function Oc(r,i,s,d){var p=_n();qe.flags|=r,p.memoizedState=Xl(1|i,{destroy:void 0},s,d===void 0?null:d)}function Dc(r,i,s,d){var p=qt();d=d===void 0?null:d;var v=p.memoizedState.inst;vt!==null&&d!==null&&Ah(d,vt.memoizedState.deps)?p.memoizedState=Xl(i,v,s,d):(qe.flags|=r,p.memoizedState=Xl(1|i,v,s,d))}function Ob(r,i){Oc(8390656,8,r,i)}function Ph(r,i){Dc(2048,8,r,i)}function y_(r){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=Tc(),qe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Db(r){var i=qt().memoizedState;return y_({ref:i,nextImpl:r}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Mb(r,i){return Dc(4,2,r,i)}function Ib(r,i){return Dc(4,4,r,i)}function Lb(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Ub(r,i,s){s=s!=null?s.concat([r]):null,Dc(4,4,Lb.bind(null,i,r),s)}function Bh(){}function Pb(r,i){var s=qt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Ah(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function Bb(r,i){var s=qt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Ah(i,d[1]))return d[0];if(d=r(),Ji){mn(!0);try{r()}finally{mn(!1)}}return s.memoizedState=[d,i],d}function $h(r,i,s){return s===void 0||(sa&1073741824)!==0&&(We&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=$x(),qe.lanes|=r,Ya|=r,s)}function $b(r,i,s,d){return Yn(s,i)?s:Kl.current!==null?(r=$h(r,s,d),Yn(r,i)||(Qt=!0),r):(sa&42)===0||(sa&1073741824)!==0&&(We&261930)===0?(Qt=!0,r.memoizedState=s):(r=$x(),qe.lanes|=r,Ya|=r,i)}function Fb(r,i,s,d,p){var v=re.p;re.p=v!==0&&8>v?v:8;var S=Z.T,N={};Z.T=N,Hh(r,!1,i,s);try{var $=p(),Y=Z.S;if(Y!==null&&Y(N,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ae=f_($,d);To(r,i,ae,nr(r))}else To(r,i,d,nr(r))}catch(de){To(r,i,{then:function(){},status:"rejected",reason:de},nr())}finally{re.p=v,S!==null&&N.types!==null&&(S.types=N.types),Z.T=S}}function v_(){}function Fh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=qb(r).queue;Fb(r,p,i,ve,s===null?v_:function(){return Hb(r),s(d)})}function qb(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:ve},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:oa,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Hb(r){var i=qb(r);i.next===null&&(i=r.alternate.memoizedState),To(r,i.next.queue,{},nr())}function qh(){return vn(Qo)}function Zb(){return qt().memoizedState}function Vb(){return qt().memoizedState}function b_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=nr();r=Ha(s);var d=Za(i,r,s);d!==null&&($n(d,i,s),Co(d,i,s)),i={cache:vh()},r.payload=i;return}i=i.return}}function x_(r,i,s){var d=nr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Mc(r)?Kb(i,s):(s=sh(r,i,s,d),s!==null&&($n(s,r,d),Gb(s,i,d)))}function Qb(r,i,s){var d=nr();To(r,i,s,d)}function To(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Mc(r))Kb(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var S=i.lastRenderedState,N=v(S,s);if(p.hasEagerState=!0,p.eagerState=N,Yn(N,S))return pc(r,i,p,0),wt===null&&mc(),!1}catch{}finally{}if(s=sh(r,i,p,d),s!==null)return $n(s,r,d),Gb(s,i,d),!0}return!1}function Hh(r,i,s,d){if(d={lane:2,revertLane:Sm(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Mc(r)){if(i)throw Error(a(479))}else i=sh(r,s,d,2),i!==null&&$n(i,r,2)}function Mc(r){var i=r.alternate;return r===qe||i!==null&&i===qe}function Kb(r,i){Gl=_c=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function Gb(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,nc(r,s)}}var Ro={readContext:vn,use:Rc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};Ro.useEffectEvent=Lt;var Yb={readContext:vn,use:Rc,useCallback:function(r,i){return _n().memoizedState=[r,i===void 0?null:i],r},useContext:vn,useEffect:Ob,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Oc(4194308,4,Lb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Oc(4194308,4,r,i)},useInsertionEffect:function(r,i){Oc(4,2,r,i)},useMemo:function(r,i){var s=_n();i=i===void 0?null:i;var d=r();if(Ji){mn(!0);try{r()}finally{mn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=_n();if(s!==void 0){var p=s(i);if(Ji){mn(!0);try{s(i)}finally{mn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=x_.bind(null,qe,r),[d.memoizedState,r]},useRef:function(r){var i=_n();return r={current:r},i.memoizedState=r},useState:function(r){r=Lh(r);var i=r.queue,s=Qb.bind(null,qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Bh,useDeferredValue:function(r,i){var s=_n();return $h(s,r,i)},useTransition:function(){var r=Lh(!1);return r=Fb.bind(null,qe,r.queue,!0,!1),_n().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=qe,p=_n();if(rt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),wt===null)throw Error(a(349));(We&127)!==0||yb(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Ob(bb.bind(null,d,v,r),[r]),d.flags|=2048,Xl(9,{destroy:void 0},vb.bind(null,d,v,s,i),null),s},useId:function(){var r=_n(),i=wt.identifierPrefix;if(rt){var s=Fr,d=$r;s=(d&~(1<<32-ft(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ac++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=h_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:qh,useFormState:_b,useActionState:_b,useOptimistic:function(r){var i=_n();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Hh.bind(null,qe,!0,s),s.dispatch=i,[r,i]},useMemoCache:Dh,useCacheRefresh:function(){return _n().memoizedState=b_.bind(null,qe)},useEffectEvent:function(r){var i=_n(),s={impl:r};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Zh={readContext:vn,use:Rc,useCallback:Pb,useContext:vn,useEffect:Ph,useImperativeHandle:Ub,useInsertionEffect:Mb,useLayoutEffect:Ib,useMemo:Bb,useReducer:zc,useRef:zb,useState:function(){return zc(oa)},useDebugValue:Bh,useDeferredValue:function(r,i){var s=qt();return $b(s,vt.memoizedState,r,i)},useTransition:function(){var r=zc(oa)[0],i=qt().memoizedState;return[typeof r=="boolean"?r:Ao(r),i]},useSyncExternalStore:gb,useId:Zb,useHostTransitionStatus:qh,useFormState:Ab,useActionState:Ab,useOptimistic:function(r,i){var s=qt();return Sb(s,vt,r,i)},useMemoCache:Dh,useCacheRefresh:Vb};Zh.useEffectEvent=Db;var Xb={readContext:vn,use:Rc,useCallback:Pb,useContext:vn,useEffect:Ph,useImperativeHandle:Ub,useInsertionEffect:Mb,useLayoutEffect:Ib,useMemo:Bb,useReducer:Ih,useRef:zb,useState:function(){return Ih(oa)},useDebugValue:Bh,useDeferredValue:function(r,i){var s=qt();return vt===null?$h(s,r,i):$b(s,vt.memoizedState,r,i)},useTransition:function(){var r=Ih(oa)[0],i=qt().memoizedState;return[typeof r=="boolean"?r:Ao(r),i]},useSyncExternalStore:gb,useId:Zb,useHostTransitionStatus:qh,useFormState:Rb,useActionState:Rb,useOptimistic:function(r,i){var s=qt();return vt!==null?Sb(s,vt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Dh,useCacheRefresh:Vb};Xb.useEffectEvent=Db;function Vh(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:g({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var Qh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=nr(),p=Ha(d);p.payload=i,s!=null&&(p.callback=s),i=Za(r,p,d),i!==null&&($n(i,r,d),Co(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=nr(),p=Ha(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Za(r,p,d),i!==null&&($n(i,r,d),Co(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=nr(),d=Ha(s);d.tag=2,i!=null&&(d.callback=i),i=Za(r,d,s),i!==null&&($n(i,r,s),Co(i,r,s))}};function Jb(r,i,s,d,p,v,S){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,S):i.prototype&&i.prototype.isPureReactComponent?!yo(s,d)||!yo(p,v):!0}function Wb(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&Qh.enqueueReplaceState(i,i.state,null)}function Wi(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function ex(r){hc(r)}function tx(r){console.error(r)}function nx(r){hc(r)}function Ic(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function rx(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Kh(r,i,s){return s=Ha(s),s.tag=3,s.payload={element:null},s.callback=function(){Ic(r,i)},s}function ax(r){return r=Ha(r),r.tag=3,r}function ix(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){rx(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){rx(i,s,d),typeof p!="function"&&(Xa===null?Xa=new Set([this]):Xa.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})})}function w_(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&ql(i,s,p,!0),s=Jn.current,s!==null){switch(s.tag){case 31:case 13:return yr===null?Kc():s.alternate===null&&Ut===0&&(Ut=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===kc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),bm(r,d,p)),!1;case 22:return s.flags|=65536,d===kc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),bm(r,d,p)),!1}throw Error(a(435,s.tag))}return bm(r,d,p),Kc(),!1}if(rt)return i=Jn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==hh&&(r=Error(a(422),{cause:d}),xo(hr(r,s)))):(d!==hh&&(i=Error(a(423),{cause:d}),xo(hr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=hr(d,s),p=Kh(r.stateNode,d,p),jh(r,p),Ut!==4&&(Ut=2)),!1;var v=Error(a(520),{cause:d});if(v=hr(v,s),Po===null?Po=[v]:Po.push(v),Ut!==4&&(Ut=2),i===null)return!0;d=hr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=Kh(s.stateNode,d,r),jh(s,r),!1;case 1:if(i=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Xa===null||!Xa.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=ax(p),ix(p,r,s,d),jh(s,p),!1}s=s.return}while(s!==null);return!1}var Gh=Error(a(461)),Qt=!1;function bn(r,i,s,d){i.child=r===null?ub(i,null,s,d):Xi(i,r.child,s,d)}function lx(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var N in d)N!=="ref"&&(S[N]=d[N])}else S=d;return Qi(i),d=Th(r,i,s,S,v,p),N=Rh(),r!==null&&!Qt?(zh(r,i,p),ua(r,i,p)):(rt&&N&&dh(i),i.flags|=1,bn(r,i,d,p),i.child)}function sx(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!oh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,ox(r,i,v,d,p)):(r=yc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!rm(r,p)){var S=v.memoizedProps;if(s=s.compare,s=s!==null?s:yo,s(S,d)&&r.ref===i.ref)return ua(r,i,p)}return i.flags|=1,r=ra(v,d),r.ref=i.ref,r.return=i,i.child=r}function ox(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(yo(v,d)&&r.ref===i.ref)if(Qt=!1,i.pendingProps=d=v,rm(r,p))(r.flags&131072)!==0&&(Qt=!0);else return i.lanes=r.lanes,ua(r,i,p)}return Yh(r,i,s,d,p)}function ux(r,i,s,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return cx(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&wc(i,v!==null?v.cachePool:null),v!==null?fb(i,v):Eh(),hb(i);else return d=i.lanes=536870912,cx(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(wc(i,v.cachePool),fb(i,v),Qa(),i.memoizedState=null):(r!==null&&wc(i,null),Eh(),Qa());return bn(r,i,p,s),i.child}function zo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function cx(r,i,s,d,p){var v=xh();return v=v===null?null:{parent:Zt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&wc(i,null),Eh(),hb(i),r!==null&&ql(r,i,d,!0),i.childLanes=p,null}function Lc(r,i){return i=Pc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function dx(r,i,s){return Xi(i,r.child,null,s),r=Lc(i,i.pendingProps),r.flags|=2,Wn(i),i.memoizedState=null,r}function S_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(rt){if(d.mode==="hidden")return r=Lc(i,d),i.lanes=536870912,zo(null,r);if(_h(i),(r=Et)?(r=k0(r,gr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:$r,overflow:Fr}:null,retryLane:536870912,hydrationErrors:null},s=Kv(r),s.return=i,i.child=s,yn=i,Et=null)):r=null,r===null)throw $a(i);return i.lanes=536870912,null}return Lc(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(_h(i),p)if(i.flags&256)i.flags&=-257,i=dx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Qt||ql(r,i,s,!1),p=(s&r.childLanes)!==0,Qt||p){if(d=wt,d!==null&&(S=tv(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,qi(r,S),$n(d,r,S),Gh;Kc(),i=dx(r,i,s)}else r=v.treeContext,Et=vr(S.nextSibling),yn=i,rt=!0,Ba=null,gr=!1,r!==null&&Xv(i,r),i=Lc(i,d),i.flags|=4096;return i}return r=ra(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function Uc(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function Yh(r,i,s,d,p){return Qi(i),s=Th(r,i,s,d,void 0,p),d=Rh(),r!==null&&!Qt?(zh(r,i,p),ua(r,i,p)):(rt&&d&&dh(i),i.flags|=1,bn(r,i,s,p),i.child)}function fx(r,i,s,d,p,v){return Qi(i),i.updateQueue=null,s=pb(i,d,s,p),mb(r),d=Rh(),r!==null&&!Qt?(zh(r,i,v),ua(r,i,v)):(rt&&d&&dh(i),i.flags|=1,bn(r,i,s,v),i.child)}function hx(r,i,s,d,p){if(Qi(i),i.stateNode===null){var v=Pl,S=s.contextType;typeof S=="object"&&S!==null&&(v=vn(S)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Qh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},Sh(i),S=s.contextType,v.context=typeof S=="object"&&S!==null?vn(S):Pl,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Vh(i,s,S,d),v.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(S=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),S!==v.state&&Qh.enqueueReplaceState(v,v.state,null),No(i,d,v,p),Eo(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var N=i.memoizedProps,$=Wi(s,N);v.props=$;var Y=v.context,ae=s.contextType;S=Pl,typeof ae=="object"&&ae!==null&&(S=vn(ae));var de=s.getDerivedStateFromProps;ae=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",N=i.pendingProps!==N,ae||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N||Y!==S)&&Wb(i,v,d,S),qa=!1;var J=i.memoizedState;v.state=J,No(i,d,v,p),Eo(),Y=i.memoizedState,N||J!==Y||qa?(typeof de=="function"&&(Vh(i,s,de,d),Y=i.memoizedState),($=qa||Jb(i,s,$,d,J,Y,S))?(ae||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=Y),v.props=d,v.state=Y,v.context=S,d=$):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,kh(r,i),S=i.memoizedProps,ae=Wi(s,S),v.props=ae,de=i.pendingProps,J=v.context,Y=s.contextType,$=Pl,typeof Y=="object"&&Y!==null&&($=vn(Y)),N=s.getDerivedStateFromProps,(Y=typeof N=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==de||J!==$)&&Wb(i,v,d,$),qa=!1,J=i.memoizedState,v.state=J,No(i,d,v,p),Eo();var te=i.memoizedState;S!==de||J!==te||qa||r!==null&&r.dependencies!==null&&bc(r.dependencies)?(typeof N=="function"&&(Vh(i,s,N,d),te=i.memoizedState),(ae=qa||Jb(i,s,ae,d,J,te,$)||r!==null&&r.dependencies!==null&&bc(r.dependencies))?(Y||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,te,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,te,$)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=te),v.props=d,v.state=te,v.context=$,d=ae):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&J===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,Uc(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Xi(i,r.child,null,p),i.child=Xi(i,null,s,p)):bn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ua(r,i,p),r}function mx(r,i,s,d){return Zi(),i.flags|=256,bn(r,i,s,d),i.child}var Xh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jh(r){return{baseLanes:r,cachePool:rb()}}function Wh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=tr),r}function px(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(Ft.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(rt){if(p?Va(i):Qa(),(r=Et)?(r=k0(r,gr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Pa!==null?{id:$r,overflow:Fr}:null,retryLane:536870912,hydrationErrors:null},s=Kv(r),s.return=i,i.child=s,yn=i,Et=null)):r=null,r===null)throw $a(i);return Mm(r)?i.lanes=32:i.lanes=536870912,null}var N=d.children;return d=d.fallback,p?(Qa(),p=i.mode,N=Pc({mode:"hidden",children:N},p),d=Hi(d,p,s,null),N.return=i,d.return=i,N.sibling=d,i.child=N,d=i.child,d.memoizedState=Jh(s),d.childLanes=Wh(r,S,s),i.memoizedState=Xh,zo(null,d)):(Va(i),em(i,N))}var $=r.memoizedState;if($!==null&&(N=$.dehydrated,N!==null)){if(v)i.flags&256?(Va(i),i.flags&=-257,i=tm(r,i,s)):i.memoizedState!==null?(Qa(),i.child=r.child,i.flags|=128,i=null):(Qa(),N=d.fallback,p=i.mode,d=Pc({mode:"visible",children:d.children},p),N=Hi(N,p,s,null),N.flags|=2,d.return=i,N.return=i,d.sibling=N,i.child=d,Xi(i,r.child,null,s),d=i.child,d.memoizedState=Jh(s),d.childLanes=Wh(r,S,s),i.memoizedState=Xh,i=zo(null,d));else if(Va(i),Mm(N)){if(S=N.nextSibling&&N.nextSibling.dataset,S)var Y=S.dgst;S=Y,d=Error(a(419)),d.stack="",d.digest=S,xo({value:d,source:null,stack:null}),i=tm(r,i,s)}else if(Qt||ql(r,i,s,!1),S=(s&r.childLanes)!==0,Qt||S){if(S=wt,S!==null&&(d=tv(S,s),d!==0&&d!==$.retryLane))throw $.retryLane=d,qi(r,d),$n(S,r,d),Gh;Dm(N)||Kc(),i=tm(r,i,s)}else Dm(N)?(i.flags|=192,i.child=r.child,i=null):(r=$.treeContext,Et=vr(N.nextSibling),yn=i,rt=!0,Ba=null,gr=!1,r!==null&&Xv(i,r),i=em(i,d.children),i.flags|=4096);return i}return p?(Qa(),N=d.fallback,p=i.mode,$=r.child,Y=$.sibling,d=ra($,{mode:"hidden",children:d.children}),d.subtreeFlags=$.subtreeFlags&65011712,Y!==null?N=ra(Y,N):(N=Hi(N,p,s,null),N.flags|=2),N.return=i,d.return=i,d.sibling=N,i.child=d,zo(null,d),d=i.child,N=r.child.memoizedState,N===null?N=Jh(s):(p=N.cachePool,p!==null?($=Zt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=rb(),N={baseLanes:N.baseLanes|s,cachePool:p}),d.memoizedState=N,d.childLanes=Wh(r,S,s),i.memoizedState=Xh,zo(r.child,d)):(Va(i),s=r.child,r=s.sibling,s=ra(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(S=i.deletions,S===null?(i.deletions=[r],i.flags|=16):S.push(r)),i.child=s,i.memoizedState=null,s)}function em(r,i){return i=Pc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Pc(r,i){return r=Xn(22,r,null,i),r.lanes=0,r}function tm(r,i,s){return Xi(i,r.child,null,s),r=em(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function gx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),gh(r.return,i,s)}function nm(r,i,s,d,p,v){var S=r.memoizedState;S===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:v}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=d,S.tail=s,S.tailMode=p,S.treeForkCount=v)}function yx(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=Ft.current,N=(S&2)!==0;if(N?(S=S&1|2,i.flags|=128):S&=1,A(Ft,S),bn(r,i,d,s),d=rt?bo:0,!N&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&gx(r,s,i);else if(r.tag===19)gx(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&Nc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),nm(i,!1,p,s,v,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&Nc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}nm(i,!0,s,null,v,d);break;case"together":nm(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ua(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Ya|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(ql(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=ra(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=ra(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function rm(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&bc(r)))}function k_(r,i,s){switch(i.tag){case 3:be(i,i.stateNode.containerInfo),Fa(i,Zt,r.memoizedState.cache),Zi();break;case 27:case 5:ee(i);break;case 4:be(i,i.stateNode.containerInfo);break;case 10:Fa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,_h(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Va(i),i.flags|=128,null):(s&i.child.childLanes)!==0?px(r,i,s):(Va(i),r=ua(r,i,s),r!==null?r.sibling:null);Va(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(ql(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return yx(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),A(Ft,Ft.current),d)break;return null;case 22:return i.lanes=0,ux(r,i,s,i.pendingProps);case 24:Fa(i,Zt,r.memoizedState.cache)}return ua(r,i,s)}function vx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Qt=!0;else{if(!rm(r,s)&&(i.flags&128)===0)return Qt=!1,k_(r,i,s);Qt=(r.flags&131072)!==0}else Qt=!1,rt&&(i.flags&1048576)!==0&&Yv(i,bo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Gi(i.elementType),i.type=r,typeof r=="function")oh(r)?(d=Wi(r,d),i.tag=1,i=hx(null,i,r,d,s)):(i.tag=0,i=Yh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===I){i.tag=11,i=lx(null,i,r,d,s);break e}else if(p===D){i.tag=14,i=sx(null,i,r,d,s);break e}}throw i=G(r)||r,Error(a(306,i,""))}}return i;case 0:return Yh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=Wi(d,i.pendingProps),hx(r,i,d,p,s);case 3:e:{if(be(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,kh(r,i),No(i,d,null,s);var S=i.memoizedState;if(d=S.cache,Fa(i,Zt,d),d!==v.cache&&yh(i,[Zt],s,!0),Eo(),d=S.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=mx(r,i,d,s);break e}else if(d!==p){p=hr(Error(a(424)),i),xo(p),i=mx(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Et=vr(r.firstChild),yn=i,rt=!0,Ba=null,gr=!0,s=ub(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Zi(),d===p){i=ua(r,i,s);break e}bn(r,i,d,s)}i=i.child}return i;case 26:return Uc(r,i),r===null?(s=A0(i.type,null,i.pendingProps,null))?i.memoizedState=s:rt||(s=i.type,r=i.pendingProps,d=td(ue.current).createElement(s),d[gn]=i,d[Mn]=r,xn(d,s,r),ln(d),i.stateNode=d):i.memoizedState=A0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return ee(i),r===null&&rt&&(d=i.stateNode=E0(i.type,i.pendingProps,ue.current),yn=i,gr=!0,p=Et,ti(i.type)?(Im=p,Et=vr(d.firstChild)):Et=p),bn(r,i,i.pendingProps.children,s),Uc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&rt&&((p=d=Et)&&(d=W_(d,i.type,i.pendingProps,gr),d!==null?(i.stateNode=d,yn=i,Et=vr(d.firstChild),gr=!1,p=!0):p=!1),p||$a(i)),ee(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Rm(p,v)?d=null:S!==null&&Rm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Th(r,i,m_,null,null,s),Qo._currentValue=p),Uc(r,i),bn(r,i,d,s),i.child;case 6:return r===null&&rt&&((r=s=Et)&&(s=e2(s,i.pendingProps,gr),s!==null?(i.stateNode=s,yn=i,Et=null,r=!0):r=!1),r||$a(i)),null;case 13:return px(r,i,s);case 4:return be(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Xi(i,null,d,s):bn(r,i,d,s),i.child;case 11:return lx(r,i,i.type,i.pendingProps,s);case 7:return bn(r,i,i.pendingProps,s),i.child;case 8:return bn(r,i,i.pendingProps.children,s),i.child;case 12:return bn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,Fa(i,i.type,d.value),bn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Qi(i),p=vn(p),d=d(p),i.flags|=1,bn(r,i,d,s),i.child;case 14:return sx(r,i,i.type,i.pendingProps,s);case 15:return ox(r,i,i.type,i.pendingProps,s);case 19:return yx(r,i,s);case 31:return S_(r,i,s);case 22:return ux(r,i,s,i.pendingProps);case 24:return Qi(i),d=vn(Zt),r===null?(p=xh(),p===null&&(p=wt,v=vh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},Sh(i),Fa(i,Zt,p)):((r.lanes&s)!==0&&(kh(r,i),No(i,null,null,s),Eo()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Fa(i,Zt,d)):(d=v.cache,Fa(i,Zt,d),d!==p.cache&&yh(i,[Zt],s,!0))),bn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function ca(r){r.flags|=4}function am(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Zx())r.flags|=8192;else throw Yi=kc,wh}else r.flags&=-16777217}function bx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!D0(i))if(Zx())r.flags|=8192;else throw Yi=kc,wh}function Bc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?we():536870912,r.lanes|=i,ts|=i)}function Oo(r,i){if(!rt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function Nt(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function j_(r,i,s){var d=i.pendingProps;switch(fh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(i),null;case 1:return Nt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),la(Zt),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Fl(i)?ca(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,mh())),Nt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(ca(i),v!==null?(Nt(i),bx(i,v)):(Nt(i),am(i,p,null,d,s))):v?v!==r.memoizedState?(ca(i),Nt(i),bx(i,v)):(Nt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&ca(i),Nt(i),am(i,p,r,d,s)),null;case 27:if(me(i),s=ue.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ca(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}r=q.current,Fl(i)?Jv(i):(r=E0(p,d,s),i.stateNode=r,ca(i))}return Nt(i),null;case 5:if(me(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&ca(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Nt(i),null}if(v=q.current,Fl(i))Jv(i);else{var S=td(ue.current);switch(v){case 1:v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=S.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?S.createElement("select",{is:d.is}):S.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?S.createElement(p,{is:d.is}):S.createElement(p)}}v[gn]=i,v[Mn]=d;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)v.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=v;e:switch(xn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&ca(i)}}return Nt(i),am(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&ca(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ue.current,Fl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=yn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[gn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||p0(r.nodeValue,s)),r||$a(i,!0)}else r=td(r).createTextNode(d),r[gn]=i,i.stateNode=r}return Nt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=Fl(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[gn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),r=!1}else s=mh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Wn(i),i):(Wn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Nt(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Fl(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[gn]=i}else Zi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Nt(i),p=!1}else p=mh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Wn(i),i):(Wn(i),null)}return Wn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Bc(i,i.updateQueue),Nt(i),null);case 4:return fe(),r===null&&Em(i.stateNode.containerInfo),Nt(i),null;case 10:return la(i.type),Nt(i),null;case 19:if(P(Ft),d=i.memoizedState,d===null)return Nt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Oo(d,!1);else{if(Ut!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Nc(r),v!==null){for(i.flags|=128,Oo(d,!1),r=v.updateQueue,i.updateQueue=r,Bc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)Qv(s,r),s=s.sibling;return A(Ft,Ft.current&1|2),rt&&aa(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&fn()>Zc&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304)}else{if(!p)if(r=Nc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Bc(i,r),Oo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!rt)return Nt(i),null}else 2*fn()-d.renderingStartTime>Zc&&s!==536870912&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=fn(),r.sibling=null,s=Ft.current,A(Ft,p?s&1|2:s&1),rt&&aa(i,d.treeForkCount),r):(Nt(i),null);case 22:case 23:return Wn(i),Nh(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(Nt(i),i.subtreeFlags&6&&(i.flags|=8192)):Nt(i),s=i.updateQueue,s!==null&&Bc(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&P(Ki),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),la(Zt),Nt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function C_(r,i){switch(fh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return la(Zt),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return me(i),null;case 31:if(i.memoizedState!==null){if(Wn(i),i.alternate===null)throw Error(a(340));Zi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Wn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Zi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return P(Ft),null;case 4:return fe(),null;case 10:return la(i.type),null;case 22:case 23:return Wn(i),Nh(),r!==null&&P(Ki),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return la(Zt),null;case 25:return null;default:return null}}function xx(r,i){switch(fh(i),i.tag){case 3:la(Zt),fe();break;case 26:case 27:case 5:me(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&Wn(i);break;case 13:Wn(i);break;case 19:P(Ft);break;case 10:la(i.type);break;case 22:case 23:Wn(i),Nh(),r!==null&&P(Ki);break;case 24:la(Zt)}}function Do(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var v=s.create,S=s.inst;d=v(),S.destroy=d}s=s.next}while(s!==p)}}catch(N){yt(i,i.return,N)}}function Ka(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var S=d.inst,N=S.destroy;if(N!==void 0){S.destroy=void 0,p=i;var $=s,Y=N;try{Y()}catch(ae){yt(p,$,ae)}}}d=d.next}while(d!==v)}}catch(ae){yt(i,i.return,ae)}}function wx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{db(i,s)}catch(d){yt(r,r.return,d)}}}function Sx(r,i,s){s.props=Wi(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){yt(r,i,d)}}function Mo(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){yt(r,i,p)}}function qr(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){yt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){yt(r,i,p)}else s.current=null}function kx(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){yt(r,r.return,p)}}function im(r,i,s){try{var d=r.stateNode;Q_(d,r.type,s,i),d[Mn]=i}catch(p){yt(r,r.return,p)}}function jx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ti(r.type)||r.tag===4}function lm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||jx(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ti(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function sm(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=ta));else if(d!==4&&(d===27&&ti(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(sm(r,i,s),r=r.sibling;r!==null;)sm(r,i,s),r=r.sibling}function $c(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ti(r.type)&&(s=r.stateNode),r=r.child,r!==null))for($c(r,i,s),r=r.sibling;r!==null;)$c(r,i,s),r=r.sibling}function Cx(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);xn(i,d,s),i[gn]=r,i[Mn]=s}catch(v){yt(r,r.return,v)}}var da=!1,Kt=!1,om=!1,Ex=typeof WeakSet=="function"?WeakSet:Set,sn=null;function E_(r,i){if(r=r.containerInfo,Am=od,r=Uv(r),th(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{s.nodeType,v.nodeType}catch{s=null;break e}var S=0,N=-1,$=-1,Y=0,ae=0,de=r,J=null;t:for(;;){for(var te;de!==s||p!==0&&de.nodeType!==3||(N=S+p),de!==v||d!==0&&de.nodeType!==3||($=S+d),de.nodeType===3&&(S+=de.nodeValue.length),(te=de.firstChild)!==null;)J=de,de=te;for(;;){if(de===r)break t;if(J===s&&++Y===p&&(N=S),J===v&&++ae===d&&($=S),(te=de.nextSibling)!==null)break;de=J,J=de.parentNode}de=te}s=N===-1||$===-1?null:{start:N,end:$}}else s=null}s=s||{start:0,end:0}}else s=null;for(Tm={focusedElem:r,selectionRange:s},od=!1,sn=i;sn!==null;)if(i=sn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,sn=r;else for(;sn!==null;){switch(i=sn,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,s=i,p=v.memoizedProps,v=v.memoizedState,d=s.stateNode;try{var je=Wi(s.type,p);r=d.getSnapshotBeforeUpdate(je,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Me){yt(s,s.return,Me)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Om(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Om(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,sn=r;break}sn=i.return}}function Nx(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ha(r,s),d&4&&Do(5,s);break;case 1:if(ha(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){yt(s,s.return,S)}else{var p=Wi(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){yt(s,s.return,S)}}d&64&&wx(s),d&512&&Mo(s,s.return);break;case 3:if(ha(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{db(r,i)}catch(S){yt(s,s.return,S)}}break;case 27:i===null&&d&4&&Cx(s);case 26:case 5:ha(r,s),i===null&&d&4&&kx(s),d&512&&Mo(s,s.return);break;case 12:ha(r,s);break;case 31:ha(r,s),d&4&&Tx(r,s);break;case 13:ha(r,s),d&4&&Rx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=M_.bind(null,s),t2(r,s))));break;case 22:if(d=s.memoizedState!==null||da,!d){i=i!==null&&i.memoizedState!==null||Kt,p=da;var v=Kt;da=d,(Kt=i)&&!v?ma(r,s,(s.subtreeFlags&8772)!==0):ha(r,s),da=p,Kt=v}break;case 30:break;default:ha(r,s)}}function _x(r){var i=r.alternate;i!==null&&(r.alternate=null,_x(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Uf(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var At=null,Ln=!1;function fa(r,i,s){for(s=s.child;s!==null;)Ax(r,i,s),s=s.sibling}function Ax(r,i,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Wt,s)}catch{}switch(s.tag){case 26:Kt||qr(s,i),fa(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Kt||qr(s,i);var d=At,p=Ln;ti(s.type)&&(At=s.stateNode,Ln=!1),fa(r,i,s),Ho(s.stateNode),At=d,Ln=p;break;case 5:Kt||qr(s,i);case 6:if(d=At,p=Ln,At=null,fa(r,i,s),At=d,Ln=p,At!==null)if(Ln)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(s.stateNode)}catch(v){yt(s,i,v)}else try{At.removeChild(s.stateNode)}catch(v){yt(s,i,v)}break;case 18:At!==null&&(Ln?(r=At,w0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),us(r)):w0(At,s.stateNode));break;case 4:d=At,p=Ln,At=s.stateNode.containerInfo,Ln=!0,fa(r,i,s),At=d,Ln=p;break;case 0:case 11:case 14:case 15:Ka(2,s,i),Kt||Ka(4,s,i),fa(r,i,s);break;case 1:Kt||(qr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Sx(s,i,d)),fa(r,i,s);break;case 21:fa(r,i,s);break;case 22:Kt=(d=Kt)||s.memoizedState!==null,fa(r,i,s),Kt=d;break;default:fa(r,i,s)}}function Tx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{us(r)}catch(s){yt(i,i.return,s)}}}function Rx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{us(r)}catch(s){yt(i,i.return,s)}}function N_(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Ex),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Ex),i;default:throw Error(a(435,r.tag))}}function Fc(r,i){var s=N_(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=I_.bind(null,r,d);d.then(p,p)}})}function Un(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],v=r,S=i,N=S;e:for(;N!==null;){switch(N.tag){case 27:if(ti(N.type)){At=N.stateNode,Ln=!1;break e}break;case 5:At=N.stateNode,Ln=!1;break e;case 3:case 4:At=N.stateNode.containerInfo,Ln=!0;break e}N=N.return}if(At===null)throw Error(a(160));Ax(v,S,p),At=null,Ln=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)zx(i,r),i=i.sibling}var Ar=null;function zx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Un(i,r),Pn(r),d&4&&(Ka(3,r,r.return),Do(3,r),Ka(5,r,r.return));break;case 1:Un(i,r),Pn(r),d&512&&(Kt||s===null||qr(s,s.return)),d&64&&da&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=Ar;if(Un(i,r),Pn(r),d&512&&(Kt||s===null||qr(s,s.return)),d&4){var v=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[so]||v[gn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),xn(v,d,s),v[gn]=r,ln(v),d=v;break e;case"link":var S=z0("link","href",p).get(d+(s.href||""));if(S){for(var N=0;N<S.length;N++)if(v=S[N],v.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&v.getAttribute("rel")===(s.rel==null?null:s.rel)&&v.getAttribute("title")===(s.title==null?null:s.title)&&v.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){S.splice(N,1);break t}}v=p.createElement(d),xn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=z0("meta","content",p).get(d+(s.content||""))){for(N=0;N<S.length;N++)if(v=S[N],v.getAttribute("content")===(s.content==null?null:""+s.content)&&v.getAttribute("name")===(s.name==null?null:s.name)&&v.getAttribute("property")===(s.property==null?null:s.property)&&v.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&v.getAttribute("charset")===(s.charSet==null?null:s.charSet)){S.splice(N,1);break t}}v=p.createElement(d),xn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[gn]=r,ln(v),d=v}r.stateNode=d}else O0(p,r.type,r.stateNode);else r.stateNode=R0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?O0(p,r.type,r.stateNode):R0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&im(r,r.memoizedProps,s.memoizedProps)}break;case 27:Un(i,r),Pn(r),d&512&&(Kt||s===null||qr(s,s.return)),s!==null&&d&4&&im(r,r.memoizedProps,s.memoizedProps);break;case 5:if(Un(i,r),Pn(r),d&512&&(Kt||s===null||qr(s,s.return)),r.flags&32){p=r.stateNode;try{zl(p,"")}catch(je){yt(r,r.return,je)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,im(r,p,s!==null?s.memoizedProps:p)),d&1024&&(om=!0);break;case 6:if(Un(i,r),Pn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(je){yt(r,r.return,je)}}break;case 3:if(ad=null,p=Ar,Ar=nd(i.containerInfo),Un(i,r),Ar=p,Pn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{us(i.containerInfo)}catch(je){yt(r,r.return,je)}om&&(om=!1,Ox(r));break;case 4:d=Ar,Ar=nd(r.stateNode.containerInfo),Un(i,r),Pn(r),Ar=d;break;case 12:Un(i,r),Pn(r);break;case 31:Un(i,r),Pn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Fc(r,d)));break;case 13:Un(i,r),Pn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Hc=fn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Fc(r,d)));break;case 22:p=r.memoizedState!==null;var $=s!==null&&s.memoizedState!==null,Y=da,ae=Kt;if(da=Y||p,Kt=ae||$,Un(i,r),Kt=ae,da=Y,Pn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||$||da||Kt||el(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){$=s=i;try{if(v=$.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{N=$.stateNode;var de=$.memoizedProps.style,J=de!=null&&de.hasOwnProperty("display")?de.display:null;N.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(je){yt($,$.return,je)}}}else if(i.tag===6){if(s===null){$=i;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(je){yt($,$.return,je)}}}else if(i.tag===18){if(s===null){$=i;try{var te=$.stateNode;p?S0(te,!0):S0($.stateNode,!1)}catch(je){yt($,$.return,je)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Fc(r,s))));break;case 19:Un(i,r),Pn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Fc(r,d)));break;case 30:break;case 21:break;default:Un(i,r),Pn(r)}}function Pn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(jx(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=lm(r);$c(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(zl(S,""),s.flags&=-33);var N=lm(r);$c(r,N,S);break;case 3:case 4:var $=s.stateNode.containerInfo,Y=lm(r);sm(r,Y,$);break;default:throw Error(a(161))}}catch(ae){yt(r,r.return,ae)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Ox(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Ox(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function ha(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Nx(r,i.alternate,i),i=i.sibling}function el(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ka(4,i,i.return),el(i);break;case 1:qr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Sx(i,i.return,s),el(i);break;case 27:Ho(i.stateNode);case 26:case 5:qr(i,i.return),el(i);break;case 22:i.memoizedState===null&&el(i);break;case 30:el(i);break;default:el(i)}r=r.sibling}}function ma(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,S=v.flags;switch(v.tag){case 0:case 11:case 15:ma(p,v,s),Do(4,v);break;case 1:if(ma(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Y){yt(d,d.return,Y)}if(d=v,p=d.updateQueue,p!==null){var N=d.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)cb($[p],N)}catch(Y){yt(d,d.return,Y)}}s&&S&64&&wx(v),Mo(v,v.return);break;case 27:Cx(v);case 26:case 5:ma(p,v,s),s&&d===null&&S&4&&kx(v),Mo(v,v.return);break;case 12:ma(p,v,s);break;case 31:ma(p,v,s),s&&S&4&&Tx(p,v);break;case 13:ma(p,v,s),s&&S&4&&Rx(p,v);break;case 22:v.memoizedState===null&&ma(p,v,s),Mo(v,v.return);break;case 30:break;default:ma(p,v,s)}i=i.sibling}}function um(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&wo(s))}function cm(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wo(r))}function Tr(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Dx(r,i,s,d),i=i.sibling}function Dx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Tr(r,i,s,d),p&2048&&Do(9,i);break;case 1:Tr(r,i,s,d);break;case 3:Tr(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wo(r)));break;case 12:if(p&2048){Tr(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,N=v.onPostCommit;typeof N=="function"&&N(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){yt(i,i.return,$)}}else Tr(r,i,s,d);break;case 31:Tr(r,i,s,d);break;case 13:Tr(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?Tr(r,i,s,d):Io(r,i):v._visibility&2?Tr(r,i,s,d):(v._visibility|=2,Jl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&um(S,i);break;case 24:Tr(r,i,s,d),p&2048&&cm(i.alternate,i);break;default:Tr(r,i,s,d)}}function Jl(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,S=i,N=s,$=d,Y=S.flags;switch(S.tag){case 0:case 11:case 15:Jl(v,S,N,$,p),Do(8,S);break;case 23:break;case 22:var ae=S.stateNode;S.memoizedState!==null?ae._visibility&2?Jl(v,S,N,$,p):Io(v,S):(ae._visibility|=2,Jl(v,S,N,$,p)),p&&Y&2048&&um(S.alternate,S);break;case 24:Jl(v,S,N,$,p),p&&Y&2048&&cm(S.alternate,S);break;default:Jl(v,S,N,$,p)}i=i.sibling}}function Io(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:Io(s,d),p&2048&&um(d.alternate,d);break;case 24:Io(s,d),p&2048&&cm(d.alternate,d);break;default:Io(s,d)}i=i.sibling}}var Lo=8192;function Wl(r,i,s){if(r.subtreeFlags&Lo)for(r=r.child;r!==null;)Mx(r,i,s),r=r.sibling}function Mx(r,i,s){switch(r.tag){case 26:Wl(r,i,s),r.flags&Lo&&r.memoizedState!==null&&h2(s,Ar,r.memoizedState,r.memoizedProps);break;case 5:Wl(r,i,s);break;case 3:case 4:var d=Ar;Ar=nd(r.stateNode.containerInfo),Wl(r,i,s),Ar=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=Lo,Lo=16777216,Wl(r,i,s),Lo=d):Wl(r,i,s));break;default:Wl(r,i,s)}}function Ix(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function Uo(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];sn=d,Ux(d,r)}Ix(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Lx(r),r=r.sibling}function Lx(r){switch(r.tag){case 0:case 11:case 15:Uo(r),r.flags&2048&&Ka(9,r,r.return);break;case 3:Uo(r);break;case 12:Uo(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,qc(r)):Uo(r);break;default:Uo(r)}}function qc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];sn=d,Ux(d,r)}Ix(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ka(8,i,i.return),qc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,qc(i));break;default:qc(i)}r=r.sibling}}function Ux(r,i){for(;sn!==null;){var s=sn;switch(s.tag){case 0:case 11:case 15:Ka(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:wo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,sn=d;else e:for(s=r;sn!==null;){d=sn;var p=d.sibling,v=d.return;if(_x(d),d===s){sn=null;break e}if(p!==null){p.return=v,sn=p;break e}sn=v}}}var __={getCacheForType:function(r){var i=vn(Zt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return vn(Zt).controller.signal}},A_=typeof WeakMap=="function"?WeakMap:Map,dt=0,wt=null,Ye=null,We=0,gt=0,er=null,Ga=!1,es=!1,dm=!1,pa=0,Ut=0,Ya=0,tl=0,fm=0,tr=0,ts=0,Po=null,Bn=null,hm=!1,Hc=0,Px=0,Zc=1/0,Vc=null,Xa=null,en=0,Ja=null,ns=null,ga=0,mm=0,pm=null,Bx=null,Bo=0,gm=null;function nr(){return(dt&2)!==0&&We!==0?We&-We:Z.T!==null?Sm():nv()}function $x(){if(tr===0)if((We&536870912)===0||rt){var r=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),tr=r}else tr=536870912;return r=Jn.current,r!==null&&(r.flags|=32),tr}function $n(r,i,s){(r===wt&&(gt===2||gt===9)||r.cancelPendingCommit!==null)&&(rs(r,0),Wa(r,We,tr,!1)),pn(r,s),((dt&2)===0||r!==wt)&&(r===wt&&((dt&2)===0&&(tl|=s),Ut===4&&Wa(r,We,tr,!1)),Hr(r))}function Fx(r,i,s){if((dt&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ia(r,i),p=d?z_(r,i):vm(r,i,!0),v=d;do{if(p===0){es&&!d&&Wa(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!T_(s)){p=vm(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var N=r;p=Po;var $=N.current.memoizedState.isDehydrated;if($&&(rs(N,S).flags|=256),S=vm(N,S,!1),S!==2){if(dm&&!$){N.errorRecoveryDisabledLanes|=v,tl|=v,p=4;break e}v=Bn,Bn=p,v!==null&&(Bn===null?Bn=v:Bn.push.apply(Bn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){rs(r,0),Wa(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Wa(d,i,tr,!Ga);break e;case 2:Bn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Hc+300-fn(),10<p)){if(Wa(d,i,tr,!Ga),Ui(d,0,!0)!==0)break e;ga=i,d.timeoutHandle=b0(qx.bind(null,d,s,Bn,Vc,hm,i,tr,tl,ts,Ga,v,"Throttled",-0,0),p);break e}qx(d,s,Bn,Vc,hm,i,tr,tl,ts,Ga,v,null,-0,0)}}break}while(!0);Hr(r)}function qx(r,i,s,d,p,v,S,N,$,Y,ae,de,J,te){if(r.timeoutHandle=-1,de=i.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ta},Mx(i,v,de);var je=(v&62914560)===v?Hc-fn():(v&4194048)===v?Px-fn():0;if(je=m2(de,je),je!==null){ga=v,r.cancelPendingCommit=je(Xx.bind(null,r,i,v,s,d,p,S,N,$,ae,de,null,J,te)),Wa(r,v,S,!Y);return}}Xx(r,i,v,s,d,p,S,N,$)}function T_(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],v=p.getSnapshot;p=p.value;try{if(!Yn(v(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Wa(r,i,s,d){i&=~fm,i&=~tl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-ft(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&lo(r,s,i)}function Qc(){return(dt&6)===0?($o(0),!1):!0}function ym(){if(Ye!==null){if(gt===0)var r=Ye.return;else r=Ye,ia=Vi=null,Oh(r),Ql=null,ko=0,r=Ye;for(;r!==null;)xx(r.alternate,r),r=r.return;Ye=null}}function rs(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,Y_(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),ga=0,ym(),wt=r,Ye=s=ra(r.current,null),We=i,gt=0,er=null,Ga=!1,es=Ia(r,i),dm=!1,ts=tr=fm=tl=Ya=Ut=0,Bn=Po=null,hm=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-ft(d),v=1<<p;i|=r[p],d&=~v}return pa=i,mc(),s}function Hx(r,i){qe=null,Z.H=Ro,i===Vl||i===Sc?(i=lb(),gt=3):i===wh?(i=lb(),gt=4):gt=i===Gh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,er=i,Ye===null&&(Ut=1,Ic(r,hr(i,r.current)))}function Zx(){var r=Jn.current;return r===null?!0:(We&4194048)===We?yr===null:(We&62914560)===We||(We&536870912)!==0?r===yr:!1}function Vx(){var r=Z.H;return Z.H=Ro,r===null?Ro:r}function Qx(){var r=Z.A;return Z.A=__,r}function Kc(){Ut=4,Ga||(We&4194048)!==We&&Jn.current!==null||(es=!0),(Ya&134217727)===0&&(tl&134217727)===0||wt===null||Wa(wt,We,tr,!1)}function vm(r,i,s){var d=dt;dt|=2;var p=Vx(),v=Qx();(wt!==r||We!==i)&&(Vc=null,rs(r,i)),i=!1;var S=Ut;e:do try{if(gt!==0&&Ye!==null){var N=Ye,$=er;switch(gt){case 8:ym(),S=6;break e;case 3:case 2:case 9:case 6:Jn.current===null&&(i=!0);var Y=gt;if(gt=0,er=null,as(r,N,$,Y),s&&es){S=0;break e}break;default:Y=gt,gt=0,er=null,as(r,N,$,Y)}}R_(),S=Ut;break}catch(ae){Hx(r,ae)}while(!0);return i&&r.shellSuspendCounter++,ia=Vi=null,dt=d,Z.H=p,Z.A=v,Ye===null&&(wt=null,We=0,mc()),S}function R_(){for(;Ye!==null;)Kx(Ye)}function z_(r,i){var s=dt;dt|=2;var d=Vx(),p=Qx();wt!==r||We!==i?(Vc=null,Zc=fn()+500,rs(r,i)):es=Ia(r,i);e:do try{if(gt!==0&&Ye!==null){i=Ye;var v=er;t:switch(gt){case 1:gt=0,er=null,as(r,i,v,1);break;case 2:case 9:if(ab(v)){gt=0,er=null,Gx(i);break}i=function(){gt!==2&>!==9||wt!==r||(gt=7),Hr(r)},v.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:ab(v)?(gt=0,er=null,Gx(i)):(gt=0,er=null,as(r,i,v,7));break;case 5:var S=null;switch(Ye.tag){case 26:S=Ye.memoizedState;case 5:case 27:var N=Ye;if(S?D0(S):N.stateNode.complete){gt=0,er=null;var $=N.sibling;if($!==null)Ye=$;else{var Y=N.return;Y!==null?(Ye=Y,Gc(Y)):Ye=null}break t}}gt=0,er=null,as(r,i,v,5);break;case 6:gt=0,er=null,as(r,i,v,6);break;case 8:ym(),Ut=6;break e;default:throw Error(a(462))}}O_();break}catch(ae){Hx(r,ae)}while(!0);return ia=Vi=null,Z.H=d,Z.A=p,dt=s,Ye!==null?0:(wt=null,We=0,mc(),Ut)}function O_(){for(;Ye!==null&&!ro();)Kx(Ye)}function Kx(r){var i=vx(r.alternate,r,pa);r.memoizedProps=r.pendingProps,i===null?Gc(r):Ye=i}function Gx(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=fx(s,i,i.pendingProps,i.type,void 0,We);break;case 11:i=fx(s,i,i.pendingProps,i.type.render,i.ref,We);break;case 5:Oh(i);default:xx(s,i),i=Ye=Qv(i,pa),i=vx(s,i,pa)}r.memoizedProps=r.pendingProps,i===null?Gc(r):Ye=i}function as(r,i,s,d){ia=Vi=null,Oh(i),Ql=null,ko=0;var p=i.return;try{if(w_(r,p,i,s,We)){Ut=1,Ic(r,hr(s,r.current)),Ye=null;return}}catch(v){if(p!==null)throw Ye=p,v;Ut=1,Ic(r,hr(s,r.current)),Ye=null;return}i.flags&32768?(rt||d===1?r=!0:es||(We&536870912)!==0?r=!1:(Ga=r=!0,(d===2||d===9||d===3||d===6)&&(d=Jn.current,d!==null&&d.tag===13&&(d.flags|=16384))),Yx(i,r)):Gc(i)}function Gc(r){var i=r;do{if((i.flags&32768)!==0){Yx(i,Ga);return}r=i.return;var s=j_(i.alternate,i,pa);if(s!==null){Ye=s;return}if(i=i.sibling,i!==null){Ye=i;return}Ye=i=r}while(i!==null);Ut===0&&(Ut=5)}function Yx(r,i){do{var s=C_(r.alternate,r);if(s!==null){s.flags&=32767,Ye=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Ye=r;return}Ye=r=s}while(r!==null);Ut=6,Ye=null}function Xx(r,i,s,d,p,v,S,N,$){r.cancelPendingCommit=null;do Yc();while(en!==0);if((dt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=lh,Wr(r,s,v,S,N,$),r===wt&&(Ye=wt=null,We=0),ns=i,Ja=r,ga=s,mm=v,pm=p,Bx=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,L_(Ue,function(){return n0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=re.p,re.p=2,S=dt,dt|=4;try{E_(r,i,s)}finally{dt=S,re.p=p,Z.T=d}}en=1,Jx(),Wx(),e0()}}function Jx(){if(en===1){en=0;var r=Ja,i=ns,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=Z.T,Z.T=null;var d=re.p;re.p=2;var p=dt;dt|=4;try{zx(i,r);var v=Tm,S=Uv(r.containerInfo),N=v.focusedElem,$=v.selectionRange;if(S!==N&&N&&N.ownerDocument&&Lv(N.ownerDocument.documentElement,N)){if($!==null&&th(N)){var Y=$.start,ae=$.end;if(ae===void 0&&(ae=Y),"selectionStart"in N)N.selectionStart=Y,N.selectionEnd=Math.min(ae,N.value.length);else{var de=N.ownerDocument||document,J=de&&de.defaultView||window;if(J.getSelection){var te=J.getSelection(),je=N.textContent.length,Me=Math.min($.start,je),xt=$.end===void 0?Me:Math.min($.end,je);!te.extend&&Me>xt&&(S=xt,xt=Me,Me=S);var Q=Iv(N,Me),H=Iv(N,xt);if(Q&&H&&(te.rangeCount!==1||te.anchorNode!==Q.node||te.anchorOffset!==Q.offset||te.focusNode!==H.node||te.focusOffset!==H.offset)){var K=de.createRange();K.setStart(Q.node,Q.offset),te.removeAllRanges(),Me>xt?(te.addRange(K),te.extend(H.node,H.offset)):(K.setEnd(H.node,H.offset),te.addRange(K))}}}}for(de=[],te=N;te=te.parentNode;)te.nodeType===1&&de.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<de.length;N++){var ce=de[N];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}od=!!Am,Tm=Am=null}finally{dt=p,re.p=d,Z.T=s}}r.current=i,en=2}}function Wx(){if(en===2){en=0;var r=Ja,i=ns,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=Z.T,Z.T=null;var d=re.p;re.p=2;var p=dt;dt|=4;try{Nx(r,i.alternate,i)}finally{dt=p,re.p=d,Z.T=s}}en=3}}function e0(){if(en===4||en===3){en=0,ao();var r=Ja,i=ns,s=ga,d=Bx;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?en=5:(en=0,ns=Ja=null,t0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Xa=null),If(s),i=i.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Wt,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=re.p,re.p=2,Z.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var N=d[S];v(N.value,{componentStack:N.stack})}}finally{Z.T=i,re.p=p}}(ga&3)!==0&&Yc(),Hr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===gm?Bo++:(Bo=0,gm=r):Bo=0,$o(0)}}function t0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,wo(i)))}function Yc(){return Jx(),Wx(),e0(),n0()}function n0(){if(en!==5)return!1;var r=Ja,i=mm;mm=0;var s=If(ga),d=Z.T,p=re.p;try{re.p=32>s?32:s,Z.T=null,s=pm,pm=null;var v=Ja,S=ga;if(en=0,ns=Ja=null,ga=0,(dt&6)!==0)throw Error(a(331));var N=dt;if(dt|=4,Lx(v.current),Dx(v,v.current,S,s),dt=N,$o(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Wt,v)}catch{}return!0}finally{re.p=p,Z.T=d,t0(r,i)}}function r0(r,i,s){i=hr(s,i),i=Kh(r.stateNode,i,2),r=Za(r,i,2),r!==null&&(pn(r,2),Hr(r))}function yt(r,i,s){if(r.tag===3)r0(r,r,s);else for(;i!==null;){if(i.tag===3){r0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Xa===null||!Xa.has(d))){r=hr(s,r),s=ax(2),d=Za(i,s,2),d!==null&&(ix(s,d,i,r),pn(d,2),Hr(d));break}}i=i.return}}function bm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new A_;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(dm=!0,p.add(s),r=D_.bind(null,r,i,s),i.then(r,r))}function D_(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,wt===r&&(We&s)===s&&(Ut===4||Ut===3&&(We&62914560)===We&&300>fn()-Hc?(dt&2)===0&&rs(r,0):fm|=s,ts===We&&(ts=0)),Hr(r)}function a0(r,i){i===0&&(i=we()),r=qi(r,i),r!==null&&(pn(r,i),Hr(r))}function M_(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),a0(r,s)}function I_(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),a0(r,s)}function L_(r,i){return Ma(r,i)}var Xc=null,is=null,xm=!1,Jc=!1,wm=!1,ei=0;function Hr(r){r!==is&&r.next===null&&(is===null?Xc=is=r:is=is.next=r),Jc=!0,xm||(xm=!0,P_())}function $o(r,i){if(!wm&&Jc){wm=!0;do for(var s=!1,d=Xc;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,N=d.pingedLanes;v=(1<<31-ft(42|r)+1)-1,v&=p&~(S&~N),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,o0(d,v))}else v=We,v=Ui(d,d===wt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||Ia(d,v)||(s=!0,o0(d,v));d=d.next}while(s);wm=!1}}function U_(){i0()}function i0(){Jc=xm=!1;var r=0;ei!==0&&G_()&&(r=ei);for(var i=fn(),s=null,d=Xc;d!==null;){var p=d.next,v=l0(d,i);v===0?(d.next=null,s===null?Xc=p:s.next=p,p===null&&(is=s)):(s=d,(r!==0||(v&3)!==0)&&(Jc=!0)),d=p}en!==0&&en!==5||$o(r),ei!==0&&(ei=0)}function l0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-ft(v),N=1<<S,$=p[S];$===-1?((N&s)===0||(N&d)!==0)&&(p[S]=tc(N,i)):$<=i&&(r.expiredLanes|=N),v&=~N}if(i=wt,s=We,s=Ui(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(gt===2||gt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Jr(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ia(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&Jr(d),If(s)){case 2:case 8:s=ye;break;case 32:s=Ue;break;case 268435456:s=nt;break;default:s=Ue}return d=s0.bind(null,r),s=Ma(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&Jr(d),r.callbackPriority=2,r.callbackNode=null,2}function s0(r,i){if(en!==0&&en!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(Yc()&&r.callbackNode!==s)return null;var d=We;return d=Ui(r,r===wt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Fx(r,d,i),l0(r,fn()),r.callbackNode!=null&&r.callbackNode===s?s0.bind(null,r):null)}function o0(r,i){if(Yc())return null;Fx(r,i,!0)}function P_(){X_(function(){(dt&6)!==0?Ma(le,U_):i0()})}function Sm(){if(ei===0){var r=Hl;r===0&&(r=Mi,Mi<<=1,(Mi&261888)===0&&(Mi=256)),ei=r}return ei}function u0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:lc(""+r)}function c0(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function B_(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=u0((p[Mn]||null).action),S=d.submitter;S&&(i=(i=S[Mn]||null)?u0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var N=new cc("action","action",null,d,p);r.push({event:N,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ei!==0){var $=S?c0(p,S):new FormData(p);Fh(s,{pending:!0,data:$,method:p.method,action:v},null,$)}}else typeof v=="function"&&(N.preventDefault(),$=S?c0(p,S):new FormData(p),Fh(s,{pending:!0,data:$,method:p.method,action:v},v,$))},currentTarget:p}]})}}for(var km=0;km<ih.length;km++){var jm=ih[km],$_=jm.toLowerCase(),F_=jm[0].toUpperCase()+jm.slice(1);_r($_,"on"+F_)}_r($v,"onAnimationEnd"),_r(Fv,"onAnimationIteration"),_r(qv,"onAnimationStart"),_r("dblclick","onDoubleClick"),_r("focusin","onFocus"),_r("focusout","onBlur"),_r(a_,"onTransitionRun"),_r(i_,"onTransitionStart"),_r(l_,"onTransitionCancel"),_r(Hv,"onTransitionEnd"),Tl("onMouseEnter",["mouseout","mouseover"]),Tl("onMouseLeave",["mouseout","mouseover"]),Tl("onPointerEnter",["pointerout","pointerover"]),Tl("onPointerLeave",["pointerout","pointerover"]),Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),q_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fo));function d0(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var S=d.length-1;0<=S;S--){var N=d[S],$=N.instance,Y=N.currentTarget;if(N=N.listener,$!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=Y;try{v(p)}catch(ae){hc(ae)}p.currentTarget=null,v=$}else for(S=0;S<d.length;S++){if(N=d[S],$=N.instance,Y=N.currentTarget,N=N.listener,$!==v&&p.isPropagationStopped())break e;v=N,p.currentTarget=Y;try{v(p)}catch(ae){hc(ae)}p.currentTarget=null,v=$}}}}function Xe(r,i){var s=i[Lf];s===void 0&&(s=i[Lf]=new Set);var d=r+"__bubble";s.has(d)||(f0(i,r,2,!1),s.add(d))}function Cm(r,i,s){var d=0;i&&(d|=4),f0(s,r,d,i)}var Wc="_reactListening"+Math.random().toString(36).slice(2);function Em(r){if(!r[Wc]){r[Wc]=!0,iv.forEach(function(s){s!=="selectionchange"&&(q_.has(s)||Cm(s,!1,r),Cm(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Wc]||(i[Wc]=!0,Cm("selectionchange",!1,i))}}function f0(r,i,s,d){switch($0(i)){case 2:var p=y2;break;case 8:p=v2;break;default:p=$m}s=p.bind(null,i,s,r),p=void 0,!Vf||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function Nm(r,i,s,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var N=d.stateNode.containerInfo;if(N===p)break;if(S===4)for(S=d.return;S!==null;){var $=S.tag;if(($===3||$===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;N!==null;){if(S=Nl(N),S===null)return;if($=S.tag,$===5||$===6||$===26||$===27){d=v=S;continue e}N=N.parentNode}}d=d.return}yv(function(){var Y=v,ae=Hf(s),de=[];e:{var J=Zv.get(r);if(J!==void 0){var te=cc,je=r;switch(r){case"keypress":if(oc(s)===0)break e;case"keydown":case"keyup":te=IN;break;case"focusin":je="focus",te=Yf;break;case"focusout":je="blur",te=Yf;break;case"beforeblur":case"afterblur":te=Yf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=xv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=jN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=PN;break;case $v:case Fv:case qv:te=NN;break;case Hv:te=$N;break;case"scroll":case"scrollend":te=SN;break;case"wheel":te=qN;break;case"copy":case"cut":case"paste":te=AN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Sv;break;case"toggle":case"beforetoggle":te=ZN}var Me=(i&4)!==0,xt=!Me&&(r==="scroll"||r==="scrollend"),Q=Me?J!==null?J+"Capture":null:J;Me=[];for(var H=Y,K;H!==null;){var ce=H;if(K=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||K===null||Q===null||(ce=uo(H,Q),ce!=null&&Me.push(qo(H,ce,K))),xt)break;H=H.return}0<Me.length&&(J=new te(J,je,null,s,ae),de.push({event:J,listeners:Me}))}}if((i&7)===0){e:{if(J=r==="mouseover"||r==="pointerover",te=r==="mouseout"||r==="pointerout",J&&s!==qf&&(je=s.relatedTarget||s.fromElement)&&(Nl(je)||je[El]))break e;if((te||J)&&(J=ae.window===ae?ae:(J=ae.ownerDocument)?J.defaultView||J.parentWindow:window,te?(je=s.relatedTarget||s.toElement,te=Y,je=je?Nl(je):null,je!==null&&(xt=o(je),Me=je.tag,je!==xt||Me!==5&&Me!==27&&Me!==6)&&(je=null)):(te=null,je=Y),te!==je)){if(Me=xv,ce="onMouseLeave",Q="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(Me=Sv,ce="onPointerLeave",Q="onPointerEnter",H="pointer"),xt=te==null?J:oo(te),K=je==null?J:oo(je),J=new Me(ce,H+"leave",te,s,ae),J.target=xt,J.relatedTarget=K,ce=null,Nl(ae)===Y&&(Me=new Me(Q,H+"enter",je,s,ae),Me.target=K,Me.relatedTarget=xt,ce=Me),xt=ce,te&&je)t:{for(Me=H_,Q=te,H=je,K=0,ce=Q;ce;ce=Me(ce))K++;ce=0;for(var Oe=H;Oe;Oe=Me(Oe))ce++;for(;0<K-ce;)Q=Me(Q),K--;for(;0<ce-K;)H=Me(H),ce--;for(;K--;){if(Q===H||H!==null&&Q===H.alternate){Me=Q;break t}Q=Me(Q),H=Me(H)}Me=null}else Me=null;te!==null&&h0(de,J,te,Me,!1),je!==null&&xt!==null&&h0(de,xt,je,Me,!0)}}e:{if(J=Y?oo(Y):window,te=J.nodeName&&J.nodeName.toLowerCase(),te==="select"||te==="input"&&J.type==="file")var ot=Tv;else if(_v(J))if(Rv)ot=t_;else{ot=WN;var Ae=JN}else te=J.nodeName,!te||te.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Y&&Ff(Y.elementType)&&(ot=Tv):ot=e_;if(ot&&(ot=ot(r,Y))){Av(de,ot,s,ae);break e}Ae&&Ae(r,J,Y),r==="focusout"&&Y&&J.type==="number"&&Y.memoizedProps.value!=null&&$f(J,"number",J.value)}switch(Ae=Y?oo(Y):window,r){case"focusin":(_v(Ae)||Ae.contentEditable==="true")&&(Il=Ae,nh=Y,vo=null);break;case"focusout":vo=nh=Il=null;break;case"mousedown":rh=!0;break;case"contextmenu":case"mouseup":case"dragend":rh=!1,Pv(de,s,ae);break;case"selectionchange":if(r_)break;case"keydown":case"keyup":Pv(de,s,ae)}var He;if(Jf)e:{switch(r){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else Ml?Ev(r,s)&&(et="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(et="onCompositionStart");et&&(kv&&s.locale!=="ko"&&(Ml||et!=="onCompositionStart"?et==="onCompositionEnd"&&Ml&&(He=vv()):(Ua=ae,Qf="value"in Ua?Ua.value:Ua.textContent,Ml=!0)),Ae=ed(Y,et),0<Ae.length&&(et=new wv(et,r,null,s,ae),de.push({event:et,listeners:Ae}),He?et.data=He:(He=Nv(s),He!==null&&(et.data=He)))),(He=QN?KN(r,s):GN(r,s))&&(et=ed(Y,"onBeforeInput"),0<et.length&&(Ae=new wv("onBeforeInput","beforeinput",null,s,ae),de.push({event:Ae,listeners:et}),Ae.data=He)),B_(de,r,Y,s,ae)}d0(de,i)})}function qo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function ed(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=uo(r,s),p!=null&&d.unshift(qo(r,p,v)),p=uo(r,i),p!=null&&d.push(qo(r,p,v))),r.tag===3)return d;r=r.return}return[]}function H_(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function h0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var N=s,$=N.alternate,Y=N.stateNode;if(N=N.tag,$!==null&&$===d)break;N!==5&&N!==26&&N!==27||Y===null||($=Y,p?(Y=uo(s,v),Y!=null&&S.unshift(qo(s,Y,$))):p||(Y=uo(s,v),Y!=null&&S.push(qo(s,Y,$)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var Z_=/\r\n?/g,V_=/\u0000|\uFFFD/g;function m0(r){return(typeof r=="string"?r:""+r).replace(Z_,`
|
|
49
|
+
`).replace(V_,"")}function p0(r,i){return i=m0(i),m0(r)===i}function bt(r,i,s,d,p,v){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||zl(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&zl(r,""+d);break;case"className":ac(r,"class",d);break;case"tabIndex":ac(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ac(r,s,d);break;case"style":pv(r,d,v);break;case"data":if(i!=="object"){ac(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=lc(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(s==="formAction"?(i!=="input"&&bt(r,i,"name",p.name,p,null),bt(r,i,"formEncType",p.formEncType,p,null),bt(r,i,"formMethod",p.formMethod,p,null),bt(r,i,"formTarget",p.formTarget,p,null)):(bt(r,i,"encType",p.encType,p,null),bt(r,i,"method",p.method,p,null),bt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=lc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=ta);break;case"onScroll":d!=null&&Xe("scroll",r);break;case"onScrollEnd":d!=null&&Xe("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=lc(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":Xe("beforetoggle",r),Xe("toggle",r),rc(r,"popover",d);break;case"xlinkActuate":ea(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ea(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ea(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ea(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ea(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ea(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ea(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ea(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ea(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":rc(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=xN.get(s)||s,rc(r,s,d))}}function _m(r,i,s,d,p,v){switch(s){case"style":pv(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?zl(r,d):(typeof d=="number"||typeof d=="bigint")&&zl(r,""+d);break;case"onScroll":d!=null&&Xe("scroll",r);break;case"onScrollEnd":d!=null&&Xe("scrollend",r);break;case"onClick":d!=null&&(r.onclick=ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lv.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),v=r[Mn]||null,v=v!=null?v[s]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):rc(r,s,d)}}}function xn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",r),Xe("load",r);var d=!1,p=!1,v;for(v in s)if(s.hasOwnProperty(v)){var S=s[v];if(S!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,v,S,s,null)}}p&&bt(r,i,"srcSet",s.srcSet,s,null),d&&bt(r,i,"src",s.src,s,null);return;case"input":Xe("invalid",r);var N=v=S=p=null,$=null,Y=null;for(d in s)if(s.hasOwnProperty(d)){var ae=s[d];if(ae!=null)switch(d){case"name":p=ae;break;case"type":S=ae;break;case"checked":$=ae;break;case"defaultChecked":Y=ae;break;case"value":v=ae;break;case"defaultValue":N=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:bt(r,i,d,ae,s,null)}}dv(r,v,N,$,Y,S,p,!1);return;case"select":Xe("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(N=s[p],N!=null))switch(p){case"value":v=N;break;case"defaultValue":S=N;break;case"multiple":d=N;default:bt(r,i,p,N,s,null)}i=v,s=S,r.multiple=!!d,i!=null?Rl(r,!!d,i,!1):s!=null&&Rl(r,!!d,s,!0);return;case"textarea":Xe("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(N=s[S],N!=null))switch(S){case"value":d=N;break;case"defaultValue":p=N;break;case"children":v=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(a(91));break;default:bt(r,i,S,N,s,null)}hv(r,d,p,v);return;case"option":for($ in s)if(s.hasOwnProperty($)&&(d=s[$],d!=null))switch($){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:bt(r,i,$,d,s,null)}return;case"dialog":Xe("beforetoggle",r),Xe("toggle",r),Xe("cancel",r),Xe("close",r);break;case"iframe":case"object":Xe("load",r);break;case"video":case"audio":for(d=0;d<Fo.length;d++)Xe(Fo[d],r);break;case"image":Xe("error",r),Xe("load",r);break;case"details":Xe("toggle",r);break;case"embed":case"source":case"link":Xe("error",r),Xe("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Y in s)if(s.hasOwnProperty(Y)&&(d=s[Y],d!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(r,i,Y,d,s,null)}return;default:if(Ff(i)){for(ae in s)s.hasOwnProperty(ae)&&(d=s[ae],d!==void 0&&_m(r,i,ae,d,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(d=s[N],d!=null&&bt(r,i,N,d,s,null))}function Q_(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,S=null,N=null,$=null,Y=null,ae=null;for(te in s){var de=s[te];if(s.hasOwnProperty(te)&&de!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":$=de;default:d.hasOwnProperty(te)||bt(r,i,te,null,d,de)}}for(var J in d){var te=d[J];if(de=s[J],d.hasOwnProperty(J)&&(te!=null||de!=null))switch(J){case"type":v=te;break;case"name":p=te;break;case"checked":Y=te;break;case"defaultChecked":ae=te;break;case"value":S=te;break;case"defaultValue":N=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:te!==de&&bt(r,i,J,te,d,de)}}Bf(r,S,N,$,Y,ae,v,p);return;case"select":te=S=N=J=null;for(v in s)if($=s[v],s.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":te=$;default:d.hasOwnProperty(v)||bt(r,i,v,null,d,$)}for(p in d)if(v=d[p],$=s[p],d.hasOwnProperty(p)&&(v!=null||$!=null))switch(p){case"value":J=v;break;case"defaultValue":N=v;break;case"multiple":S=v;default:v!==$&&bt(r,i,p,v,d,$)}i=N,s=S,d=te,J!=null?Rl(r,!!s,J,!1):!!d!=!!s&&(i!=null?Rl(r,!!s,i,!0):Rl(r,!!s,s?[]:"",!1));return;case"textarea":te=J=null;for(N in s)if(p=s[N],s.hasOwnProperty(N)&&p!=null&&!d.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:bt(r,i,N,null,d,p)}for(S in d)if(p=d[S],v=s[S],d.hasOwnProperty(S)&&(p!=null||v!=null))switch(S){case"value":J=p;break;case"defaultValue":te=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&bt(r,i,S,p,d,v)}fv(r,J,te);return;case"option":for(var je in s)if(J=s[je],s.hasOwnProperty(je)&&J!=null&&!d.hasOwnProperty(je))switch(je){case"selected":r.selected=!1;break;default:bt(r,i,je,null,d,J)}for($ in d)if(J=d[$],te=s[$],d.hasOwnProperty($)&&J!==te&&(J!=null||te!=null))switch($){case"selected":r.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:bt(r,i,$,J,d,te)}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 Me in s)J=s[Me],s.hasOwnProperty(Me)&&J!=null&&!d.hasOwnProperty(Me)&&bt(r,i,Me,null,d,J);for(Y in d)if(J=d[Y],te=s[Y],d.hasOwnProperty(Y)&&J!==te&&(J!=null||te!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,i));break;default:bt(r,i,Y,J,d,te)}return;default:if(Ff(i)){for(var xt in s)J=s[xt],s.hasOwnProperty(xt)&&J!==void 0&&!d.hasOwnProperty(xt)&&_m(r,i,xt,void 0,d,J);for(ae in d)J=d[ae],te=s[ae],!d.hasOwnProperty(ae)||J===te||J===void 0&&te===void 0||_m(r,i,ae,J,d,te);return}}for(var Q in s)J=s[Q],s.hasOwnProperty(Q)&&J!=null&&!d.hasOwnProperty(Q)&&bt(r,i,Q,null,d,J);for(de in d)J=d[de],te=s[de],!d.hasOwnProperty(de)||J===te||J==null&&te==null||bt(r,i,de,J,d,te)}function g0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function K_(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],v=p.transferSize,S=p.initiatorType,N=p.duration;if(v&&N&&g0(S)){for(S=0,N=p.responseEnd,d+=1;d<s.length;d++){var $=s[d],Y=$.startTime;if(Y>N)break;var ae=$.transferSize,de=$.initiatorType;ae&&g0(de)&&($=$.responseEnd,S+=ae*($<N?1:(N-Y)/($-Y)))}if(--d,i+=8*(v+S)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Am=null,Tm=null;function td(r){return r.nodeType===9?r:r.ownerDocument}function y0(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function v0(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function Rm(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var zm=null;function G_(){var r=window.event;return r&&r.type==="popstate"?r===zm?!1:(zm=r,!0):(zm=null,!1)}var b0=typeof setTimeout=="function"?setTimeout:void 0,Y_=typeof clearTimeout=="function"?clearTimeout:void 0,x0=typeof Promise=="function"?Promise:void 0,X_=typeof queueMicrotask=="function"?queueMicrotask:typeof x0<"u"?function(r){return x0.resolve(null).then(r).catch(J_)}:b0;function J_(r){setTimeout(function(){throw r})}function ti(r){return r==="head"}function w0(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),us(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")Ho(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,Ho(s);for(var v=s.firstChild;v;){var S=v.nextSibling,N=v.nodeName;v[so]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Ho(r.ownerDocument.body);s=p}while(s);us(i)}function S0(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function Om(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Om(s),Uf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function W_(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[so])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=vr(r.nextSibling),r===null)break}return null}function e2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=vr(r.nextSibling),r===null))return null;return r}function k0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=vr(r.nextSibling),r===null))return null;return r}function Dm(r){return r.data==="$?"||r.data==="$~"}function Mm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function t2(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function vr(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var Im=null;function j0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return vr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function C0(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function E0(r,i,s){switch(i=td(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Ho(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Uf(r)}var br=new Map,N0=new Set;function nd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ya=re.d;re.d={f:n2,r:r2,D:a2,C:i2,L:l2,m:s2,X:u2,S:o2,M:c2};function n2(){var r=ya.f(),i=Qc();return r||i}function r2(r){var i=_l(r);i!==null&&i.tag===5&&i.type==="form"?Hb(i):ya.r(r)}var ls=typeof document>"u"?null:document;function _0(r,i,s){var d=ls;if(d&&typeof i=="string"&&i){var p=dr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),N0.has(p)||(N0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),xn(i,"link",r),ln(i),d.head.appendChild(i)))}}function a2(r){ya.D(r),_0("dns-prefetch",r,null)}function i2(r,i){ya.C(r,i),_0("preconnect",r,i)}function l2(r,i,s){ya.L(r,i,s);var d=ls;if(d&&r&&i){var p='link[rel="preload"][as="'+dr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+dr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+dr(s.imageSizes)+'"]')):p+='[href="'+dr(r)+'"]';var v=p;switch(i){case"style":v=ss(r);break;case"script":v=os(r)}br.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),br.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Zo(v))||i==="script"&&d.querySelector(Vo(v))||(i=d.createElement("link"),xn(i,"link",r),ln(i),d.head.appendChild(i)))}}function s2(r,i){ya.m(r,i);var s=ls;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+dr(d)+'"][href="'+dr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=os(r)}if(!br.has(v)&&(r=g({rel:"modulepreload",href:r},i),br.set(v,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Vo(v)))return}d=s.createElement("link"),xn(d,"link",r),ln(d),s.head.appendChild(d)}}}function o2(r,i,s){ya.S(r,i,s);var d=ls;if(d&&r){var p=Al(d).hoistableStyles,v=ss(r);i=i||"default";var S=p.get(v);if(!S){var N={loading:0,preload:null};if(S=d.querySelector(Zo(v)))N.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=br.get(v))&&Lm(r,s);var $=S=d.createElement("link");ln($),xn($,"link",r),$._p=new Promise(function(Y,ae){$.onload=Y,$.onerror=ae}),$.addEventListener("load",function(){N.loading|=1}),$.addEventListener("error",function(){N.loading|=2}),N.loading|=4,rd(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:N},p.set(v,S)}}}function u2(r,i){ya.X(r,i);var s=ls;if(s&&r){var d=Al(s).hoistableScripts,p=os(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0},i),(i=br.get(p))&&Um(r,i),v=s.createElement("script"),ln(v),xn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function c2(r,i){ya.M(r,i);var s=ls;if(s&&r){var d=Al(s).hoistableScripts,p=os(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0,type:"module"},i),(i=br.get(p))&&Um(r,i),v=s.createElement("script"),ln(v),xn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function A0(r,i,s,d){var p=(p=ue.current)?nd(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ss(s.href),s=Al(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=ss(s.href);var v=Al(p).hoistableStyles,S=v.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,S),(v=p.querySelector(Zo(r)))&&!v._p&&(S.instance=v,S.state.loading=5),br.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},br.set(r,s),v||d2(p,r,s,S.state))),i&&d===null)throw Error(a(528,""));return S}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=os(s),s=Al(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ss(r){return'href="'+dr(r)+'"'}function Zo(r){return'link[rel="stylesheet"]['+r+"]"}function T0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function d2(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),xn(i,"link",s),ln(i),r.head.appendChild(i))}function os(r){return'[src="'+dr(r)+'"]'}function Vo(r){return"script[async]"+r}function R0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+dr(s.href)+'"]');if(d)return i.instance=d,ln(d),d;var p=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),ln(d),xn(d,"style",p),rd(d,s.precedence,r),i.instance=d;case"stylesheet":p=ss(s.href);var v=r.querySelector(Zo(p));if(v)return i.state.loading|=4,i.instance=v,ln(v),v;d=T0(s),(p=br.get(p))&&Lm(d,p),v=(r.ownerDocument||r).createElement("link"),ln(v);var S=v;return S._p=new Promise(function(N,$){S.onload=N,S.onerror=$}),xn(v,"link",d),i.state.loading|=4,rd(v,s.precedence,r),i.instance=v;case"script":return v=os(s.src),(p=r.querySelector(Vo(v)))?(i.instance=p,ln(p),p):(d=s,(p=br.get(v))&&(d=g({},s),Um(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),ln(p),xn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,rd(d,s.precedence,r));return i.instance}function rd(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,S=0;S<d.length;S++){var N=d[S];if(N.dataset.precedence===i)v=N;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function Lm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Um(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var ad=null;function z0(r,i,s){if(ad===null){var d=new Map,p=ad=new Map;p.set(s,d)}else p=ad,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var v=s[p];if(!(v[so]||v[gn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var N=d.get(S);N?N.push(v):d.set(S,[v])}}return d}function O0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function f2(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function D0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function h2(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=ss(d.href),v=i.querySelector(Zo(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=id.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,ln(v);return}v=i.ownerDocument||i,d=T0(d),(p=br.get(p))&&Lm(d,p),v=v.createElement("link"),ln(v);var S=v;S._p=new Promise(function(N,$){S.onload=N,S.onerror=$}),xn(v,"link",d),s.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=id.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Pm=0;function m2(r,i){return r.stylesheets&&r.count===0&&sd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&sd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Pm===0&&(Pm=62500*K_());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&sd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Pm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function id(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ld=null;function sd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ld=new Map,i.forEach(p2,r),ld=null,id.call(r))}function p2(r,i){if(!(i.state.loading&4)){var s=ld.get(r);if(s)var d=s.get(null);else{s=new Map,ld.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var S=p[v];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(s.set(S.dataset.precedence,S),d=S)}d&&s.set(null,d)}p=i.instance,S=p.getAttribute("data-precedence"),v=s.get(S)||d,v===d&&s.set(null,p),s.set(S,p),this.count++,d=id.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var Qo={$$typeof:z,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function g2(r,i,s,d,p,v,S,N,$){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function M0(r,i,s,d,p,v,S,N,$,Y,ae,de){return r=new g2(r,i,s,S,$,Y,ae,de,N),i=1,v===!0&&(i|=24),v=Xn(3,null,null,i),r.current=v,v.stateNode=r,i=vh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},Sh(v),r}function I0(r){return r?(r=Pl,r):Pl}function L0(r,i,s,d,p,v){p=I0(p),d.context===null?d.context=p:d.pendingContext=p,d=Ha(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Za(r,d,i),s!==null&&($n(s,r,i),Co(s,r,i))}function U0(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Bm(r,i){U0(r,i),(r=r.alternate)&&U0(r,i)}function P0(r){if(r.tag===13||r.tag===31){var i=qi(r,67108864);i!==null&&$n(i,r,67108864),Bm(r,67108864)}}function B0(r){if(r.tag===13||r.tag===31){var i=nr();i=Mf(i);var s=qi(r,i);s!==null&&$n(s,r,i),Bm(r,i)}}var od=!0;function y2(r,i,s,d){var p=Z.T;Z.T=null;var v=re.p;try{re.p=2,$m(r,i,s,d)}finally{re.p=v,Z.T=p}}function v2(r,i,s,d){var p=Z.T;Z.T=null;var v=re.p;try{re.p=8,$m(r,i,s,d)}finally{re.p=v,Z.T=p}}function $m(r,i,s,d){if(od){var p=Fm(d);if(p===null)Nm(r,i,d,ud,s),F0(r,d);else if(x2(p,r,i,s,d))d.stopPropagation();else if(F0(r,d),i&4&&-1<b2.indexOf(r)){for(;p!==null;){var v=_l(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var S=Br(v.pendingLanes);if(S!==0){var N=v;for(N.pendingLanes|=2,N.entangledLanes|=2;S;){var $=1<<31-ft(S);N.entanglements[1]|=$,S&=~$}Hr(v),(dt&6)===0&&(Zc=fn()+500,$o(0))}}break;case 31:case 13:N=qi(v,2),N!==null&&$n(N,v,2),Qc(),Bm(v,2)}if(v=Fm(d),v===null&&Nm(r,i,d,ud,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Nm(r,i,d,null,s)}}function Fm(r){return r=Hf(r),qm(r)}var ud=null;function qm(r){if(ud=null,r=Nl(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=u(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return ud=r,null}function $0(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(io()){case le:return 2;case ye:return 8;case Ue:case Be:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Hm=!1,ni=null,ri=null,ai=null,Ko=new Map,Go=new Map,ii=[],b2="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 F0(r,i){switch(r){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Ko.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(i.pointerId)}}function Yo(r,i,s,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=_l(i),i!==null&&P0(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function x2(r,i,s,d,p){switch(i){case"focusin":return ni=Yo(ni,r,i,s,d,p),!0;case"dragenter":return ri=Yo(ri,r,i,s,d,p),!0;case"mouseover":return ai=Yo(ai,r,i,s,d,p),!0;case"pointerover":var v=p.pointerId;return Ko.set(v,Yo(Ko.get(v)||null,r,i,s,d,p)),!0;case"gotpointercapture":return v=p.pointerId,Go.set(v,Yo(Go.get(v)||null,r,i,s,d,p)),!0}return!1}function q0(r){var i=Nl(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=u(s),i!==null){r.blockedOn=i,rv(r.priority,function(){B0(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,rv(r.priority,function(){B0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function cd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Fm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);qf=d,s.target.dispatchEvent(d),qf=null}else return i=_l(s),i!==null&&P0(i),r.blockedOn=s,!1;i.shift()}return!0}function H0(r,i,s){cd(r)&&s.delete(i)}function w2(){Hm=!1,ni!==null&&cd(ni)&&(ni=null),ri!==null&&cd(ri)&&(ri=null),ai!==null&&cd(ai)&&(ai=null),Ko.forEach(H0),Go.forEach(H0)}function dd(r,i){r.blockedOn===i&&(r.blockedOn=null,Hm||(Hm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,w2)))}var fd=null;function Z0(r){fd!==r&&(fd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){fd===r&&(fd=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(qm(d||s)===null)continue;break}var v=_l(s);v!==null&&(r.splice(i,3),i-=3,Fh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function us(r){function i($){return dd($,r)}ni!==null&&dd(ni,r),ri!==null&&dd(ri,r),ai!==null&&dd(ai,r),Ko.forEach(i),Go.forEach(i);for(var s=0;s<ii.length;s++){var d=ii[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<ii.length&&(s=ii[0],s.blockedOn===null);)q0(s),s.blockedOn===null&&ii.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],S=p[Mn]||null;if(typeof v=="function")S||Z0(s);else if(S){var N=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[Mn]||null)N=S.formAction;else if(qm(p)!==null)continue}else N=S.action;typeof N=="function"?s[d+1]=N:(s.splice(d,3),d-=3),Z0(s)}}}function V0(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function Zm(r){this._internalRoot=r}hd.prototype.render=Zm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=nr();L0(s,d,r,i,null,null)},hd.prototype.unmount=Zm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;L0(r.current,2,null,r,null,null),Qc(),i[El]=null}};function hd(r){this._internalRoot=r}hd.prototype.unstable_scheduleHydration=function(r){if(r){var i=nv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<ii.length&&i!==0&&i<ii[s].priority;s++);ii.splice(s,0,r),s===0&&q0(r)}};var Q0=t.version;if(Q0!=="19.2.4")throw Error(a(527,Q0,"19.2.4"));re.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var S2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var md=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!md.isDisabled&&md.supportsFiber)try{Wt=md.inject(S2),$t=md}catch{}}return Jo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=ex,v=tx,S=nx;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError)),i=M0(r,1,!1,null,null,s,d,null,p,v,S,V0),r[El]=i.current,Em(r),new Zm(i)},Jo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=ex,S=tx,N=nx,$=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(v=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&($=s.formState)),i=M0(r,1,!0,i,s??null,d,p,$,v,S,N,V0),i.context=I0(null),s=i.current,d=nr(),d=Mf(d),p=Ha(d),p.callback=null,Za(s,p,d),s=d,i.current.lanes=s,pn(i,s),Hr(i),r[El]=i.current,Em(r),new hd(i)},Jo.version="19.2.4",Jo}var a1;function O2(){if(a1)return Gm.exports;a1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gm.exports=z2(),Gm.exports}var D2=O2(),xl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ll,mi,js,AS,M2=(AS=class extends xl{constructor(){super();ke(this,ll);ke(this,mi);ke(this,js);pe(this,js,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,mi)||this.setEventListener(M(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,mi))==null||t.call(this),pe(this,mi,void 0))}setEventListener(t){var n;pe(this,js,t),(n=M(this,mi))==null||n.call(this),pe(this,mi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){M(this,ll)!==t&&(pe(this,ll,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,ll)=="boolean"?M(this,ll):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ll=new WeakMap,mi=new WeakMap,js=new WeakMap,AS),qg=new M2,I2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pi,Bg,TS,L2=(TS=class{constructor(){ke(this,pi,I2);ke(this,Bg,!1)}setTimeoutProvider(e){pe(this,pi,e)}setTimeout(e,t){return M(this,pi).setTimeout(e,t)}clearTimeout(e){M(this,pi).clearTimeout(e)}setInterval(e,t){return M(this,pi).setInterval(e,t)}clearInterval(e){M(this,pi).clearInterval(e)}},pi=new WeakMap,Bg=new WeakMap,TS),al=new L2;function U2(e){setTimeout(e,0)}var P2=typeof window>"u"||"Deno"in globalThis;function Cn(){}function B2(e,t){return typeof e=="function"?e(t):e}function Pp(e){return typeof e=="number"&&e>=0&&e!==1/0}function FS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function Sr(e,t){return typeof e=="function"?e(t):e}function i1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==Hg(u,t.options))return!1}else if(!yu(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function l1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pl(t.options.mutationKey)!==pl(o))return!1}else if(!yu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function Hg(e,t){return((t==null?void 0:t.queryKeyHashFn)||pl)(e)}function pl(e){return JSON.stringify(e,(t,n)=>Bp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function yu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>yu(e[n],t[n])):!1}var $2=Object.prototype.hasOwnProperty;function Zg(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=s1(e)&&s1(t);if(!a&&!(Bp(e)&&Bp(t)))return t;const o=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:u[y],x=e[g],w=t[g];if(x===w){m[g]=x,(a?y<o:$2.call(e,g))&&h++;continue}if(x===null||w===null||typeof x!="object"||typeof w!="object"){m[g]=w;continue}const k=Zg(x,w,n+1);m[g]=k,k===x&&h++}return o===f&&h===o?e:m}function vu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function s1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bp(e){if(!o1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!o1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function o1(e){return Object.prototype.toString.call(e)==="[object Object]"}function F2(e){return new Promise(t=>{al.setTimeout(t,e)})}function $p(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Zg(e,t):t}function q2(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function H2(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Vg=Symbol();function qS(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qg(e,t){return typeof e=="function"?e(...t):!!e}function Z2(e,t,n){let a=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??(l=t()),a||(a=!0,l.aborted?n():l.addEventListener("abort",n,{once:!0})),l)}),e}var bu=(()=>{let e=()=>P2;return{isServer(){return e()},setIsServer(t){e=t}}})();function Fp(){let e,t;const n=new Promise((l,o)=>{e=l,t=o});n.status="pending",n.catch(()=>{});function a(l){Object.assign(n,l),delete n.resolve,delete n.reject}return n.resolve=l=>{a({status:"fulfilled",value:l}),e(l)},n.reject=l=>{a({status:"rejected",reason:l}),t(l)},n}var V2=U2;function Q2(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=V2;const o=f=>{t?e.push(f):l(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||u()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Bt=Q2(),Cs,gi,Es,RS,K2=(RS=class extends xl{constructor(){super();ke(this,Cs,!0);ke(this,gi);ke(this,Es);pe(this,Es,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){M(this,gi)||this.setEventListener(M(this,Es))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,gi))==null||t.call(this),pe(this,gi,void 0))}setEventListener(t){var n;pe(this,Es,t),(n=M(this,gi))==null||n.call(this),pe(this,gi,t(this.setOnline.bind(this)))}setOnline(t){M(this,Cs)!==t&&(pe(this,Cs,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return M(this,Cs)}},Cs=new WeakMap,gi=new WeakMap,Es=new WeakMap,RS),Hd=new K2;function G2(e){return Math.min(1e3*2**e,3e4)}function HS(e){return(e??"online")==="online"?Hd.isOnline():!0}var qp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ZS(e){let t=!1,n=0,a;const l=Fp(),o=()=>l.status!=="pending",u=j=>{var C;if(!o()){const E=new qp(j);x(E),(C=e.onCancel)==null||C.call(e,E)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>qg.isFocused()&&(e.networkMode==="always"||Hd.isOnline())&&e.canRun(),y=()=>HS(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},x=j=>{o()||(a==null||a(),l.reject(j))},w=()=>new Promise(j=>{var C;a=E=>{(o()||h())&&j(E)},(C=e.onPause)==null||C.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const C=n===0?e.initialPromise:void 0;try{j=C??e.fn()}catch(E){j=Promise.reject(E)}Promise.resolve(j).then(g).catch(E=>{var O;if(o())return;const R=e.retry??(bu.isServer()?0:3),z=e.retryDelay??G2,I=typeof z=="function"?z(n,E):z,B=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,E);if(t||!B){x(E);return}n++,(O=e.onFail)==null||O.call(e,n,E),F2(I).then(()=>h()?void 0:w()).then(()=>{t?x(E):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var sl,zS,VS=(zS=class{constructor(){ke(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pp(this.gcTime)&&pe(this,sl,al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(bu.isServer()?1/0:300*1e3))}clearGcTimeout(){M(this,sl)&&(al.clearTimeout(M(this,sl)),pe(this,sl,void 0))}},sl=new WeakMap,zS),ol,Ns,xr,ul,on,Ru,cl,lr,QS,ba,OS,Y2=(OS=class extends VS{constructor(t){super();ke(this,lr);ke(this,ol);ke(this,Ns);ke(this,xr);ke(this,ul);ke(this,on);ke(this,Ru);ke(this,cl);pe(this,cl,!1),pe(this,Ru,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,ul,t.client),pe(this,xr,M(this,ul).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,ol,c1(this.options)),this.state=t.state??M(this,ol),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,on))==null?void 0:t.promise}setOptions(t){if(this.options={...M(this,Ru),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=c1(this.options);n.data!==void 0&&(this.setState(u1(n.data,n.dataUpdatedAt)),pe(this,ol,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,xr).remove(this)}setData(t,n){const a=$p(this.state.data,t,this.options);return Ie(this,lr,ba).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Ie(this,lr,ba).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=M(this,on))==null?void 0:a.promise;return(l=M(this,on))==null||l.cancel(t),n?n.then(Cn).catch(Cn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return M(this,ol)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Sr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ji(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!FS(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,on))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,on))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,xr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,on)&&(M(this,cl)||Ie(this,lr,QS).call(this)?M(this,on).cancel({revert:!0}):M(this,on).cancelRetry()),this.scheduleGc()),M(this,xr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ie(this,lr,ba).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,x,w,k,j,C,E,R,z;if(this.state.fetchStatus!=="idle"&&((m=M(this,on))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,on))return M(this,on).continueRetry(),M(this,on).promise}if(t&&this.setOptions(t),!this.options.queryFn){const I=this.observers.find(B=>B.options.queryFn);I&&this.setOptions(I.options)}const a=new AbortController,l=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(pe(this,cl,!0),a.signal)})},o=()=>{const I=qS(this.options,n),O=(()=>{const D={client:M(this,ul),queryKey:this.queryKey,meta:this.meta};return l(D),D})();return pe(this,cl,!1),this.options.persister?this.options.persister(I,O,this):I(O)},f=(()=>{const I={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,ul),state:this.state,fetchFn:o};return l(I),I})();(h=this.options.behavior)==null||h.onFetch(f,this),pe(this,Ns,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=f.fetchOptions)==null?void 0:y.meta))&&Ie(this,lr,ba).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),pe(this,on,ZS({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:I=>{I instanceof qp&&I.revert&&this.setState({...M(this,Ns),fetchStatus:"idle"}),a.abort()},onFail:(I,B)=>{Ie(this,lr,ba).call(this,{type:"failed",failureCount:I,error:B})},onPause:()=>{Ie(this,lr,ba).call(this,{type:"pause"})},onContinue:()=>{Ie(this,lr,ba).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const I=await M(this,on).start();if(I===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(I),(w=(x=M(this,xr).config).onSuccess)==null||w.call(x,I,this),(j=(k=M(this,xr).config).onSettled)==null||j.call(k,I,this.state.error,this),I}catch(I){if(I instanceof qp){if(I.silent)return M(this,on).promise;if(I.revert){if(this.state.data===void 0)throw I;return this.state.data}}throw Ie(this,lr,ba).call(this,{type:"error",error:I}),(E=(C=M(this,xr).config).onError)==null||E.call(C,I,this),(z=(R=M(this,xr).config).onSettled)==null||z.call(R,this.state.data,I,this),I}finally{this.scheduleGc()}}},ol=new WeakMap,Ns=new WeakMap,xr=new WeakMap,ul=new WeakMap,on=new WeakMap,Ru=new WeakMap,cl=new WeakMap,lr=new WeakSet,QS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ba=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...KS(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...u1(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return pe(this,Ns,t.manual?l:void 0),l;case"error":const o=t.error;return{...a,error:o,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),Bt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),M(this,xr).notify({query:this,type:"updated",action:t})})},OS);function KS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function u1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var qn,at,zu,Tn,dl,_s,xa,yi,Ou,As,Ts,fl,hl,vi,Rs,mt,uu,Hp,Zp,Vp,Qp,Kp,Gp,Yp,GS,DS,Kg=(DS=class extends xl{constructor(t,n){super();ke(this,mt);ke(this,qn);ke(this,at);ke(this,zu);ke(this,Tn);ke(this,dl);ke(this,_s);ke(this,xa);ke(this,yi);ke(this,Ou);ke(this,As);ke(this,Ts);ke(this,fl);ke(this,hl);ke(this,vi);ke(this,Rs,new Set);this.options=n,pe(this,qn,t),pe(this,yi,null),pe(this,xa,Fp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,at).addObserver(this),d1(M(this,at),this.options)?Ie(this,mt,uu).call(this):this.updateResult(),Ie(this,mt,Qp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xp(M(this,at),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xp(M(this,at),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,mt,Kp).call(this),Ie(this,mt,Gp).call(this),M(this,at).removeObserver(this)}setOptions(t){const n=this.options,a=M(this,at);if(this.options=M(this,qn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Sr(this.options.enabled,M(this,at))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ie(this,mt,Yp).call(this),M(this,at).setOptions(this.options),n._defaulted&&!vu(this.options,n)&&M(this,qn).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,at),observer:this});const l=this.hasListeners();l&&f1(M(this,at),a,this.options,n)&&Ie(this,mt,uu).call(this),this.updateResult(),l&&(M(this,at)!==a||Sr(this.options.enabled,M(this,at))!==Sr(n.enabled,M(this,at))||ji(this.options.staleTime,M(this,at))!==ji(n.staleTime,M(this,at)))&&Ie(this,mt,Hp).call(this);const o=Ie(this,mt,Zp).call(this);l&&(M(this,at)!==a||Sr(this.options.enabled,M(this,at))!==Sr(n.enabled,M(this,at))||o!==M(this,vi))&&Ie(this,mt,Vp).call(this,o)}getOptimisticResult(t){const n=M(this,qn).getQueryCache().build(M(this,qn),t),a=this.createResult(n,t);return J2(this,a)&&(pe(this,Tn,a),pe(this,_s,this.options),pe(this,dl,M(this,at).state)),a}getCurrentResult(){return M(this,Tn)}trackResult(t,n){return new Proxy(t,{get:(a,l)=>(this.trackProp(l),n==null||n(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&M(this,xa).status==="pending"&&M(this,xa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){M(this,Rs).add(t)}getCurrentQuery(){return M(this,at)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=M(this,qn).defaultQueryOptions(t),a=M(this,qn).getQueryCache().build(M(this,qn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Ie(this,mt,uu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,Tn)))}createResult(t,n){var V;const a=M(this,at),l=this.options,o=M(this,Tn),u=M(this,dl),f=M(this,_s),h=t!==a?t.state:M(this,zu),{state:y}=t;let g={...y},x=!1,w;if(n._optimisticResults){const F=this.hasListeners(),ne=!F&&d1(t,n),oe=F&&f1(t,a,n,l);(ne||oe)&&(g={...g,...KS(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:C}=g;w=g.data;let E=!1;if(n.placeholderData!==void 0&&w===void 0&&C==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((V=M(this,Ts))==null?void 0:V.state.data,M(this,Ts)):n.placeholderData,F!==void 0&&(C="success",w=$p(o==null?void 0:o.data,F,n),x=!0)}if(n.select&&w!==void 0&&!E)if(o&&w===(u==null?void 0:u.data)&&n.select===M(this,Ou))w=M(this,As);else try{pe(this,Ou,n.select),w=n.select(w),w=$p(o==null?void 0:o.data,w,n),pe(this,As,w),pe(this,yi,null)}catch(F){pe(this,yi,F)}M(this,yi)&&(k=M(this,yi),w=M(this,As),j=Date.now(),C="error");const R=g.fetchStatus==="fetching",z=C==="pending",I=C==="error",B=z&&R,O=w!==void 0,U={status:C,fetchStatus:g.fetchStatus,isPending:z,isSuccess:C==="success",isError:I,isInitialLoading:B,isLoading:B,data:w,dataUpdatedAt:g.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:R,isRefetching:R&&!z,isLoadingError:I&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:I&&O,isStale:Gg(t,n),refetch:this.refetch,promise:M(this,xa),isEnabled:Sr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=U.data!==void 0,ne=U.status==="error"&&!F,oe=W=>{ne?W.reject(U.error):F&&W.resolve(U.data)},Se=()=>{const W=pe(this,xa,U.promise=Fp());oe(W)},G=M(this,xa);switch(G.status){case"pending":t.queryHash===a.queryHash&&oe(G);break;case"fulfilled":(ne||U.data!==G.value)&&Se();break;case"rejected":(!ne||U.error!==G.reason)&&Se();break}}return U}updateResult(){const t=M(this,Tn),n=this.createResult(M(this,at),this.options);if(pe(this,dl,M(this,at).state),pe(this,_s,this.options),M(this,dl).data!==void 0&&pe(this,Ts,M(this,at)),vu(n,t))return;pe(this,Tn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!M(this,Rs).size)return!0;const u=new Set(o??M(this,Rs));return this.options.throwOnError&&u.add("error"),Object.keys(M(this,Tn)).some(f=>{const m=f;return M(this,Tn)[m]!==t[m]&&u.has(m)})};Ie(this,mt,GS).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,mt,Qp).call(this)}},qn=new WeakMap,at=new WeakMap,zu=new WeakMap,Tn=new WeakMap,dl=new WeakMap,_s=new WeakMap,xa=new WeakMap,yi=new WeakMap,Ou=new WeakMap,As=new WeakMap,Ts=new WeakMap,fl=new WeakMap,hl=new WeakMap,vi=new WeakMap,Rs=new WeakMap,mt=new WeakSet,uu=function(t){Ie(this,mt,Yp).call(this);let n=M(this,at).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Cn)),n},Hp=function(){Ie(this,mt,Kp).call(this);const t=ji(this.options.staleTime,M(this,at));if(bu.isServer()||M(this,Tn).isStale||!Pp(t))return;const a=FS(M(this,Tn).dataUpdatedAt,t)+1;pe(this,fl,al.setTimeout(()=>{M(this,Tn).isStale||this.updateResult()},a))},Zp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,at)):this.options.refetchInterval)??!1},Vp=function(t){Ie(this,mt,Gp).call(this),pe(this,vi,t),!(bu.isServer()||Sr(this.options.enabled,M(this,at))===!1||!Pp(M(this,vi))||M(this,vi)===0)&&pe(this,hl,al.setInterval(()=>{(this.options.refetchIntervalInBackground||qg.isFocused())&&Ie(this,mt,uu).call(this)},M(this,vi)))},Qp=function(){Ie(this,mt,Hp).call(this),Ie(this,mt,Vp).call(this,Ie(this,mt,Zp).call(this))},Kp=function(){M(this,fl)&&(al.clearTimeout(M(this,fl)),pe(this,fl,void 0))},Gp=function(){M(this,hl)&&(al.clearInterval(M(this,hl)),pe(this,hl,void 0))},Yp=function(){const t=M(this,qn).getQueryCache().build(M(this,qn),this.options);if(t===M(this,at))return;const n=M(this,at);pe(this,at,t),pe(this,zu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},GS=function(t){Bt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(M(this,Tn))}),M(this,qn).getQueryCache().notify({query:M(this,at),type:"observerResultsUpdated"})})},DS);function X2(e,t){return Sr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function d1(e,t){return X2(e,t)||e.state.data!==void 0&&Xp(e,t,t.refetchOnMount)}function Xp(e,t,n){if(Sr(t.enabled,e)!==!1&&ji(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&Gg(e,t)}return!1}function f1(e,t,n,a){return(e!==t||Sr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Gg(e,n)}function Gg(e,t){return Sr(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function J2(e,t){return!vu(e.getCurrentResult(),t)}function h1(e){return{onFetch:(t,n)=>{var y,g,x,w,k;const a=t.options,l=(x=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:x.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const C=z=>{Z2(z,()=>t.signal,()=>j=!0)},E=qS(t.options,t.fetchOptions),R=async(z,I,B)=>{if(j)return Promise.reject();if(I==null&&z.pages.length)return Promise.resolve(z);const D=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:I,direction:B?"backward":"forward",meta:t.options.meta};return C(ne),ne})(),U=await E(D),{maxPages:V}=t.options,F=B?H2:q2;return{pages:F(z.pages,U,V),pageParams:F(z.pageParams,I,V)}};if(l&&o.length){const z=l==="backward",I=z?W2:m1,B={pages:o,pageParams:u},O=I(a,B);f=await R(B,O,z)}else{const z=e??o.length;do{const I=m===0?u[0]??a.initialPageParam:m1(a,f);if(m>0&&I==null)break;f=await R(f,I),m++}while(m<z)}return f};t.options.persister?t.fetchFn=()=>{var j,C;return(C=(j=t.options).persister)==null?void 0:C.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function m1(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function W2(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Du,Vr,kn,ml,Qr,ci,MS,eA=(MS=class extends VS{constructor(t){super();ke(this,Qr);ke(this,Du);ke(this,Vr);ke(this,kn);ke(this,ml);pe(this,Du,t.client),this.mutationId=t.mutationId,pe(this,kn,t.mutationCache),pe(this,Vr,[]),this.state=t.state||YS(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,Vr).includes(t)||(M(this,Vr).push(t),this.clearGcTimeout(),M(this,kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Vr,M(this,Vr).filter(n=>n!==t)),this.scheduleGc(),M(this,kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,Vr).length||(this.state.status==="pending"?this.scheduleGc():M(this,kn).remove(this))}continue(){var t;return((t=M(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,f,m,h,y,g,x,w,k,j,C,E,R,z,I,B,O,D;const n=()=>{Ie(this,Qr,ci).call(this,{type:"continue"})},a={client:M(this,Du),meta:this.options.meta,mutationKey:this.options.mutationKey};pe(this,ml,ZS({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,V)=>{Ie(this,Qr,ci).call(this,{type:"failed",failureCount:U,error:V})},onPause:()=>{Ie(this,Qr,ci).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,kn).canRun(this)}));const l=this.state.status==="pending",o=!M(this,ml).canStart();try{if(l)n();else{Ie(this,Qr,ci).call(this,{type:"pending",variables:t,isPaused:o}),M(this,kn).config.onMutate&&await M(this,kn).config.onMutate(t,this,a);const V=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,t,a));V!==this.state.context&&Ie(this,Qr,ci).call(this,{type:"pending",context:V,variables:t,isPaused:o})}const U=await M(this,ml).start();return await((h=(m=M(this,kn).config).onSuccess)==null?void 0:h.call(m,U,t,this.state.context,this,a)),await((g=(y=this.options).onSuccess)==null?void 0:g.call(y,U,t,this.state.context,a)),await((w=(x=M(this,kn).config).onSettled)==null?void 0:w.call(x,U,null,this.state.variables,this.state.context,this,a)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,U,null,t,this.state.context,a)),Ie(this,Qr,ci).call(this,{type:"success",data:U}),U}catch(U){try{await((E=(C=M(this,kn).config).onError)==null?void 0:E.call(C,U,t,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((z=(R=this.options).onError)==null?void 0:z.call(R,U,t,this.state.context,a))}catch(V){Promise.reject(V)}try{await((B=(I=M(this,kn).config).onSettled)==null?void 0:B.call(I,void 0,U,this.state.variables,this.state.context,this,a))}catch(V){Promise.reject(V)}try{await((D=(O=this.options).onSettled)==null?void 0:D.call(O,void 0,U,t,this.state.context,a))}catch(V){Promise.reject(V)}throw Ie(this,Qr,ci).call(this,{type:"error",error:U}),U}finally{M(this,kn).runNext(this)}}},Du=new WeakMap,Vr=new WeakMap,kn=new WeakMap,ml=new WeakMap,Qr=new WeakSet,ci=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Bt.batch(()=>{M(this,Vr).forEach(a=>{a.onMutationUpdate(t)}),M(this,kn).notify({mutation:this,type:"updated",action:t})})},MS);function YS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wa,Rr,Mu,IS,tA=(IS=class extends xl{constructor(t={}){super();ke(this,wa);ke(this,Rr);ke(this,Mu);this.config=t,pe(this,wa,new Set),pe(this,Rr,new Map),pe(this,Mu,0)}build(t,n,a){const l=new eA({client:t,mutationCache:this,mutationId:++pd(this,Mu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){M(this,wa).add(t);const n=gd(t);if(typeof n=="string"){const a=M(this,Rr).get(n);a?a.push(t):M(this,Rr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,wa).delete(t)){const n=gd(t);if(typeof n=="string"){const a=M(this,Rr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&M(this,Rr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=gd(t);if(typeof n=="string"){const a=M(this,Rr).get(n),l=a==null?void 0:a.find(o=>o.state.status==="pending");return!l||l===t}else return!0}runNext(t){var a;const n=gd(t);if(typeof n=="string"){const l=(a=M(this,Rr).get(n))==null?void 0:a.find(o=>o!==t&&o.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Bt.batch(()=>{M(this,wa).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,wa).clear(),M(this,Rr).clear()})}getAll(){return Array.from(M(this,wa))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>l1(n,a))}findAll(t={}){return this.getAll().filter(n=>l1(t,n))}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Bt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Cn))))}},wa=new WeakMap,Rr=new WeakMap,Mu=new WeakMap,IS);function gd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Sa,bi,Hn,ka,Ca,Id,Jp,LS,nA=(LS=class extends xl{constructor(n,a){super();ke(this,Ca);ke(this,Sa);ke(this,bi);ke(this,Hn);ke(this,ka);pe(this,Sa,n),this.setOptions(a),this.bindMethods(),Ie(this,Ca,Id).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var l;const a=this.options;this.options=M(this,Sa).defaultMutationOptions(n),vu(this.options,a)||M(this,Sa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,Hn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&pl(a.mutationKey)!==pl(this.options.mutationKey)?this.reset():((l=M(this,Hn))==null?void 0:l.state.status)==="pending"&&M(this,Hn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=M(this,Hn))==null||n.removeObserver(this)}onMutationUpdate(n){Ie(this,Ca,Id).call(this),Ie(this,Ca,Jp).call(this,n)}getCurrentResult(){return M(this,bi)}reset(){var n;(n=M(this,Hn))==null||n.removeObserver(this),pe(this,Hn,void 0),Ie(this,Ca,Id).call(this),Ie(this,Ca,Jp).call(this)}mutate(n,a){var l;return pe(this,ka,a),(l=M(this,Hn))==null||l.removeObserver(this),pe(this,Hn,M(this,Sa).getMutationCache().build(M(this,Sa),this.options)),M(this,Hn).addObserver(this),M(this,Hn).execute(n)}},Sa=new WeakMap,bi=new WeakMap,Hn=new WeakMap,ka=new WeakMap,Ca=new WeakSet,Id=function(){var a;const n=((a=M(this,Hn))==null?void 0:a.state)??YS();pe(this,bi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Jp=function(n){Bt.batch(()=>{var a,l,o,u,f,m,h,y;if(M(this,ka)&&this.hasListeners()){const g=M(this,bi).variables,x=M(this,bi).context,w={client:M(this,Sa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=M(this,ka)).onSuccess)==null||l.call(a,n.data,g,x,w)}catch(k){Promise.reject(k)}try{(u=(o=M(this,ka)).onSettled)==null||u.call(o,n.data,null,g,x,w)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=M(this,ka)).onError)==null||m.call(f,n.error,g,x,w)}catch(k){Promise.reject(k)}try{(y=(h=M(this,ka)).onSettled)==null||y.call(h,void 0,n.error,g,x,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(M(this,bi))})})},LS);function p1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function rA(e,t,n){const a=e.slice(0);return a[t]=n,a}var zs,ar,Os,Ds,wr,xi,Iu,Lu,Uu,Pu,wn,Wp,eg,tg,ng,rg,US,aA=(US=class extends xl{constructor(t,n,a){super();ke(this,wn);ke(this,zs);ke(this,ar);ke(this,Os);ke(this,Ds);ke(this,wr);ke(this,xi);ke(this,Iu);ke(this,Lu);ke(this,Uu);ke(this,Pu,[]);pe(this,zs,t),pe(this,Ds,a),pe(this,Os,[]),pe(this,wr,[]),pe(this,ar,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&M(this,wr).forEach(t=>{t.subscribe(n=>{Ie(this,wn,ng).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,M(this,wr).forEach(t=>{t.destroy()})}setQueries(t,n){pe(this,Os,t),pe(this,Ds,n),Bt.batch(()=>{const a=M(this,wr),l=Ie(this,wn,tg).call(this,M(this,Os));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),u=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,x)=>g!==a[x]),h=f||m,y=h?!0:u.some((g,x)=>{const w=M(this,ar)[x];return!w||!vu(g,w)});!h&&!y||(h&&(pe(this,Pu,l),pe(this,wr,o)),pe(this,ar,u),this.hasListeners()&&(h&&(p1(a,o).forEach(g=>{g.destroy()}),p1(o,a).forEach(g=>{g.subscribe(x=>{Ie(this,wn,ng).call(this,g,x)})})),Ie(this,wn,rg).call(this)))})}getCurrentResult(){return M(this,ar)}getQueries(){return M(this,wr).map(t=>t.getCurrentQuery())}getObservers(){return M(this,wr)}getOptimisticResult(t,n){const a=Ie(this,wn,tg).call(this,t),l=a.map(u=>u.observer.getOptimisticResult(u.defaultedQueryOptions)),o=a.map(u=>u.defaultedQueryOptions.queryHash);return[l,u=>Ie(this,wn,eg).call(this,u??l,n,o),()=>Ie(this,wn,Wp).call(this,l,a)]}},zs=new WeakMap,ar=new WeakMap,Os=new WeakMap,Ds=new WeakMap,wr=new WeakMap,xi=new WeakMap,Iu=new WeakMap,Lu=new WeakMap,Uu=new WeakMap,Pu=new WeakMap,wn=new WeakSet,Wp=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,u=>{n.forEach(f=>{f.observer.trackProp(u)})})})},eg=function(t,n,a){if(n){const l=M(this,Uu),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((u,f)=>u!==l[f]));return(!M(this,xi)||M(this,ar)!==M(this,Lu)||o||n!==M(this,Iu))&&(pe(this,Iu,n),pe(this,Lu,M(this,ar)),a!==void 0&&pe(this,Uu,a),pe(this,xi,Zg(M(this,xi),n(t)))),M(this,xi)}return t},tg=function(t){const n=new Map;M(this,wr).forEach(l=>{const o=l.options.queryHash;if(!o)return;const u=n.get(o);u?u.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=M(this,zs).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new Kg(M(this,zs),o);a.push({defaultedQueryOptions:o,observer:f})}),a},ng=function(t,n){const a=M(this,wr).indexOf(t);a!==-1&&(pe(this,ar,rA(M(this,ar),a,n)),Ie(this,wn,rg).call(this))},rg=function(){var t;if(this.hasListeners()){const n=M(this,xi),a=Ie(this,wn,Wp).call(this,M(this,ar),M(this,Pu)),l=Ie(this,wn,eg).call(this,a,(t=M(this,Ds))==null?void 0:t.combine);n!==l&&Bt.batch(()=>{this.listeners.forEach(o=>{o(M(this,ar))})})}},US),Kr,PS,iA=(PS=class extends xl{constructor(t={}){super();ke(this,Kr);this.config=t,pe(this,Kr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??Hg(l,n);let u=this.get(o);return u||(u=new Y2({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){M(this,Kr).has(t.queryHash)||(M(this,Kr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,Kr).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,Kr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,Kr).get(t)}getAll(){return[...M(this,Kr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>i1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>i1(t,a)):n}notify(t){Bt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kr=new WeakMap,PS),Pt,wi,Si,Ms,Is,ki,Ls,Us,BS,lA=(BS=class{constructor(e={}){ke(this,Pt);ke(this,wi);ke(this,Si);ke(this,Ms);ke(this,Is);ke(this,ki);ke(this,Ls);ke(this,Us);pe(this,Pt,e.queryCache||new iA),pe(this,wi,e.mutationCache||new tA),pe(this,Si,e.defaultOptions||{}),pe(this,Ms,new Map),pe(this,Is,new Map),pe(this,ki,0)}mount(){pd(this,ki)._++,M(this,ki)===1&&(pe(this,Ls,qg.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Pt).onFocus())})),pe(this,Us,Hd.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Pt).onOnline())})))}unmount(){var e,t;pd(this,ki)._--,M(this,ki)===0&&((e=M(this,Ls))==null||e.call(this),pe(this,Ls,void 0),(t=M(this,Us))==null||t.call(this),pe(this,Us,void 0))}isFetching(e){return M(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,wi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,Pt).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ji(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return M(this,Pt).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),l=M(this,Pt).get(a.queryHash),o=l==null?void 0:l.state.data,u=B2(t,o);if(u!==void 0)return M(this,Pt).build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Bt.batch(()=>M(this,Pt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,Pt);Bt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,Pt);return Bt.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Bt.batch(()=>M(this,Pt).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Cn).catch(Cn)}invalidateQueries(e,t={}){return Bt.batch(()=>(M(this,Pt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>M(this,Pt).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(Cn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(Cn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,Pt).build(this,t);return n.isStaleByTime(ji(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cn).catch(Cn)}fetchInfiniteQuery(e){return e.behavior=h1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cn).catch(Cn)}ensureInfiniteQueryData(e){return e.behavior=h1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hd.isOnline()?M(this,wi).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Pt)}getMutationCache(){return M(this,wi)}getDefaultOptions(){return M(this,Si)}setDefaultOptions(e){pe(this,Si,e)}setQueryDefaults(e,t){M(this,Ms).set(pl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Ms).values()],n={};return t.forEach(a=>{yu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){M(this,Is).set(pl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,Is).values()],n={};return t.forEach(a=>{yu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,Si).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Hg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Vg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,Si).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,Pt).clear(),M(this,wi).clear()}},Pt=new WeakMap,wi=new WeakMap,Si=new WeakMap,Ms=new WeakMap,Is=new WeakMap,ki=new WeakMap,Ls=new WeakMap,Us=new WeakMap,BS),XS=b.createContext(void 0),dn=e=>{const t=b.useContext(XS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},sA=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(XS.Provider,{value:e,children:t})),JS=b.createContext(!1),WS=()=>b.useContext(JS);JS.Provider;function oA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uA=b.createContext(oA()),ek=()=>b.useContext(uA),tk=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Qg(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},nk=e=>{b.useEffect(()=>{e.clearReset()},[e])},rk=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||Qg(n,[e.error,a])),ak=e=>{if(e.suspense){const n=l=>l==="static"?l:Math.max(l??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...l)=>n(a(...l)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},cA=(e,t)=>e.isLoading&&e.isFetching&&!t,ag=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ig=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function dA({queries:e,...t},n){const a=dn(),l=WS(),o=ek(),u=b.useMemo(()=>e.map(j=>{const C=a.defaultQueryOptions(j);return C._optimisticResults=l?"isRestoring":"optimistic",C}),[e,a,l]);u.forEach(j=>{ak(j);const C=a.getQueryCache().get(j.queryHash);tk(j,o,C)}),nk(o);const[f]=b.useState(()=>new aA(a,u,t)),[m,h,y]=f.getOptimisticResult(u,t.combine),g=!l&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(j=>g?f.subscribe(Bt.batchCalls(j)):Cn,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setQueries(u,t)},[u,t,f]);const w=m.some((j,C)=>ag(u[C],j))?m.flatMap((j,C)=>{const E=u[C];if(E&&ag(E,j)){const R=new Kg(a,E);return ig(E,R,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,C)=>{const E=u[C];return E&&rk({result:j,errorResetBoundary:o,throwOnError:E.throwOnError,query:a.getQueryCache().get(E.queryHash),suspense:E.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function fA(e,t,n){var x,w,k,j;const a=WS(),l=ek(),o=dn(),u=o.defaultQueryOptions(e);(w=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||w.call(x,u);const f=o.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",ak(u),tk(u,l,f),nk(l);const m=!o.getQueryCache().get(u.queryHash),[h]=b.useState(()=>new t(o,u)),y=h.getOptimisticResult(u),g=!a&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(C=>{const E=g?h.subscribe(Bt.batchCalls(C)):Cn;return h.updateResult(),E},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),b.useEffect(()=>{h.setOptions(u)},[u,h]),ag(u,y))throw ig(u,h,l);if(rk({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,u,y),u.experimental_prefetchInRender&&!bu.isServer()&&cA(y,a)){const C=m?ig(u,h,l):f==null?void 0:f.promise;C==null||C.catch(Cn).finally(()=>{h.updateResult()})}return u.notifyOnChangeProps?y:h.trackResult(y)}function Ve(e,t){return fA(e,Kg)}function jt(e,t){const n=dn(),[a]=b.useState(()=>new nA(n,e));b.useEffect(()=>{a.setOptions(e)},[a,e]);const l=b.useSyncExternalStore(b.useCallback(u=>a.subscribe(Bt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=b.useCallback((u,f)=>{a.mutate(u,f).catch(Cn)},[a]);if(l.error&&Qg(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:o,mutateAsync:l.mutate}}/**
|
|
50
|
+
* react-router v7.13.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var g1="popstate";function y1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function hA(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:u,search:f,hash:m}=o||a.location;return lg("",{pathname:u,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:xu(l)}return pA(t,n,null,e)}function Rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mA(){return Math.random().toString(36).substring(2,10)}function v1(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function lg(e,t,n=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ks(t):t,state:n,key:t&&t.key||a||mA(),unstable_mask:l}}function xu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ks(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function pA(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,u=l.history,f="POP",m=null,h=y();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function y(){return(u.state||{idx:null}).idx}function g(){f="POP";let C=y(),E=C==null?null:C-h;h=C,m&&m({action:f,location:j.location,delta:E})}function x(C,E){f="PUSH";let R=y1(C)?C:lg(j.location,C,E);h=y()+1;let z=v1(R,h),I=j.createHref(R.unstable_mask||R);try{u.pushState(z,"",I)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(I)}o&&m&&m({action:f,location:j.location,delta:1})}function w(C,E){f="REPLACE";let R=y1(C)?C:lg(j.location,C,E);h=y();let z=v1(R,h),I=j.createHref(R.unstable_mask||R);u.replaceState(z,"",I),o&&m&&m({action:f,location:j.location,delta:0})}function k(C){return gA(C)}let j={get action(){return f},get location(){return e(l,u)},listen(C){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(g1,g),m=C,()=>{l.removeEventListener(g1,g),m=null}},createHref(C){return t(l,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:w,go(C){return u.go(C)}};return j}function gA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Rt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:xu(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function ik(e,t,n="/"){return yA(e,t,n,!1)}function yA(e,t,n,a){let l=typeof t=="string"?Ks(t):t,o=Ea(l.pathname||"/",n);if(o==null)return null;let u=lk(e);vA(u);let f=null;for(let m=0;f==null&&m<u.length;++m){let h=AA(o);f=NA(u[m],h,a)}return f}function lk(e,t=[],n=[],a="",l=!1){let o=(u,f,m=l,h)=>{let y={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;Rt(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Yr([a,y.relativePath]),x=n.concat(y);u.children&&u.children.length>0&&(Rt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),lk(u.children,t,x,g,m)),!(u.path==null&&!u.index)&&t.push({path:g,score:CA(g,u.index),routesMeta:x})};return e.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))o(u,f);else for(let h of sk(u.path))o(u,f,!0,h)}),t}function sk(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let u=sk(a.join("/")),f=[];return f.push(...u.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...u),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function vA(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:EA(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var bA=/^:[\w-]+$/,xA=3,wA=2,SA=1,kA=10,jA=-2,b1=e=>e==="*";function CA(e,t){let n=e.split("/"),a=n.length;return n.some(b1)&&(a+=jA),t&&(a+=wA),n.filter(l=>!b1(l)).reduce((l,o)=>l+(bA.test(o)?xA:o===""?SA:kA),a)}function EA(e,t){return e.length===t.length&&e.slice(0,-1).every((a,l)=>a===t[l])?e[e.length-1]-t[t.length-1]:0}function NA(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",u=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=Zd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),x=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Zd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),u.push({params:l,pathname:Yr([o,g.pathname]),pathnameBase:OA(Yr([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=Yr([o,g.pathnameBase]))}return u}function Zd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=_A(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],u=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},x)=>{if(y==="*"){let k=f[x]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[x];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:u,pattern:e}}function _A(e,t=!1,n=!0){jr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function AA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ea(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var TA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function RA(e,t="/"){let{pathname:n,search:a="",hash:l=""}=typeof e=="string"?Ks(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=x1(n.substring(1),"/"):o=x1(n,t)):o=t,{pathname:o,search:DA(a),hash:MA(l)}}function x1(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Wm(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yg(e){let t=zA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function cf(e,t,n,a=!1){let l;typeof e=="string"?l=Ks(e):(l={...e},Rt(!l.pathname||!l.pathname.includes("?"),Wm("?","pathname","search",l)),Rt(!l.pathname||!l.pathname.includes("#"),Wm("#","pathname","hash",l)),Rt(!l.search||!l.search.includes("#"),Wm("#","search","hash",l)));let o=e===""||l.pathname==="",u=o?"/":l.pathname,f;if(u==null)f=n;else{let g=t.length-1;if(!a&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;l.pathname=x.join("/")}f=g>=0?t[g]:"/"}let m=RA(l,f),h=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var Yr=e=>e.join("/").replace(/\/\/+/g,"/"),OA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,MA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,IA=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function LA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function UA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ok=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function uk(e,t){let n=e;if(typeof n!="string"||!TA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(ok)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ea(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:l=!0}catch{jr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ck=["POST","PUT","PATCH","DELETE"];new Set(ck);var PA=["GET",...ck];new Set(PA);var Gs=b.createContext(null);Gs.displayName="DataRouter";var df=b.createContext(null);df.displayName="DataRouterState";var BA=b.createContext(!1),dk=b.createContext({isTransitioning:!1});dk.displayName="ViewTransition";var $A=b.createContext(new Map);$A.displayName="Fetchers";var FA=b.createContext(null);FA.displayName="Await";var or=b.createContext(null);or.displayName="Navigation";var Bu=b.createContext(null);Bu.displayName="Location";var Cr=b.createContext({outlet:null,matches:[],isDataRoute:!1});Cr.displayName="Route";var Xg=b.createContext(null);Xg.displayName="RouteError";var fk="REACT_ROUTER_ERROR",qA="REDIRECT",HA="ROUTE_ERROR_RESPONSE";function ZA(e){if(e.startsWith(`${fk}:${qA}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function VA(e){if(e.startsWith(`${fk}:${HA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new IA(t.status,t.statusText,t.data)}catch{}}function QA(e,{relative:t}={}){Rt(Ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=b.useContext(or),{hash:l,pathname:o,search:u}=$u(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Yr([n,o])),a.createHref({pathname:f,search:u,hash:l})}function Ys(){return b.useContext(Bu)!=null}function Vn(){return Rt(Ys(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Bu).location}var hk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function mk(e){b.useContext(or).static||b.useLayoutEffect(e)}function On(){let{isDataRoute:e}=b.useContext(Cr);return e?oT():KA()}function KA(){Rt(Ys(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Gs),{basename:t,navigator:n}=b.useContext(or),{matches:a}=b.useContext(Cr),{pathname:l}=Vn(),o=JSON.stringify(Yg(a)),u=b.useRef(!1);return mk(()=>{u.current=!0}),b.useCallback((m,h={})=>{if(jr(u.current,hk),!u.current)return;if(typeof m=="number"){n.go(m);return}let y=cf(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Yr([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var GA=b.createContext(null);function YA(e){let t=b.useContext(Cr).outlet;return b.useMemo(()=>t&&b.createElement(GA.Provider,{value:e},t),[t,e])}function pk(){let{matches:e}=b.useContext(Cr),t=e[e.length-1];return t?t.params:{}}function $u(e,{relative:t}={}){let{matches:n}=b.useContext(Cr),{pathname:a}=Vn(),l=JSON.stringify(Yg(n));return b.useMemo(()=>cf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function XA(e,t){return gk(e,t)}function gk(e,t,n){var C;Rt(Ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=b.useContext(or),{matches:l}=b.useContext(Cr),o=l[l.length-1],u=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";vk(f,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Vn(),g;if(t){let E=typeof t=="string"?Ks(t):t;Rt(m==="/"||((C=E.pathname)==null?void 0:C.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=y;let x=g.pathname||"/",w=x;if(m!=="/"){let E=m.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=ik(e,{pathname:w});jr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),jr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=nT(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:Yr([m,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:Yr([m,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),l,n);return t&&j?b.createElement(Bu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function JA(){let e=sT(),t=LA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:o},"ErrorBoundary")," or"," ",b.createElement("code",{style:o},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:l},n):null,u)}var WA=b.createElement(JA,null),yk=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=VA(e.digest);n&&(e=n)}let t=e!==void 0?b.createElement(Cr.Provider,{value:this.props.routeContext},b.createElement(Xg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(eT,{error:e},t):t}};yk.contextType=BA;var ep=new WeakMap;function eT({children:e,error:t}){let{basename:n}=b.useContext(or);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=ZA(t.digest);if(a){let l=ep.get(t);if(l)throw l;let o=uk(a.location,n);if(ok&&!ep.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw ep.set(t,u),u}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function tT({routeContext:e,match:t,children:n}){let a=b.useContext(Gs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Cr.Provider,{value:e},n)}function nT(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,o=a==null?void 0:a.errors;if(o!=null){let y=l.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Rt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let u=!1,f=-1;if(n&&a){u=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:w}=a,k=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(u=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var x,w;m(y,{location:a.location,params:((w=(x=a.matches)==null?void 0:x[0])==null?void 0:w.params)??{},unstable_pattern:UA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,x)=>{let w,k=!1,j=null,C=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||WA,u&&(f<0&&x===0?(vk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,C=null):f===x&&(k=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,x+1)),R=()=>{let z;return w?z=j:k?z=C:g.route.Component?z=b.createElement(g.route.Component,null):g.route.element?z=g.route.element:z=y,b.createElement(tT,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:a!=null},children:z})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?b.createElement(yk,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):R()},null)}function Jg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rT(e){let t=b.useContext(Gs);return Rt(t,Jg(e)),t}function aT(e){let t=b.useContext(df);return Rt(t,Jg(e)),t}function iT(e){let t=b.useContext(Cr);return Rt(t,Jg(e)),t}function Wg(e){let t=iT(e),n=t.matches[t.matches.length-1];return Rt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lT(){return Wg("useRouteId")}function sT(){var a;let e=b.useContext(Xg),t=aT("useRouteError"),n=Wg("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function oT(){let{router:e}=rT("useNavigate"),t=Wg("useNavigate"),n=b.useRef(!1);return mk(()=>{n.current=!0}),b.useCallback(async(l,o={})=>{jr(n.current,hk),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var w1={};function vk(e,t,n){!t&&!w1[e]&&(w1[e]=!0,jr(!1,n))}b.memo(uT);function uT({routes:e,future:t,state:n,isStatic:a,onError:l}){return gk(e,void 0,{state:n,isStatic:a,onError:l})}function ir({to:e,replace:t,state:n,relative:a}){Rt(Ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=b.useContext(or);jr(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=b.useContext(Cr),{pathname:u}=Vn(),f=On(),m=cf(e,Yg(o),u,a==="path"),h=JSON.stringify(m);return b.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function Ps(e){return YA(e.context)}function Tt(e){Rt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function cT({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:u}){Rt(!Ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:u,future:{}}),[f,l,o,u]);typeof n=="string"&&(n=Ks(n));let{pathname:h="/",search:y="",hash:g="",state:x=null,key:w="default",unstable_mask:k}=n,j=b.useMemo(()=>{let C=Ea(h,f);return C==null?null:{location:{pathname:C,search:y,hash:g,state:x,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,x,w,a,k]);return jr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:b.createElement(or.Provider,{value:m},b.createElement(Bu.Provider,{children:t,value:j}))}function dT({children:e,location:t}){return XA(sg(e),t)}function sg(e,t=[]){let n=[];return b.Children.forEach(e,(a,l)=>{if(!b.isValidElement(a))return;let o=[...t,l];if(a.type===b.Fragment){n.push.apply(n,sg(a.props.children,o));return}Rt(a.type===Tt,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Rt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let u={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(u.children=sg(a.props.children,o)),n.push(u)}),n}var Ld="get",Ud="application/x-www-form-urlencoded";function ff(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function fT(e){return ff(e)&&e.tagName.toLowerCase()==="button"}function hT(e){return ff(e)&&e.tagName.toLowerCase()==="form"}function mT(e){return ff(e)&&e.tagName.toLowerCase()==="input"}function pT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gT(e,t){return e.button===0&&(!t||t==="_self")&&!pT(e)}function og(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(l=>[n,l]):[[n,a]])},[]))}function yT(e,t){let n=og(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var yd=null;function vT(){if(yd===null)try{new FormData(document.createElement("form"),0),yd=!1}catch{yd=!0}return yd}var bT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tp(e){return e!=null&&!bT.has(e)?(jr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ud}"`),null):e}function xT(e,t){let n,a,l,o,u;if(hT(e)){let f=e.getAttribute("action");a=f?Ea(f,t):null,n=e.getAttribute("method")||Ld,l=tp(e.getAttribute("enctype"))||Ud,o=new FormData(e)}else if(fT(e)||mT(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(a=m?Ea(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Ld,l=tp(e.getAttribute("formenctype"))||tp(f.getAttribute("enctype"))||Ud,o=new FormData(f,e),!vT()){let{name:h,type:y,value:g}=e;if(y==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,g)}}else{if(ff(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ld,a=null,l=Ud,u=e}return o&&l==="text/plain"&&(u=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ey(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wT(e,t,n,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:t&&Ea(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function ST(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function kT(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function jT(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await ST(o,n);return u.links?u.links():[]}return[]}));return _T(a.flat(1).filter(kT).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function S1(e,t,n,a,l,o){let u=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>u(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let x=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function CT(e,t,{includeHydrateFallback:n}={}){return ET(e.map(a=>{let l=t.routes[a.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function ET(e){return[...new Set(e)]}function NT(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function _T(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(NT(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function bk(){let e=b.useContext(Gs);return ey(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function AT(){let e=b.useContext(df);return ey(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ty=b.createContext(void 0);ty.displayName="FrameworkContext";function xk(){let e=b.useContext(ty);return ey(e,"You must render this element inside a <HydratedRouter> element"),e}function TT(e,t){let n=b.useContext(ty),[a,l]=b.useState(!1),[o,u]=b.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,x=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=E=>{E.forEach(R=>{u(R.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[e]),b.useEffect(()=>{if(a){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),u(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:Wo(f,w),onBlur:Wo(m,k),onMouseEnter:Wo(h,w),onMouseLeave:Wo(y,k),onTouchStart:Wo(g,w)}]:[!1,x,{}]}function Wo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function RT({page:e,...t}){let{router:n}=bk(),a=b.useMemo(()=>ik(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?b.createElement(OT,{page:e,matches:a,...t}):null}function zT(e){let{manifest:t,routeModules:n}=xk(),[a,l]=b.useState([]);return b.useEffect(()=>{let o=!1;return jT(e,t,n).then(u=>{o||l(u)}),()=>{o=!0}},[e,t,n]),a}function OT({page:e,matches:t,...n}){let a=Vn(),{future:l,manifest:o,routeModules:u}=xk(),{basename:f}=bk(),{loaderData:m,matches:h}=AT(),y=b.useMemo(()=>S1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=b.useMemo(()=>S1(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=b.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,C=!1;if(t.forEach(R=>{var I;let z=o.routes[R.route.id];!z||!z.hasLoader||(!y.some(B=>B.route.id===R.route.id)&&R.route.id in m&&((I=u[R.route.id])!=null&&I.shouldRevalidate)||z.hasClientLoader?C=!0:j.add(R.route.id))}),j.size===0)return[];let E=wT(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&E.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,u]),w=b.useMemo(()=>CT(g,o),[g,o]),k=zT(g);return b.createElement(b.Fragment,null,x.map(j=>b.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.map(j=>b.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:C})=>b.createElement("link",{key:j,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function DT(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var MT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{MT&&(window.__reactRouterVersion="7.13.1")}catch{}function IT({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=b.useRef();l.current==null&&(l.current=hA({window:a,v5Compat:!0}));let o=l.current,[u,f]=b.useState({action:o.action,location:o.location}),m=b.useCallback(h=>{n===!1?f(h):b.startTransition(()=>f(h))},[n]);return b.useLayoutEffect(()=>o.listen(m),[o,m]),b.createElement(cT,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var wk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fu=b.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:u,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:x,unstable_defaultShouldRevalidate:w,...k},j){let{basename:C,navigator:E,unstable_useTransitions:R}=b.useContext(or),z=typeof y=="string"&&wk.test(y),I=uk(y,C);y=I.to;let B=QA(y,{relative:l}),O=Vn(),D=null;if(f){let W=cf(f,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);C!=="/"&&(W.pathname=W.pathname==="/"?C:Yr([C,W.pathname])),D=E.createHref(W)}let[U,V,F]=TT(a,k),ne=PT(y,{replace:u,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:R});function oe(W){t&&t(W),W.defaultPrevented||ne(W)}let Se=!(I.isExternal||o),G=b.createElement("a",{...k,...F,href:(Se?D:void 0)||I.absoluteURL||B,onClick:Se?oe:t,ref:DT(j,V),target:h,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?b.createElement(b.Fragment,null,G,b.createElement(RT,{page:B})):G});Fu.displayName="Link";var hf=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:u,viewTransition:f,children:m,...h},y){let g=$u(u,{relative:h.relative}),x=Vn(),w=b.useContext(df),{navigator:k,basename:j}=b.useContext(or),C=w!=null&&HT(g)&&f===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,R=x.pathname,z=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(R=R.toLowerCase(),z=z?z.toLowerCase():null,E=E.toLowerCase()),z&&j&&(z=Ea(z,j)||z);const I=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let B=R===E||!l&&R.startsWith(E)&&R.charAt(I)==="/",O=z!=null&&(z===E||!l&&z.startsWith(E)&&z.charAt(E.length)==="/"),D={isActive:B,isPending:O,isTransitioning:C},U=B?t:void 0,V;typeof a=="function"?V=a(D):V=[a,B?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(D):o;return b.createElement(Fu,{...h,"aria-current":U,className:V,ref:y,style:F,to:u,viewTransition:f},typeof m=="function"?m(D):m)});hf.displayName="NavLink";var LT=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:u=Ld,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x,...w},k)=>{let{unstable_useTransitions:j}=b.useContext(or),C=FT(),E=qT(f,{relative:h}),R=u.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&wk.test(f),I=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let O=B.nativeEvent.submitter,D=(O==null?void 0:O.getAttribute("formmethod"))||u,U=()=>C(O||B.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:x});j&&n!==!1?b.startTransition(()=>U()):U()};return b.createElement("form",{ref:k,method:R,action:E,onSubmit:a?m:I,...w,"data-discover":!z&&e==="render"?"true":void 0})});LT.displayName="Form";function UT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Sk(e){let t=b.useContext(Gs);return Rt(t,UT(e)),t}function PT(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=On(),g=Vn(),x=$u(e,{relative:u});return b.useCallback(w=>{if(gT(w,t)){w.preventDefault();let k=n!==void 0?n:xu(g)===xu(x),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:m});h?b.startTransition(()=>j()):j()}},[g,y,x,n,a,l,t,e,o,u,f,m,h])}function kk(e){jr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(og(e)),n=b.useRef(!1),a=Vn(),l=b.useMemo(()=>yT(a.search,n.current?null:t.current),[a.search]),o=On(),u=b.useCallback((f,m)=>{const h=og(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,u]}var BT=0,$T=()=>`__${String(++BT)}__`;function FT(){let{router:e}=Sk("useSubmit"),{basename:t}=b.useContext(or),n=lT(),a=e.fetch,l=e.navigate;return b.useCallback(async(o,u={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=xT(o,t);if(u.navigate===!1){let x=u.fetcherKey||$T();await a(x,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,flushSync:u.flushSync})}else await l(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||m,formEncType:u.encType||h,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[a,l,t,n])}function qT(e,{relative:t}={}){let{basename:n}=b.useContext(or),a=b.useContext(Cr);Rt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...$u(e||".",{relative:t})},u=Vn();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Yr([n,o.pathname])),xu(o)}function HT(e,{relative:t}={}){let n=b.useContext(dk);Rt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Sk("useViewTransitionState"),l=$u(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ea(n.currentLocation.pathname,a)||n.currentLocation.pathname,u=Ea(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Zd(l.pathname,u)!=null||Zd(l.pathname,o)!=null}const ZT="/api/v1";async function VT(e,t){const n=await fetch(`${ZT}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok){const a=await n.text();let l;try{l=JSON.parse(a).error??a}catch{l=a}throw new Error(l)}return await n.json()}const jk="/api/v1",ny="first-tree-hub:tokens";let ug=null;function eu(e){ug=e}function an(e){if(!ug)throw new Error(`withOrg("${e}") called before an organization is selected`);return`/orgs/${encodeURIComponent(ug)}${e}`}function k1(e,t){return`/orgs/${encodeURIComponent(e)}${t}`}function mf(){const e=localStorage.getItem(ny);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function cg(e){localStorage.setItem(ny,JSON.stringify(e))}function Ck(){localStorage.removeItem(ny)}class qu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let tu=null;async function QT(){const e=mf();return e!=null&&e.refreshToken?Ek(e.refreshToken):null}async function Ek(e){return tu||(tu=(async()=>{try{const t=await fetch(`${jk}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})});if(!t.ok)return null;const n=await t.json(),a={accessToken:n.accessToken,refreshToken:n.refreshToken??e};return cg(a),a}catch{return null}finally{tu=null}})(),tu)}async function vd(e,t){const{method:n="GET",body:a}=t??{},l=f=>{const m={};return f&&(m.Authorization=`Bearer ${f}`),a!==void 0&&(m["Content-Type"]="application/json"),fetch(`${jk}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=mf();let u=await l(o==null?void 0:o.accessToken);if(u.status===401&&(o!=null&&o.refreshToken)){const f=await Ek(o.refreshToken);f&&(u=await l(f.accessToken))}if(!u.ok){u.status===401&&(Ck(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await u.text();let m,h;try{const y=JSON.parse(f);m=y.error??f,Array.isArray(y.details)&&(h=y.details.filter(g=>typeof g=="object"&&g!==null&&Array.isArray(g.path)))}catch{m=f}throw new qu(u.status,m,h)}if(u.status!==204)return await u.json()}const Ne={get:e=>vd(e),post:(e,t)=>vd(e,{method:"POST",body:t}),patch:(e,t)=>vd(e,{method:"PATCH",body:t}),delete:e=>vd(e,{method:"DELETE"})},ry="onboarding:joinPath",KT="onboarding:draft";function Nk(e){typeof window>"u"||window.sessionStorage.setItem(ry,e)}function GT(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(ry);return e==="solo"||e==="invite"?e:null}function YT(){typeof window>"u"||window.sessionStorage.removeItem(ry)}function XT(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function ay(e){return`${KT}:${e}`}function JT(e){if(!e||typeof e!="object"||!("displayName"in e)||typeof e.displayName!="string")return null;const t="selectedRuntime"in e?e.selectedRuntime:null;if(t!==null&&typeof t!="string")return null;const n="connectToken"in e?e.connectToken:null;if(n!==null&&typeof n!="string")return null;const a="connectTokenExpiresAt"in e?e.connectTokenExpiresAt:null;return a!==null&&typeof a!="number"?null:{displayName:e.displayName,selectedRuntime:t,connectToken:n,connectTokenExpiresAt:a}}function WT(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(ay(e));if(!t)return null;try{return JT(JSON.parse(t))}catch{return null}}function eR(e,t){typeof window>"u"||window.sessionStorage.setItem(ay(e),JSON.stringify(t))}function tR(e){typeof window>"u"||window.sessionStorage.removeItem(ay(e))}const _k=b.createContext(null),dg="first-tree-hub:selectedOrganizationId";function nR(){try{return localStorage.getItem(dg)}catch{return null}}function np(e){try{e===null?localStorage.removeItem(dg):localStorage.setItem(dg,e)}catch{}}function rR({children:e}){const t=dn(),[n,a]=b.useState(()=>!!mf()),[l,o]=b.useState(null),[u,f]=b.useState([]),[m,h]=b.useState(()=>{const I=nR();return eu(I),I}),[y,g]=b.useState(null),[x,w]=b.useState(!1),k=b.useCallback(()=>{Ck(),np(null),eu(null),t.clear(),a(!1),o(null),f([]),h(null),g(null),w(!1)},[t]),j=b.useCallback(async()=>{var I;try{const B=await Ne.get("/me");o(B.user??null);const O=B.memberships??[];f(O);const D=((I=B.wizard)==null?void 0:I.step)??null;g(D),D==="completed"&&YT(),h(U=>{var ne;const V=U&&O.some(oe=>oe.organizationId===U)?U:null;if(V)return eu(V),V;const F=B.defaultOrganizationId??((ne=O[0])==null?void 0:ne.organizationId)??null;return np(F),eu(F),F})}catch{}finally{w(!0)}},[]),C=b.useCallback(async(I,B)=>{const O=await VT(I,B);cg({accessToken:O.accessToken,refreshToken:O.refreshToken}),a(!0),await j()},[j]),E=b.useCallback(async I=>{cg(I),a(!0),await j()},[j]),R=b.useCallback(async I=>{np(I),eu(I),t.clear(),h(I),await j()},[j,t]);b.useEffect(()=>{n&&!l&&j()},[n,l,j]),b.useEffect(()=>{const I=()=>k();return window.addEventListener("auth:logout",I),()=>window.removeEventListener("auth:logout",I)},[k]);const z=b.useMemo(()=>u.length===0?null:u.find(B=>B.organizationId===m)??u[0]??null,[u,m]);return c.jsx(_k.Provider,{value:{isAuthenticated:n,meLoaded:x,user:l,memberships:u,currentMembership:z,organizationId:(z==null?void 0:z.organizationId)??null,memberId:(z==null?void 0:z.id)??null,role:(z==null?void 0:z.role)??null,agentId:(z==null?void 0:z.agentId)??null,wizardStep:y,login:C,adoptTokens:E,selectOrganization:R,refreshMe:j,logout:k},children:e})}function zt(){const e=b.useContext(_k);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const aR="modulepreload",iR=function(e){return"/"+e},j1={},lR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let u=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=u(n.map(h=>{if(h=iR(h),h in j1)return;j1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":aR,y||(x.as="script"),x.crossOrigin="",x.href=h,m&&x.setAttribute("nonce",m),document.head.appendChild(x),y)return new Promise((w,k)=>{x.addEventListener("load",w),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return l.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},sR=b.lazy(()=>lR(()=>import("./index-Dbwa40_B.js"),[]).then(e=>({default:e.LandingPage}))),C1=()=>c.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function oR(){const{isAuthenticated:e,meLoaded:t}=zt(),n=Vn();return e?t?c.jsx(Ps,{}):c.jsx(C1,{}):n.pathname==="/"?c.jsx(b.Suspense,{fallback:c.jsx(C1,{}),children:c.jsx(sR,{})}):c.jsx(ir,{to:"/login",replace:!0,state:{from:n}})}/**
|
|
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 Ak=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.577.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const uR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
+
* @license lucide-react v0.577.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const cR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
|
|
76
|
+
* @license lucide-react v0.577.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const E1=e=>{const t=cR(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
81
|
+
* @license lucide-react v0.577.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/var dR={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 fR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
91
|
+
* @license lucide-react v0.577.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const hR=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:u,...f},m)=>b.createElement("svg",{ref:m,...dR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Ak("lucide",l),...!o&&!fR(f)&&{"aria-hidden":"true"},...f},[...u.map(([h,y])=>b.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
+
* @license lucide-react v0.577.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const st=(e,t)=>{const n=b.forwardRef(({className:a,...l},o)=>b.createElement(hR,{ref:o,iconNode:t,className:Ak(`lucide-${uR(E1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=E1(e),n};/**
|
|
101
|
+
* @license lucide-react v0.577.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const mR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],iy=st("arrow-left",mR);/**
|
|
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 pR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],gR=st("arrow-right",pR);/**
|
|
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 yR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Tk=st("arrow-up",yR);/**
|
|
116
|
+
* @license lucide-react v0.577.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const vR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],bR=st("at-sign",vR);/**
|
|
121
|
+
* @license lucide-react v0.577.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const xR=[["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"}]],wR=st("bell",xR);/**
|
|
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 SR=[["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"}]],kR=st("bot",SR);/**
|
|
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 jR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mr=st("check",jR);/**
|
|
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 CR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rk=st("chevron-down",CR);/**
|
|
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 ER=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],NR=st("chevron-right",ER);/**
|
|
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 _R=[["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"}]],zk=st("copy",_R);/**
|
|
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 AR=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],TR=st("eye-off",AR);/**
|
|
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 RR=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],zR=st("eye",RR);/**
|
|
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 OR=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],Ok=st("github",OR);/**
|
|
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 DR=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],MR=st("key-round",DR);/**
|
|
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 IR=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],LR=st("layout-dashboard",IR);/**
|
|
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 UR=[["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"}]],fg=st("link-2",UR);/**
|
|
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 PR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],BR=st("loader-circle",PR);/**
|
|
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 $R=[["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"}]],Dk=st("lock",$R);/**
|
|
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 FR=[["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"}]],qR=st("log-out",FR);/**
|
|
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 HR=[["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"}]],ly=st("message-square",HR);/**
|
|
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 ZR=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],VR=st("moon",ZR);/**
|
|
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 QR=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],KR=st("paperclip",QR);/**
|
|
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 GR=[["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"}]],pf=st("pencil",GR);/**
|
|
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 YR=[["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"}]],Mk=st("play",YR);/**
|
|
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 XR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ir=st("plus",XR);/**
|
|
226
|
+
* @license lucide-react v0.577.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const JR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],sy=st("search",JR);/**
|
|
231
|
+
* @license lucide-react v0.577.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const WR=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],ez=st("sun",WR);/**
|
|
236
|
+
* @license lucide-react v0.577.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const tz=[["path",{d:"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"}]],Bs=st("trash-2",tz);/**
|
|
241
|
+
* @license lucide-react v0.577.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const nz=[["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"}]],oy=st("triangle-alert",nz);/**
|
|
246
|
+
* @license lucide-react v0.577.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const rz=[["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"}]],az=st("undo-2",rz);/**
|
|
251
|
+
* @license lucide-react v0.577.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const iz=[["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"}]],lz=st("unplug",iz);/**
|
|
256
|
+
* @license lucide-react v0.577.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const sz=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Ik=st("user-plus",sz);/**
|
|
261
|
+
* @license lucide-react v0.577.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const oz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],wu=st("x",oz);/**
|
|
266
|
+
* @license lucide-react v0.577.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const uz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],cz=st("zap",uz);function Lk(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=Lk(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Uk(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=Lk(e))&&(a&&(a+=" "),a+=t);return a}const dz=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},fz=(e,t)=>({classGroupId:e,validator:t}),Pk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vd="-",N1=[],hz="arbitrary..",mz=e=>{const t=gz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return pz(u);const f=u.split(Vd),m=f[0]===""&&f.length>1?1:0;return Bk(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],h=n[u];return m?h?dz(h,m):m:h||N1}return n[u]||N1}}},Bk=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=Bk(e,t+1,o);if(h)return h}const u=n.validators;if(u===null)return;const f=t===0?e.join(Vd):e.slice(t).join(Vd),m=u.length;for(let h=0;h<m;h++){const y=u[h];if(y.validator(f))return y.classGroupId}},pz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?hz+a:void 0})(),gz=e=>{const{theme:t,classGroups:n}=e;return yz(n,t)},yz=(e,t)=>{const n=Pk();for(const a in e){const l=e[a];uy(l,n,a,t)}return n},uy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const u=e[o];vz(u,t,n,a)}},vz=(e,t,n,a)=>{if(typeof e=="string"){bz(e,t,n);return}if(typeof e=="function"){xz(e,t,n,a);return}wz(e,t,n,a)},bz=(e,t,n)=>{const a=e===""?t:$k(t,e);a.classGroupId=n},xz=(e,t,n,a)=>{if(Sz(e)){uy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(fz(n,e))},wz=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let u=0;u<o;u++){const[f,m]=l[u];uy(m,$k(t,f),n,a)}},$k=(e,t)=>{let n=e;const a=t.split(Vd),l=a.length;for(let o=0;o<l;o++){const u=a[o];let f=n.nextPart.get(u);f||(f=Pk(),n.nextPart.set(u,f)),n=f}return n},Sz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,kz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,u)=>{n[o]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let u=n[o];if(u!==void 0)return u;if((u=a[o])!==void 0)return l(o,u),u},set(o,u){o in n?n[o]=u:l(o,u)}}},hg="!",_1=":",jz=[],A1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Cz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let u=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const C=l[j];if(u===0&&f===0){if(C===_1){o.push(l.slice(m,j)),m=j+1;continue}if(C==="/"){h=j;continue}}C==="["?u++:C==="]"?u--:C==="("?f++:C===")"&&f--}const g=o.length===0?l:l.slice(m);let x=g,w=!1;g.endsWith(hg)?(x=g.slice(0,-1),w=!0):g.startsWith(hg)&&(x=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return A1(o,w,x,k)};if(t){const l=t+_1,o=a;a=u=>u.startsWith(l)?o(u.slice(l.length)):A1(jz,!1,u,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},Ez=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const u=n[o],f=u[0]==="[",m=t.has(u);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(u)):l.push(u)}return l.length>0&&(l.sort(),a.push(...l)),a}},Nz=e=>({cache:kz(e.cacheSize),parseClassName:Cz(e),sortModifiers:Ez(e),...mz(e)}),_z=/\s+/,Az=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,u=[],f=e.trim().split(_z);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:x,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let C=!!j,E=a(C?k.substring(0,j):k);if(!E){if(!C){m=y+(m.length>0?" "+m:m);continue}if(E=a(k),!E){m=y+(m.length>0?" "+m:m);continue}C=!1}const R=x.length===0?"":x.length===1?x[0]:o(x).join(":"),z=w?R+hg:R,I=z+E;if(u.indexOf(I)>-1)continue;u.push(I);const B=l(E,C);for(let O=0;O<B.length;++O){const D=B[O];u.push(z+D)}m=y+(m.length>0?" "+m:m)}return m},Tz=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=Fk(n))&&(l&&(l+=" "),l+=a);return l},Fk=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=Fk(e[a]))&&(n&&(n+=" "),n+=t);return n},Rz=(e,...t)=>{let n,a,l,o;const u=m=>{const h=t.reduce((y,g)=>g(y),e());return n=Nz(h),a=n.cache.get,l=n.cache.set,o=f,f(m)},f=m=>{const h=a(m);if(h)return h;const y=Az(m,n);return l(m,y),y};return o=u,(...m)=>o(Tz(...m))},zz=[],tn=e=>{const t=n=>n[e]||zz;return t.isThemeGetter=!0,t},qk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Dz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mz=/\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$/,Iz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Uz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,si=e=>Oz.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),oi=e=>!!e&&Number.isInteger(Number(e)),rp=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),va=e=>Dz.test(e),Zk=()=>!0,Pz=e=>Mz.test(e)&&!Iz.test(e),cy=()=>!1,Bz=e=>Lz.test(e),$z=e=>Uz.test(e),Fz=e=>!Ce(e)&&!Ee(e),qz=e=>Ri(e,Kk,cy),Ce=e=>qk.test(e),nl=e=>Ri(e,Gk,Pz),T1=e=>Ri(e,Xz,Qe),Hz=e=>Ri(e,Xk,Zk),Zz=e=>Ri(e,Yk,cy),R1=e=>Ri(e,Vk,cy),Vz=e=>Ri(e,Qk,$z),bd=e=>Ri(e,Jk,Bz),Ee=e=>Hk.test(e),nu=e=>wl(e,Gk),Qz=e=>wl(e,Yk),z1=e=>wl(e,Vk),Kz=e=>wl(e,Kk),Gz=e=>wl(e,Qk),xd=e=>wl(e,Jk,!0),Yz=e=>wl(e,Xk,!0),Ri=(e,t,n)=>{const a=qk.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},wl=(e,t,n=!1)=>{const a=Hk.exec(e);return a?a[1]?t(a[1]):n:!1},Vk=e=>e==="position"||e==="percentage",Qk=e=>e==="image"||e==="url",Kk=e=>e==="length"||e==="size"||e==="bg-size",Gk=e=>e==="length",Xz=e=>e==="number",Yk=e=>e==="family-name",Xk=e=>e==="number"||e==="weight",Jk=e=>e==="shadow",Jz=()=>{const e=tn("color"),t=tn("font"),n=tn("text"),a=tn("font-weight"),l=tn("tracking"),o=tn("leading"),u=tn("breakpoint"),f=tn("container"),m=tn("spacing"),h=tn("radius"),y=tn("shadow"),g=tn("inset-shadow"),x=tn("text-shadow"),w=tn("drop-shadow"),k=tn("blur"),j=tn("perspective"),C=tn("aspect"),E=tn("ease"),R=tn("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...I(),Ee,Ce],O=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],U=()=>[Ee,Ce,m],V=()=>[si,"full","auto",...U()],F=()=>[oi,"none","subgrid",Ee,Ce],ne=()=>["auto",{span:["full",oi,Ee,Ce]},oi,Ee,Ce],oe=()=>[oi,"auto",Ee,Ce],Se=()=>["auto","min","max","fr",Ee,Ce],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...U()],re=()=>[si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ve=()=>[si,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Re=()=>[si,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],_=()=>[e,Ee,Ce],L=()=>[...I(),z1,R1,{position:[Ee,Ce]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Kz,qz,{size:[Ee,Ce]}],q=()=>[rp,nu,nl],X=()=>["","none","full",h,Ee,Ce],ue=()=>["",Qe,nu,nl],xe=()=>["solid","dashed","dotted","double"],be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Qe,rp,z1,R1],ee=()=>["","none",k,Ee,Ce],me=()=>["none",Qe,Ee,Ce],_e=()=>["none",Qe,Ee,Ce],Le=()=>[Qe,Ee,Ce],it=()=>[si,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[va],breakpoint:[va],color:[Zk],container:[va],"drop-shadow":[va],ease:["in","out","in-out"],font:[Fz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[va],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[va],shadow:[va],spacing:["px",Qe],text:[va],"text-shadow":[va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",si,Ce,Ee,C]}],container:["container"],columns:[{columns:[Qe,Ce,Ee,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[oi,"auto",Ee,Ce]}],basis:[{basis:[si,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,si,"auto","initial","none",Ce]}],grow:[{grow:["",Qe,Ee,Ce]}],shrink:[{shrink:["",Qe,Ee,Ce]}],order:[{order:[oi,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Se()}],"auto-rows":[{"auto-rows":Se()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mbs:[{mbs:Z()}],mbe:[{mbe:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],"inline-size":[{inline:["auto",...ve()]}],"min-inline-size":[{"min-inline":["auto",...ve()]}],"max-inline-size":[{"max-inline":["none",...ve()]}],"block-size":[{block:["auto",...Re()]}],"min-block-size":[{"min-block":["auto",...Re()]}],"max-block-size":[{"max-block":["none",...Re()]}],w:[{w:[f,"screen",...re()]}],"min-w":[{"min-w":[f,"screen","none",...re()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",n,nu,nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Yz,Hz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rp,Ce]}],"font-family":[{font:[Qz,Zz,t]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ee,Ce]}],"line-clamp":[{"line-clamp":[Qe,"none",Ee,T1]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Ee,nl]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Qe,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oi,Ee,Ce],radial:["",Ee,Ce],conic:[oi,Ee,Ce]},Gz,Vz]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Ee,Ce]}],"outline-w":[{outline:["",Qe,nu,nl]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",y,xd,bd]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",g,xd,bd]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Qe,nl]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",x,xd,bd]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Qe,Ee,Ce]}],"mix-blend":[{"mix-blend":[...be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:ee()}],brightness:[{brightness:[Qe,Ee,Ce]}],contrast:[{contrast:[Qe,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",w,xd,bd]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Qe,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Qe,Ee,Ce]}],invert:[{invert:["",Qe,Ee,Ce]}],saturate:[{saturate:[Qe,Ee,Ce]}],sepia:[{sepia:["",Qe,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",E,Ee,Ce]}],delay:[{delay:[Qe,Ee,Ce]}],animate:[{animate:["none",R,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ee,Ce]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ce]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Qe,nu,nl,T1]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Wz=Rz(Jz);function Te(...e){return Wz(Uk(e))}function gl(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e)):"—"}function eO(e){return Ne.delete(`/clients/${encodeURIComponent(e)}`)}function Hu(){return Ne.get(an("/activity"))}function Ei(){return Ne.get(an("/clients"))}function dy(e){return Ne.get(`/clients/${e}`)}function tO(e){return Ne.post(`/clients/${e}/disconnect`)}function nO(){return Ne.post("/me/connect-tokens")}const O1=e=>["agent-sessions",e];function rO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.toolUseId!="string"||typeof t.name!="string"||t.status!=="pending"&&t.status!=="ok"&&t.status!=="error"?null:{toolUseId:t.toolUseId,name:t.name,args:t.args,status:t.status,durationMs:typeof t.durationMs=="number"?t.durationMs:void 0,resultPreview:typeof t.resultPreview=="string"?t.resultPreview:void 0}}function aO(e){if(typeof e!="object"||e===null)return null;const t=e;return t.source!=="sdk"&&t.source!=="runtime"&&t.source!=="tool"||typeof t.message!="string"?null:{source:t.source,message:t.message}}function iO(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function Wk(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.runtimeState&&n.set("runtimeState",t.runtimeState);const a=n.toString();return Ne.get(`/agents/${e}/sessions${a?`?${a}`:""}`)}function lO(e,t,n){const a=new URLSearchParams;a.set("limit",String(n.limit)),(n==null?void 0:n.cursor)!==void 0&&a.set("cursor",String(n.cursor)),n!=null&&n.direction&&a.set("direction",n.direction);const l=a.toString();return Ne.get(`/agents/${e}/sessions/${t}/events${l?`?${l}`:""}`)}var D1=1,sO=.9,oO=.8,uO=.17,ap=.1,ip=.999,cO=.9999,dO=.99,fO=/[\\\/_+.#"@\[\(\{&]/,hO=/[\\\/_+.#"@\[\(\{&]/g,mO=/[\s-]/,ej=/[\s-]/g;function mg(e,t,n,a,l,o,u){if(o===t.length)return l===e.length?D1:dO;var f=`${l},${o}`;if(u[f]!==void 0)return u[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,x,w,k;h>=0;)g=mg(e,t,n,a,h+1,o+1,u),g>y&&(h===l?g*=D1:fO.test(e.charAt(h-1))?(g*=oO,w=e.slice(l,h-1).match(hO),w&&l>0&&(g*=Math.pow(ip,w.length))):mO.test(e.charAt(h-1))?(g*=sO,k=e.slice(l,h-1).match(ej),k&&l>0&&(g*=Math.pow(ip,k.length))):(g*=uO,l>0&&(g*=Math.pow(ip,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=cO)),(g<ap&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(x=mg(e,t,n,a,h+1,o+2,u),x*ap>g&&(g=x*ap)),g>y&&(y=g),h=n.indexOf(m,h+1);return u[f]=y,y}function M1(e){return e.toLowerCase().replace(ej," ")}function pO(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,mg(e,t,M1(e),M1(t),0,0,{})}function Ci(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function I1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ni(...e){return t=>{let n=!1;const a=e.map(l=>{const o=I1(l,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let l=0;l<a.length;l++){const o=a[l];typeof o=="function"?o():I1(e[l],null)}}}}function Sl(...e){return b.useCallback(Ni(...e),e)}function gO(e,t){const n=b.createContext(t),a=o=>{const{children:u,...f}=o,m=b.useMemo(()=>f,Object.values(f));return c.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function l(o){const u=b.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function yO(e,t=[]){let n=[];function a(o,u){const f=b.createContext(u),m=n.length;n=[...n,u];const h=g=>{var E;const{scope:x,children:w,...k}=g,j=((E=x==null?void 0:x[e])==null?void 0:E[m])||f,C=b.useMemo(()=>k,Object.values(k));return c.jsx(j.Provider,{value:C,children:w})};h.displayName=o+"Provider";function y(g,x){var j;const w=((j=x==null?void 0:x[e])==null?void 0:j[m])||f,k=b.useContext(w);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(u=>b.createContext(u));return function(f){const m=(f==null?void 0:f[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,vO(l,...t)]}function vO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const u=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var Su=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},bO=Fg[" useId ".trim().toString()]||(()=>{}),xO=0;function ja(e){const[t,n]=b.useState(bO());return Su(()=>{n(a=>a??String(xO++))},[e]),t?`radix-${t}`:""}var wO=Fg[" useInsertionEffect ".trim().toString()]||Su;function SO({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,u]=kO({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=b.useRef(e!==void 0);b.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,a])}const h=b.useCallback(y=>{var g;if(f){const x=jO(y)?y(e):y;x!==e&&((g=u.current)==null||g.call(u,x))}else o(y)},[f,e,o,u]);return[m,h]}function kO({defaultProp:e,onChange:t}){const[n,a]=b.useState(e),l=b.useRef(n),o=b.useRef(t);return wO(()=>{o.current=t},[t]),b.useEffect(()=>{var u;l.current!==n&&((u=o.current)==null||u.call(o,n),l.current=n)},[n,l]),[n,a,o]}function jO(e){return typeof e=="function"}var fy=$S();const CO=uf(fy);function tj(e){const t=EO(e),n=b.forwardRef((a,l)=>{const{children:o,...u}=a,f=b.Children.toArray(o),m=f.find(_O);if(m){const h=m.props.children,y=f.map(g=>g===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:g);return c.jsx(t,{...u,ref:l,children:b.isValidElement(h)?b.cloneElement(h,void 0,y):null})}return c.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function EO(e){const t=b.forwardRef((n,a)=>{const{children:l,...o}=n;if(b.isValidElement(l)){const u=TO(l),f=AO(o,l.props);return l.type!==b.Fragment&&(f.ref=a?Ni(a,u):u),b.cloneElement(l,f)}return b.Children.count(l)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NO=Symbol("radix.slottable");function _O(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NO}function AO(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function TO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var RO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Na=RO.reduce((e,t)=>{const n=tj(`Primitive.${t}`),a=b.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function zO(e,t){e&&fy.flushSync(()=>e.dispatchEvent(t))}function ku(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function OO(e,t=globalThis==null?void 0:globalThis.document){const n=ku(e);b.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var DO="DismissableLayer",pg="dismissableLayer.update",MO="dismissableLayer.pointerDownOutside",IO="dismissableLayer.focusOutside",L1,nj=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rj=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:u,onDismiss:f,...m}=e,h=b.useContext(nj),[y,g]=b.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=b.useState({}),k=Sl(t,D=>g(D)),j=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=j.indexOf(C),R=y?j.indexOf(y):-1,z=h.layersWithOutsidePointerEventsDisabled.size>0,I=R>=E,B=PO(D=>{const U=D.target,V=[...h.branches].some(F=>F.contains(U));!I||V||(l==null||l(D),u==null||u(D),D.defaultPrevented||f==null||f())},x),O=BO(D=>{const U=D.target;[...h.branches].some(F=>F.contains(U))||(o==null||o(D),u==null||u(D),D.defaultPrevented||f==null||f())},x);return OO(D=>{R===h.layers.size-1&&(a==null||a(D),!D.defaultPrevented&&f&&(D.preventDefault(),f()))},x),b.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(L1=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),U1(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=L1)}},[y,x,n,h]),b.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),U1())},[y,h]),b.useEffect(()=>{const D=()=>w({});return document.addEventListener(pg,D),()=>document.removeEventListener(pg,D)},[]),c.jsx(Na.div,{...m,ref:k,style:{pointerEvents:z?I?"auto":"none":void 0,...e.style},onFocusCapture:Ci(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ci(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ci(e.onPointerDownCapture,B.onPointerDownCapture)})});rj.displayName=DO;var LO="DismissableLayerBranch",UO=b.forwardRef((e,t)=>{const n=b.useContext(nj),a=b.useRef(null),l=Sl(t,a);return b.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(Na.div,{...e,ref:l})});UO.displayName=LO;function PO(e,t=globalThis==null?void 0:globalThis.document){const n=ku(e),a=b.useRef(!1),l=b.useRef(()=>{});return b.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){aj(MO,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function BO(e,t=globalThis==null?void 0:globalThis.document){const n=ku(e),a=b.useRef(!1);return b.useEffect(()=>{const l=o=>{o.target&&!a.current&&aj(IO,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function U1(){const e=new CustomEvent(pg);document.dispatchEvent(e)}function aj(e,t,n,{discrete:a}){const l=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?zO(l,o):l.dispatchEvent(o)}var lp="focusScope.autoFocusOnMount",sp="focusScope.autoFocusOnUnmount",P1={bubbles:!1,cancelable:!0},$O="FocusScope",ij=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...u}=e,[f,m]=b.useState(null),h=ku(l),y=ku(o),g=b.useRef(null),x=Sl(t,j=>m(j)),w=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(a){let j=function(z){if(w.paused||!f)return;const I=z.target;f.contains(I)?g.current=I:di(g.current,{select:!0})},C=function(z){if(w.paused||!f)return;const I=z.relatedTarget;I!==null&&(f.contains(I)||di(g.current,{select:!0}))},E=function(z){if(document.activeElement===document.body)for(const B of z)B.removedNodes.length>0&&di(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",C);const R=new MutationObserver(E);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",C),R.disconnect()}}},[a,f,w.paused]),b.useEffect(()=>{if(f){$1.add(w);const j=document.activeElement;if(!f.contains(j)){const E=new CustomEvent(lp,P1);f.addEventListener(lp,h),f.dispatchEvent(E),E.defaultPrevented||(FO(QO(lj(f)),{select:!0}),document.activeElement===j&&di(f))}return()=>{f.removeEventListener(lp,h),setTimeout(()=>{const E=new CustomEvent(sp,P1);f.addEventListener(sp,y),f.dispatchEvent(E),E.defaultPrevented||di(j??document.body,{select:!0}),f.removeEventListener(sp,y),$1.remove(w)},0)}}},[f,h,y,w]);const k=b.useCallback(j=>{if(!n&&!a||w.paused)return;const C=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,E=document.activeElement;if(C&&E){const R=j.currentTarget,[z,I]=qO(R);z&&I?!j.shiftKey&&E===I?(j.preventDefault(),n&&di(z,{select:!0})):j.shiftKey&&E===z&&(j.preventDefault(),n&&di(I,{select:!0})):E===R&&j.preventDefault()}},[n,a,w.paused]);return c.jsx(Na.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})});ij.displayName=$O;function FO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(di(a,{select:t}),document.activeElement!==n)return}function qO(e){const t=lj(e),n=B1(t,e),a=B1(t.reverse(),e);return[n,a]}function lj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function B1(e,t){for(const n of e)if(!HO(n,{upTo:t}))return n}function HO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ZO(e){return e instanceof HTMLInputElement&&"select"in e}function di(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZO(e)&&t&&e.select()}}var $1=VO();function VO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=F1(e,t),e.unshift(t)},remove(t){var n;e=F1(e,t),(n=e[0])==null||n.resume()}}}function F1(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function QO(e){return e.filter(t=>t.tagName!=="A")}var KO="Portal",sj=b.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=b.useState(!1);Su(()=>o(!0),[]);const u=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return u?CO.createPortal(c.jsx(Na.div,{...a,ref:t}),u):null});sj.displayName=KO;function GO(e,t){return b.useReducer((n,a)=>t[n][a]??n,e)}var gf=e=>{const{present:t,children:n}=e,a=YO(t),l=typeof n=="function"?n({present:a.isPresent}):b.Children.only(n),o=Sl(a.ref,XO(l));return typeof n=="function"||a.isPresent?b.cloneElement(l,{ref:o}):null};gf.displayName="Presence";function YO(e){const[t,n]=b.useState(),a=b.useRef(null),l=b.useRef(e),o=b.useRef("none"),u=e?"mounted":"unmounted",[f,m]=GO(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const h=wd(a.current);o.current=f==="mounted"?h:"none"},[f]),Su(()=>{const h=a.current,y=l.current;if(y!==e){const x=o.current,w=wd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&x!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Su(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=wd(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&j&&(m("ANIMATION_END"),!l.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=w=>{w.target===t&&(o.current=wd(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:b.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function wd(e){return(e==null?void 0:e.animationName)||"none"}function XO(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var op=0;function JO(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??q1()),document.body.insertAdjacentElement("beforeend",e[1]??q1()),op++,()=>{op===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),op--}},[])}function q1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Gr=function(){return Gr=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Gr.apply(this,arguments)};function oj(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function WO(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,o;a<l;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var Pd="right-scroll-bar-position",Bd="width-before-scroll-bar",e3="with-scroll-bars-hidden",t3="--removed-body-scroll-bar-size";function up(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function n3(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var r3=typeof window<"u"?b.useLayoutEffect:b.useEffect,H1=new WeakMap;function a3(e,t){var n=n3(null,function(a){return e.forEach(function(l){return up(l,a)})});return r3(function(){var a=H1.get(n);if(a){var l=new Set(a),o=new Set(e),u=n.current;l.forEach(function(f){o.has(f)||up(f,null)}),o.forEach(function(f){l.has(f)||up(f,u)})}H1.set(n,e)},[e]),n}function i3(e){return e}function l3(e,t){t===void 0&&(t=i3);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var u=t(o,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(o){for(a=!0;n.length;){var u=n;n=[],u.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(o),u=n}var m=function(){var y=u;u=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){u.push(y),h()},filter:function(y){return u=u.filter(y),n}}}};return l}function s3(e){e===void 0&&(e={});var t=l3(null);return t.options=Gr({async:!0,ssr:!1},e),t}var uj=function(e){var t=e.sideCar,n=oj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return b.createElement(a,Gr({},n))};uj.isSideCarExport=!0;function o3(e,t){return e.useMedium(t),uj}var cj=s3(),cp=function(){},yf=b.forwardRef(function(e,t){var n=b.useRef(null),a=b.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),l=a[0],o=a[1],u=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,C=e.allowPinchZoom,E=e.as,R=E===void 0?"div":E,z=e.gapMode,I=oj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=x,O=a3([n,t]),D=Gr(Gr({},I),l);return b.createElement(b.Fragment,null,y&&b.createElement(B,{sideCar:cj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:z}),u?b.cloneElement(b.Children.only(f),Gr(Gr({},D),{ref:O})):b.createElement(R,Gr({},D,{className:m,ref:O}),f))});yf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yf.classNames={fullWidth:Bd,zeroRight:Pd};var u3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function c3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u3();return t&&e.setAttribute("nonce",t),e}function d3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function f3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var h3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=c3())&&(d3(t,n),f3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},m3=function(){var e=h3();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dj=function(){var e=m3(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},p3={left:0,top:0,right:0,gap:0},dp=function(e){return parseInt(e||"",10)||0},g3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[dp(n),dp(a),dp(l)]},y3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return p3;var t=g3(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},v3=dj(),ws="data-scroll-locked",b3=function(e,t,n,a){var l=e.left,o=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
271
|
+
.`.concat(e3,` {
|
|
272
|
+
overflow: hidden `).concat(a,`;
|
|
273
|
+
padding-right: `).concat(f,"px ").concat(a,`;
|
|
274
|
+
}
|
|
275
|
+
body[`).concat(ws,`] {
|
|
276
|
+
overflow: hidden `).concat(a,`;
|
|
277
|
+
overscroll-behavior: contain;
|
|
278
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
279
|
+
padding-left: `.concat(l,`px;
|
|
280
|
+
padding-top: `).concat(o,`px;
|
|
281
|
+
padding-right: `).concat(u,`px;
|
|
282
|
+
margin-left:0;
|
|
283
|
+
margin-top:0;
|
|
284
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
285
|
+
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.`).concat(Pd,` {
|
|
289
|
+
right: `).concat(f,"px ").concat(a,`;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.`).concat(Bd,` {
|
|
293
|
+
margin-right: `).concat(f,"px ").concat(a,`;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.`).concat(Pd," .").concat(Pd,` {
|
|
297
|
+
right: 0 `).concat(a,`;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.`).concat(Bd," .").concat(Bd,` {
|
|
301
|
+
margin-right: 0 `).concat(a,`;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
body[`).concat(ws,`] {
|
|
305
|
+
`).concat(t3,": ").concat(f,`px;
|
|
306
|
+
}
|
|
307
|
+
`)},Z1=function(){var e=parseInt(document.body.getAttribute(ws)||"0",10);return isFinite(e)?e:0},x3=function(){b.useEffect(function(){return document.body.setAttribute(ws,(Z1()+1).toString()),function(){var e=Z1()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},w3=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;x3();var o=b.useMemo(function(){return y3(l)},[l]);return b.createElement(v3,{styles:b3(o,!t,l,n?"":"!important")})},gg=!1;if(typeof window<"u")try{var Sd=Object.defineProperty({},"passive",{get:function(){return gg=!0,!0}});window.addEventListener("test",Sd,Sd),window.removeEventListener("test",Sd,Sd)}catch{gg=!1}var cs=gg?{passive:!1}:!1,S3=function(e){return e.tagName==="TEXTAREA"},fj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!S3(e)&&n[t]==="visible")},k3=function(e){return fj(e,"overflowY")},j3=function(e){return fj(e,"overflowX")},V1=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=hj(e,a);if(l){var o=mj(e,a),u=o[1],f=o[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},C3=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},E3=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},hj=function(e,t){return e==="v"?k3(t):j3(t)},mj=function(e,t){return e==="v"?C3(t):E3(t)},N3=function(e,t){return e==="h"&&t==="rtl"?-1:1},_3=function(e,t,n,a,l){var o=N3(e,window.getComputedStyle(t).direction),u=o*a,f=n.target,m=t.contains(f),h=!1,y=u>0,g=0,x=0;do{if(!f)break;var w=mj(e,f),k=w[0],j=w[1],C=w[2],E=j-C-o*k;(k||E)&&hj(e,f)&&(g+=E,x+=k);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(h=!0),h},kd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Q1=function(e){return[e.deltaX,e.deltaY]},K1=function(e){return e&&"current"in e?e.current:e},A3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},T3=function(e){return`
|
|
308
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
309
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
310
|
+
`)},R3=0,ds=[];function z3(e){var t=b.useRef([]),n=b.useRef([0,0]),a=b.useRef(),l=b.useState(R3++)[0],o=b.useState(dj)[0],u=b.useRef(e);b.useEffect(function(){u.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=WO([e.lockRef.current],(e.shards||[]).map(K1),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=b.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var E=kd(j),R=n.current,z="deltaX"in j?j.deltaX:R[0]-E[0],I="deltaY"in j?j.deltaY:R[1]-E[1],B,O=j.target,D=Math.abs(z)>Math.abs(I)?"h":"v";if("touches"in j&&D==="h"&&O.type==="range")return!1;var U=window.getSelection(),V=U&&U.anchorNode,F=V?V===O||V.contains(O):!1;if(F)return!1;var ne=V1(D,O);if(!ne)return!0;if(ne?B=D:(B=D==="v"?"h":"v",ne=V1(D,O)),!ne)return!1;if(!a.current&&"changedTouches"in j&&(z||I)&&(a.current=B),!B)return!0;var oe=a.current||B;return _3(oe,C,j,oe==="h"?z:I)},[]),m=b.useCallback(function(j){var C=j;if(!(!ds.length||ds[ds.length-1]!==o)){var E="deltaY"in C?Q1(C):kd(C),R=t.current.filter(function(B){return B.name===C.type&&(B.target===C.target||C.target===B.shadowParent)&&A3(B.delta,E)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var z=(u.current.shards||[]).map(K1).filter(Boolean).filter(function(B){return B.contains(C.target)}),I=z.length>0?f(C,z[0]):!u.current.noIsolation;I&&C.cancelable&&C.preventDefault()}}},[]),h=b.useCallback(function(j,C,E,R){var z={name:j,delta:C,target:E,should:R,shadowParent:O3(E)};t.current.push(z),setTimeout(function(){t.current=t.current.filter(function(I){return I!==z})},1)},[]),y=b.useCallback(function(j){n.current=kd(j),a.current=void 0},[]),g=b.useCallback(function(j){h(j.type,Q1(j),j.target,f(j,e.lockRef.current))},[]),x=b.useCallback(function(j){h(j.type,kd(j),j.target,f(j,e.lockRef.current))},[]);b.useEffect(function(){return ds.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",m,cs),document.addEventListener("touchmove",m,cs),document.addEventListener("touchstart",y,cs),function(){ds=ds.filter(function(j){return j!==o}),document.removeEventListener("wheel",m,cs),document.removeEventListener("touchmove",m,cs),document.removeEventListener("touchstart",y,cs)}},[]);var w=e.removeScrollBar,k=e.inert;return b.createElement(b.Fragment,null,k?b.createElement(o,{styles:T3(l)}):null,w?b.createElement(w3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function O3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const D3=o3(cj,z3);var pj=b.forwardRef(function(e,t){return b.createElement(yf,Gr({},e,{ref:t,sideCar:D3}))});pj.classNames=yf.classNames;var M3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fs=new WeakMap,jd=new WeakMap,Cd={},fp=0,gj=function(e){return e&&(e.host||gj(e.parentNode))},I3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=gj(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},L3=function(e,t,n,a){var l=I3(t,Array.isArray(e)?e:[e]);Cd[n]||(Cd[n]=new WeakMap);var o=Cd[n],u=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(x){if(f.has(x))y(x);else try{var w=x.getAttribute(a),k=w!==null&&w!=="false",j=(fs.get(x)||0)+1,C=(o.get(x)||0)+1;fs.set(x,j),o.set(x,C),u.push(x),j===1&&k&&jd.set(x,!0),C===1&&x.setAttribute(n,"true"),k||x.setAttribute(a,"true")}catch(E){console.error("aria-hidden: cannot operate on ",x,E)}})};return y(t),f.clear(),fp++,function(){u.forEach(function(g){var x=fs.get(g)-1,w=o.get(g)-1;fs.set(g,x),o.set(g,w),x||(jd.has(g)||g.removeAttribute(a),jd.delete(g)),w||g.removeAttribute(n)}),fp--,fp||(fs=new WeakMap,fs=new WeakMap,jd=new WeakMap,Cd={})}},U3=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=M3(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),L3(a,l,n,"aria-hidden")):function(){return null}},vf="Dialog",[yj]=yO(vf),[P3,Ur]=yj(vf),vj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:u=!0}=e,f=b.useRef(null),m=b.useRef(null),[h,y]=SO({prop:a,defaultProp:l??!1,onChange:o,caller:vf});return c.jsx(P3,{scope:t,triggerRef:f,contentRef:m,contentId:ja(),titleId:ja(),descriptionId:ja(),open:h,onOpenChange:y,onOpenToggle:b.useCallback(()=>y(g=>!g),[y]),modal:u,children:n})};vj.displayName=vf;var bj="DialogTrigger",B3=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(bj,n),o=Sl(t,l.triggerRef);return c.jsx(Na.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":py(l.open),...a,ref:o,onClick:Ci(e.onClick,l.onOpenToggle)})});B3.displayName=bj;var hy="DialogPortal",[$3,xj]=yj(hy,{forceMount:void 0}),wj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Ur(hy,t);return c.jsx($3,{scope:t,forceMount:n,children:b.Children.map(a,u=>c.jsx(gf,{present:n||o.open,children:c.jsx(sj,{asChild:!0,container:l,children:u})}))})};wj.displayName=hy;var Qd="DialogOverlay",Sj=b.forwardRef((e,t)=>{const n=xj(Qd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ur(Qd,e.__scopeDialog);return o.modal?c.jsx(gf,{present:a||o.open,children:c.jsx(q3,{...l,ref:t})}):null});Sj.displayName=Qd;var F3=tj("DialogOverlay.RemoveScroll"),q3=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Qd,n);return c.jsx(pj,{as:F3,allowPinchZoom:!0,shards:[l.contentRef],children:c.jsx(Na.div,{"data-state":py(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),yl="DialogContent",kj=b.forwardRef((e,t)=>{const n=xj(yl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Ur(yl,e.__scopeDialog);return c.jsx(gf,{present:a||o.open,children:o.modal?c.jsx(H3,{...l,ref:t}):c.jsx(Z3,{...l,ref:t})})});kj.displayName=yl;var H3=b.forwardRef((e,t)=>{const n=Ur(yl,e.__scopeDialog),a=b.useRef(null),l=Sl(t,n.contentRef,a);return b.useEffect(()=>{const o=a.current;if(o)return U3(o)},[]),c.jsx(jj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ci(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ci(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&o.preventDefault()}),onFocusOutside:Ci(e.onFocusOutside,o=>o.preventDefault())})}),Z3=b.forwardRef((e,t)=>{const n=Ur(yl,e.__scopeDialog),a=b.useRef(!1),l=b.useRef(!1);return c.jsx(jj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,f;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),jj=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...u}=e,f=Ur(yl,n),m=b.useRef(null),h=Sl(t,m);return JO(),c.jsxs(c.Fragment,{children:[c.jsx(ij,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:c.jsx(rj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":py(f.open),...u,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(V3,{titleId:f.titleId}),c.jsx(K3,{contentRef:m,descriptionId:f.descriptionId})]})]})}),my="DialogTitle",Cj=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(my,n);return c.jsx(Na.h2,{id:l.titleId,...a,ref:t})});Cj.displayName=my;var Ej="DialogDescription",Nj=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(Ej,n);return c.jsx(Na.p,{id:l.descriptionId,...a,ref:t})});Nj.displayName=Ej;var _j="DialogClose",Aj=b.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Ur(_j,n);return c.jsx(Na.button,{type:"button",...a,ref:t,onClick:Ci(e.onClick,()=>l.onOpenChange(!1))})});Aj.displayName=_j;function py(e){return e?"open":"closed"}var Tj="DialogTitleWarning",[VH,Rj]=gO(Tj,{contentName:yl,titleName:my,docsSlug:"dialog"}),V3=({titleId:e})=>{const t=Rj(Tj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
311
|
+
|
|
312
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
313
|
+
|
|
314
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Q3="DialogDescriptionWarning",K3=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rj(Q3).contentName}}.`;return b.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},zj=vj,Oj=wj,Dj=Sj,Mj=kj,G3=Cj,Y3=Nj,X3=Aj,J3=Symbol.for("react.lazy"),Kd=Fg[" use ".trim().toString()];function W3(e){return typeof e=="object"&&e!==null&&"then"in e}function Ij(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===J3&&"_payload"in e&&W3(e._payload)}function Lj(e){const t=tD(e),n=b.forwardRef((a,l)=>{let{children:o,...u}=a;Ij(o)&&typeof Kd=="function"&&(o=Kd(o._payload));const f=b.Children.toArray(o),m=f.find(rD);if(m){const h=m.props.children,y=f.map(g=>g===m?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:g);return c.jsx(t,{...u,ref:l,children:b.isValidElement(h)?b.cloneElement(h,void 0,y):null})}return c.jsx(t,{...u,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var eD=Lj("Slot");function tD(e){const t=b.forwardRef((n,a)=>{let{children:l,...o}=n;if(Ij(l)&&typeof Kd=="function"&&(l=Kd(l._payload)),b.isValidElement(l)){const u=iD(l),f=aD(o,l.props);return l.type!==b.Fragment&&(f.ref=a?Ni(a,u):u),b.cloneElement(l,f)}return b.Children.count(l)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nD=Symbol("radix.slottable");function rD(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nD}function aD(e,t){const n={...t};for(const a in t){const l=e[a],o=t[a];/^on[A-Z]/.test(a)?l&&o?n[a]=(...f)=>{const m=o(...f);return l(...f),m}:l&&(n[a]=l):a==="style"?n[a]={...l,...o}:a==="className"&&(n[a]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function iD(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_a=lD.reduce((e,t)=>{const n=Lj(`Primitive.${t}`),a=b.forwardRef((l,o)=>{const{asChild:u,...f}=l,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),ru='[cmdk-group=""]',hp='[cmdk-group-items=""]',sD='[cmdk-group-heading=""]',Uj='[cmdk-item=""]',G1=`${Uj}:not([aria-disabled="true"])`,yg="cmdk-item-select",ps="data-value",oD=(e,t,n)=>pO(e,t,n),Pj=b.createContext(void 0),Zu=()=>b.useContext(Pj),Bj=b.createContext(void 0),gy=()=>b.useContext(Bj),$j=b.createContext(void 0),Fj=b.forwardRef((e,t)=>{let n=gs(()=>{var P,A;return{search:"",value:(A=(P=e.value)!=null?P:e.defaultValue)!=null?A:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=gs(()=>new Set),l=gs(()=>new Map),o=gs(()=>new Map),u=gs(()=>new Set),f=qj(e),{label:m,children:h,value:y,onValueChange:g,filter:x,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:C=!0,...E}=e,R=ja(),z=ja(),I=ja(),B=b.useRef(null),O=bD();vl(()=>{if(y!==void 0){let P=y.trim();n.current.value=P,D.emit()}},[y]),vl(()=>{O(6,Se)},[]);let D=b.useMemo(()=>({subscribe:P=>(u.current.add(P),()=>u.current.delete(P)),snapshot:()=>n.current,setState:(P,A,q)=>{var X,ue,xe,be;if(!Object.is(n.current[P],A)){if(n.current[P]=A,P==="search")oe(),F(),O(1,ne);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(I);fe?fe.focus():(X=document.getElementById(R))==null||X.focus()}if(O(7,()=>{var fe;n.current.selectedItemId=(fe=G())==null?void 0:fe.id,D.emit()}),q||O(5,Se),((ue=f.current)==null?void 0:ue.value)!==void 0){let fe=A??"";(be=(xe=f.current).onValueChange)==null||be.call(xe,fe);return}}D.emit()}},emit:()=>{u.current.forEach(P=>P())}}),[]),U=b.useMemo(()=>({value:(P,A,q)=>{var X;A!==((X=o.current.get(P))==null?void 0:X.value)&&(o.current.set(P,{value:A,keywords:q}),n.current.filtered.items.set(P,V(A,q)),O(2,()=>{F(),D.emit()}))},item:(P,A)=>(a.current.add(P),A&&(l.current.has(A)?l.current.get(A).add(P):l.current.set(A,new Set([P]))),O(3,()=>{oe(),F(),n.current.value||ne(),D.emit()}),()=>{o.current.delete(P),a.current.delete(P),n.current.filtered.items.delete(P);let q=G();O(4,()=>{oe(),(q==null?void 0:q.getAttribute("id"))===P&&ne(),D.emit()})}),group:P=>(l.current.has(P)||l.current.set(P,new Set),()=>{o.current.delete(P),l.current.delete(P)}),filter:()=>f.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>f.current.disablePointerSelection,listId:R,inputId:I,labelId:z,listInnerRef:B}),[]);function V(P,A){var q,X;let ue=(X=(q=f.current)==null?void 0:q.filter)!=null?X:oD;return P?ue(P,n.current.search,A):0}function F(){if(!n.current.search||f.current.shouldFilter===!1)return;let P=n.current.filtered.items,A=[];n.current.filtered.groups.forEach(X=>{let ue=l.current.get(X),xe=0;ue.forEach(be=>{let fe=P.get(be);xe=Math.max(fe,xe)}),A.push([X,xe])});let q=B.current;W().sort((X,ue)=>{var xe,be;let fe=X.getAttribute("id"),ee=ue.getAttribute("id");return((xe=P.get(ee))!=null?xe:0)-((be=P.get(fe))!=null?be:0)}).forEach(X=>{let ue=X.closest(hp);ue?ue.appendChild(X.parentElement===ue?X:X.closest(`${hp} > *`)):q.appendChild(X.parentElement===q?X:X.closest(`${hp} > *`))}),A.sort((X,ue)=>ue[1]-X[1]).forEach(X=>{var ue;let xe=(ue=B.current)==null?void 0:ue.querySelector(`${ru}[${ps}="${encodeURIComponent(X[0])}"]`);xe==null||xe.parentElement.appendChild(xe)})}function ne(){let P=W().find(q=>q.getAttribute("aria-disabled")!=="true"),A=P==null?void 0:P.getAttribute(ps);D.setState("value",A||void 0)}function oe(){var P,A,q,X;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let xe of a.current){let be=(A=(P=o.current.get(xe))==null?void 0:P.value)!=null?A:"",fe=(X=(q=o.current.get(xe))==null?void 0:q.keywords)!=null?X:[],ee=V(be,fe);n.current.filtered.items.set(xe,ee),ee>0&&ue++}for(let[xe,be]of l.current)for(let fe of be)if(n.current.filtered.items.get(fe)>0){n.current.filtered.groups.add(xe);break}n.current.filtered.count=ue}function Se(){var P,A,q;let X=G();X&&(((P=X.parentElement)==null?void 0:P.firstChild)===X&&((q=(A=X.closest(ru))==null?void 0:A.querySelector(sD))==null||q.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function G(){var P;return(P=B.current)==null?void 0:P.querySelector(`${Uj}[aria-selected="true"]`)}function W(){var P;return Array.from(((P=B.current)==null?void 0:P.querySelectorAll(G1))||[])}function Z(P){let A=W()[P];A&&D.setState("value",A.getAttribute(ps))}function re(P){var A;let q=G(),X=W(),ue=X.findIndex(be=>be===q),xe=X[ue+P];(A=f.current)!=null&&A.loop&&(xe=ue+P<0?X[X.length-1]:ue+P===X.length?X[0]:X[ue+P]),xe&&D.setState("value",xe.getAttribute(ps))}function ve(P){let A=G(),q=A==null?void 0:A.closest(ru),X;for(;q&&!X;)q=P>0?yD(q,ru):vD(q,ru),X=q==null?void 0:q.querySelector(G1);X?D.setState("value",X.getAttribute(ps)):re(P)}let Re=()=>Z(W().length-1),_=P=>{P.preventDefault(),P.metaKey?Re():P.altKey?ve(1):re(1)},L=P=>{P.preventDefault(),P.metaKey?Z(0):P.altKey?ve(-1):re(-1)};return b.createElement(_a.div,{ref:t,tabIndex:-1,...E,"cmdk-root":"",onKeyDown:P=>{var A;(A=E.onKeyDown)==null||A.call(E,P);let q=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||q))switch(P.key){case"n":case"j":{C&&P.ctrlKey&&_(P);break}case"ArrowDown":{_(P);break}case"p":case"k":{C&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),Z(0);break}case"End":{P.preventDefault(),Re();break}case"Enter":{P.preventDefault();let X=G();if(X){let ue=new Event(yg);X.dispatchEvent(ue)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:wD},m),bf(e,P=>b.createElement(Bj.Provider,{value:D},b.createElement(Pj.Provider,{value:U},P))))}),uD=b.forwardRef((e,t)=>{var n,a;let l=ja(),o=b.useRef(null),u=b.useContext($j),f=Zu(),m=qj(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:u==null?void 0:u.forceMount;vl(()=>{if(!h)return f.item(l,u==null?void 0:u.id)},[h]);let y=Hj(l,o,[e.value,e.children,o],e.keywords),g=gy(),x=_i(O=>O.value&&O.value===y.current),w=_i(O=>h||f.filter()===!1?!0:O.search?O.filtered.items.get(l)>0:!0);b.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(yg,k),()=>O.removeEventListener(yg,k)},[w,e.onSelect,e.disabled]);function k(){var O,D;j(),(D=(O=m.current).onSelect)==null||D.call(O,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:C,value:E,onSelect:R,forceMount:z,keywords:I,...B}=e;return b.createElement(_a.div,{ref:Ni(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!x,"data-disabled":!!C,"data-selected":!!x,onPointerMove:C||f.getDisablePointerSelection()?void 0:j,onClick:C?void 0:k},e.children)}),cD=b.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,u=ja(),f=b.useRef(null),m=b.useRef(null),h=ja(),y=Zu(),g=_i(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(u):!0);vl(()=>y.group(u),[]),Hj(u,f,[e.value,e.heading,m]);let x=b.useMemo(()=>({id:u,forceMount:l}),[l]);return b.createElement(_a.div,{ref:Ni(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&b.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),bf(e,w=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},b.createElement($j.Provider,{value:x},w))))}),dD=b.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=b.useRef(null),o=_i(u=>!u.search);return!n&&!o?null:b.createElement(_a.div,{ref:Ni(l,t),...a,"cmdk-separator":"",role:"separator"})}),fD=b.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=gy(),u=_i(h=>h.search),f=_i(h=>h.selectedItemId),m=Zu();return b.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),b.createElement(_a.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:u,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),hD=b.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=b.useRef(null),u=b.useRef(null),f=_i(h=>h.selectedItemId),m=Zu();return b.useEffect(()=>{if(u.current&&o.current){let h=u.current,y=o.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(g),x.unobserve(h)}}},[]),b.createElement(_a.div,{ref:Ni(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},bf(e,h=>b.createElement("div",{ref:Ni(u,m.listInnerRef),"cmdk-list-sizer":""},h)))}),mD=b.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:u,...f}=e;return b.createElement(zj,{open:n,onOpenChange:a},b.createElement(Oj,{container:u},b.createElement(Dj,{"cmdk-overlay":"",className:l}),b.createElement(Mj,{"aria-label":e.label,"cmdk-dialog":"",className:o},b.createElement(Fj,{ref:t,...f}))))}),pD=b.forwardRef((e,t)=>_i(n=>n.filtered.count===0)?b.createElement(_a.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),gD=b.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return b.createElement(_a.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},bf(e,u=>b.createElement("div",{"aria-hidden":!0},u)))}),Qn=Object.assign(Fj,{List:hD,Item:uD,Input:fD,Group:cD,Separator:dD,Dialog:mD,Empty:pD,Loading:gD});function yD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function vD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function qj(e){let t=b.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?b.useEffect:b.useLayoutEffect;function gs(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function _i(e){let t=gy(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function Hj(e,t,n,a=[]){let l=b.useRef(),o=Zu();return vl(()=>{var u;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(u=t.current)==null||u.setAttribute(ps,f),l.current=f}),l}var bD=()=>{let[e,t]=b.useState(),n=gs(()=>new Map);return vl(()=>{n.current.forEach(a=>a()),n.current=new Map},[e]),(a,l)=>{n.current.set(a,l),t({})}};function xD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function bf({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(xD(t),{ref:t.ref},n(t.props.children)):n(t)}var wD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const nn=zj,SD=Oj,Zj=b.forwardRef(({className:e,...t},n)=>c.jsx(Dj,{ref:n,className:Te("fixed inset-0 z-50 bg-overlay-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Zj.displayName="DialogOverlay";const Jt=b.forwardRef(({className:e,children:t,...n},a)=>c.jsxs(SD,{children:[c.jsx(Zj,{}),c.jsxs(Mj,{ref:a,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,c.jsxs(X3,{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:[c.jsx(wu,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jt.displayName="DialogContent";function cn({className:e,...t}){return c.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function zn({className:e,...t}){return c.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const rn=b.forwardRef(({className:e,...t},n)=>c.jsx(G3,{ref:n,className:Te("text-subtitle leading-none tracking-tight",e),...t}));rn.displayName="DialogTitle";const yy=b.forwardRef(({className:e,...t},n)=>c.jsx(Y3,{ref:n,className:Te("text-body text-muted-foreground",e),...t}));yy.displayName="DialogDescription";const Vj=b.forwardRef(({className:e,...t},n)=>c.jsx(Qn,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Vj.displayName=Qn.displayName;function kD({open:e,onOpenChange:t,children:n}){return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsx(Jt,{className:"overflow-hidden p-0 shadow-lg",children:c.jsx(Vj,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})})}const Qj=b.forwardRef(({className:e,...t},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(sy,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Qn.Input,{ref:n,className:Te("flex h-11 w-full rounded-md bg-transparent py-3 text-body outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Qj.displayName=Qn.Input.displayName;const Kj=b.forwardRef(({className:e,...t},n)=>c.jsx(Qn.List,{ref:n,className:Te("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));Kj.displayName=Qn.List.displayName;const Gj=b.forwardRef((e,t)=>c.jsx(Qn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));Gj.displayName=Qn.Empty.displayName;const $d=b.forwardRef(({className:e,...t},n)=>c.jsx(Qn.Group,{ref:n,className:Te("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-caption [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));$d.displayName=Qn.Group.displayName;const vg=b.forwardRef(({className:e,...t},n)=>c.jsx(Qn.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));vg.displayName=Qn.Separator.displayName;const Fd=b.forwardRef(({className:e,...t},n)=>c.jsx(Qn.Item,{ref:n,className:Te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));Fd.displayName=Qn.Item.displayName;function Vu(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.type&&t.set("type",e.type);const n=t.toString();return Ne.get(an(`/agents${n?`?${n}`:""}`))}function Yj(){return Ne.get("/me/managed-agents")}function jD(e){return Ne.get(`/agents/${encodeURIComponent(e)}`)}function CD(e){return Ne.post(an("/agents"),e)}function ED(e){return Ne.get(an(`/agents/names/${encodeURIComponent(e)}/availability`))}function Y1(e,t){return Ne.patch(`/agents/${encodeURIComponent(e)}`,t)}function ND(e,t){return Ne.patch(`/agents/${encodeURIComponent(e)}/rebind`,t)}function _D(e){return Ne.delete(`/agents/${encodeURIComponent(e)}`)}function AD(e){return Ne.post(`/agents/${encodeURIComponent(e)}/suspend`,{})}function TD(e){return Ne.post(`/agents/${encodeURIComponent(e)}/reactivate`,{})}function RD(e){return Ne.post(`/agents/${encodeURIComponent(e)}/test`,{})}function xf(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Vu({limit:100}),staleTime:3e4}),{data:t}=Ve({queryKey:["managed-agents","name-map"],queryFn:Yj,staleTime:3e4});return b.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,a.displayName);if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,a.displayName);return a=>a?n.get(a)??a:"—"},[e,t])}function vy(){const{data:e}=Ve({queryKey:["agents","name-map"],queryFn:()=>Vu({limit:100}),staleTime:3e4}),{data:t}=Ve({queryKey:["managed-agents","name-map"],queryFn:Yj,staleTime:3e4});return b.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,{name:a.name,displayName:a.displayName});if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,{name:a.name,displayName:a.displayName});return a=>a?n.get(a)??null:null},[e,t])}const zD=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function OD({open:e,onOpenChange:t}){const n=On(),a=xf(),{data:l}=Ve({queryKey:["activity"],queryFn:Hu,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=Ve({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await Wk(y.agentId);for(const x of g)h.push({agentId:y.agentId,session:x})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return c.jsxs(kD,{open:e,onOpenChange:t,children:[c.jsx(Qj,{placeholder:"Jump to agent, chat, or page…"}),c.jsxs(Kj,{children:[c.jsx(Gj,{children:"No results"}),o.length>0&&c.jsx($d,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return c.jsxs(Fd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[c.jsx(kR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"flex-1 truncate",children:y}),c.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(vg,{}),c.jsx($d,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return c.jsxs(Fd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[c.jsx(ly,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{className:"flex-1 truncate",children:g}),c.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),c.jsx(vg,{}),c.jsx($d,{heading:"Pages",children:zD.map(h=>c.jsxs(Fd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[c.jsx(LR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),c.jsx("span",{children:h.label})]},h.path))})]})]})}function DD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function MD(){var a;const{user:e}=zt(),{data:t}=Ve({queryKey:["clients"],queryFn:Ei,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=DD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const ID=160;function LD(){const e=On(),{rows:t,firstHostname:n}=MD();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return c.jsxs("button",{type:"button",onClick:()=>e("/settings/computers"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[c.jsx(UD,{}),a?c.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[c.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):c.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[c.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:ID,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),c.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function UD(){return c.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),c.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function Qu(e){return c.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[c.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),c.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),c.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),c.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),c.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),c.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),c.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),c.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),c.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),c.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function X1(e){const t=new URLSearchParams;e!=null&&e.limit&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.severity&&t.set("severity",e.severity),(e==null?void 0:e.read)!==void 0&&t.set("read",String(e.read)),e!=null&&e.agentId&&t.set("agentId",e.agentId);const n=t.toString();return Ne.get(an(`/notifications${n?`?${n}`:""}`))}function PD(e){return Ne.post(an(`/notifications/${e}/read`))}function BD(){return Ne.post(an("/notifications/read-all"))}const $D={agent_error:"Error",session_error:"Error",agent_blocked:"Blocked",agent_stale:"Stale",agent_disconnected:"Disconnected",agent_connected:"Connected",agent_needs_decision:"Decision",session_completed:"Completed"};function FD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function qD({notification:e,onClick:t,clickable:n}){const a=($D[e.type]??e.type).toString(),l=FD(e.severity),o=n??!0;return c.jsxs("button",{type:"button",onClick:t,className:Te("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:u=>{o&&(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{u.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[c.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[c.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:gl(e.createdAt)})]}),c.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function HD(){var w;const[e,t]=b.useState(!1),[n,a]=b.useState(null),l=b.useRef(null),o=On(),u=dn(),{data:f}=Ve({queryKey:["notifications","bell"],queryFn:()=>X1({limit:8}),refetchInterval:1e4}),{data:m}=Ve({queryKey:["notifications","unread-count"],queryFn:()=>X1({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=b.useCallback(async k=>{k.read||(PD(k.id).catch(()=>{}),u.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,u]),x=b.useCallback(async()=>{a(null);try{await BD(),await u.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[u]);return c.jsxs("div",{className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[c.jsx(wR,{className:"h-4 w-4"}),y&&c.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),c.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[c.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&c.jsx("button",{type:"button",onClick:x,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&c.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),c.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?c.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>c.jsx(qD,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function ZD(){if(typeof window>"u")return"light";const e=window.localStorage.getItem("theme");return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function VD(){const[e,t]=b.useState(ZD);return b.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),c.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?c.jsx(ez,{className:"h-4 w-4"}):c.jsx(VR,{className:"h-4 w-4"})})}function QD(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function J1({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?c.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):c.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:c.jsx("span",{className:"text-subtitle font-semibold",children:QD(t)})})}const W1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ew=Uk,KD=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return ew(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,u=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const x=W1(y)||W1(g);return l[h][x]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,x]=y;return x===void 0||(h[g]=x),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:x,...w}=y;return Object.entries(w).every(k=>{let[j,C]=k;return Array.isArray(C)?C.includes({...o,...f}[j]):{...o,...f}[j]===C})?[...h,g,x]:h},[]);return ew(e,u,m,n==null?void 0:n.class,n==null?void 0:n.className)},GD=KD("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ge=b.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const u=a?eD:"button";return c.jsx(u,{className:Te(GD({variant:t,size:n,className:e})),ref:o,...l})});ge.displayName="Button";const _t=b.forwardRef(({className:e,type:t,...n},a)=>c.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));_t.displayName="Input";function YD({action:e,onClose:t}){const n=e!==null;return c.jsx(nn,{open:n,onOpenChange:a=>!a&&t(),children:c.jsxs(Jt,{children:[c.jsxs(cn,{children:[c.jsx(rn,{children:e==="join"?"Join a team":"Create a new team"}),c.jsx(yy,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&c.jsx(JD,{onDone:t}),e==="join"&&c.jsx(WD,{onDone:t})]})})}function XD(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function JD({onDone:e}){const{adoptTokens:t}=zt(),n=On(),[a,l]=b.useState(""),[o,u]=b.useState(null),[f,m]=b.useState(!1);b.useEffect(()=>{l(""),u(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),u(null);try{const x=await Ne.post("/me/organizations",{name:XD(g),displayName:g});await t(x.tokens),e(),n("/",{replace:!0})}catch(x){u(x instanceof Error?x.message:"Failed to create team")}finally{m(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(_t,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),c.jsx(ge,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function WD({onDone:e}){const{adoptTokens:t}=zt(),n=On(),[a,l]=b.useState(""),[o,u]=b.useState(null),[f,m]=b.useState(!1);b.useEffect(()=>{l(""),u(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),u(null);try{const g=a.trim(),x=/\/invite\/([^/?#]+)/.exec(g),w=(x==null?void 0:x[1])??g,k=await Ne.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){u(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return c.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),c.jsx(_t,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),c.jsx(ge,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function eM(){var B,O;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:l}=zt(),o=On(),[u,f]=b.useState([]),[m,h]=b.useState(!1),[y,g]=b.useState(null),x=b.useRef(null);b.useEffect(()=>{(async()=>{try{const D=await Ne.get("/me/organizations");f(D)}catch{}})()},[]),b.useEffect(()=>{const D=V=>{m&&x.current&&!x.current.contains(V.target)&&h(!1)},U=V=>{m&&V.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",D),window.addEventListener("keydown",U),()=>{window.removeEventListener("mousedown",D),window.removeEventListener("keydown",U)}},[m]);const w=(n==null?void 0:n.displayName)??"User",k=(n==null?void 0:n.username)??"",j=(n==null?void 0:n.avatarUrl)??null,C=u.find(D=>D.id===e)??null,E=(C==null?void 0:C.role)??(t==="admin"||t==="member"?t:null),R=async D=>{if(D===e){h(!1);return}try{await a(D),h(!1),o("/",{replace:!0})}catch{}},z=()=>{h(!1),g("create")},I=()=>{h(!1),g("join")};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{ref:x,className:"relative","data-testid":"user-menu",children:[c.jsx("button",{type:"button","aria-label":`User menu, ${w}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h(D=>!D),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:m?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:c.jsx(J1,{src:j,name:w,size:28})}),m&&c.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[c.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[c.jsx(J1,{src:j,name:w,size:32}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:w}),k&&k!==w&&c.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",k]})]})]}),u.length>0&&c.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[c.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Current team"}),u.length===1?c.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[c.jsx("span",{style:{width:14,display:"inline-flex"},children:c.jsx(Mr,{className:"h-3.5 w-3.5"})}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:(B=u[0])==null?void 0:B.displayName}),c.jsx(tw,{role:((O=u[0])==null?void 0:O.role)??E})]}):c.jsx("div",{children:u.map(D=>c.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void R(D.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[c.jsx("span",{style:{width:14,display:"inline-flex"},children:D.id===e?c.jsx(Mr,{className:"h-3.5 w-3.5"}):null}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:D.displayName}),c.jsx(tw,{role:D.role})]},D.id))})]}),c.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[c.jsxs("button",{type:"button",role:"menuitem",onClick:z,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[c.jsx(Ir,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Create new team"})]}),c.jsxs("button",{type:"button",role:"menuitem",onClick:I,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[c.jsx(Ik,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Join with invite link"})]})]}),c.jsx("div",{className:"py-1",children:c.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),l()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[c.jsx(qR,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Sign out"})]})})]})]}),c.jsx(YD,{action:y,onClose:()=>g(null)})]})}function tw({role:e}){return e!=="admin"&&e!=="member"?null:c.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:e==="admin"?"var(--accent-dim)":"var(--fg-3)",border:"var(--hairline) solid var(--border)",background:e==="admin"?"var(--accent-bg)":"var(--bg-sunken)"},children:e})}const tM=[{to:"/",label:"Workspace",end:!0,kbd:"⌘1"},{to:"/context",label:"Context",end:!1,kbd:"⌘2"},{to:"/team",label:"Team",end:!1,kbd:"⌘3"},{to:"/settings",label:"Settings",end:!1,kbd:"⌘4"}];function nM(){const[e,t]=b.useState(!1),n=Vn(),a=n.pathname==="/"||n.search.includes("a=");return b.useEffect(()=>{const l=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),t(u=>!u))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),c.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[c.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[c.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[c.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[c.jsx(Qu,{width:16,height:18,style:{color:"var(--fg)"}}),c.jsx("span",{className:"text-title",style:{color:"var(--fg)"},children:"First Tree"})]}),c.jsx(LD,{})]}),c.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:tM.map(l=>c.jsx(hf,{to:l.to,end:l.end,style:{pointerEvents:"auto"},className:({isActive:o})=>Te("inline-flex items-center transition-colors",o?"":"hover:text-[var(--fg)]"),children:({isActive:o})=>c.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:o?"var(--fg)":"var(--fg-3)",background:o?"var(--bg-hover)":"transparent"},children:[l.label,o&&c.jsx("span",{className:"kbd",children:l.kbd})]})},l.to))}),c.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[c.jsxs("button",{type:"button",onClick:()=>t(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--fg)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--fg-3)"},children:[c.jsx(sy,{className:"h-4 w-4"}),c.jsx("span",{children:"Jump to…"}),c.jsx("span",{className:"kbd",children:"⌘K"})]}),c.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),c.jsx(HD,{}),c.jsx(VD,{}),c.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),c.jsx(eM,{})]})]}),c.jsx(OD,{open:e,onOpenChange:t}),a?c.jsx(Ps,{}):c.jsx("main",{className:"flex-1 overflow-auto",children:c.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:c.jsx(Ps,{})})})]})}function se(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=u.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const x=y[g];x in f||(f[x]=h[x].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function u(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}class Ss extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jj={};function Ai(e){return Jj}function Wj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,l])=>t.indexOf(+a)===-1).map(([a,l])=>l)}function bg(e,t){return typeof t=="bigint"?t.toString():t}function wf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function by(e){return e==null}function xy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function rM(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,u=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return u%f/10**o}const nw=Symbol("evaluating");function ht(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==nw)return a===void 0&&(a=nw,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function kl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function zi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function rw(e){return JSON.stringify(e)}function aM(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ju(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const iM=wf(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function $s(e){if(ju(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ju(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tC(e){return $s(e)?{...e}:Array.isArray(e)?[...e]:e}const lM=new Set(["string","number","symbol"]);function Fs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function ze(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function sM(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const oM={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 uM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=zi(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return kl(this,"shape",u),u},checks:[]});return Oi(e,o)}function cM(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=zi(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return kl(this,"shape",u),u},checks:[]});return Oi(e,o)}function dM(e,t){if(!$s(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const u in t)if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=zi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return kl(this,"shape",o),o}});return Oi(e,l)}function fM(e,t){if(!$s(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return kl(this,"shape",a),a}});return Oi(e,n)}function hM(e,t){const n=zi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return kl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Oi(e,n)}function mM(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=zi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return kl(this,"shape",m),m},checks:[]});return Oi(t,u)}function pM(e,t,n){const a=zi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const u in n){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(o[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)o[u]=new e({type:"nonoptional",innerType:l[u]});return kl(this,"shape",o),o}});return Oi(t,a)}function vs(e,t=0){var n;if(e.aborted===!0)return!0;for(let a=t;a<e.issues.length;a++)if(((n=e.issues[a])==null?void 0:n.continue)!==!0)return!0;return!1}function bs(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Ed(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ti(e,t,n){var l,o,u,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Ed((u=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:u.call(o,e))??Ed((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Ed((m=n.customError)==null?void 0:m.call(n,e))??Ed((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";a.message=y}return delete a.inst,delete a.continue,t!=null&&t.reportInput||delete a.input,a}function wy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Cu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const nC=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,bg,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},rC=se("$ZodError",nC),aC=se("$ZodError",nC,{Parent:Error});function gM(e,t=n=>n.message){const n={},a=[];for(const l of e.issues)l.path.length>0?(n[l.path[0]]=n[l.path[0]]||[],n[l.path[0]].push(t(l))):a.push(t(l));return{formErrors:a,fieldErrors:n}}function yM(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(u=>a({issues:u}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let u=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(o))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),n}const Sy=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise)throw new Ss;if(u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ti(m,o,Ai())));throw eC(f,l==null?void 0:l.callee),f}return u.value},ky=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},o);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new((l==null?void 0:l.Err)??e)(u.issues.map(m=>Ti(m,o,Ai())));throw eC(f,l==null?void 0:l.callee),f}return u.value},Sf=e=>(t,n,a)=>{const l=a?{...a,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},l);if(o instanceof Promise)throw new Ss;return o.issues.length?{success:!1,error:new(e??rC)(o.issues.map(u=>Ti(u,l,Ai())))}:{success:!0,data:o.value}},vM=Sf(aC),kf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(u=>Ti(u,l,Ai())))}:{success:!0,data:o.value}},bM=kf(aC),xM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sy(e)(t,n,l)},wM=e=>(t,n,a)=>Sy(e)(t,n,a),SM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ky(e)(t,n,l)},kM=e=>async(t,n,a)=>ky(e)(t,n,a),jM=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Sf(e)(t,n,l)},CM=e=>(t,n,a)=>Sf(e)(t,n,a),EM=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kf(e)(t,n,l)},NM=e=>async(t,n,a)=>kf(e)(t,n,a),_M=/^[cC][^\s-]{8,}$/,AM=/^[0-9a-z]+$/,TM=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,RM=/^[0-9a-vA-V]{20}$/,zM=/^[A-Za-z0-9]{27}$/,OM=/^[a-zA-Z0-9_-]{21}$/,DM=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,MM=/^([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})$/,aw=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,IM=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function UM(){return new RegExp(LM,"u")}const PM=/^(?:(?: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])$/,BM=/^(([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}|:))$/,$M=/^((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])$/,FM=/^(([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])$/,qM=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iC=/^[A-Za-z0-9_-]*$/,HM=/^\+[1-9]\d{6,14}$/,lC="(?:(?:\\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])))",ZM=new RegExp(`^${lC}$`);function sC(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function VM(e){return new RegExp(`^${sC(e)}$`)}function QM(e){const t=sC({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${lC}T(?:${a})$`)}const KM=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},GM=/^-?\d+$/,oC=/^-?\d+(?:\.\d+)?$/,YM=/^(?:true|false)$/i,XM=/^[^A-Z]*$/,JM=/^[^a-z]*$/,Kn=se("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uC={number:"number",bigint:"bigint",object:"date"},cC=se("$ZodCheckLessThan",(e,t)=>{Kn.init(e,t);const n=uC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),dC=se("$ZodCheckGreaterThan",(e,t)=>{Kn.init(e,t);const n=uC[typeof t.value];e._zod.onattach.push(a=>{const l=a._zod.bag,o=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),WM=se("$ZodCheckMultipleOf",(e,t)=>{Kn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):rM(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),e4=se("$ZodCheckNumberFormat",(e,t)=>{var u;Kn.init(e,t),t.format=t.format||"float64";const n=(u=t.format)==null?void 0:u.includes("int"),a=n?"int":"number",[l,o]=oM[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=l,m.maximum=o,n&&(m.pattern=GM)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<l&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),m>o&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),t4=se("$ZodCheckMaxLength",(e,t)=>{var n;Kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const u=wy(l);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),n4=se("$ZodCheckMinLength",(e,t)=>{var n;Kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const u=wy(l);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),r4=se("$ZodCheckLengthEquals",(e,t)=>{var n;Kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!by(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const u=wy(l),f=o>t.length;a.issues.push({origin:u,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),jf=se("$ZodCheckStringFormat",(e,t)=>{var n,a;Kn.init(e,t),e._zod.onattach.push(l=>{const o=l._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),a4=se("$ZodCheckRegex",(e,t)=>{jf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),i4=se("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=XM),jf.init(e,t)}),l4=se("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=JM),jf.init(e,t)}),s4=se("$ZodCheckIncludes",(e,t)=>{Kn.init(e,t);const n=Fs(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(l=>{const o=l._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(a)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),o4=se("$ZodCheckStartsWith",(e,t)=>{Kn.init(e,t);const n=new RegExp(`^${Fs(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),u4=se("$ZodCheckEndsWith",(e,t)=>{Kn.init(e,t);const n=new RegExp(`.*${Fs(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const l=a._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),c4=se("$ZodCheckOverwrite",(e,t)=>{Kn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class d4{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
315
|
+
`).filter(u=>u),l=Math.min(...a.map(u=>u.length-u.trimStart().length)),o=a.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of o)this.content.push(u)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
|
|
316
|
+
`))}}const f4={major:4,minor:3,patch:6},Dt=se("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=f4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const u of o._zod.onattach)u(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=vs(f),g;for(const x of m){if(x._zod.def.when){if(!x._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=x._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Ss;if(g||k instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await k,f.issues.length!==w&&(y||(y=vs(f,w)))});else{if(f.issues.length===w)continue;y||(y=vs(f,w))}}return g?g.then(()=>f):f},u=(f,m,h)=>{if(vs(f))return f.aborted=!0,f;const y=o(m,a,h);if(y instanceof Promise){if(h.async===!1)throw new Ss;return y.then(g=>e._zod.parse(g,h))}return e._zod.parse(y,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const y=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return y instanceof Promise?y.then(g=>u(g,f,m)):u(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Ss;return h.then(y=>o(y,a,m))}return o(h,a,m)}}ht(e,"~standard",()=>({validate:o=>{var u;try{const f=vM(e,o);return f.success?{value:f.data}:{issues:(u=f.error)==null?void 0:u.issues}}catch{return bM(e,o).then(m=>{var h;return m.success?{value:m.data}:{issues:(h=m.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),jy=se("$ZodString",(e,t)=>{var n;Dt.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??KM(e._zod.bag),e._zod.parse=(a,l)=>{if(t.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Ot=se("$ZodStringFormat",(e,t)=>{jf.init(e,t),jy.init(e,t)}),h4=se("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=MM),Ot.init(e,t)}),m4=se("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=aw(a))}else t.pattern??(t.pattern=aw());Ot.init(e,t)}),p4=se("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=IM),Ot.init(e,t)}),g4=se("$ZodURL",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),l=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=l.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),y4=se("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=UM()),Ot.init(e,t)}),v4=se("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=OM),Ot.init(e,t)}),b4=se("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_M),Ot.init(e,t)}),x4=se("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=AM),Ot.init(e,t)}),w4=se("$ZodULID",(e,t)=>{t.pattern??(t.pattern=TM),Ot.init(e,t)}),S4=se("$ZodXID",(e,t)=>{t.pattern??(t.pattern=RM),Ot.init(e,t)}),k4=se("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=zM),Ot.init(e,t)}),j4=se("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=QM(t)),Ot.init(e,t)}),C4=se("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ZM),Ot.init(e,t)}),E4=se("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=VM(t)),Ot.init(e,t)}),N4=se("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=DM),Ot.init(e,t)}),_4=se("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=PM),Ot.init(e,t),e._zod.bag.format="ipv4"}),A4=se("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=BM),Ot.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),T4=se("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=$M),Ot.init(e,t)}),R4=se("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=FM),Ot.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const u=Number(o);if(`${u}`!==o)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const z4=se("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qM),Ot.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function O4(e){if(!iC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fC(n)}const D4=se("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iC),Ot.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{O4(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),M4=se("$ZodE164",(e,t)=>{t.pattern??(t.pattern=HM),Ot.init(e,t)});function I4(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const l=JSON.parse(atob(a));return!("typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const L4=se("$ZodJWT",(e,t)=>{Ot.init(e,t),e._zod.check=n=>{I4(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hC=se("$ZodNumber",(e,t)=>{Dt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oC,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const l=n.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return n;const o=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...o?{received:o}:{}}),n}}),U4=se("$ZodNumberFormat",(e,t)=>{e4.init(e,t),hC.init(e,t)}),P4=se("$ZodBoolean",(e,t)=>{Dt.init(e,t),e._zod.pattern=YM,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const l=n.value;return typeof l=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),n}}),B4=se("$ZodUnknown",(e,t)=>{Dt.init(e,t),e._zod.parse=n=>n}),$4=se("$ZodNever",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function iw(e,t,n){e.issues.length&&t.issues.push(...bs(n,e.issues)),t.value[n]=e.value}const F4=se("$ZodArray",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let u=0;u<l.length;u++){const f=l[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>iw(h,n,u))):iw(m,n,u)}return o.length?Promise.all(o).then(()=>n):n}});function Gd(e,t,n,a,l){if(e.issues.length){if(l&&!(n in a))return;t.issues.push(...bs(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function mC(e){var a,l,o,u;const t=Object.keys(e.shape);for(const f of t)if(!((u=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&u.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=sM(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function pC(e,t,n,a,l,o){const u=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){u.push(g);continue}const x=m.run({value:t[g],issues:[]},a);x instanceof Promise?e.push(x.then(w=>Gd(w,n,g,t,y))):Gd(x,n,g,t,y)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const q4=se("$ZodObject",(e,t)=>{Dt.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=wf(()=>mC(t));ht(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=ju,o=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const y=[],g=u.shape;for(const x of u.keys){const w=g[x],k=w._zod.optout==="optional",j=w._zod.run({value:h[x],issues:[]},m);j instanceof Promise?y.push(j.then(C=>Gd(C,f,x,h,k))):Gd(j,f,x,h,k)}return o?pC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),H4=se("$ZodObjectJIT",(e,t)=>{q4.init(e,t);const n=e._zod.parse,a=wf(()=>mC(t)),l=x=>{var z;const w=new d4(["shape","payload","ctx"]),k=a.value,j=I=>{const B=rw(I);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};w.write("const input = payload.value;");const C=Object.create(null);let E=0;for(const I of k.keys)C[I]=`key_${E++}`;w.write("const newResult = {};");for(const I of k.keys){const B=C[I],O=rw(I),D=x[I],U=((z=D==null?void 0:D._zod)==null?void 0:z.optout)==="optional";w.write(`const ${B} = ${j(I)};`),U?w.write(`
|
|
317
|
+
if (${B}.issues.length) {
|
|
318
|
+
if (${O} in input) {
|
|
319
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
320
|
+
...iss,
|
|
321
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
322
|
+
})));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (${B}.value === undefined) {
|
|
327
|
+
if (${O} in input) {
|
|
328
|
+
newResult[${O}] = undefined;
|
|
329
|
+
}
|
|
330
|
+
} else {
|
|
331
|
+
newResult[${O}] = ${B}.value;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
`):w.write(`
|
|
335
|
+
if (${B}.issues.length) {
|
|
336
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
337
|
+
...iss,
|
|
338
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
339
|
+
})));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (${B}.value === undefined) {
|
|
343
|
+
if (${O} in input) {
|
|
344
|
+
newResult[${O}] = undefined;
|
|
345
|
+
}
|
|
346
|
+
} else {
|
|
347
|
+
newResult[${O}] = ${B}.value;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
`)}w.write("payload.value = newResult;"),w.write("return payload;");const R=w.compile();return(I,B)=>R(x,I,B)};let o;const u=ju,f=!Jj.jitless,h=f&&iM.value,y=t.catchall;let g;e._zod.parse=(x,w)=>{g??(g=a.value);const k=x.value;return u(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),x=o(x,w),y?pC([],k,x,w,g,e):x):n(x,w):(x.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),x)}});function lw(e,t,n,a){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const l=e.filter(o=>!vs(o));return l.length===1?(t.value=l[0].value,l[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(u=>Ti(u,a,Ai())))}),t)}const gC=se("$ZodUnion",(e,t)=>{Dt.init(e,t),ht(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),ht(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ht(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),ht(e._zod,"pattern",()=>{if(t.options.every(l=>l._zod.pattern)){const l=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${l.map(o=>xy(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let u=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),u=!0;else{if(h.issues.length===0)return h;f.push(h)}}return u?Promise.all(f).then(m=>lw(m,l,e,o)):lw(f,l,e,o)}}),Z4=se("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gC.init(e,t);const n=e._zod.parse;ht(e._zod,"propValues",()=>{const l={};for(const o of t.options){const u=o._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(u)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=wf(()=>{var u;const l=t.options,o=new Map;for(const f of l){const m=(u=f._zod.propValues)==null?void 0:u[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const u=l.value;if(!ju(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=a.value.get(u==null?void 0:u[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),l)}}),V4=se("$ZodIntersection",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),u=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||u instanceof Promise?Promise.all([o,u]).then(([m,h])=>sw(n,m,h)):sw(n,o,u)}});function xg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($s(e)&&$s(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const u=xg(e[o],t[o]);if(!u.valid)return{valid:!1,mergeErrorPath:[o,...u.mergeErrorPath]};l[o]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],u=xg(l,o);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function sw(e,t,n){const a=new Map;let l;for(const f of t.issues)if(f.code==="unrecognized_keys"){l??(l=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const o=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(o.length&&l&&e.issues.push({...l,keys:o}),vs(e))return e;const u=xg(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const Q4=se("$ZodRecord",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!$s(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],u=t.keyType._zod.values;if(u){n.value={};const f=new Set;for(const h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...bs(h,g.issues)),n.value[h]=g.value})):(y.issues.length&&n.issues.push(...bs(h,y.issues)),n.value[h]=y.value)}let m;for(const h in l)f.has(h)||(m=m??[],m.push(h));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(l)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&oC.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ti(g,a,Ai())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...bs(f,g.issues)),n.value[m.value]=g.value})):(y.issues.length&&n.issues.push(...bs(f,y.issues)),n.value[m.value]=y.value)}}return o.length?Promise.all(o).then(()=>n):n}}),K4=se("$ZodEnum",(e,t)=>{Dt.init(e,t);const n=Wj(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>lM.has(typeof l)).map(l=>typeof l=="string"?Fs(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const u=l.value;return a.has(u)||l.issues.push({code:"invalid_value",values:n,input:u,inst:e}),l}}),G4=se("$ZodLiteral",(e,t)=>{if(Dt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Fs(a):a?Fs(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,l)=>{const o=a.value;return n.has(o)||a.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),a}}),Y4=se("$ZodTransform",(e,t)=>{Dt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Xj(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(n.value=u,n));if(l instanceof Promise)throw new Ss;return n.value=l,n}});function ow(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const yC=se("$ZodOptional",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xy(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>ow(o,n.value)):ow(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),X4=se("$ZodExactOptional",(e,t)=>{yC.init(e,t),ht(e._zod,"values",()=>t.innerType._zod.values),ht(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),J4=se("$ZodNullable",(e,t)=>{Dt.init(e,t),ht(e._zod,"optin",()=>t.innerType._zod.optin),ht(e._zod,"optout",()=>t.innerType._zod.optout),ht(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xy(n.source)}|null)$`):void 0}),ht(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),W4=se("$ZodDefault",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",ht(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>uw(o,t)):uw(l,t)}});function uw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const e5=se("$ZodPrefault",(e,t)=>{Dt.init(e,t),e._zod.optin="optional",ht(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),t5=se("$ZodNonOptional",(e,t)=>{Dt.init(e,t),ht(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>cw(o,e)):cw(l,e)}});function cw(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const n5=se("$ZodCatch",(e,t)=>{Dt.init(e,t),ht(e._zod,"optin",()=>t.innerType._zod.optin),ht(e._zod,"optout",()=>t.innerType._zod.optout),ht(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(u=>Ti(u,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ti(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),r5=se("$ZodPipe",(e,t)=>{Dt.init(e,t),ht(e._zod,"values",()=>t.in._zod.values),ht(e._zod,"optin",()=>t.in._zod.optin),ht(e._zod,"optout",()=>t.out._zod.optout),ht(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(u=>Nd(u,t.in,a)):Nd(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>Nd(o,t.out,a)):Nd(l,t.out,a)}});function Nd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const a5=se("$ZodReadonly",(e,t)=>{Dt.init(e,t),ht(e._zod,"propValues",()=>t.innerType._zod.propValues),ht(e._zod,"values",()=>t.innerType._zod.values),ht(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),ht(e._zod,"optout",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optout}),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(dw):dw(l)}});function dw(e){return e.value=Object.freeze(e.value),e}const i5=se("$ZodCustom",(e,t)=>{Kn.init(e,t),Dt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,l=t.fn(a);if(l instanceof Promise)return l.then(o=>fw(o,n,a,e));fw(l,n,a,e)}});function fw(e,t,n,a){if(!e){const l={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(Cu(l))}}var hw;class l5{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const l={...a,...this._map.get(t)};return Object.keys(l).length?l:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function s5(){return new l5}(hw=globalThis).__zod_globalRegistry??(hw.__zod_globalRegistry=s5());const cu=globalThis.__zod_globalRegistry;function o5(e,t){return new e({type:"string",...ze(t)})}function u5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function mw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function c5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function d5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function f5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function h5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function m5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function p5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function g5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function y5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function v5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function b5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function x5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function w5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function S5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function k5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function j5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function C5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function E5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function N5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function _5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function A5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function T5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function R5(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function z5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function O5(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function D5(e,t){return new e({type:"number",checks:[],...ze(t)})}function M5(e,t){return new e({type:"number",coerce:!0,checks:[],...ze(t)})}function I5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function L5(e,t){return new e({type:"boolean",...ze(t)})}function U5(e){return new e({type:"unknown"})}function P5(e,t){return new e({type:"never",...ze(t)})}function pw(e,t){return new cC({check:"less_than",...ze(t),value:e,inclusive:!1})}function mp(e,t){return new cC({check:"less_than",...ze(t),value:e,inclusive:!0})}function gw(e,t){return new dC({check:"greater_than",...ze(t),value:e,inclusive:!1})}function pp(e,t){return new dC({check:"greater_than",...ze(t),value:e,inclusive:!0})}function yw(e,t){return new WM({check:"multiple_of",...ze(t),value:e})}function vC(e,t){return new t4({check:"max_length",...ze(t),maximum:e})}function Yd(e,t){return new n4({check:"min_length",...ze(t),minimum:e})}function bC(e,t){return new r4({check:"length_equals",...ze(t),length:e})}function B5(e,t){return new a4({check:"string_format",format:"regex",...ze(t),pattern:e})}function $5(e){return new i4({check:"string_format",format:"lowercase",...ze(e)})}function F5(e){return new l4({check:"string_format",format:"uppercase",...ze(e)})}function q5(e,t){return new s4({check:"string_format",format:"includes",...ze(t),includes:e})}function H5(e,t){return new o4({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function Z5(e,t){return new u4({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function Xs(e){return new c4({check:"overwrite",tx:e})}function V5(e){return Xs(t=>t.normalize(e))}function Q5(){return Xs(e=>e.trim())}function K5(){return Xs(e=>e.toLowerCase())}function G5(){return Xs(e=>e.toUpperCase())}function Y5(){return Xs(e=>aM(e))}function X5(e,t,n){return new e({type:"array",element:t,...ze(n)})}function J5(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ze(n)})}function W5(e){const t=eI(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Cu(a,n.value,t._zod.def));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(Cu(l))}},e(n.value,n)));return t}function eI(e,t){const n=new Kn({check:"custom",...ze(t)});return n._zod.check=e,n}function xC(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??cu,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Xt(e,t,n={path:[],schemaPath:[]}){var y,g;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)u.schema=f;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,x);else{const k=u.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,x)}const w=e._zod.parent;w&&(u.ref||(u.ref=w),Xt(w,t,x),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&An(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function wC(e,t){var u,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const g=(u=e.metadataRegistry.get(y[0]))==null?void 0:u.id;if(g){const x=a.get(g);if(x&&x!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const C=(j=e.external.registry.get(y[0]))==null?void 0:j.id,E=e.external.uri??(z=>z);if(C)return{ref:E(C)};const R=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=R,{defId:R,ref:`${E("__shared")}#/${g}/${R}`}}if(y[1]===n)return{ref:"#"};const w=`#/${g}/`,k=y[1].schema.id??`__schema${e.counter++}`;return{defId:k,ref:w+k}},o=y=>{if(y[1].schema.$ref)return;const g=y[1],{ref:x,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);const k=g.schema;for(const j in k)delete k[j];k.$ref=x};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
|
|
351
|
+
|
|
352
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function SC(e,t){var u,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,x={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),C=j.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,x),h._zod.parent===w)for(const R in g)R==="$ref"||R==="allOf"||R in x||delete g[R];if(C.$ref&&j.def)for(const R in g)R==="$ref"||R==="allOf"||R in j.def&&JSON.stringify(g[R])===JSON.stringify(j.def[R])&&delete g[R]}const k=h._zod.parent;if(k&&k!==w){a(k);const j=e.seen.get(k);if(j!=null&&j.schema.$ref&&(g.$ref=j.schema.$ref,j.def))for(const C in g)C==="$ref"||C==="allOf"||C in j.def&&JSON.stringify(g[C])===JSON.stringify(j.def[C])&&delete g[C]}e.override({zodSchema:h,jsonSchema:g,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(u=e.external)!=null&&u.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:Xd(t,"input",e.processors),output:Xd(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function An(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return An(a.element,n);if(a.type==="set")return An(a.valueType,n);if(a.type==="lazy")return An(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return An(a.innerType,n);if(a.type==="intersection")return An(a.left,n)||An(a.right,n);if(a.type==="record"||a.type==="map")return An(a.keyType,n)||An(a.valueType,n);if(a.type==="pipe")return An(a.in,n)||An(a.out,n);if(a.type==="object"){for(const l in a.shape)if(An(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(An(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(An(l,n))return!0;return!!(a.rest&&An(a.rest,n))}return!1}const tI=(e,t={})=>n=>{const a=xC({...n,processors:t});return Xt(e,a),wC(a,e),SC(a,e)},Xd=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},u=xC({...l??{},target:o,io:t,processors:n});return Xt(e,u),wC(u,e),SC(u,e)},nI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rI=(e,t,n,a)=>{const l=n;l.type="string";const{minimum:o,maximum:u,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof u=="number"&&(l.maxLength=u),f&&(l.format=nI[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),h&&(l.contentEncoding=h),m&&m.size>0){const y=[...m];y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},aI=(e,t,n,a)=>{const l=n,{minimum:o,maximum:u,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof u=="number"&&(l.maximum=u,typeof h=="number"&&t.target!=="draft-04"&&(h<=u?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},iI=(e,t,n,a)=>{n.type="boolean"},lI=(e,t,n,a)=>{n.not={}},sI=(e,t,n,a)=>{},oI=(e,t,n,a)=>{const l=e._zod.def,o=Wj(l.entries);o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),n.enum=o},uI=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const u of l.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(u))}else o.push(u);if(o.length!==0)if(o.length===1){const u=o[0];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else o.every(u=>typeof u=="number")&&(n.type="number"),o.every(u=>typeof u=="string")&&(n.type="string"),o.every(u=>typeof u=="boolean")&&(n.type="boolean"),o.every(u=>u===null)&&(n.type="null"),n.enum=o},cI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},dI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fI=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Xt(o.element,t,{...a,path:[...a.path,"items"]})},hI=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const u=o.shape;for(const y in u)l.properties[y]=Xt(u[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Xt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},mI=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,u=l.options.map((f,m)=>Xt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=u:n.anyOf=u},pI=(e,t,n,a)=>{const l=e._zod.def,o=Xt(l.left,t,{...a,path:[...a.path,"allOf",0]}),u=Xt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(u)?u.allOf:[u]];n.allOf=m},gI=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const u=o.keyType,f=u._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Xt(o.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});l.patternProperties={};for(const g of m)l.patternProperties[g.source]=y}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(l.propertyNames=Xt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Xt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=u._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},yI=(e,t,n,a)=>{const l=e._zod.def,o=Xt(l.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},vI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},bI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},xI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},wI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},SI=(e,t,n,a)=>{const l=e._zod.def,o=t.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Xt(o,t,a);const u=t.seen.get(e);u.ref=o},kI=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},kC=(e,t,n,a)=>{const l=e._zod.def;Xt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},jI=se("ZodISODateTime",(e,t)=>{j4.init(e,t),It.init(e,t)});function CI(e){return T5(jI,e)}const EI=se("ZodISODate",(e,t)=>{C4.init(e,t),It.init(e,t)});function NI(e){return R5(EI,e)}const _I=se("ZodISOTime",(e,t)=>{E4.init(e,t),It.init(e,t)});function AI(e){return z5(_I,e)}const TI=se("ZodISODuration",(e,t)=>{N4.init(e,t),It.init(e,t)});function RI(e){return O5(TI,e)}const zI=(e,t)=>{rC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>yM(e,n)},flatten:{value:n=>gM(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,bg,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,bg,2)}},isEmpty:{get(){return e.issues.length===0}}})},Er=se("ZodError",zI,{Parent:Error}),OI=Sy(Er),DI=ky(Er),MI=Sf(Er),II=kf(Er),LI=xM(Er),UI=wM(Er),PI=SM(Er),BI=kM(Er),$I=jM(Er),FI=CM(Er),qI=EM(Er),HI=NM(Er),Mt=se("ZodType",(e,t)=>(Dt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Xd(e,"input"),output:Xd(e,"output")}}),e.toJSONSchema=tI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(zi(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Oi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>OI(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>MI(e,n,a),e.parseAsync=async(n,a)=>DI(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>II(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>LI(e,n,a),e.decode=(n,a)=>UI(e,n,a),e.encodeAsync=async(n,a)=>PI(e,n,a),e.decodeAsync=async(n,a)=>BI(e,n,a),e.safeEncode=(n,a)=>$I(e,n,a),e.safeDecode=(n,a)=>FI(e,n,a),e.safeEncodeAsync=async(n,a)=>qI(e,n,a),e.safeDecodeAsync=async(n,a)=>HI(e,n,a),e.refine=(n,a)=>e.check(IL(n,a)),e.superRefine=n=>e.check(LL(n)),e.overwrite=n=>e.check(Xs(n)),e.optional=()=>xw(e),e.exactOptional=()=>kL(e),e.nullable=()=>ww(e),e.nullish=()=>xw(ww(e)),e.nonoptional=n=>AL(e,n),e.array=()=>un(e),e.or=n=>EC([e,n]),e.and=n=>vL(e,n),e.transform=n=>Sg(e,NC(n)),e.default=n=>EL(e,n),e.prefault=n=>_L(e,n),e.catch=n=>RL(e,n),e.pipe=n=>Sg(e,n),e.readonly=()=>DL(e),e.describe=n=>{const a=e.clone();return cu.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=cu.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return cu.get(e);const a=e.clone();return cu.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),jC=se("_ZodString",(e,t)=>{jy.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>rI(e,a,l);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(B5(...a)),e.includes=(...a)=>e.check(q5(...a)),e.startsWith=(...a)=>e.check(H5(...a)),e.endsWith=(...a)=>e.check(Z5(...a)),e.min=(...a)=>e.check(Yd(...a)),e.max=(...a)=>e.check(vC(...a)),e.length=(...a)=>e.check(bC(...a)),e.nonempty=(...a)=>e.check(Yd(1,...a)),e.lowercase=a=>e.check($5(a)),e.uppercase=a=>e.check(F5(a)),e.trim=()=>e.check(Q5()),e.normalize=(...a)=>e.check(V5(...a)),e.toLowerCase=()=>e.check(K5()),e.toUpperCase=()=>e.check(G5()),e.slugify=()=>e.check(Y5())}),ZI=se("ZodString",(e,t)=>{jy.init(e,t),jC.init(e,t),e.email=n=>e.check(u5(VI,n)),e.url=n=>e.check(m5(QI,n)),e.jwt=n=>e.check(A5(oL,n)),e.emoji=n=>e.check(p5(KI,n)),e.guid=n=>e.check(mw(vw,n)),e.uuid=n=>e.check(c5(_d,n)),e.uuidv4=n=>e.check(d5(_d,n)),e.uuidv6=n=>e.check(f5(_d,n)),e.uuidv7=n=>e.check(h5(_d,n)),e.nanoid=n=>e.check(g5(GI,n)),e.guid=n=>e.check(mw(vw,n)),e.cuid=n=>e.check(y5(YI,n)),e.cuid2=n=>e.check(v5(XI,n)),e.ulid=n=>e.check(b5(JI,n)),e.base64=n=>e.check(E5(iL,n)),e.base64url=n=>e.check(N5(lL,n)),e.xid=n=>e.check(x5(WI,n)),e.ksuid=n=>e.check(w5(eL,n)),e.ipv4=n=>e.check(S5(tL,n)),e.ipv6=n=>e.check(k5(nL,n)),e.cidrv4=n=>e.check(j5(rL,n)),e.cidrv6=n=>e.check(C5(aL,n)),e.e164=n=>e.check(_5(sL,n)),e.datetime=n=>e.check(CI(n)),e.date=n=>e.check(NI(n)),e.time=n=>e.check(AI(n)),e.duration=n=>e.check(RI(n))});function T(e){return o5(ZI,e)}const It=se("ZodStringFormat",(e,t)=>{Ot.init(e,t),jC.init(e,t)}),VI=se("ZodEmail",(e,t)=>{p4.init(e,t),It.init(e,t)}),vw=se("ZodGUID",(e,t)=>{h4.init(e,t),It.init(e,t)}),_d=se("ZodUUID",(e,t)=>{m4.init(e,t),It.init(e,t)}),QI=se("ZodURL",(e,t)=>{g4.init(e,t),It.init(e,t)}),KI=se("ZodEmoji",(e,t)=>{y4.init(e,t),It.init(e,t)}),GI=se("ZodNanoID",(e,t)=>{v4.init(e,t),It.init(e,t)}),YI=se("ZodCUID",(e,t)=>{b4.init(e,t),It.init(e,t)}),XI=se("ZodCUID2",(e,t)=>{x4.init(e,t),It.init(e,t)}),JI=se("ZodULID",(e,t)=>{w4.init(e,t),It.init(e,t)}),WI=se("ZodXID",(e,t)=>{S4.init(e,t),It.init(e,t)}),eL=se("ZodKSUID",(e,t)=>{k4.init(e,t),It.init(e,t)}),tL=se("ZodIPv4",(e,t)=>{_4.init(e,t),It.init(e,t)}),nL=se("ZodIPv6",(e,t)=>{A4.init(e,t),It.init(e,t)}),rL=se("ZodCIDRv4",(e,t)=>{T4.init(e,t),It.init(e,t)}),aL=se("ZodCIDRv6",(e,t)=>{R4.init(e,t),It.init(e,t)}),iL=se("ZodBase64",(e,t)=>{z4.init(e,t),It.init(e,t)}),lL=se("ZodBase64URL",(e,t)=>{D4.init(e,t),It.init(e,t)}),sL=se("ZodE164",(e,t)=>{M4.init(e,t),It.init(e,t)}),oL=se("ZodJWT",(e,t)=>{L4.init(e,t),It.init(e,t)}),Cy=se("ZodNumber",(e,t)=>{hC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>aI(e,a,l),e.gt=(a,l)=>e.check(gw(a,l)),e.gte=(a,l)=>e.check(pp(a,l)),e.min=(a,l)=>e.check(pp(a,l)),e.lt=(a,l)=>e.check(pw(a,l)),e.lte=(a,l)=>e.check(mp(a,l)),e.max=(a,l)=>e.check(mp(a,l)),e.int=a=>e.check(bw(a)),e.safe=a=>e.check(bw(a)),e.positive=a=>e.check(gw(0,a)),e.nonnegative=a=>e.check(pp(0,a)),e.negative=a=>e.check(pw(0,a)),e.nonpositive=a=>e.check(mp(0,a)),e.multipleOf=(a,l)=>e.check(yw(a,l)),e.step=(a,l)=>e.check(yw(a,l)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Fe(e){return D5(Cy,e)}const uL=se("ZodNumberFormat",(e,t)=>{U4.init(e,t),Cy.init(e,t)});function bw(e){return I5(uL,e)}const cL=se("ZodBoolean",(e,t)=>{P4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>iI(e,n,a)});function Lr(e){return L5(cL,e)}const dL=se("ZodUnknown",(e,t)=>{B4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>sI()});function Ct(){return U5(dL)}const fL=se("ZodNever",(e,t)=>{$4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>lI(e,n,a)});function hL(e){return P5(fL,e)}const mL=se("ZodArray",(e,t)=>{F4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>fI(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(Yd(n,a)),e.nonempty=n=>e.check(Yd(1,n)),e.max=(n,a)=>e.check(vC(n,a)),e.length=(n,a)=>e.check(bC(n,a)),e.unwrap=()=>e.element});function un(e,t){return X5(mL,e,t)}const pL=se("ZodObject",(e,t)=>{H4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>hI(e,n,a,l),ht(e,"shape",()=>t.shape),e.keyof=()=>Pe(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ct()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ct()}),e.strict=()=>e.clone({...e._zod.def,catchall:hL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>dM(e,n),e.safeExtend=n=>fM(e,n),e.merge=n=>hM(e,n),e.pick=n=>uM(e,n),e.omit=n=>cM(e,n),e.partial=(...n)=>mM(_C,e,n[0]),e.required=(...n)=>pM(AC,e,n[0])});function ie(e,t){const n={type:"object",shape:e??{},...ze(t)};return new pL(n)}const CC=se("ZodUnion",(e,t)=>{gC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>mI(e,n,a,l),e.options=t.options});function EC(e,t){return new CC({type:"union",options:e,...ze(t)})}const gL=se("ZodDiscriminatedUnion",(e,t)=>{CC.init(e,t),Z4.init(e,t)});function Ey(e,t,n){return new gL({type:"union",options:t,discriminator:e,...ze(n)})}const yL=se("ZodIntersection",(e,t)=>{V4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>pI(e,n,a,l)});function vL(e,t){return new yL({type:"intersection",left:e,right:t})}const bL=se("ZodRecord",(e,t)=>{Q4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>gI(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Ht(e,t,n){return new bL({type:"record",keyType:e,valueType:t,...ze(n)})}const wg=se("ZodEnum",(e,t)=>{K4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>oI(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const u of a)if(n.has(u))o[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new wg({...t,checks:[],...ze(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const u of a)if(n.has(u))delete o[u];else throw new Error(`Key ${u} not found in enum`);return new wg({...t,checks:[],...ze(l),entries:o})}});function Pe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new wg({type:"enum",entries:n,...ze(t)})}const xL=se("ZodLiteral",(e,t)=>{G4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>uI(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Yt(e,t){return new xL({type:"literal",values:Array.isArray(e)?e:[e],...ze(t)})}const wL=se("ZodTransform",(e,t)=>{Y4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>dI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Xj(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Cu(o,n.value,t));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(Cu(u))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function NC(e){return new wL({type:"transform",transform:e})}const _C=se("ZodOptional",(e,t)=>{yC.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function xw(e){return new _C({type:"optional",innerType:e})}const SL=se("ZodExactOptional",(e,t)=>{X4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function kL(e){return new SL({type:"optional",innerType:e})}const jL=se("ZodNullable",(e,t)=>{J4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>yI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function ww(e){return new jL({type:"nullable",innerType:e})}const CL=se("ZodDefault",(e,t)=>{W4.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>bI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function EL(e,t){return new CL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tC(t)}})}const NL=se("ZodPrefault",(e,t)=>{e5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>xI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function _L(e,t){return new NL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tC(t)}})}const AC=se("ZodNonOptional",(e,t)=>{t5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>vI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function AL(e,t){return new AC({type:"nonoptional",innerType:e,...ze(t)})}const TL=se("ZodCatch",(e,t)=>{n5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>wI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function RL(e,t){return new TL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const zL=se("ZodPipe",(e,t)=>{r5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>SI(e,n,a,l),e.in=t.in,e.out=t.out});function Sg(e,t){return new zL({type:"pipe",in:e,out:t})}const OL=se("ZodReadonly",(e,t)=>{a5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>kI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function DL(e){return new OL({type:"readonly",innerType:e})}const ML=se("ZodCustom",(e,t)=>{i5.init(e,t),Mt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>cI(e,n)});function IL(e,t={}){return J5(ML,e,t)}function LL(e){return W5(e)}function UL(e,t){return Sg(NC(e),t)}const gp={custom:"custom"};function Ku(e){return M5(Cy,e)}const PL=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function BL(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function TC(e,t){const n=BL(e),a=new Map;for(const o of t)o.name&&a.set(o.name.toLowerCase(),o.agentId);if(a.size===0)return[];const l=new Set;for(const o of n.matchAll(PL)){const u=o[1];if(!u)continue;const f=a.get(u.toLowerCase());f&&l.add(f)}return[...l]}const $L=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,Sw="/";function RC(e){return!e||typeof e!="string"||e.length>256||!$L.test(e)?"/":e}const FL={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},zC=Pe(["feishu","slack","kael"]),OC=Pe(["active","inactive"]);ie({platform:zC,agentId:T().min(1),credentials:Ht(T(),Ct()),status:OC.default("active")});ie({agentId:T().min(1).optional(),credentials:Ht(T(),Ct()).optional(),status:OC.optional()});ie({id:Fe(),platform:T(),agentId:T(),hasCredentials:Lr(),status:T(),createdAt:T(),updatedAt:T()});const qL=Pe(["code","reverse_token","oauth","manual"]);ie({appId:T().min(1),appSecret:T().min(1)});ie({platform:zC,externalUserId:T().min(1),agentId:T().min(1),boundVia:qL.default("manual"),displayName:T().max(200).optional()});ie({id:Fe(),platform:T(),externalUserId:T(),agentId:T(),boundVia:T().nullable(),displayName:T().nullable(),createdAt:T()});ie({feishuUserId:T().min(1),displayName:T().max(200).optional()});ie({configId:Fe(),platform:T(),agentId:T(),appId:T(),connected:Lr(),lastActiveAt:T().nullable()});const DC=Pe(["online","offline"]),MC=Pe(["idle","working","blocked","error"]);Pe(["active","suspended","evicted"]);const HL=Pe(["active","suspended"]);ie({chatId:T().min(1),state:HL});ie({runtimeState:MC});ie({agentId:T().min(1),runtimeType:T().max(50),runtimeVersion:T().max(50).optional()});Pe(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);ie({agentId:T(),status:DC,connectedAt:T().nullable(),lastSeenAt:T(),clientId:T().nullable().optional(),runtimeType:T().nullable().optional(),runtimeVersion:T().nullable().optional(),runtimeState:MC.nullable().optional(),activeSessions:Fe().int().nullable().optional(),totalSessions:Fe().int().nullable().optional(),runtimeUpdatedAt:T().nullable().optional()});ie({total:Fe().int(),running:Fe().int(),byState:ie({idle:Fe().int(),working:Fe().int(),blocked:Fe().int(),error:Fe().int()}),clients:Fe().int()});const Jd={CLAUDE_CODE:"claude-code",CODEX:"codex"},Cf=Pe(["claude-code","codex"]),Ef=Pe(["human","personal_assistant","autonomous_agent"]),kw={PRIVATE:"private",ORGANIZATION:"organization"},Ny=Pe(["private","organization"]),ZL=Pe(["admin-api","portal"]);Pe(["active","suspended"]);const kg=/^[a-z0-9][a-z0-9_-]{0,63}$/,xs=64,VL=["admin","agent","first-tree","hub","me","null","system","undefined"],QL=new Set(VL);function jg(e){return QL.has(e)}ie({name:T().min(1).max(64).regex(kg,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!jg(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:Ef,displayName:T().min(1).max(200).optional(),delegateMention:T().max(100).optional(),organizationId:T().min(1).max(100).optional(),source:ZL.optional(),visibility:Ny.optional(),metadata:Ht(T(),Ct()).optional(),managerId:T().optional(),clientId:T().min(1).max(100).optional(),runtimeProvider:Cf.optional()});ie({type:Ef.optional(),displayName:T().min(1).max(200).optional(),delegateMention:T().max(100).nullable().optional(),visibility:Ny.optional(),metadata:Ht(T(),Ct()).optional(),managerId:T().nullable().optional(),clientId:T().min(1).max(100).nullable().optional()});ie({clientId:T().min(1).max(100),runtimeProvider:Cf,force:Lr().optional()});ie({uuid:T(),name:T().nullable(),organizationId:T(),type:Ef,displayName:T(),delegateMention:T().nullable(),inboxId:T(),status:T(),source:T().nullable().optional(),visibility:Ny,metadata:Ht(T(),Ct()),managerId:T().nullable(),clientId:T().nullable(),runtimeProvider:Cf,presenceStatus:DC.optional(),createdAt:T(),updatedAt:T()});ie({repo:T().nullable(),branch:T().nullable()});ie({type:Yt("agent:pinned"),agentId:T(),name:T().nullable(),displayName:T(),agentType:Ef,runtimeProvider:Cf});const KL=32e3,_y=/^[a-z0-9][a-z0-9_-]{0,63}$/i,GL=/^[A-Z][A-Z0-9_]*$/,YL=ie({append:T().max(KL).default("")}),XL=ie({name:T().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Yt("stdio"),command:T().min(1),args:un(T()).optional()}),JL=ie({name:T().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Yt("http"),url:T().url(),headers:Ht(T(),T()).optional()}),WL=ie({name:T().regex(_y,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Yt("sse"),url:T().url(),headers:Ht(T(),T()).optional()}),e6=Ey("transport",[XL,JL,WL]),t6=ie({key:T().regex(GL,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:T(),sensitive:Lr().default(!1)}),n6=ie({url:T().min(1),ref:T().min(1).optional(),localPath:T().min(1).optional()}),Nf=ie({prompt:YL.default({append:""}),model:T().default("opus"),mcpServers:un(e6).default([]),env:un(t6).default([]),gitRepos:un(n6).default([])}),r6=Nf.extend({kind:Yt("claude-code")}),a6=Nf.extend({kind:Yt("codex")}),i6=Ey("kind",[r6,a6]),l6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,u)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:gp.custom,path:["mcpServers",u,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,u)=>{a.has(o.key)&&t.addIssue({code:gp.custom,path:["env",u,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,u)=>{const f=o.localPath??ef(o.url);f&&(l.has(f)&&t.addIssue({code:gp.custom,path:["gitRepos",u,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},IC=UL(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,i6).superRefine((e,t)=>{l6(e,t)}),s6=ie({agentId:T(),version:Fe().int().positive(),payload:IC,updatedAt:T(),updatedBy:T()});ie({expectedVersion:Fe().int().positive(),payload:Nf.partial()});ie({payload:Nf.partial()});ie({current:s6,next:IC,diff:un(ie({path:T(),op:Pe(["add","remove","replace"]),before:Ct().optional(),after:Ct().optional()}))});const Wd="***";function ef(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}ie({username:T().min(1),password:T().min(1)});ie({accessToken:T(),refreshToken:T()});ie({refreshToken:T().min(1)});ie({token:T().min(1)});ie({token:T(),expiresIn:Fe(),command:T()});const o6=Pe(["direct","group","thread"]);ie({type:o6,topic:T().max(500).optional(),participantIds:un(T()).min(1),metadata:Ht(T(),Ct()).optional()});const LC=ie({agentId:T(),role:T(),mode:T(),joinedAt:T()});LC.extend({name:T().nullable(),displayName:T(),type:T()});const u6=ie({id:T(),organizationId:T(),type:T(),topic:T().nullable(),lifecyclePolicy:T().nullable().optional(),metadata:Ht(T(),Ct()),createdAt:T(),updatedAt:T()});u6.extend({participants:un(LC),title:T(),firstMessagePreview:T().nullable()});ie({topic:T().trim().max(500).nullable()});ie({agentId:T().min(1),mode:Pe(["full","mention_only"]).default("full")});ie({agentId:T().min(1)});const c6=Pe(["connected","disconnected"]),d6=Pe(["ok","expired"]);ie({id:T(),userId:T().nullable(),status:c6,authState:d6,sdkVersion:T().max(50).nullable(),hostname:T().max(100).nullable(),os:T().max(50).nullable(),agentCount:Fe().int().min(0),connectedAt:T().nullable(),lastSeenAt:T(),metadata:Ht(T(),Ct()).nullable()});const f6=ie({wsInboxDeliver:Lr().default(!1)}).partial();ie({clientId:T().min(1).max(100),hostname:T().max(100).optional(),os:T().max(50).optional(),sdkVersion:T().max(50).optional(),wireCapabilities:f6.optional()});ie({clientId:T(),previousUserId:T().nullable(),unpinnedAgentCount:Fe().int().nonnegative()});const h6=Pe(["ok","missing","unauthenticated","error"]),m6=Pe(["api_key","oauth","auth_json","none"]),p6=ie({state:h6,available:Lr(),authenticated:Lr(),sdkVersion:T().nullable().optional(),authMethod:m6,error:T().nullable().optional(),detectedAt:T()}),g6=Ht(T(),p6);ie({capabilities:g6});ie({limit:Ku().int().min(1).max(100).default(20),cursor:T().optional()});const y6=["image/png","image/jpeg","image/gif","image/webp"],Ay=Pe(y6);ie({data:T().min(1),mimeType:Ay,filename:T().min(1),size:Fe().int().nonnegative().optional(),imageId:T().uuid().optional()});ie({imageId:T().uuid(),mimeType:Ay,filename:T().min(1),size:Fe().int().nonnegative().optional()});ie({type:Yt("image_payload"),imageId:T().uuid(),chatId:T(),base64:T().min(1),mimeType:Ay,filename:T().min(1),size:Fe().int().nonnegative().optional()});const Ty=Pe(["hub_ui","cli","feishu","github","api"]),UC=Pe(["text","markdown","card","reference","file","task"]);ie({format:UC.default("text"),content:Ct(),metadata:Ht(T(),Ct()).optional(),inReplyTo:T().optional(),replyToInbox:T().optional(),replyToChat:T().optional(),source:Ty.optional()});ie({format:UC.default("text"),content:Ct(),metadata:Ht(T(),Ct()).optional(),replyToInbox:T().optional(),replyToChat:T().optional(),source:Ty.optional()});const v6=ie({id:T(),chatId:T(),senderId:T(),format:T(),content:Ct(),metadata:Ht(T(),Ct()),replyToInbox:T().nullable(),replyToChat:T().nullable(),inReplyTo:T().nullable(),source:Ty.nullable(),createdAt:T()}),b6=ie({senderId:T(),chatId:T(),replyToChat:T().nullable()}).nullable(),x6=Pe(["full","mention_only"]),w6=ie({id:T(),senderId:T(),format:T(),content:Ct(),metadata:Ht(T(),Ct()).default({}),createdAt:T()}),PC=v6.extend({configVersion:Fe().int().positive(),recipientMode:x6.default("full"),inReplyToSnapshot:b6.default(null),precedingMessages:un(w6).default([])});Pe(["pending","delivered","acked","failed"]);const S6=ie({id:Fe(),inboxId:T(),messageId:T(),chatId:T().nullable(),status:T(),retryCount:Fe(),createdAt:T(),deliveredAt:T().nullable(),ackedAt:T().nullable()});S6.extend({message:PC});ie({limit:Ku().int().min(1).max(50).default(10)});ie({type:Yt("inbox:deliver"),entryId:Fe().int().nonnegative(),inboxId:T().min(1),chatId:T().nullable(),message:PC}).passthrough();ie({type:Yt("inbox:ack"),entryId:Fe().int().nonnegative()});const k6=7;ie({organizationId:T(),organizationName:T(),organizationDisplayName:T(),role:T(),expiresAt:T().nullable()});ie({id:T(),organizationId:T(),token:T(),inviteUrl:T(),role:T(),createdAt:T(),expiresAt:T().nullable()});ie({token:T().min(1)});ie({}).optional();const j6=["all","unread","watching"],C6=Pe(j6),BC=Pe(["participant","watching"]);ie({cursor:T().optional(),limit:Ku().int().min(1).max(200).default(50),filter:C6.default("all")});const E6=ie({agentId:T(),displayName:T(),type:T()}),N6=ie({chatId:T(),type:T(),membershipKind:BC,title:T(),topic:T().nullable(),participants:un(E6),participantCount:Fe().int(),lastMessageAt:T().nullable(),lastMessagePreview:T().nullable(),unreadMentionCount:Fe().int(),canReply:Lr(),taskId:T().nullable(),taskStatus:T().nullable()});ie({rows:un(N6),nextCursor:T().nullable()});ie({participantIds:un(T().min(1)).min(1),topic:T().trim().max(500).optional().nullable()});ie({participantIds:un(T().min(1)).min(1)});ie({chatId:T(),lastReadAt:T(),unreadMentionCount:Fe().int()});ie({chatId:T(),membershipKind:BC.nullable()});ie({type:Yt("chat:message"),chatId:T()});Pe(["connect","create_agent","completed"]);ie({id:T(),name:T(),displayName:T(),role:Pe(["admin","member"])});ie({name:T().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:T().min(1).max(200)});ie({id:T(),organizationId:T(),organizationName:T(),role:Pe(["admin","member"]),agentId:T()});const _6={ADMIN:"admin",MEMBER:"member"},Ry=Pe(["admin","member"]),A6=ie({id:T(),userId:T(),organizationId:T(),agentId:T(),role:Ry,createdAt:T()});ie({username:T().min(1).max(100),displayName:T().min(1).max(200),role:Ry.default("member")});ie({role:Ry.optional(),displayName:T().min(1).max(200).optional()});A6.extend({username:T(),displayName:T(),password:T()});const T6=Pe(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),$C=Pe(["high","medium","low"]);ie({id:T(),organizationId:T(),type:T6,severity:$C,agentId:T().nullable(),chatId:T().nullable(),message:T(),read:Lr(),createdAt:T()});ie({limit:Ku().int().min(1).max(100).default(20),cursor:T().optional(),severity:$C.optional(),read:Pe(["true","false"]).transform(e=>e==="true").optional(),agentId:T().optional()});ie({next:T().max(256).optional()});ie({code:T().min(1),state:T().min(1)});ie({githubId:T().min(1),login:T().min(1),email:T().email().optional(),displayName:T().optional(),next:T().max(256).optional()});const FC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;ie({name:T().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!FC.test(e),"Name must not be a UUID format"),displayName:T().min(1).max(200),maxAgents:Fe().int().min(0).default(0),maxMessagesPerMinute:Fe().int().min(0).default(0),features:Ht(T(),Ct()).default({})});ie({name:T().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/,"Must start with a letter or digit and contain only lowercase alphanumeric and hyphens").refine(e=>!FC.test(e),"Name must not be a UUID format").optional(),displayName:T().min(1).max(200).optional(),maxAgents:Fe().int().min(0).optional(),maxMessagesPerMinute:Fe().int().min(0).optional(),features:Ht(T(),Ct()).optional()});ie({id:T(),name:T(),displayName:T(),maxAgents:Fe(),maxMessagesPerMinute:Fe(),features:Ht(T(),Ct()),createdAt:T(),updatedAt:T()});const R6=ie({workingCount:Fe().int().nonnegative(),errorMask:Lr()}),z6=ie({type:Yt("pulse:tick"),organizationId:T(),agents:Ht(T(),un(R6).length(32))}),O6=Pe(["tool_call","error","assistant_text","thinking","turn_end"]),qC=ie({toolUseId:T(),name:T(),args:Ct(),status:Pe(["pending","ok","error"]),durationMs:Fe().int().nonnegative().optional(),resultPreview:T().max(400).optional()}),HC=ie({source:Pe(["sdk","runtime","tool"]),message:T().max(2e3)}),ZC=ie({text:T().max(8e3)}),VC=ie({}),QC=ie({status:Pe(["success","error"])}),D6=Ey("kind",[ie({kind:Yt("tool_call"),payload:qC}),ie({kind:Yt("error"),payload:HC}),ie({kind:Yt("assistant_text"),payload:ZC}),ie({kind:Yt("thinking"),payload:VC}),ie({kind:Yt("turn_end"),payload:QC})]);ie({id:T(),agentId:T(),chatId:T(),seq:Fe().int().positive(),kind:O6,payload:EC([qC,HC,ZC,VC,QC]),createdAt:T()});ie({agentId:T(),chatId:T(),event:D6});ie({agentId:T(),chatId:T()});ie({type:Yt("session:reconcile"),agentId:T().min(1),chatIds:un(T().min(1)).max(500)});ie({type:Yt("session:reconcile:result"),agentId:T().min(1),staleChatIds:un(T().min(1))});const M6=ie({organizationId:T(),agentCount:Fe(),chatCount:Fe(),messageCount:Fe()});ie({totalAgents:Fe(),totalChats:Fe(),totalMessages:Fe(),byOrganization:un(M6)});const Eu=Pe(["pending","assigned","working","completed","failed","cancelled"]),jw=Pe(["agent","admin"]),I6=Pe(["assigned","status_changed","cancelled"]);ie({taskId:T(),event:I6,title:T(),body:T().default(""),status:Eu,fromStatus:Eu.optional(),originRef:T().nullable().optional()});const L6=ie({title:T().min(1).max(500),body:T().optional(),assigneeAgentId:T().optional(),originRef:T().max(500).optional(),metadata:Ht(T(),Ct()).optional()});L6.extend({organizationId:T().optional()});ie({status:Pe(["working","completed","failed"]),result:T().optional()});ie({assigneeAgentId:T().nullable().optional(),status:Eu.optional(),result:T().optional()});ie({chatId:T().min(1)});const U6=ie({id:T(),organizationId:T(),title:T(),body:T(),status:Eu,assigneeAgentId:T().nullable(),createdByType:jw,createdById:T(),originRef:T().nullable(),result:T().nullable(),metadata:Ht(T(),Ct()),createdAt:T(),updatedAt:T(),cancelledAt:T().nullable(),cancelledByType:jw.nullable(),cancelledById:T().nullable()}),P6=ie({taskId:T(),chatId:T(),linkedByAgentId:T().nullable(),linkedAt:T()});U6.extend({chats:un(P6)});ie({status:Eu.optional(),assigneeAgentId:T().optional(),originRef:T().optional(),limit:Ku().int().min(1).max(100).default(20),cursor:T().optional()});const B6=Pe(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);ie({taskId:T(),signal:B6,reason:T()});const $6=Pe(["active","suspended"]);ie({id:T(),username:T(),displayName:T(),avatarUrl:T().nullable(),status:$6,createdAt:T(),updatedAt:T()});ie({username:T().min(1).max(100),displayName:T().min(1).max(200),password:T().min(8).max(200)});ie({displayName:T().min(1).max(200).optional(),password:T().min(8).max(200).optional()});ie({type:Yt("auth"),token:T().min(1)});const F6=ie({wsInboxDeliver:Lr().default(!1)}).partial();ie({type:Yt("server:welcome"),serverCommandVersion:T().min(1),serverTimeMs:Fe().int().nonnegative(),capabilities:F6.optional()}).passthrough();const KC=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function q6(e){const t=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));for(const n of Object.values(e))for(let a=0;a<32&&a<n.length;a++){const l=n[a],o=t[a];!l||!o||(o.workingCount+=l.workingCount,o.errorMask=o.errorMask||l.errorMask)}return t}const H6=2e3,Z6=3e4;let hi=null,Nu=!1,tf=0,du=null;const Cg=new Set;let fi=null,il=0;function V6(e){for(const t of Cg)try{t(e)}catch{}if(fi){if(e.type==="notification")fi.invalidateQueries({queryKey:["notifications"]});else if(e.type==="session:state")fi.invalidateQueries({queryKey:["activity"]}),fi.invalidateQueries({queryKey:["sessions"]});else if(e.type==="chat:message"){const t=typeof e.chatId=="string"?e.chatId:null;fi.invalidateQueries({queryKey:["me","chats"]}),t&&(fi.invalidateQueries({queryKey:["chat-messages",t]}),fi.invalidateQueries({queryKey:["chat-detail",t]}))}}}function zy(){const e=mf();if(!(e!=null&&e.accessToken))return;let t=null;try{t=localStorage.getItem("first-tree-hub:selectedOrganizationId")}catch{t=null}if(!t)return;const a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/v1/orgs/${encodeURIComponent(t)}/ws/?token=${e.accessToken}`,l=new WebSocket(a);hi=l,l.onmessage=o=>{if(l===hi)try{const u=JSON.parse(o.data);V6(u)}catch{}},l.onopen=()=>{l===hi&&(tf=0)},l.onclose=o=>{if(l===hi&&(hi=null,!(Nu||il===0))){if(o.code===4001){QT().then(u=>{Nu||il===0||(u?(tf=0,zy()):Cw())});return}Cw()}}}function Cw(){tf++;const e=Math.min(H6*2**(tf-1),Z6);du=setTimeout(()=>{du=null,!Nu&&il>0&&zy()},e)}function Q6(){Nu=!0,du&&(clearTimeout(du),du=null),hi&&(hi.close(1e3,"unmount"),hi=null)}function GC(e){const{onMessage:t,enabled:n=!0}=e??{},a=dn(),l=b.useRef(t);l.current=t,b.useEffect(()=>{fi=a},[a]),b.useEffect(()=>{if(!n)return;const o=u=>{var f;return(f=l.current)==null?void 0:f.call(l,u)};return Cg.add(o),il++,il===1&&(Nu=!1,zy()),()=>{Cg.delete(o),il--,il===0&&Q6()}},[n])}const K6=b.createContext({aggregated:KC,agents:{},receivedAtMs:null,stale:!0});function G6({children:e}){const[t,n]=b.useState({aggregated:KC,agents:{},receivedAtMs:null}),[a,l]=b.useState(()=>Date.now());GC({onMessage:u=>{const f=z6.safeParse(u);f.success&&n({aggregated:q6(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),b.useEffect(()=>{const u=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(u)},[]);const o=b.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return c.jsx(K6.Provider,{value:o,children:e})}function Y6(e){return Ne.get(`/agents/${e}/config`)}function X6(e,t){return Ne.patch(`/agents/${e}/config`,t)}function J6(e,t){return Ne.post(`/agents/${e}/config/dry-run`,{payload:t})}function W6(e){return Ne.get(`/agents/${e}/client-status`)}function eU({className:e,style:t,...n}){return c.jsx("div",{className:Te("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function tU({onClick:e,children:t}){return c.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function nU(){return c.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function rU({children:e,mono:t}){return c.jsx("span",{className:Te("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const aU={neutral:{bg:"var(--bg-sunken)",fg:"var(--fg-2)",bd:"var(--border)"},accent:{bg:"var(--accent-bg)",fg:"var(--accent-dim)",bd:"color-mix(in oklch, var(--accent) 30%, transparent)"},warn:{bg:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},error:{bg:"color-mix(in oklch, var(--state-error) 14%, transparent)",fg:"var(--state-error)",bd:"color-mix(in oklch, var(--state-error) 30%, transparent)"},outline:{bg:"transparent",fg:"var(--fg-3)",bd:"var(--border)"},idle:{bg:"color-mix(in oklch, var(--state-idle) 14%, transparent)",fg:"var(--state-idle)",bd:"color-mix(in oklch, var(--state-idle) 30%, transparent)"},working:{bg:"color-mix(in oklch, var(--state-working) 14%, transparent)",fg:"var(--state-working)",bd:"color-mix(in oklch, var(--state-working) 30%, transparent)"},blocked:{bg:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",fg:"color-mix(in oklch, var(--state-blocked) 50%, var(--fg))",bd:"color-mix(in oklch, var(--state-blocked) 30%, transparent)"},offline:{bg:"color-mix(in oklch, var(--state-offline) 14%, transparent)",fg:"var(--state-offline)",bd:"color-mix(in oklch, var(--state-offline) 30%, transparent)"}};function zr({tone:e="neutral",className:t,style:n,...a}){const l=aU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return c.jsx("span",{className:Te("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}function Eg({children:e,right:t,className:n,style:a,...l}){return c.jsxs("div",{className:Te("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[c.jsx("span",{children:e}),t]})}function Oy({className:e,style:t,...n}){return c.jsx("span",{className:Te("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function fu({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?c.jsxs("span",{className:Te("shrink-0",n),style:a,role:"img","aria-label":"working",children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),c.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?c.jsx("span",{className:Te("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:c.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?c.jsx("span",{className:Te("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?c.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):c.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function iU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function _u({state:e,className:t}){const n=e!==null&&iU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return c.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[c.jsx(fu,{state:n,size:7}),n]})}function Ad({label:e,value:t,accent:n}){return c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[c.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),c.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function lU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?c.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:c.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[c.jsxs("span",{children:["Runs on ",c.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&c.jsxs(c.Fragment,{children:[c.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),c.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function sU(e){const{agent:t}=e,[n,a]=b.useState(!1),[l,o]=b.useState(!1),u=t.displayName||t.name||t.uuid;return c.jsxs("section",{id:"ad-danger",style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-panel)"},children:[c.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[c.jsx(oy,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),c.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),c.jsxs("div",{children:[t.status==="active"?c.jsx(yp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:c.jsx(ge,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):c.jsx(yp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:c.jsx(ge,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),c.jsx(yp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:c.jsxs(ge,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[c.jsx(Bs,{className:"h-3 w-3"}),"Delete"]})})]}),c.jsx(oU,{open:l,onOpenChange:o,label:u,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),c.jsx(uU,{open:n,onOpenChange:a,expected:u,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function yp(e){return c.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),c.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),c.jsx("div",{children:e.action})]})}function oU({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsxs(rn,{children:['Suspend "',n,'"?']})}),c.jsx("div",{className:"space-y-3",children:c.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),c.jsx(ge,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function uU({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,u]=b.useState("");function f(m){m.preventDefault(),o===n&&a()}return c.jsx(nn,{open:e,onOpenChange:m=>{t(m),m||u("")},children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsxs(rn,{children:['Delete "',n,'"?']})}),c.jsxs("form",{onSubmit:f,className:"space-y-4",children:[c.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",c.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),c.jsx(_t,{value:o,onChange:m=>u(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),c.jsx(ge,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}var cU="Label",YC=b.forwardRef((e,t)=>c.jsx(_a.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));YC.displayName=cU;var dU=YC;const ct=b.forwardRef(({className:e,...t},n)=>c.jsx(dU,{ref:n,className:Te("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));ct.displayName="Label";const Zn=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));Zn.displayName="Panel";const Aa=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Te("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Aa.displayName="PanelHeader";const Ta=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Te("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Ta.displayName="PanelTitle";const Ra=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("div",{ref:a,className:Te(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Ra.displayName="PanelBody";const fU={unchanged:{label:"",tone:""},added:{label:"new",tone:"bg-success-soft text-success"},modified:{label:"changed",tone:"bg-warn-soft text-warn"},deleted:{label:"will be removed on save",tone:"bg-error-soft text-error"}};function Dy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const u=fU[e],f=e==="deleted";return c.jsxs("div",{className:Te("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[c.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),u.label&&c.jsx("span",{className:Te("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",u.tone),children:u.label}),!o&&(f?c.jsxs(ge,{size:"sm",variant:"ghost",onClick:a,children:[c.jsx(az,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsxs(ge,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[c.jsx(pf,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"sr-only",children:"Edit"})]}),c.jsxs(ge,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[c.jsx(Bs,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function hU(e){const[t,n]=b.useState(null),[a,l]=b.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),u=e.items.filter(f=>f.status!=="deleted").length;return c.jsxs(Zn,{children:[c.jsxs(Aa,{children:[c.jsxs(Ta,{children:["Environment variables (",u,")"]}),!e.disabled&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(Ir,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Ra,{className:"space-y-2",children:e.items.length===0?c.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===Wd,y=m&&!h&&!!f.value.value,g=a.has(f.key);let x;return m?y&&g?x=f.value.value:x="••••••":x=f.value.value||c.jsx("em",{children:"(empty)"}),c.jsxs(Dy,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[c.jsx("span",{className:"font-mono font-medium",children:f.value.key}),c.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:x}),m&&c.jsx(Dk,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&c.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?c.jsx(TR,{className:"h-3.5 w-3.5"}):c.jsx(zR,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&c.jsx(mU,{open:!!t,onOpenChange:f=>!f&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenKeys:e.otherKeys(t.mode==="edit"?t.key:null),onSubmit:f=>{t.mode==="edit"?e.onUpdate(t.key,f):e.onAdd(f),n(null)}})]})}function mU({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,u]=b.useState((n==null?void 0:n.key)??""),[f,m]=b.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=b.useState((n==null?void 0:n.sensitive)??!1),[g,x]=b.useState(null);b.useEffect(()=>{e&&(u((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),x(null))},[e,n]);function w(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){x("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){x(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=Wd),!h&&!n&&!f){x("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:n?"Edit environment variable":"Add environment variable"})}),c.jsxs("form",{onSubmit:w,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"env-key",children:"Key"}),c.jsx(_t,{id:"env-key",value:o,onChange:k=>u(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&c.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"env-value",children:"Value"}),c.jsx(_t,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),c.jsxs("label",{className:"flex items-center gap-2 text-body",children:[c.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&c.jsx("p",{className:"text-body text-destructive",children:g}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(ge,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function pU(e){const[t,n]=b.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return c.jsxs(Zn,{children:[c.jsxs(Aa,{children:[c.jsxs(Ta,{children:["Git repositories (",a,")"]}),!e.disabled&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(Ir,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Ra,{className:"space-y-2",children:e.items.length===0?c.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??ef(l.value.url);return c.jsxs(Dy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[c.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&c.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),c.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&c.jsx(gU,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenPaths:e.otherPaths(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function gU({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,u]=b.useState((n==null?void 0:n.url)??""),[f,m]=b.useState((n==null?void 0:n.ref)??""),[h,y]=b.useState((n==null?void 0:n.localPath)??""),[g,x]=b.useState(null);b.useEffect(()=>{e&&(u((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),x(null))},[e,n]);function w(k){k.preventDefault();const j=o.trim();if(!j){x("URL is required.");return}const C=h.trim()||ef(j);if(C&&a.has(C)){x(`Another repo already occupies local path "${C}".`);return}const E={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(E)}return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:n?"Edit Git repository":"Add Git repository"})}),c.jsxs("form",{onSubmit:w,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"git-url",children:"URL"}),c.jsx(_t,{id:"git-url",value:o,onChange:k=>u(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),c.jsx(_t,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"git-path",children:"Local path (optional)"}),c.jsx(_t,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:ef(o)||"repo-name",className:"font-mono"}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&c.jsx("p",{className:"text-body text-destructive",children:g}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(ge,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function yU({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:u,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return c.jsx("span",{className:Te("mono text-label",o),style:{color:"var(--fg-4)",...u},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,x=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?c.jsxs("span",{className:Te("inline-flex flex-col leading-tight",o),style:{gap:1,...u},title:y??void 0,children:[h&&c.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&c.jsxs("span",{className:"mono text-caption",style:{color:x},children:["@",e]})]}):c.jsxs("span",{className:Te("inline-flex items-baseline gap-1.5",o),style:u,title:y??void 0,children:[h&&c.jsx("span",{style:{color:g},children:t}),m&&c.jsxs("span",{className:"mono text-caption",style:{color:x},children:["@",e]})]})}function _f(){return Ne.get(an("/members"))}function vU(e,t){return Ne.patch(an(`/members/${encodeURIComponent(e)}`),t)}function bU(e){return Ne.delete(an(`/members/${encodeURIComponent(e)}`))}function XC(){const{data:e}=Ve({queryKey:["members","name-map"],queryFn:_f,staleTime:3e4});return b.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function xU({agent:e,onSave:t}){const[n,a]=b.useState(!1),l=vy(),o=XC(),u=e.metadata,f=u==null?void 0:u.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(x=>typeof x=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return c.jsxs(Zn,{children:[c.jsxs(Aa,{children:[c.jsx(Ta,{children:"Profile"}),e.status==="active"&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[c.jsx(pf,{className:"h-3 w-3"})," Edit"]})]}),c.jsxs(Ra,{className:"text-body space-y-1",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&c.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),c.jsxs("span",{className:"text-muted-foreground",children:["delegate ",c.jsx(yU,{name:g.name,displayName:g.displayName})]})]})]}),c.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[c.jsxs("span",{children:["owner ",c.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&c.jsxs("span",{children:["role ",c.jsx("span",{className:"text-foreground",children:m})]}),c.jsxs("span",{children:["type ",c.jsx(zr,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),c.jsxs("span",{children:["visibility"," ",c.jsx(zr,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&c.jsxs("span",{children:["domains"," ",c.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(x=>c.jsx(zr,{tone:"outline",children:x},x))})]})]})]}),c.jsx(wU,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function wU({agent:e,open:t,onOpenChange:n,onSave:a}){var I;const{memberId:l,role:o}=zt(),[u,f]=b.useState(e.displayName),[m,h]=b.useState(e.delegateMention??""),[y,g]=b.useState(e.visibility),[x,w]=b.useState(!1),[k,j]=b.useState(null);b.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const C=e.type==="human",E=o==="admin"||e.managerId===l,R=Ve({queryKey:["agents-for-delegate"],queryFn:async()=>(await Vu({limit:100})).items.filter(O=>O.type==="personal_assistant"&&O.status==="active"),enabled:t&&C});async function z(B){B.preventDefault(),j(null);const O=u.trim();if(!O){j("Display name is required.");return}w(!0);try{const D={displayName:O,delegateMention:m||null};y!==e.visibility&&(D.visibility=y),await a(D),n(!1)}catch(D){j(D instanceof Error?D.message:String(D))}finally{w(!1)}}return c.jsx(nn,{open:t,onOpenChange:n,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Edit Identity"})}),c.jsxs("form",{onSubmit:z,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Agent name"}),c.jsx(_t,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"id-display",children:"Display Name"}),c.jsx(_t,{id:"id-display",value:u,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"id-visibility",children:"Visibility"}),c.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.target.value),disabled:!E,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[c.jsx("option",{value:kw.PRIVATE,children:"Private — only the manager"}),c.jsx("option",{value:kw.ORGANIZATION,children:"Organization — all members"})]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:E?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),C&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"id-delegate",children:"Delegate Mention"}),c.jsxs("select",{id:"id-delegate",value:m,onChange:B=>h(B.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[c.jsx("option",{value:"",children:"None"}),(I=R.data)==null?void 0:I.map(B=>c.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (@${B.name??B.uuid})`:B.name?`@${B.name}`:B.uuid},B.uuid))]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&c.jsx("p",{className:"text-body text-destructive",children:k}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:x,children:"Cancel"}),c.jsx(ge,{type:"submit",disabled:x,children:x?"Saving…":"Save"})]})]})]})})}function SU(e){return e==="working"?"accent":e==="error"?"error":"outline"}function kU(e){const[t,n]=b.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return c.jsxs(Zn,{children:[c.jsxs(Aa,{children:[c.jsxs(Ta,{children:["MCP servers (",a,")"]}),!e.disabled&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[c.jsx(Ir,{className:"h-3 w-3"})," Add"]})]}),c.jsx(Ra,{className:"space-y-2",children:e.items.length===0?c.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return c.jsxs(Dy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[c.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),c.jsx("span",{className:"font-medium font-mono",children:l.value.name}),c.jsx(zr,{tone:SU(o),children:o}),c.jsx("span",{className:"text-caption text-muted-foreground truncate",children:jU(l.value)})]},l.key)})}),t&&c.jsx(CU,{open:!!t,onOpenChange:l=>!l&&n(null),initial:t.mode==="edit"?t.initial:null,forbiddenNames:e.otherNames(t.mode==="edit"?t.key:null),onSubmit:l=>{t.mode==="edit"?e.onUpdate(t.key,l):e.onAdd(l),n(null)}})]})}function jU(e){var t;if(e.transport==="stdio"){const n=(t=e.args)!=null&&t.length?` ${e.args.join(" ")}`:"";return`${e.command}${n}`}return e.url}function CU({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,u]=b.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=b.useState((n==null?void 0:n.name)??""),[h,y]=b.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,x]=b.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=b.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,C]=b.useState(null);b.useEffect(()=>{e&&(u((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),x((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),C(null))},[e,n]);function E(R){if(R.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){C("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){C(`Another MCP server is already named "${f}".`);return}let z;if(o==="stdio"){if(!h.trim()){C("stdio transport requires a command.");return}const I=g.trim().split(/\s+/).filter(B=>B.length>0);z={name:f,transport:"stdio",command:h.trim(),...I.length?{args:I}:{}}}else{const I=w.trim();try{new URL(I)}catch{C("URL is not valid.");return}z={name:f,transport:o,url:I}}l(z)}return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:n?"Edit MCP server":"Add MCP server"})}),c.jsxs("form",{onSubmit:E,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-transport",children:"Transport"}),c.jsxs("select",{id:"mcp-transport",value:o,onChange:R=>u(R.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[c.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),c.jsx("option",{value:"http",children:"http"}),c.jsx("option",{value:"sse",children:"sse"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-name",children:"Name"}),c.jsx(_t,{id:"mcp-name",value:f,onChange:R=>m(R.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-command",children:"Command"}),c.jsx(_t,{id:"mcp-command",value:h,onChange:R=>y(R.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),c.jsx(_t,{id:"mcp-args",value:g,onChange:R=>x(R.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"mcp-url",children:"URL"}),c.jsx(_t,{id:"mcp-url",value:w,onChange:R=>k(R.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&c.jsx("p",{className:"text-body text-destructive",children:j}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),c.jsx(ge,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const EU=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],NU=[{value:"gpt-5.5",label:"gpt-5.5",hint:"latest"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5.4-mini",label:"gpt-5.4-mini",hint:"fastest"},{value:"gpt-5.3-codex",label:"gpt-5.3-codex",hint:"coding-specialized"},{value:"gpt-5.2",label:"gpt-5.2"}],_U={"claude-code":EU,codex:NU},AU={"claude-code":"Choose which Claude model powers this agent. Aliases (opus / sonnet / haiku) follow the CLI's latest-in-family mapping and may shift across releases. Applies to new sessions immediately; active sessions switch on their next message. Unset falls back to the operator's local ~/.claude/settings.json model preference, then the CLI default.",codex:"Pick a Codex model. Slugs come from the Codex CLI bundled with @openai/codex-sdk; ChatGPT-account auth currently only accepts gpt-5.5, while API-key auth accepts the wider set. Applies to new sessions immediately; active sessions switch on their next message. Unset lets the codex CLI choose a model that matches the user's auth mode."},TU={value:"",label:"(unset — inherits local)"};function RU({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const u=e!==t,f=_U[o],m=b.useMemo(()=>{const h=[TU,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return c.jsxs(Zn,{style:{borderColor:u?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[c.jsxs(Aa,{children:[c.jsxs(Ta,{children:["Model",u&&c.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),u&&c.jsx(ge,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),c.jsxs(Ra,{className:"space-y-2",children:[c.jsx(zU,{items:m,value:e,onChange:n,disabled:l}),c.jsx("p",{className:"text-caption text-muted-foreground",children:AU[o]})]})]})}function zU({items:e,value:t,onChange:n,disabled:a}){const[l,o]=b.useState(!1),[u,f]=b.useState(null),m=b.useRef(null),h=b.useRef(null),y=e.find(x=>x.value===t)??e[0],g=b.useCallback(()=>{const x=m.current;if(!x)return;const w=x.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return b.useLayoutEffect(()=>{l&&g()},[l,g]),b.useEffect(()=>{if(!l)return;const x=j=>{var E,R;const C=j.target;(E=m.current)!=null&&E.contains(C)||(R=h.current)!=null&&R.contains(C)||o(!1)},w=j=>{var C;j.key==="Escape"&&(o(!1),(C=m.current)==null||C.focus())},k=()=>g();return document.addEventListener("pointerdown",x),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",x),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),c.jsxs("div",{className:"max-w-md",children:[c.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(x=>!x),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[c.jsx("span",{className:"truncate",style:{color:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),c.jsx(Rk,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&u&&fy.createPortal(c.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:u.top,left:u.left,width:u.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(x=>{const w=x.value===t;return c.jsxs("button",{type:"button",onClick:()=>{n(x.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:w?"var(--bg-hover)":void 0,color:x.value===""?"var(--fg-3)":void 0},children:[c.jsx(Mr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),c.jsx("span",{className:"flex-1 truncate",children:x.label}),x.hint&&c.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:x.hint})]},x.value||"__unset")})}),document.body)]})}function OU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const DU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IU={};function Ew(e,t){return(IU.jsx?MU:DU).test(e)}const LU=/[ \t\n\f\r]/g;function UU(e){return typeof e=="object"?e.type==="text"?Nw(e.value):!1:Nw(e)}function Nw(e){return e.replace(LU,"")===""}class Gu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Gu.prototype.normal={};Gu.prototype.property={};Gu.prototype.space=void 0;function JC(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Gu(n,a,t)}function Ng(e){return e.toLowerCase()}class Gn{constructor(t,n){this.attribute=n,this.property=t}}Gn.prototype.attribute="";Gn.prototype.booleanish=!1;Gn.prototype.boolean=!1;Gn.prototype.commaOrSpaceSeparated=!1;Gn.prototype.commaSeparated=!1;Gn.prototype.defined=!1;Gn.prototype.mustUseProperty=!1;Gn.prototype.number=!1;Gn.prototype.overloadedBoolean=!1;Gn.prototype.property="";Gn.prototype.spaceSeparated=!1;Gn.prototype.space=void 0;let PU=0;const Ze=jl(),Gt=jl(),_g=jl(),he=jl(),kt=jl(),ks=jl(),rr=jl();function jl(){return 2**++PU}const Ag=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ze,booleanish:Gt,commaOrSpaceSeparated:rr,commaSeparated:ks,number:he,overloadedBoolean:_g,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),vp=Object.keys(Ag);class My extends Gn{constructor(t,n,a,l){let o=-1;if(super(t,n),_w(this,"space",l),typeof a=="number")for(;++o<vp.length;){const u=vp[o];_w(this,vp[o],(a&Ag[u])===Ag[u])}}}My.prototype.defined=!0;function _w(e,t,n){n&&(e[t]=n)}function Js(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new My(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Ng(a)]=a,n[Ng(o.attribute)]=a}return new Gu(t,n,e.space)}const WC=Js({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:kt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:he,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:kt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Gt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function eE(e,t){return t in e?e[t]:t}function tE(e,t){return eE(e,t.toLowerCase())}const BU=Js({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ks,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ze,allowPaymentRequest:Ze,allowUserMedia:Ze,alt:null,as:null,async:Ze,autoCapitalize:null,autoComplete:kt,autoFocus:Ze,autoPlay:Ze,blocking:kt,capture:null,charSet:null,checked:Ze,cite:null,className:kt,cols:he,colSpan:null,content:null,contentEditable:Gt,controls:Ze,controlsList:kt,coords:he|ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ze,defer:Ze,dir:null,dirName:null,disabled:Ze,download:_g,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ze,formTarget:null,headers:kt,height:he,hidden:_g,high:he,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ze,inputMode:null,integrity:null,is:null,isMap:Ze,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ze,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ze,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ze,muted:Ze,name:null,nonce:null,noModule:Ze,noValidate:Ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ze,optimum:he,pattern:null,ping:kt,placeholder:null,playsInline:Ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ze,referrerPolicy:null,rel:kt,required:Ze,reversed:Ze,rows:he,rowSpan:he,sandbox:kt,scope:null,scoped:Ze,seamless:Ze,selected:Ze,shadowRootClonable:Ze,shadowRootDelegatesFocus:Ze,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ze,useMap:null,value:Gt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ze,declare:Ze,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ze,noHref:Ze,noShade:Ze,noWrap:Ze,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ze,disableRemotePlayback:Ze,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:tE}),$U=Js({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:rr,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:kt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ks,g2:ks,glyphName:ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rr,rev:rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rr,requiredFeatures:rr,requiredFonts:rr,requiredFormats:rr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rr,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eE}),nE=Js({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),rE=Js({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tE}),aE=Js({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),FU={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},qU=/[A-Z]/g,Aw=/-[a-z]/g,HU=/^data[-\w.:]+$/i;function ZU(e,t){const n=Ng(t);let a=t,l=Gn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&HU.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Aw,QU);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Aw.test(o)){let u=o.replace(qU,VU);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=My}return new l(a,t)}function VU(e){return"-"+e.toLowerCase()}function QU(e){return e.charAt(1).toUpperCase()}const KU=JC([WC,BU,nE,rE,aE],"html"),Iy=JC([WC,$U,nE,rE,aE],"svg");function GU(e){return e.join(" ").trim()}var hs={},bp,Tw;function YU(){if(Tw)return bp;Tw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
353
|
+
`,h="/",y="*",g="",x="comment",w="declaration";function k(C,E){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];E=E||{};var R=1,z=1;function I(G){var W=G.match(t);W&&(R+=W.length);var Z=G.lastIndexOf(m);z=~Z?G.length-Z:z+G.length}function B(){var G={line:R,column:z};return function(W){return W.position=new O(G),V(),W}}function O(G){this.start=G,this.end={line:R,column:z},this.source=E.source}O.prototype.content=C;function D(G){var W=new Error(E.source+":"+R+":"+z+": "+G);if(W.reason=G,W.filename=E.source,W.line=R,W.column=z,W.source=C,!E.silent)throw W}function U(G){var W=G.exec(C);if(W){var Z=W[0];return I(Z),C=C.slice(Z.length),W}}function V(){U(n)}function F(G){var W;for(G=G||[];W=ne();)W!==!1&&G.push(W);return G}function ne(){var G=B();if(!(h!=C.charAt(0)||y!=C.charAt(1))){for(var W=2;g!=C.charAt(W)&&(y!=C.charAt(W)||h!=C.charAt(W+1));)++W;if(W+=2,g===C.charAt(W-1))return D("End of comment missing");var Z=C.slice(2,W-2);return z+=2,I(Z),C=C.slice(W),z+=2,G({type:x,comment:Z})}}function oe(){var G=B(),W=U(a);if(W){if(ne(),!U(l))return D("property missing ':'");var Z=U(o),re=G({type:w,property:j(W[0].replace(e,g)),value:Z?j(Z[0].replace(e,g)):g});return U(u),re}}function Se(){var G=[];F(G);for(var W;W=oe();)W!==!1&&(G.push(W),F(G));return G}return V(),Se()}function j(C){return C?C.replace(f,g):g}return bp=k,bp}var Rw;function XU(){if(Rw)return hs;Rw=1;var e=hs&&hs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(hs,"__esModule",{value:!0}),hs.default=n;const t=e(YU());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const u=(0,t.default)(a),f=typeof l=="function";return u.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return hs}var au={},zw;function JU(){if(zw)return au;zw=1,Object.defineProperty(au,"__esModule",{value:!0}),au.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},u=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,u))};return au.camelCase=m,au}var iu,Ow;function WU(){if(Ow)return iu;Ow=1;var e=iu&&iu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(XU()),n=JU();function a(l,o){var u={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(u[(0,n.camelCase)(f,o)]=m)}),u}return a.default=a,iu=a,iu}var eP=WU();const tP=uf(eP),iE=lE("end"),Ly=lE("start");function lE(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function nP(e){const t=Ly(e),n=iE(e);if(t&&n)return{start:t,end:n}}function hu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Dw(e.position):"start"in e||"end"in e?Dw(e):"line"in e||"column"in e?Tg(e):""}function Tg(e){return Mw(e&&e.line)+":"+Mw(e&&e.column)}function Dw(e){return Tg(e&&e.start)+"-"+Tg(e&&e.end)}function Mw(e){return e&&typeof e=="number"?e:1}class Nn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(u=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=hu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Nn.prototype.file="";Nn.prototype.name="";Nn.prototype.reason="";Nn.prototype.message="";Nn.prototype.stack="";Nn.prototype.column=void 0;Nn.prototype.line=void 0;Nn.prototype.ancestors=void 0;Nn.prototype.cause=void 0;Nn.prototype.fatal=void 0;Nn.prototype.place=void 0;Nn.prototype.ruleId=void 0;Nn.prototype.source=void 0;const Uy={}.hasOwnProperty,rP=new Map,aP=/[A-Z]/g,iP=new Set(["table","tbody","thead","tfoot","tr"]),lP=new Set(["td","th"]),sE="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=pP(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=mP(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Iy:KU,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=oE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function oE(e,t,n){if(t.type==="element")return oP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return uP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return dP(e,t,n);if(t.type==="mdxjsEsm")return cP(e,t);if(t.type==="root")return fP(e,t,n);if(t.type==="text")return hP(e,t)}function oP(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Iy,e.schema=l),e.ancestors.push(t);const o=cE(e,t.tagName,!1),u=gP(e,t);let f=By(e,t);return iP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!UU(m):!0})),uE(e,u,o,t),Py(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function uP(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Au(e,t.position)}function cP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Au(e,t.position)}function dP(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Iy,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:cE(e,t.name,!0),u=yP(e,t),f=By(e,t);return uE(e,u,o,t),Py(u,f),e.ancestors.pop(),e.schema=a,e.create(t,o,u,n)}function fP(e,t,n){const a={};return Py(a,By(e,t)),e.create(t,e.Fragment,a,n)}function hP(e,t){return t.value}function uE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Py(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mP(e,t,n){return a;function a(l,o,u,f){const h=Array.isArray(u.children)?n:t;return f?h(o,u,f):h(o,u)}}function pP(e,t){return n;function n(a,l,o,u){const f=Array.isArray(o.children),m=Ly(a);return t(l,o,u,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function gP(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Uy.call(t.properties,l)){const o=vP(e,l,t.properties[l]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&lP.has(t.tagName)?a=f:n[u]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function yP(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Au(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else Au(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function By(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:rP;for(;++a<t.children.length;){const o=t.children[a];let u;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;u=m+"-"+h,l.set(m,h+1)}}const f=oE(e,o,u);f!==void 0&&n.push(f)}return n}function vP(e,t,n){const a=ZU(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?OU(n):GU(n)),a.property==="style"){let l=typeof n=="object"?n:bP(e,String(n));return e.stylePropertyNameCase==="css"&&(l=xP(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?FU[a.property]||a.property:a.attribute,n]}}function bP(e,t){try{return tP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new Nn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=sE+"#cannot-parse-style-attribute",l}}function cE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,u;for(;++o<l.length;){const f=Ew(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=u}else a=Ew(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Uy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Au(e)}function Au(e,t){const n=new Nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=sE+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xP(e){const t={};let n;for(n in e)Uy.call(e,n)&&(t[wP(n)]=e[n]);return t}function wP(e){let t=e.replace(aP,SP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function SP(e){return"-"+e.toLowerCase()}const xp={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},kP={};function $y(e,t){const n=kP,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return dE(e,a,l)}function dE(e,t,n){if(jP(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Iw(e.children,t,n)}return Array.isArray(e)?Iw(e,t,n):""}function Iw(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=dE(e[l],t,n);return a.join("")}function jP(e){return!!(e&&typeof e=="object")}const Lw=document.createElement("i");function Fy(e){const t="&"+e+";";Lw.innerHTML=t;const n=Lw.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function sr(e,t,n,a){const l=e.length;let o=0,u;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)u=Array.from(a),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<a.length;)u=a.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function kr(e,t){return e.length>0?(sr(e,e.length,0,t),e):t}const Uw={}.hasOwnProperty;function fE(e){const t={};let n=-1;for(;++n<e.length;)CP(t,e[n]);return t}function CP(e,t){let n;for(n in t){const l=(Uw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){Uw.call(l,u)||(l[u]=[]);const f=o[u];EP(l[u],Array.isArray(f)?f:f?[f]:[])}}}function EP(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);sr(e,0,0,a)}function hE(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rn=Di(/[A-Za-z]/),En=Di(/[\dA-Za-z]/),NP=Di(/[#-'*+\--9=?A-Z^-~]/);function nf(e){return e!==null&&(e<32||e===127)}const Rg=Di(/\d/),_P=Di(/[\dA-Fa-f]/),AP=Di(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function St(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Af=Di(new RegExp("\\p{P}|\\p{S}","u")),bl=Di(/\s/);function Di(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ws(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&En(e.charCodeAt(n+1))&&En(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),l=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(a,n),encodeURIComponent(u)),a=n+l+1,u=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function lt(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(m){return Je(m)?(e.enter(n),f(m)):t(m)}function f(m){return Je(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const TP={tokenize:RP};function RP(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),lt(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return De(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const zP={tokenize:OP},Pw={tokenize:DP};function OP(e){const t=this,n=[];let a=0,l,o,u;return f;function f(z){if(a<n.length){const I=n[a];return t.containerState=I[1],e.attempt(I[0].continuation,m,h)(z)}return h(z)}function m(z){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const I=t.events.length;let B=I,O;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){O=t.events[B][1].end;break}E(a);let D=I;for(;D<t.events.length;)t.events[D][1].end={...O},D++;return sr(t.events,B+1,0,t.events.slice(I)),t.events.length=D,h(z)}return f(z)}function h(z){if(a===n.length){if(!l)return x(z);if(l.currentConstruct&&l.currentConstruct.concrete)return k(z);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pw,y,g)(z)}function y(z){return l&&R(),E(a),x(z)}function g(z){return t.parser.lazy[t.now().line]=a!==n.length,u=t.now().offset,k(z)}function x(z){return t.containerState={},e.attempt(Pw,w,k)(z)}function w(z){return a++,n.push([t.currentConstruct,t.containerState]),x(z)}function k(z){if(z===null){l&&R(),E(0),e.consume(z);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(z)}function j(z){if(z===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(z);return}return De(z)?(e.consume(z),C(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(z),j)}function C(z,I){const B=t.sliceStream(z);if(I&&B.push(null),z.previous=o,o&&(o.next=z),o=z,l.defineSkip(z.start),l.write(B),t.parser.lazy[z.start.line]){let O=l.events.length;for(;O--;)if(l.events[O][1].start.offset<u&&(!l.events[O][1].end||l.events[O][1].end.offset>u))return;const D=t.events.length;let U=D,V,F;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(V){F=t.events[U][1].end;break}V=!0}for(E(a),O=D;O<t.events.length;)t.events[O][1].end={...F},O++;sr(t.events,U+1,0,t.events.slice(D)),t.events.length=O}}function E(z){let I=n.length;for(;I-- >z;){const B=n[I];t.containerState=B[1],B[0].exit.call(t,e)}n.length=z}function R(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function DP(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qs(e){if(e===null||St(e)||bl(e))return 1;if(Af(e))return 2}function Tf(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const zg={name:"attention",resolveAll:MP,tokenize:IP};function MP(e,t){let n=-1,a,l,o,u,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};Bw(g,-m),Bw(x,m),u={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[a][1].end={...u.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=kr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=kr(h,[["enter",l,t],["enter",u,t],["exit",u,t],["enter",o,t]]),h=kr(h,Tf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=kr(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,h=kr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,sr(e,a-1,n-a+3,h),n=a+h.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function IP(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=qs(a);let o;return u;function u(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=qs(m),g=!y||y===2&&l||n.includes(m),x=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!x)),h._close=!!(o===42?x:x&&(y||!g)),t(m)}}function Bw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const LP={name:"autolink",tokenize:UP};function UP(e,t,n){let a=0;return l;function l(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(w){return Rn(w)?(e.consume(w),u):w===64?n(w):h(w)}function u(w){return w===43||w===45||w===46||En(w)?(a=1,f(w)):h(w)}function f(w){return w===58?(e.consume(w),a=0,m):(w===43||w===45||w===46||En(w))&&a++<32?(e.consume(w),f):(a=0,h(w))}function m(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||nf(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):NP(w)?(e.consume(w),h):n(w)}function y(w){return En(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||En(w))&&a++<63){const k=w===45?x:g;return e.consume(w),k}return n(w)}}const Yu={partial:!0,tokenize:PP};function PP(e,t,n){return a;function a(o){return Je(o)?lt(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||De(o)?t(o):n(o)}}const mE={continuation:{tokenize:$P},exit:FP,name:"blockQuote",tokenize:BP};function BP(e,t,n){const a=this;return l;function l(u){if(u===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function $P(e,t,n){const a=this;return l;function l(u){return Je(u)?lt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(mE,t,n)(u)}}function FP(e){e.exit("blockQuote")}const pE={name:"characterEscape",tokenize:qP};function qP(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return AP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const gE={name:"characterReference",tokenize:HP};function HP(e,t,n){const a=this;let l=0,o,u;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,u=En,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=_P,y):(e.enter("characterReferenceValue"),o=7,u=Rg,y(g))}function y(g){if(g===59&&l){const x=e.exit("characterReferenceValue");return u===En&&!Fy(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&l++<o?(e.consume(g),y):n(g)}}const $w={partial:!0,tokenize:VP},Fw={concrete:!0,name:"codeFenced",tokenize:ZP};function ZP(e,t,n){const a=this,l={partial:!0,tokenize:B};let o=0,u=0,f;return m;function m(O){return h(O)}function h(O){const D=a.events[a.events.length-1];return o=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,f=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(O)}function y(O){return O===f?(u++,e.consume(O),y):u<3?n(O):(e.exit("codeFencedFenceSequence"),Je(O)?lt(e,g,"whitespace")(O):g(O))}function g(O){return O===null||De(O)?(e.exit("codeFencedFence"),a.interrupt?t(O):e.check($w,j,I)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(O))}function x(O){return O===null||De(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(O)):Je(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),lt(e,w,"whitespace")(O)):O===96&&O===f?n(O):(e.consume(O),x)}function w(O){return O===null||De(O)?g(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(O))}function k(O){return O===null||De(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(O)):O===96&&O===f?n(O):(e.consume(O),k)}function j(O){return e.attempt(l,I,C)(O)}function C(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),E}function E(O){return o>0&&Je(O)?lt(e,R,"linePrefix",o+1)(O):R(O)}function R(O){return O===null||De(O)?e.check($w,j,I)(O):(e.enter("codeFlowValue"),z(O))}function z(O){return O===null||De(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),z)}function I(O){return e.exit("codeFenced"),t(O)}function B(O,D,U){let V=0;return F;function F(W){return O.enter("lineEnding"),O.consume(W),O.exit("lineEnding"),ne}function ne(W){return O.enter("codeFencedFence"),Je(W)?lt(O,oe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):oe(W)}function oe(W){return W===f?(O.enter("codeFencedFenceSequence"),Se(W)):U(W)}function Se(W){return W===f?(V++,O.consume(W),Se):V>=u?(O.exit("codeFencedFenceSequence"),Je(W)?lt(O,G,"whitespace")(W):G(W)):U(W)}function G(W){return W===null||De(W)?(O.exit("codeFencedFence"),D(W)):U(W)}}}function VP(e,t,n){const a=this;return l;function l(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}const wp={name:"codeIndented",tokenize:KP},QP={partial:!0,tokenize:GP};function KP(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),lt(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(h):n(h)}function u(h){return h===null?m(h):De(h)?e.attempt(QP,u,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||De(h)?(e.exit("codeFlowValue"),u(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function GP(e,t,n){const a=this;return l;function l(u){return a.parser.lazy[a.now().line]?n(u):De(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):lt(e,o,"linePrefix",5)(u)}function o(u){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):De(u)?l(u):n(u)}}const YP={name:"codeText",previous:JP,resolve:XP,tokenize:WP};function XP(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function JP(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function WP(e,t,n){let a=0,l,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):De(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||De(g)?(e.exit("codeTextData"),m(g)):(e.consume(g),h)}function y(g){return g===96?(e.consume(g),l++,y):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class e9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&lu(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),lu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);lu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lu(this.left,n.reverse())}}}function lu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yE(e){const t={};let n=-1,a,l,o,u,f,m,h;const y=new e9(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(a=y.get(n),n&&a[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,t9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return sr(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function t9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let u=n._tokenizer;u||(u=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,m=[],h={};let y,g,x=-1,w=n,k=0,j=0;const C=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&u.defineSkip(w.start),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=n;++x<f.length;)f[x][0]==="exit"&&f[x-1][0]==="enter"&&f[x][1].type===f[x-1][1].type&&f[x][1].start.line!==f[x][1].end.line&&(j=x+1,C.push(j),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(u.events=[],w?(w._tokenizer=void 0,w.previous=void 0):C.pop(),x=C.length;x--;){const E=f.slice(C[x],C[x+1]),R=o.pop();m.push([R,R+E.length-1]),e.splice(R,2,E)}for(m.reverse(),x=-1;++x<m.length;)h[k+m[x][0]]=k+m[x][1],k+=m[x][1]-m[x][0]-1;return h}const n9={resolve:a9,tokenize:i9},r9={partial:!0,tokenize:l9};function a9(e){return yE(e),e}function i9(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):De(f)?e.check(r9,u,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function l9(e,t,n){const a=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),lt(e,o,"linePrefix")}function o(u){if(u===null||De(u))return n(u);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(a.parser.constructs.flow,n,t)(u)}}function vE(e,t,n,a,l,o,u,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(E),e.exit(o),x):E===null||E===32||E===41||nf(E)?n(E):(e.enter(a),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(E))}function x(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),w(E))}function w(E){return E===62?(e.exit("chunkString"),e.exit(f),x(E)):E===null||E===60||De(E)?n(E):(e.consume(E),E===92?k:w)}function k(E){return E===60||E===62||E===92?(e.consume(E),w):w(E)}function j(E){return!y&&(E===null||E===41||St(E))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(a),t(E)):y<h&&E===40?(e.consume(E),y++,j):E===41?(e.consume(E),y--,j):E===null||E===32||E===40||nf(E)?n(E):(e.consume(E),E===92?C:j)}function C(E){return E===40||E===41||E===92?(e.consume(E),j):j(E)}}function bE(e,t,n,a,l,o){const u=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):De(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||De(w)||f++>999?(e.exit("chunkString"),y(w)):(e.consume(w),m||(m=!Je(w)),w===92?x:g)}function x(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function xE(e,t,n,a,l,o){let u;return f;function f(x){return x===34||x===39||x===40?(e.enter(a),e.enter(l),e.consume(x),e.exit(l),u=x===40?41:x,m):n(x)}function m(x){return x===u?(e.enter(l),e.consume(x),e.exit(l),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===u?(e.exit(o),m(u)):x===null?n(x):De(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),lt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===u||x===null||De(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:y)}function g(x){return x===u||x===92?(e.consume(x),y):y(x)}}function mu(e,t){let n;return a;function a(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Je(l)?lt(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const s9={name:"definition",tokenize:u9},o9={partial:!0,tokenize:c9};function u9(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),u(w)}function u(w){return bE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Dr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return St(w)?mu(e,h)(w):h(w)}function h(w){return vE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(o9,g,g)(w)}function g(w){return Je(w)?lt(e,x,"whitespace")(w):x(w)}function x(w){return w===null||De(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function c9(e,t,n){return a;function a(f){return St(f)?mu(e,l)(f):n(f)}function l(f){return xE(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Je(f)?lt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||De(f)?t(f):n(f)}}const d9={name:"hardBreakEscape",tokenize:f9};function f9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return De(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const h9={name:"headingAtx",resolve:m9,tokenize:p9};function m9(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},sr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function p9(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&a++<6?(e.consume(y),u):y===null||St(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||De(y)?(e.exit("atxHeading"),t(y)):Je(y)?lt(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||St(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const g9=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qw=["pre","script","style","textarea"],y9={concrete:!0,name:"htmlFlow",resolveTo:x9,tokenize:w9},v9={partial:!0,tokenize:k9},b9={partial:!0,tokenize:S9};function x9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function w9(e,t,n){const a=this;let l,o,u,f,m;return h;function h(A){return y(A)}function y(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),x):A===47?(e.consume(A),o=!0,j):A===63?(e.consume(A),l=3,a.interrupt?t:_):Rn(A)?(e.consume(A),u=String.fromCharCode(A),C):n(A)}function x(A){return A===45?(e.consume(A),l=2,w):A===91?(e.consume(A),l=5,f=0,k):Rn(A)?(e.consume(A),l=4,a.interrupt?t:_):n(A)}function w(A){return A===45?(e.consume(A),a.interrupt?t:_):n(A)}function k(A){const q="CDATA[";return A===q.charCodeAt(f++)?(e.consume(A),f===q.length?a.interrupt?t:oe:k):n(A)}function j(A){return Rn(A)?(e.consume(A),u=String.fromCharCode(A),C):n(A)}function C(A){if(A===null||A===47||A===62||St(A)){const q=A===47,X=u.toLowerCase();return!q&&!o&&qw.includes(X)?(l=1,a.interrupt?t(A):oe(A)):g9.includes(u.toLowerCase())?(l=6,q?(e.consume(A),E):a.interrupt?t(A):oe(A)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(A):o?R(A):z(A))}return A===45||En(A)?(e.consume(A),u+=String.fromCharCode(A),C):n(A)}function E(A){return A===62?(e.consume(A),a.interrupt?t:oe):n(A)}function R(A){return Je(A)?(e.consume(A),R):F(A)}function z(A){return A===47?(e.consume(A),F):A===58||A===95||Rn(A)?(e.consume(A),I):Je(A)?(e.consume(A),z):F(A)}function I(A){return A===45||A===46||A===58||A===95||En(A)?(e.consume(A),I):B(A)}function B(A){return A===61?(e.consume(A),O):Je(A)?(e.consume(A),B):z(A)}function O(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),m=A,D):Je(A)?(e.consume(A),O):U(A)}function D(A){return A===m?(e.consume(A),m=null,V):A===null||De(A)?n(A):(e.consume(A),D)}function U(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||St(A)?B(A):(e.consume(A),U)}function V(A){return A===47||A===62||Je(A)?z(A):n(A)}function F(A){return A===62?(e.consume(A),ne):n(A)}function ne(A){return A===null||De(A)?oe(A):Je(A)?(e.consume(A),ne):n(A)}function oe(A){return A===45&&l===2?(e.consume(A),Z):A===60&&l===1?(e.consume(A),re):A===62&&l===4?(e.consume(A),L):A===63&&l===3?(e.consume(A),_):A===93&&l===5?(e.consume(A),Re):De(A)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(v9,P,Se)(A)):A===null||De(A)?(e.exit("htmlFlowData"),Se(A)):(e.consume(A),oe)}function Se(A){return e.check(b9,G,P)(A)}function G(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return A===null||De(A)?Se(A):(e.enter("htmlFlowData"),oe(A))}function Z(A){return A===45?(e.consume(A),_):oe(A)}function re(A){return A===47?(e.consume(A),u="",ve):oe(A)}function ve(A){if(A===62){const q=u.toLowerCase();return qw.includes(q)?(e.consume(A),L):oe(A)}return Rn(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),ve):oe(A)}function Re(A){return A===93?(e.consume(A),_):oe(A)}function _(A){return A===62?(e.consume(A),L):A===45&&l===2?(e.consume(A),_):oe(A)}function L(A){return A===null||De(A)?(e.exit("htmlFlowData"),P(A)):(e.consume(A),L)}function P(A){return e.exit("htmlFlow"),t(A)}}function S9(e,t,n){const a=this;return l;function l(u){return De(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return a.parser.lazy[a.now().line]?n(u):t(u)}}function k9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Yu,t,n)}}const j9={name:"htmlText",tokenize:C9};function C9(e,t,n){const a=this;let l,o,u;return f;function f(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),m}function m(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),B):_===63?(e.consume(_),z):Rn(_)?(e.consume(_),U):n(_)}function h(_){return _===45?(e.consume(_),y):_===91?(e.consume(_),o=0,k):Rn(_)?(e.consume(_),R):n(_)}function y(_){return _===45?(e.consume(_),w):n(_)}function g(_){return _===null?n(_):_===45?(e.consume(_),x):De(_)?(u=g,re(_)):(e.consume(_),g)}function x(_){return _===45?(e.consume(_),w):g(_)}function w(_){return _===62?Z(_):_===45?x(_):g(_)}function k(_){const L="CDATA[";return _===L.charCodeAt(o++)?(e.consume(_),o===L.length?j:k):n(_)}function j(_){return _===null?n(_):_===93?(e.consume(_),C):De(_)?(u=j,re(_)):(e.consume(_),j)}function C(_){return _===93?(e.consume(_),E):j(_)}function E(_){return _===62?Z(_):_===93?(e.consume(_),E):j(_)}function R(_){return _===null||_===62?Z(_):De(_)?(u=R,re(_)):(e.consume(_),R)}function z(_){return _===null?n(_):_===63?(e.consume(_),I):De(_)?(u=z,re(_)):(e.consume(_),z)}function I(_){return _===62?Z(_):z(_)}function B(_){return Rn(_)?(e.consume(_),O):n(_)}function O(_){return _===45||En(_)?(e.consume(_),O):D(_)}function D(_){return De(_)?(u=D,re(_)):Je(_)?(e.consume(_),D):Z(_)}function U(_){return _===45||En(_)?(e.consume(_),U):_===47||_===62||St(_)?V(_):n(_)}function V(_){return _===47?(e.consume(_),Z):_===58||_===95||Rn(_)?(e.consume(_),F):De(_)?(u=V,re(_)):Je(_)?(e.consume(_),V):Z(_)}function F(_){return _===45||_===46||_===58||_===95||En(_)?(e.consume(_),F):ne(_)}function ne(_){return _===61?(e.consume(_),oe):De(_)?(u=ne,re(_)):Je(_)?(e.consume(_),ne):V(_)}function oe(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,Se):De(_)?(u=oe,re(_)):Je(_)?(e.consume(_),oe):(e.consume(_),G)}function Se(_){return _===l?(e.consume(_),l=void 0,W):_===null?n(_):De(_)?(u=Se,re(_)):(e.consume(_),Se)}function G(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||St(_)?V(_):(e.consume(_),G)}function W(_){return _===47||_===62||St(_)?V(_):n(_)}function Z(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function re(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),ve}function ve(_){return Je(_)?lt(e,Re,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Re(_)}function Re(_){return e.enter("htmlTextData"),u(_)}}const qy={name:"labelEnd",resolveAll:A9,resolveTo:T9,tokenize:R9},E9={tokenize:z9},N9={tokenize:O9},_9={tokenize:D9};function A9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&sr(e,0,e.length,n),e}function T9(e,t){let n=e.length,a=0,l,o,u,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(u=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=kr(f,e.slice(o+1,o+a+3)),f=kr(f,[["enter",y,t]]),f=kr(f,Tf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,u-3),t)),f=kr(f,[["exit",y,t],e[u-2],e[u-1],["exit",h,t]]),f=kr(f,e.slice(u+1)),f=kr(f,[["exit",m,t]]),sr(e,o,e.length,f),e}function R9(e,t,n){const a=this;let l=a.events.length,o,u;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(x){return o?o._inactive?g(x):(u=a.parser.defined.includes(Dr(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),m):n(x)}function m(x){return x===40?e.attempt(E9,y,u?y:g)(x):x===91?e.attempt(N9,y,u?h:g)(x):u?y(x):g(x)}function h(x){return e.attempt(_9,y,g)(x)}function y(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function z9(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return St(g)?mu(e,o)(g):o(g)}function o(g){return g===41?y(g):vE(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return St(g)?mu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?xE(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return St(g)?mu(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function O9(e,t,n){const a=this;return l;function l(f){return bE.call(a,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Dr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function D9(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const M9={name:"labelStartImage",resolveAll:qy.resolveAll,tokenize:I9};function I9(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const L9={name:"labelStartLink",resolveAll:qy.resolveAll,tokenize:U9};function U9(e,t,n){const a=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(u):t(u)}}const Sp={name:"lineEnding",tokenize:P9};function P9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),lt(e,t,"linePrefix")}}const qd={name:"thematicBreak",tokenize:B9};function B9(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),u(h)}function u(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||De(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),Je(h)?lt(e,f,"whitespace")(h):f(h))}}const Fn={continuation:{tokenize:H9},exit:V9,name:"list",tokenize:q9},$9={partial:!0,tokenize:Q9},F9={partial:!0,tokenize:Z9};function q9(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,u=0;return f;function f(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Rg(w)){if(a.containerState.type||(a.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(qd,n,h)(w):h(w);if(!a.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(w)}return n(w)}function m(w){return Rg(w)&&++u<10?(e.consume(w),m):(!a.interrupt||u<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(Yu,a.interrupt?n:y,e.attempt($9,x,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,x(w)}function g(w){return Je(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):n(w)}function x(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function H9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Yu,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,lt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!Je(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,u(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(F9,t,u)(f))}function u(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,lt(e,e.attempt(Fn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function Z9(e,t,n){const a=this;return lt(e,l,"listItemIndent",a.containerState.size+1);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===a.containerState.size?t(o):n(o)}}function V9(e){e.exit(this.containerState.type)}function Q9(e,t,n){const a=this;return lt(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const u=a.events[a.events.length-1];return!Je(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Hw={name:"setextUnderline",resolveTo:K9,tokenize:G9};function K9(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",u,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=u,e.push(["exit",u,t]),e}function G9(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),l=h,u(h)):n(h)}function u(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),Je(h)?lt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||De(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const Y9={tokenize:X9};function X9(e){const t=this,n=e.attempt(Yu,a,e.attempt(this.parser.constructs.flowInitial,l,lt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(n9,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const J9={resolveAll:SE()},W9=wE("string"),e8=wE("text");function wE(e){return{resolveAll:SE(e==="text"?t8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,u,f);return u;function u(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let x=-1;if(g)for(;++x<g.length;){const w=g[x];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function SE(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function t8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,u=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(u=h.length;h.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:a.start._bufferIndex+u,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const n8={42:Fn,43:Fn,45:Fn,48:Fn,49:Fn,50:Fn,51:Fn,52:Fn,53:Fn,54:Fn,55:Fn,56:Fn,57:Fn,62:mE},r8={91:s9},a8={[-2]:wp,[-1]:wp,32:wp},i8={35:h9,42:qd,45:[Hw,qd],60:y9,61:Hw,95:qd,96:Fw,126:Fw},l8={38:gE,92:pE},s8={[-5]:Sp,[-4]:Sp,[-3]:Sp,33:M9,38:gE,42:zg,60:[LP,j9],91:L9,92:[d9,pE],93:qy,95:zg,96:YP},o8={null:[zg,J9]},u8={null:[42,95]},c8={null:[]},d8=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:u8,contentInitial:r8,disable:c8,document:n8,flow:i8,flowInitial:a8,insideSpan:o8,string:l8,text:s8},Symbol.toStringTag,{value:"Module"}));function f8(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let u=[],f=[];const m={attempt:D(B),check:D(O),consume:R,enter:z,exit:I,interrupt:D(O,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ne){return u=kr(u,ne),C(),u[u.length-1]!==null?[]:(U(t,0),h.events=Tf(o,h.events,h),h.events)}function x(ne,oe){return m8(w(ne),oe)}function w(ne){return h8(u,ne)}function k(){const{_bufferIndex:ne,_index:oe,line:Se,column:G,offset:W}=a;return{_bufferIndex:ne,_index:oe,line:Se,column:G,offset:W}}function j(ne){l[ne.line]=ne.column,F()}function C(){let ne;for(;a._index<u.length;){const oe=u[a._index];if(typeof oe=="string")for(ne=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ne&&a._bufferIndex<oe.length;)E(oe.charCodeAt(a._bufferIndex));else E(oe)}}function E(ne){y=y(ne)}function R(ne){De(ne)?(a.line++,a.column=1,a.offset+=ne===-3?2:1,F()):ne!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===u[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ne}function z(ne,oe){const Se=oe||{};return Se.type=ne,Se.start=k(),h.events.push(["enter",Se,h]),f.push(Se),Se}function I(ne){const oe=f.pop();return oe.end=k(),h.events.push(["exit",oe,h]),oe}function B(ne,oe){U(ne,oe.from)}function O(ne,oe){oe.restore()}function D(ne,oe){return Se;function Se(G,W,Z){let re,ve,Re,_;return Array.isArray(G)?P(G):"tokenize"in G?P([G]):L(G);function L(ue){return xe;function xe(be){const fe=be!==null&&ue[be],ee=be!==null&&ue.null,me=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return P(me)(be)}}function P(ue){return re=ue,ve=0,ue.length===0?Z:A(ue[ve])}function A(ue){return xe;function xe(be){return _=V(),Re=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?X():ue.tokenize.call(oe?Object.assign(Object.create(h),oe):h,m,q,X)(be)}}function q(ue){return ne(Re,_),W}function X(ue){return _.restore(),++ve<re.length?A(re[ve]):Z}}}function U(ne,oe){ne.resolveAll&&!o.includes(ne)&&o.push(ne),ne.resolve&&sr(h.events,oe,h.events.length-oe,ne.resolve(h.events.slice(oe),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function V(){const ne=k(),oe=h.previous,Se=h.currentConstruct,G=h.events.length,W=Array.from(f);return{from:G,restore:Z};function Z(){a=ne,h.previous=oe,h.currentConstruct=Se,h.events.length=G,f=W,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function h8(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let u;if(n===l)u=[e[n].slice(a,o)];else{if(u=e.slice(n,l),a>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(a):u.shift()}o>0&&u.push(e[l].slice(0,o))}return u}function m8(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
354
|
+
`;break}case-3:{u=`\r
|
|
355
|
+
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&l)continue;u=" ";break}default:u=String.fromCharCode(o)}l=o===-2,a.push(u)}return a.join("")}function p8(e){const a={constructs:fE([d8,...(e||{}).extensions||[]]),content:l(TP),defined:[],document:l(zP),flow:l(Y9),lazy:{},string:l(W9),text:l(e8)};return a;function l(o){return u;function u(f){return f8(a,o,f)}}}function g8(e){for(;!yE(e););return e}const Zw=/[\0\t\n\r]/g;function y8(){let e=1,t="",n=!0,a;return l;function l(o,u,f){const m=[];let h,y,g,x,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(Zw.lastIndex=g,h=Zw.exec(o),x=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(x),!h){t=o.slice(g);break}if(w===10&&g===x&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<x&&(m.push(o.slice(g,x)),e+=x-g),w){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const v8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function b8(e){return e.replace(v8,x8)}function x8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return hE(n.slice(o?2:1),o?16:10)}return Fy(n)||e}const kE={}.hasOwnProperty;function w8(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),S8(n)(g8(p8(n).document().write(y8()(e,t,!0))))}function S8(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Da),autolinkProtocol:V,autolinkEmail:V,atxHeading:o(pt),blockQuote:o(ee),characterEscape:V,characterReference:V,codeFenced:o(me),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(me,u),codeText:o(_e,u),codeTextData:V,data:V,codeFlowValue:V,definition:o(Le),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(it),hardBreakEscape:o(Pr),hardBreakTrailing:o(Pr),htmlFlow:o(Oa,u),htmlFlowData:V,htmlText:o(Oa,u),htmlTextData:V,image:o(Cl),label:u,link:o(Da),listItem:o(Jr),listItemValue:x,listOrdered:o(Ma,g),listUnordered:o(Ma),paragraph:o(ro),reference:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(pt),strong:o(ao),thematicBreak:o(io)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:fe,autolinkProtocol:be,blockQuote:m(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:ue,characterReference:xe,codeFenced:m(C),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:F,codeIndented:m(E),codeText:m(W),codeTextData:F,data:F,definition:m(),definitionDestinationString:I,definitionLabelString:R,definitionTitleString:z,emphasis:m(),hardBreakEscape:m(oe),hardBreakTrailing:m(oe),htmlFlow:m(Se),htmlFlowData:F,htmlText:m(G),htmlTextData:F,image:m(re),label:Re,labelText:ve,lineEnding:ne,link:m(Z),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:q,resourceDestinationString:_,resourceTitleString:L,resource:P,setextHeading:m(U),setextHeadingLineSequence:D,setextHeadingText:O,strong:m(),thematicBreak:m()}};jE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(le){let ye={type:"root",children:[]};const Ue={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:u,resume:y,data:n},Be=[];let nt=-1;for(;++nt<le.length;)if(le[nt][1].type==="listOrdered"||le[nt][1].type==="listUnordered")if(le[nt][0]==="enter")Be.push(nt);else{const hn=Be.pop();nt=l(le,hn,nt)}for(nt=-1;++nt<le.length;){const hn=t[le[nt][0]];kE.call(hn,le[nt][1].type)&&hn[le[nt][1].type].call(Object.assign({sliceSerialize:le[nt][2].sliceSerialize},Ue),le[nt][1])}if(Ue.tokenStack.length>0){const hn=Ue.tokenStack[Ue.tokenStack.length-1];(hn[1]||Vw).call(Ue,void 0,hn[0])}for(ye.position={start:ui(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:ui(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},nt=-1;++nt<t.transforms.length;)ye=t.transforms[nt](ye)||ye;return ye}function l(le,ye,Ue){let Be=ye-1,nt=-1,hn=!1,ur,Wt,$t,mn;for(;++Be<=Ue;){const ft=le[Be];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?nt++:nt--,mn=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(ur&&!mn&&!nt&&!$t&&($t=Be),mn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mn=void 0}if(!nt&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||nt===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(ur){let Nr=Be;for(Wt=void 0;Nr--;){const Dn=le[Nr];if(Dn[1].type==="lineEnding"||Dn[1].type==="lineEndingBlank"){if(Dn[0]==="exit")continue;Wt&&(le[Wt][1].type="lineEndingBlank",hn=!0),Dn[1].type="lineEnding",Wt=Nr}else if(!(Dn[1].type==="linePrefix"||Dn[1].type==="blockQuotePrefix"||Dn[1].type==="blockQuotePrefixWhitespace"||Dn[1].type==="blockQuoteMarker"||Dn[1].type==="listItemIndent"))break}$t&&(!Wt||$t<Wt)&&(ur._spread=!0),ur.end=Object.assign({},Wt?le[Wt][1].start:ft[1].end),le.splice(Wt||Be,0,["exit",ur,ft[2]]),Be++,Ue++}if(ft[1].type==="listItemPrefix"){const Nr={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};ur=Nr,le.splice(Be,0,["enter",Nr,ft[2]]),Be++,Ue++,$t=void 0,mn=!0}}}return le[ye][1]._spread=hn,Ue}function o(le,ye){return Ue;function Ue(Be){f.call(this,le(Be),Be),ye&&ye.call(this,Be)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(le,ye,Ue){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ye,Ue||void 0]),le.position={start:ui(ye.start),end:void 0}}function m(le){return ye;function ye(Ue){le&&le.call(this,Ue),h.call(this,Ue)}}function h(le,ye){const Ue=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==le.type&&(ye?ye.call(this,le,Be[0]):(Be[1]||Vw).call(this,le,Be[0]));else throw new Error("Cannot close `"+le.type+"` ("+hu({start:le.start,end:le.end})+"): it’s not open");Ue.position.end=ui(le.end)}function y(){return $y(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(le){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function w(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=le}function k(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=le}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le.replace(/(\r?\n|\r)$/g,"")}function R(le){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Dr(this.sliceSerialize(le)).toLowerCase()}function z(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function I(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function B(le){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ue=this.sliceSerialize(le).length;ye.depth=Ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function D(le){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function V(le){const Ue=this.stack[this.stack.length-1].children;let Be=Ue[Ue.length-1];(!Be||Be.type!=="text")&&(Be=fn(),Be.position={start:ui(le.start),end:void 0},Ue.push(Be)),this.stack.push(Be)}function F(le){const ye=this.stack.pop();ye.value+=this.sliceSerialize(le),ye.position.end=ui(le.end)}function ne(le){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=ye.children[ye.children.length-1];Ue.position.end=ui(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(V.call(this,le),F.call(this,le))}function oe(){this.data.atHardBreak=!0}function Se(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function G(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function W(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.value=le}function Z(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function re(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ye,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function ve(le){const ye=this.sliceSerialize(le),Ue=this.stack[this.stack.length-2];Ue.label=b8(ye),Ue.identifier=Dr(ye).toLowerCase()}function Re(){const le=this.stack[this.stack.length-1],ye=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const Be=le.children;Ue.children=Be}else Ue.alt=ye}function _(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.url=le}function L(){const le=this.resume(),ye=this.stack[this.stack.length-1];ye.title=le}function P(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function q(le){const ye=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=ye,Ue.identifier=Dr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function X(le){this.data.characterReferenceType=le.type}function ue(le){const ye=this.sliceSerialize(le),Ue=this.data.characterReferenceType;let Be;Ue?(Be=hE(ye,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Fy(ye);const nt=this.stack[this.stack.length-1];nt.value+=Be}function xe(le){const ye=this.stack.pop();ye.position.end=ui(le.end)}function be(le){F.call(this,le);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(le)}function fe(le){F.call(this,le);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(le)}function ee(){return{type:"blockquote",children:[]}}function me(){return{type:"code",lang:null,meta:null,value:""}}function _e(){return{type:"inlineCode",value:""}}function Le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function it(){return{type:"emphasis",children:[]}}function pt(){return{type:"heading",depth:0,children:[]}}function Pr(){return{type:"break"}}function Oa(){return{type:"html",value:""}}function Cl(){return{type:"image",title:null,url:"",alt:null}}function Da(){return{type:"link",title:null,url:"",children:[]}}function Ma(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Jr(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function ro(){return{type:"paragraph",children:[]}}function ao(){return{type:"strong",children:[]}}function fn(){return{type:"text",value:""}}function io(){return{type:"thematicBreak"}}}function ui(e){return{line:e.line,column:e.column,offset:e.offset}}function jE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?jE(e,a):k8(e,a)}}function k8(e,t){let n;for(n in t)if(kE.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function Vw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is still open")}function j8(e){const t=this;t.parser=n;function n(a){return w8(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function C8(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function E8(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
356
|
+
`}]}function N8(e,t){const n=t.value?t.value+`
|
|
357
|
+
`:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function _8(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A8(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T8(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=Ws(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let u,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function R8(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function z8(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function CE(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const u=l[l.length-1];return u&&u.type==="text"?u.value+=a:l.push({type:"text",value:a}),l}function O8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return CE(e,t);const l={src:Ws(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function D8(e,t){const n={src:Ws(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function M8(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function I8(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return CE(e,t);const l={href:Ws(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function L8(e,t){const n={href:Ws(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function U8(e,t,n){const a=e.all(t),l=n?P8(n):EE(t),o={},u=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
|
|
358
|
+
`}),y.type==="element"&&y.tagName==="p"&&!l?u.push(...y.children):u.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
359
|
+
`});const h={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,h),e.applyData(t,h)}function P8(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=EE(n[a])}return t}function EE(e){const t=e.spread;return t??e.children.length>1}function B8(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const u=a[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function $8(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F8(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function q8(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function H8(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],u),l.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Ly(t.children[1]),m=iE(t.children[t.children.length-1]);f&&m&&(u.position={start:f,end:m}),l.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function Z8(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],x={},w=u?u[m]:void 0;w&&(x.align=w);let k={type:"element",tagName:o,properties:x,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function V8(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Qw=9,Kw=32;function Q8(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(Gw(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(Gw(t.slice(l),l>0,!1)),o.join("")}function Gw(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===Qw||o===Kw;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===Qw||o===Kw;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function K8(e,t){const n={type:"text",value:Q8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function G8(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Y8={blockquote:C8,break:E8,code:N8,delete:_8,emphasis:A8,footnoteReference:T8,heading:R8,html:z8,imageReference:O8,image:D8,inlineCode:M8,linkReference:I8,link:L8,listItem:U8,list:B8,paragraph:$8,root:F8,strong:q8,table:H8,tableCell:V8,tableRow:Z8,text:K8,thematicBreak:G8,toml:Td,yaml:Td,definition:Td,footnoteDefinition:Td};function Td(){}const NE=-1,Rf=0,pu=1,rf=2,Hy=3,Zy=4,Vy=5,Qy=6,_E=7,AE=8,Yw=typeof self=="object"?self:globalThis,X8=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,u]=t[l];switch(o){case Rf:case NE:return n(u,l);case pu:{const f=n([],l);for(const m of u)f.push(a(m));return f}case rf:{const f=n({},l);for(const[m,h]of u)f[a(m)]=a(h);return f}case Hy:return n(new Date(u),l);case Zy:{const{source:f,flags:m}=u;return n(new RegExp(f,m),l)}case Vy:{const f=n(new Map,l);for(const[m,h]of u)f.set(a(m),a(h));return f}case Qy:{const f=n(new Set,l);for(const m of u)f.add(a(m));return f}case _E:{const{name:f,message:m}=u;return n(new Yw[f](m),l)}case AE:return n(BigInt(u),l);case"BigInt":return n(Object(BigInt(u)),l);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new Yw[o](u),l)};return a},Xw=e=>X8(new Map,e)(0),ms="",{toString:J8}={},{keys:W8}=Object,su=e=>{const t=typeof e;if(t!=="object"||!e)return[Rf,t];const n=J8.call(e).slice(8,-1);switch(n){case"Array":return[pu,ms];case"Object":return[rf,ms];case"Date":return[Hy,ms];case"RegExp":return[Zy,ms];case"Map":return[Vy,ms];case"Set":return[Qy,ms];case"DataView":return[pu,n]}return n.includes("Array")?[pu,n]:n.includes("Error")?[_E,n]:[rf,n]},Rd=([e,t])=>e===Rf&&(t==="function"||t==="symbol"),eB=(e,t,n,a)=>{const l=(u,f)=>{const m=a.push(u)-1;return n.set(f,m),m},o=u=>{if(n.has(u))return n.get(u);let[f,m]=su(u);switch(f){case Rf:{let y=u;switch(m){case"bigint":f=AE,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([NE],u)}return l([f,y],u)}case pu:{if(m){let x=u;return m==="DataView"?x=new Uint8Array(u.buffer):m==="ArrayBuffer"&&(x=new Uint8Array(u)),l([m,[...x]],u)}const y=[],g=l([f,y],u);for(const x of u)y.push(o(x));return g}case rf:{if(m)switch(m){case"BigInt":return l([m,u.toString()],u);case"Boolean":case"Number":case"String":return l([m,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],g=l([f,y],u);for(const x of W8(u))(e||!Rd(su(u[x])))&&y.push([o(x),o(u[x])]);return g}case Hy:return l([f,u.toISOString()],u);case Zy:{const{source:y,flags:g}=u;return l([f,{source:y,flags:g}],u)}case Vy:{const y=[],g=l([f,y],u);for(const[x,w]of u)(e||!(Rd(su(x))||Rd(su(w))))&&y.push([o(x),o(w)]);return g}case Qy:{const y=[],g=l([f,y],u);for(const x of u)(e||!Rd(su(x)))&&y.push(o(x));return g}}const{message:h}=u;return l([f,{name:m,message:h}],u)};return o},Jw=(e,{json:t,lossy:n}={})=>{const a=[];return eB(!(t||n),!!t,new Map,a)(e),a},af=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Xw(Jw(e,t)):structuredClone(e):(e,t)=>Xw(Jw(e,t));function tB(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function rB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tB,a=e.options.footnoteBackLabel||nB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),x=Ws(g.toLowerCase());let w=0;const k=[],j=e.footnoteCounts.get(g);for(;j!==void 0&&++w<=j;){k.length>0&&k.push({type:"text",value:" "});let R=typeof n=="string"?n:n(m,w);typeof R=="string"&&(R={type:"text",value:R}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const C=y[y.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const R=C.children[C.children.length-1];R&&R.type==="text"?R.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(y,!0)};e.patch(h,E),f.push(E)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...af(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
360
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
361
|
+
`}]}}const zf=(function(e){if(e==null)return sB;if(typeof e=="function")return Of(e);if(typeof e=="object")return Array.isArray(e)?aB(e):iB(e);if(typeof e=="string")return lB(e);throw new Error("Expected function, string, or object as test")});function aB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=zf(e[n]);return Of(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function iB(e){const t=e;return Of(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function lB(e){return Of(t);function t(n){return n&&n.type===e}}function Of(e){return t;function t(n,a,l){return!!(oB(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function sB(){return!0}function oB(e){return e!==null&&typeof e=="object"&&"type"in e}const TE=[],uB=!0,Og=!1,cB="skip";function RE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=zf(l),u=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return x;function x(){let w=TE,k,j,C;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=dB(n(m,y)),w[0]===Og))return w;if("children"in m&&m.children){const E=m;if(E.children&&w[0]!==cB)for(j=(a?E.children.length:-1)+u,C=y.concat(E);j>-1&&j<E.children.length;){const R=E.children[j];if(k=f(R,j,C)(),k[0]===Og)return k;j=typeof k[1]=="number"?k[1]:j+u}}return w}}}function dB(e){return Array.isArray(e)?e:typeof e=="number"?[uB,e]:e==null?TE:[e]}function Ky(e,t,n,a){let l,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,l=n):(o=t,u=n,l=a),RE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return u(m,g,y)}}const Dg={}.hasOwnProperty,fB={};function hB(e,t){const n=t||fB,a=new Map,l=new Map,o=new Map,u={...Y8,...n.handlers},f={all:h,applyData:pB,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:u,one:m,options:n,patch:mB,wrap:yB};return Ky(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,x=String(y.identifier).toUpperCase();g.has(x)||g.set(x,y)}}),f;function m(y,g){const x=y.type,w=f.handlers[x];if(Dg.call(f.handlers,x)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(x)){if("children"in y){const{children:j,...C}=y,E=af(C);return E.children=f.all(y),E}return af(y)}return(f.options.unknownHandler||gB)(f,y,g)}function h(y){const g=[];if("children"in y){const x=y.children;let w=-1;for(;++w<x.length;){const k=f.one(x[w],y);if(k){if(w&&x[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Ww(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=Ww(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function mB(e,t){e.position&&(t.position=nP(e))}function pB(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const u="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,af(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function gB(e,t){const n=t.data||{},a="value"in t&&!(Dg.call(n,"hProperties")||Dg.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function yB(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
362
|
+
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
363
|
+
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
364
|
+
`}),n}function Ww(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eS(e,t){const n=hB(e,t),a=n.one(e,void 0),l=rB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
365
|
+
`},l),o}function vB(e,t){return e&&"run"in e?async function(n,a){const l=eS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return eS(n,{file:a,...e||t})}}function tS(e){if(e)throw e}var kp,nS;function bB(){if(nS)return kp;nS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},u=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return kp=function m(){var h,y,g,x,w,k,j=arguments[0],C=1,E=arguments.length,R=!1;for(typeof j=="boolean"&&(R=j,j=arguments[1]||{},C=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});C<E;++C)if(h=arguments[C],h!=null)for(y in h)g=f(j,y),x=f(h,y),j!==x&&(R&&x&&(o(x)||(w=l(x)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},u(j,{name:y,newValue:m(R,k,x)})):typeof x<"u"&&u(j,{name:y,newValue:x}));return j},kp}var xB=bB();const jp=uf(xB);function Mg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function wB(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){u(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?SB(y,f)(...h):u(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function SB(e,t){let n;return a;function a(...u){const f=e.length>u.length;let m;f&&u.push(l);try{m=e.apply(this,u)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(u,...f){n||(n=!0,t(u,...f))}function o(u){l(null,u)}}const Zr={basename:kB,dirname:jB,extname:CB,join:EB,sep:"/"};function kB(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Xu(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let u=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else u<0&&(o=!0,u=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=u));return n===a?a=u:a<0&&(a=e.length),e.slice(n,a)}function jB(e){if(Xu(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function CB(e){Xu(e);let t=e.length,n=-1,a=0,l=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){a=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function EB(...e){let t=-1,n;for(;++t<e.length;)Xu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":NB(n)}function NB(e){Xu(e);const t=e.codePointAt(0)===47;let n=_B(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _B(e,t){let n="",a=0,l=-1,o=0,u=-1,f,m;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(l===u-1||o===1))if(l!==u-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=u,o=0;continue}}else if(n.length>0){n="",a=0,l=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,u):n=e.slice(l+1,u),a=u-l-1;l=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Xu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const AB={cwd:TB};function TB(){return"/"}function Ig(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function RB(e){if(typeof e=="string")e=new URL(e);else if(!Ig(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zB(e)}function zB(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Cp=["history","path","basename","stem","extname","dirname"];class zE{constructor(t){let n;t?Ig(t)?n={path:t}:typeof t=="string"||OB(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":AB.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Cp.length;){const o=Cp[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Cp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Zr.basename(this.path):void 0}set basename(t){Np(t,"basename"),Ep(t,"basename"),this.path=Zr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Zr.dirname(this.path):void 0}set dirname(t){rS(this.basename,"dirname"),this.path=Zr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Zr.extname(this.path):void 0}set extname(t){if(Ep(t,"extname"),rS(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Zr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ig(t)&&(t=RB(t)),Np(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Zr.basename(this.path,this.extname):void 0}set stem(t){Np(t,"stem"),Ep(t,"stem"),this.path=Zr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new Nn(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ep(e,t){if(e&&e.includes(Zr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Zr.sep+"`")}function Np(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function rS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function OB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const DB=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),MB={}.hasOwnProperty;class Gy extends DB{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wB()}copy(){const t=new Gy;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(jp(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Tp("data",this.frozen),this.namespace[t]=n,this):MB.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tp("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=zd(t),a=this.parser||this.Parser;return _p("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),_p("process",this.parser||this.Parser),Ap("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,u){const f=zd(t),m=a.parse(f);a.run(m,f,function(y,g,x){if(y||!g||!x)return h(y);const w=g,k=a.stringify(w,x);UB(k)?x.value=k:x.result=k,h(y,x)});function h(y,g){y||!g?u(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),_p("processSync",this.parser||this.Parser),Ap("processSync",this.compiler||this.Compiler),this.process(t,l),iS("processSync","process",n),a;function l(o,u){n=!0,tS(o),a=u}}run(t,n,a){aS(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(u,f){const m=zd(n);l.run(t,m,h);function h(y,g,x){const w=g||t;y?f(y):u?u(w):a(void 0,w,x)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),iS("runSync","run",a),l;function o(u,f){tS(u),l=f,a=!0}}stringify(t,n){this.freeze();const a=zd(n),l=this.compiler||this.Compiler;return Ap("stringify",l),aS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Tp("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else u(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function u(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=jp(!0,l.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,x=-1;for(;++g<a.length;)if(a[g][0]===h){x=g;break}if(x===-1)a.push([h,...y]);else if(y.length>0){let[w,...k]=y;const j=a[x][1];Mg(j)&&Mg(w)&&(w=jp(!0,j,w)),a[x]=[h,w,...k]}}}}const IB=new Gy().freeze();function _p(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ap(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function aS(e){if(!Mg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function iS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zd(e){return LB(e)?e:new zE(e)}function LB(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UB(e){return typeof e=="string"||PB(e)}function PB(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const BB="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lS=[],sS={allowDangerousHtml:!0},$B=/^(https?|ircs?|mailto|xmpp)$/i,FB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qB(e){const t=HB(e),n=ZB(e);return VB(t.runSync(t.parse(n),n),e)}function HB(e){const t=e.rehypePlugins||lS,n=e.remarkPlugins||lS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sS}:sS;return IB().use(j8).use(n).use(vB,a).use(t)}function ZB(e){const t=e.children||"",n=new zE;return typeof t=="string"&&(n.value=t),n}function VB(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||QB;for(const y of FB)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+BB+y.id,void 0);return Ky(e,h),sP(e,{Fragment:c.Fragment,components:l,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(y,g,x){if(y.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in xp)if(Object.hasOwn(xp,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=xp[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,x)),w&&x&&typeof g=="number")return f&&y.children?x.children.splice(g,1,...y.children):x.children.splice(g,1),g}}}function QB(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||$B.test(e.slice(0,t))?e:""}function KB(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OE(e,t,n){const l=zf((n||{}).ignore||[]),o=GB(t);let u=-1;for(;++u<o.length;)RE(e,"text",f);function f(h,y){let g=-1,x;for(;++g<y.length;){const w=y[g],k=x?x.children:void 0;if(l(w,k?k.indexOf(w):void 0,x))return;x=w}if(x)return m(h,y)}function m(h,y){const g=y[y.length-1],x=o[u][0],w=o[u][1];let k=0;const C=g.children.indexOf(h);let E=!1,R=[];x.lastIndex=0;let z=x.exec(h.value);for(;z;){const I=z.index,B={index:z.index,input:z.input,stack:[...y,h]};let O=w(...z,B);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?x.lastIndex=I+1:(k!==I&&R.push({type:"text",value:h.value.slice(k,I)}),Array.isArray(O)?R.push(...O):O&&R.push(O),k=I+z[0].length,E=!0),!x.global)break;z=x.exec(h.value)}return E?(k<h.value.length&&R.push({type:"text",value:h.value.slice(k)}),g.children.splice(C,1,...R)):R=[h],C+R.length}}function GB(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([YB(l[0]),XB(l[1])])}return t}function YB(e){return typeof e=="string"?new RegExp(KB(e),"g"):e}function XB(e){return typeof e=="function"?e:function(){return e}}function JB(e){OE(e,[/\r?\n|\r/g,WB])}function WB(){return{type:"break"}}function e$(){return function(e){JB(e)}}function oS(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}const Rp="phrasing",zp=["autolink","link","image","label"];function t$(){return{transforms:[o$],enter:{literalAutolink:r$,literalAutolinkEmail:Op,literalAutolinkHttp:Op,literalAutolinkWww:Op},exit:{literalAutolink:s$,literalAutolinkEmail:l$,literalAutolinkHttp:a$,literalAutolinkWww:i$}}}function n$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rp,notInConstruct:zp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rp,notInConstruct:zp},{character:":",before:"[ps]",after:"\\/",inConstruct:Rp,notInConstruct:zp}]}}function r$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Op(e){this.config.enter.autolinkProtocol.call(this,e)}function a$(e){this.config.exit.autolinkProtocol.call(this,e)}function i$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function l$(e){this.config.exit.autolinkEmail.call(this,e)}function s$(e){this.exit(e)}function o$(e){OE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,u$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),c$]],{ignore:["link","linkReference"]})}function u$(e,t,n,a,l){let o="";if(!DE(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!d$(n)))return!1;const u=f$(n+a);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function c$(e,t,n,a){return!DE(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function f$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=oS(e,"(");let o=oS(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function DE(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bl(n)||Af(n))&&(!t||n!==47)}ME.peek=w$;function h$(){this.buffer()}function m$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function p$(){this.buffer()}function g$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function y$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function v$(e){this.exit(e)}function b$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Dr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function x$(e){this.exit(e)}function w$(){return"["}function ME(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=l.move("]"),o}function S$(){return{enter:{gfmFootnoteCallString:h$,gfmFootnoteCall:m$,gfmFootnoteDefinitionLabelString:p$,gfmFootnoteDefinition:g$},exit:{gfmFootnoteCallString:y$,gfmFootnoteCall:v$,gfmFootnoteDefinitionLabelString:b$,gfmFootnoteDefinition:x$}}}function k$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ME},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,u){const f=o.createTracker(u);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
366
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?IE:j$))),h(),m}}function j$(e,t,n){return t===0?e:IE(e,t,n)}function IE(e,t,n){return(n?"":" ")+e}const C$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];LE.peek=T$;function E$(){return{canContainEols:["delete"],enter:{strikethrough:_$},exit:{strikethrough:A$}}}function N$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:C$}],handlers:{delete:LE}}}function _$(e){this.enter({type:"delete",children:[]},e)}function A$(e){this.exit(e)}function LE(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let u=l.move("~~");return u+=n.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),o(),u}function T$(){return"~"}function R$(e){return e.length}function z$(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||R$,o=[],u=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],C=[];let E=-1;for(e[y].length>h&&(h=e[y].length);++E<e[y].length;){const R=O$(e[y][E]);if(n.alignDelimiters!==!1){const z=l(R);C[E]=z,(m[E]===void 0||z>m[E])&&(m[E]=z)}j.push(R)}u[y]=j,f[y]=C}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=uS(a[g]);else{const j=uS(a);for(;++g<h;)o[g]=j}g=-1;const x=[],w=[];for(;++g<h;){const j=o[g];let C="",E="";j===99?(C=":",E=":"):j===108?C=":":j===114&&(E=":");let R=n.alignDelimiters===!1?1:Math.max(1,m[g]-C.length-E.length);const z=C+"-".repeat(R)+E;n.alignDelimiters!==!1&&(R=C.length+R+E.length,R>m[g]&&(m[g]=R),w[g]=R),x[g]=z}u.splice(1,0,x),f.splice(1,0,w),y=-1;const k=[];for(;++y<u.length;){const j=u[y],C=f[y];g=-1;const E=[];for(;++g<h;){const R=j[g]||"";let z="",I="";if(n.alignDelimiters!==!1){const B=m[g]-(C[g]||0),O=o[g];O===114?z=" ".repeat(B):O===99?B%2?(z=" ".repeat(B/2+.5),I=" ".repeat(B/2-.5)):(z=" ".repeat(B/2),I=z):I=" ".repeat(B)}n.delimiterStart!==!1&&!g&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||g)&&E.push(" "),n.alignDelimiters!==!1&&E.push(z),E.push(R),n.alignDelimiters!==!1&&E.push(I),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
367
|
+
`)}function O$(e){return e==null?"":String(e)}function uS(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function D$(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),M$);return l(),u}function M$(e,t,n){return">"+(n?"":" ")+e}function I$(e,t){return cS(e,t.inConstruct,!0)&&!cS(e,t.notInConstruct,!1)}function cS(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function dS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
368
|
+
`&&I$(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
369
|
+
`}function L$(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>u&&(u=o):o=1,l=a+t.length,a=n.indexOf(t,l);return u}function U$(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function P$(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function B$(e,t,n,a){const l=P$(n),o=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(U$(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,$$);return g(),x}const f=n.createTracker(a),m=l.repeat(Math.max(L$(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
370
|
+
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
371
|
+
`),o&&(y+=f.move(o+`
|
|
372
|
+
`)),y+=f.move(m),h(),y}function $$(e,t,n){return(n?"":" ")+e}function Yy(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function F$(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
373
|
+
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),u(),h}function q$(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Tu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function lf(e,t,n){const a=qs(e),l=qs(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}UE.peek=H$;function UE(e,t,n,a){const l=q$(n),o=n.enter("emphasis"),u=n.createTracker(a),f=u.move(l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=lf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Tu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=lf(a.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+Tu(g));const w=u.move(l);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+w}function H$(e,t,n){return n.options.emphasis||"*"}function Z$(e,t){let n=!1;return Ky(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Og}),!!((!e.depth||e.depth<3)&&$y(e)&&(t.options.setext||n))}function V$(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(Z$(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
|
|
374
|
+
`,after:`
|
|
375
|
+
`});return g(),y(),x+`
|
|
376
|
+
`+(l===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
377
|
+
`))+1))}const u="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(u+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
378
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=Tu(h.charCodeAt(0))+h.slice(1)),h=h?u+" "+h:u,n.options.closeAtx&&(h+=" "+u),m(),f(),h}PE.peek=Q$;function PE(e){return e.value||""}function Q$(){return"<"}BE.peek=K$;function BE(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),u(),h}function K$(){return"!"}$E.peek=G$;function $E(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function G$(){return"!"}FE.peek=Y$;function FE(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const u=n.unsafe[o],f=n.compilePattern(u);let m;if(u.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function Y$(){return"`"}function qE(e,t){const n=$y(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}HE.peek=X$;function HE(e,t,n,a){const l=Yy(n),o=l==='"'?"Quote":"Apostrophe",u=n.createTracker(a);let f,m;if(qE(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=u.move("<");return g+=u.move(n.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=u.move("[");return h+=u.move(n.containerPhrasing(e,{before:h,after:"](",...u.current()})),h+=u.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(n.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(m=n.enter("destinationRaw"),h+=u.move(n.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=u.move(" "+l),h+=u.move(n.safe(e.title,{before:h,after:l,...u.current()})),h+=u.move(l),m()),h+=u.move(")"),f(),h}function X$(e,t,n){return qE(e,n)?"<":"["}ZE.peek=J$;function ZE(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return u(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function J$(){return"["}function Xy(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function W$(e){const t=Xy(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function eF(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function VE(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?eF(n):Xy(n);const f=e.ordered?u==="."?")":".":W$(n);let m=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),VE(n)===u&&y){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(u=f),n.bulletCurrent=u;const h=n.containerFlow(e,a);return n.bulletLastUsed=u,n.bulletCurrent=o,l(),h}function nF(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rF(e,t,n,a){const l=nF(n);let o=n.bulletCurrent||Xy(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(u-o.length)),f.shift(u);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,x,w){return x?(w?"":" ".repeat(u))+g:(w?o:o+" ".repeat(u-o.length))+g}}function aF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,a);return o(),l(),u}const iF=zf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function lF(e,t,n,a){return(e.children.some(function(u){return iF(u)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function sF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}QE.peek=oF;function QE(e,t,n,a){const l=sF(n),o=n.enter("strong"),u=n.createTracker(a),f=u.move(l+l);let m=u.move(n.containerPhrasing(e,{after:l,before:f,...u.current()}));const h=m.charCodeAt(0),y=lf(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Tu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),x=lf(a.after.charCodeAt(0),g,l);x.inside&&(m=m.slice(0,-1)+Tu(g));const w=u.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},f+m+w}function oF(e,t,n){return n.options.strong||"*"}function uF(e,t,n,a){return n.safe(e.value,a)}function cF(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function dF(e,t,n){const a=(VE(n)+(n.options.ruleSpaces?" ":"")).repeat(cF(n));return n.options.ruleSpaces?a.slice(0,-1):a}const KE={blockquote:D$,break:dS,code:B$,definition:F$,emphasis:UE,hardBreak:dS,heading:V$,html:PE,image:BE,imageReference:$E,inlineCode:FE,link:HE,linkReference:ZE,list:tF,listItem:rF,paragraph:aF,root:lF,strong:QE,text:uF,thematicBreak:dF};function fF(){return{enter:{table:hF,tableData:fS,tableHeader:fS,tableRow:pF},exit:{codeText:gF,table:mF,tableData:Dp,tableHeader:Dp,tableRow:Dp}}}function hF(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function mF(e){this.exit(e),this.data.inTable=void 0}function pF(e){this.enter({type:"tableRow",children:[]},e)}function Dp(e){this.exit(e)}function fS(e){this.enter({type:"tableCell",children:[]},e)}function gF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yF(e,t){return t==="|"?t:e}function vF(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
379
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:m,tableRow:f}};function u(w,k,j,C){return h(y(w,j,C),w.align)}function f(w,k,j,C){const E=g(w,j,C),R=h([E]);return R.slice(0,R.indexOf(`
|
|
380
|
+
`))}function m(w,k,j,C){const E=j.enter("tableCell"),R=j.enter("phrasing"),z=j.containerPhrasing(w,{...C,before:o,after:o});return R(),E(),z}function h(w,k){return z$(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const C=w.children;let E=-1;const R=[],z=k.enter("table");for(;++E<C.length;)R[E]=g(C[E],k,j);return z(),R}function g(w,k,j){const C=w.children;let E=-1;const R=[],z=k.enter("tableRow");for(;++E<C.length;)R[E]=m(C[E],w,k,j);return z(),R}function x(w,k,j){let C=KE.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function bF(){return{exit:{taskListCheckValueChecked:hS,taskListCheckValueUnchecked:hS,paragraph:wF}}}function xF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SF}}}function hS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wF(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,u;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){u=f;break}}u===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function SF(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(u);let m=KE.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+u}}function kF(){return[t$(),S$(),E$(),fF(),bF()]}function jF(e){return{extensions:[n$(),k$(e),N$(),vF(e),xF()]}}const CF={tokenize:RF,partial:!0},GE={tokenize:zF,partial:!0},YE={tokenize:OF,partial:!0},XE={tokenize:DF,partial:!0},EF={tokenize:MF,partial:!0},JE={name:"wwwAutolink",tokenize:AF,previous:eN},WE={name:"protocolAutolink",tokenize:TF,previous:tN},za={name:"emailAutolink",tokenize:_F,previous:nN},Xr={};function NF(){return{text:Xr}}let rl=48;for(;rl<123;)Xr[rl]=za,rl++,rl===58?rl=65:rl===91&&(rl=97);Xr[43]=za;Xr[45]=za;Xr[46]=za;Xr[95]=za;Xr[72]=[za,WE];Xr[104]=[za,WE];Xr[87]=[za,JE];Xr[119]=[za,JE];function _F(e,t,n){const a=this;let l,o;return u;function u(g){return!Lg(g)||!nN.call(a,a.previous)||Jy(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Lg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(EF,y,h)(g):g===45||g===95||En(g)?(o=!0,e.consume(g),m):y(g)}function h(g){return e.consume(g),l=!0,m}function y(g){return o&&l&&Rn(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function AF(e,t,n){const a=this;return l;function l(u){return u!==87&&u!==119||!eN.call(a,a.previous)||Jy(a.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(CF,e.attempt(GE,e.attempt(YE,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function TF(e,t,n){const a=this;let l="",o=!1;return u;function u(g){return(g===72||g===104)&&tN.call(a,a.previous)&&!Jy(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(Rn(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const x=l.toLowerCase();if(x==="http"||x==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||nf(g)||St(g)||bl(g)||Af(g)?n(g):e.attempt(GE,e.attempt(YE,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function RF(e,t,n){let a=0;return l;function l(u){return(u===87||u===119)&&a<3?(a++,e.consume(u),l):u===46&&a===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function zF(e,t,n){let a,l,o;return u;function u(h){return h===46||h===95?e.check(XE,m,f)(h):h===null||St(h)||bl(h)||h!==45&&Af(h)?m(h):(o=!0,e.consume(h),u)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),u}function m(h){return l||a||!o?n(h):t(h)}}function OF(e,t){let n=0,a=0;return l;function l(u){return u===40?(n++,e.consume(u),l):u===41&&a<n?o(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(XE,t,o)(u):u===null||St(u)||bl(u)?t(u):(e.consume(u),l)}function o(u){return u===41&&a++,e.consume(u),l}}function DF(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||St(f)||bl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||St(f)||bl(f)?t(f):a(f)}function o(f){return Rn(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),a):Rn(f)?(e.consume(f),u):n(f)}}function MF(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return En(o)?n(o):t(o)}}function eN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||St(e)}function tN(e){return!Rn(e)}function nN(e){return!(e===47||Lg(e))}function Lg(e){return e===43||e===45||e===46||e===95||En(e)}function Jy(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const IF={tokenize:HF,partial:!0};function LF(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$F,continuation:{tokenize:FF},exit:qF}},text:{91:{name:"gfmFootnoteCall",tokenize:BF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:UF,resolveTo:PF}}}}function UF(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){u=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!u||!u._balanced)return n(m);const h=Dr(a.sliceSerialize({start:u.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function PF(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function BF(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,u;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!u||g===null||g===91||St(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return l.includes(Dr(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return St(g)||(u=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function $F(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,u=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(u>999||k===93&&!f||k===null||k===91||St(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Dr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return St(k)||(f=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function x(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),lt(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function FF(e,t,n){return e.check(Yu,t,e.attempt(IF,t,n))}function qF(e){e.exit("gfmFootnoteDefinition")}function HF(e,t,n){const a=this;return lt(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const u=a.events[a.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function ZF(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(u,f){let m=-1;for(;++m<u.length;)if(u[m][0]==="enter"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._close){let h=m;for(;h--;)if(u[h][0]==="exit"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._open&&u[m][1].end.offset-u[m][1].start.offset===u[h][1].end.offset-u[h][1].start.offset){u[m][1].type="strikethroughSequence",u[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[h][1].start),end:Object.assign({},u[m][1].end)},g={type:"strikethroughText",start:Object.assign({},u[h][1].end),end:Object.assign({},u[m][1].start)},x=[["enter",y,f],["enter",u[h][1],f],["exit",u[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&sr(x,x.length,0,Tf(w,u.slice(h+1,m),f)),sr(x,x.length,0,[["exit",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["exit",y,f]]),sr(u,h-1,m-h+3,x),m=h+x.length-2;break}}for(m=-1;++m<u.length;)u[m][1].type==="strikethroughSequenceTemporary"&&(u[m][1].type="data");return u}function o(u,f,m){const h=this.previous,y=this.events;let g=0;return x;function x(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(u.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=qs(h);if(k===126)return g>1?m(k):(u.consume(k),g++,w);if(g<2&&!n)return m(k);const C=u.exit("strikethroughSequenceTemporary"),E=qs(k);return C._open=!E||E===2&&!!j,C._close=!j||j===2&&!!E,f(k)}}}class VF{constructor(){this.map=[]}add(t,n,a){QF(this,t,n,a)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function QF(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function KF(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function GF(){return{flow:{null:{name:"table",tokenize:YF,resolveAll:XF}}}}function YF(e,t,n){const a=this;let l=0,o=0,u;return f;function f(F){let ne=a.events.length-1;for(;ne>-1;){const G=a.events[ne][1].type;if(G==="lineEnding"||G==="linePrefix")ne--;else break}const oe=ne>-1?a.events[ne][1].type:null,Se=oe==="tableHead"||oe==="tableRow"?O:m;return Se===O&&a.parser.lazy[a.now().line]?n(F):Se(F)}function m(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(u=!0,o+=1),y(F)}function y(F){return F===null?n(F):De(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),w):n(F):Je(F)?lt(e,y,"whitespace")(F):(o+=1,u&&(u=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(F)))}function g(F){return F===null||F===124||St(F)?(e.exit("data"),y(F)):(e.consume(F),F===92?x:g)}function x(F){return F===92||F===124?(e.consume(F),g):g(F)}function w(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),u=!1,Je(F)?lt(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):k(F))}function k(F){return F===45||F===58?C(F):F===124?(u=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),j):B(F)}function j(F){return Je(F)?lt(e,C,"whitespace")(F):C(F)}function C(F){return F===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),E):F===45?(o+=1,E(F)):F===null||De(F)?I(F):B(F)}function E(F){return F===45?(e.enter("tableDelimiterFiller"),R(F)):B(F)}function R(F){return F===45?(e.consume(F),R):F===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):(e.exit("tableDelimiterFiller"),z(F))}function z(F){return Je(F)?lt(e,I,"whitespace")(F):I(F)}function I(F){return F===124?k(F):F===null||De(F)?!u||l!==o?B(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):B(F)}function B(F){return n(F)}function O(F){return e.enter("tableRow"),D(F)}function D(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),D):F===null||De(F)?(e.exit("tableRow"),t(F)):Je(F)?lt(e,D,"whitespace")(F):(e.enter("data"),U(F))}function U(F){return F===null||F===124||St(F)?(e.exit("data"),D(F)):(e.consume(F),F===92?V:U)}function V(F){return F===92||F===124?(e.consume(F),U):U(F)}}function XF(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,m=0,h,y,g;const x=new VF;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(mS(x,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],g=Od(x,t,o,l,void 0,g),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(u[0]=u[1],g=Od(x,t,o,l,void 0,g)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(u[0]=u[1],g=Od(x,t,o,l,n,g)):u[1]!==0&&(g=Od(x,t,u,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(m!==0&&mS(x,t,m,h,y),x.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=KF(t.events,n))}return e}function Od(e,t,n,a,l,o){const u=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},ys(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=ys(t.events,n[1]);if(o={type:u,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=ys(t.events,n[2]),y=ys(t.events,n[3]),g={type:f,start:Object.assign({},h),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],w=t.events[n[3]];if(x[1].end=Object.assign({},w[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ys(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function mS(e,t,n,a,l){const o=[],u=ys(t.events,n);l&&(l.end=Object.assign({},u),o.push(["exit",l,t])),a.end=Object.assign({},u),o.push(["exit",a,t]),e.add(n+1,0,o)}function ys(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const JF={name:"tasklistCheck",tokenize:eq};function WF(){return{text:{91:JF}}}function eq(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return St(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),u):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),u):n(m)}function u(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return De(m)?t(m):Je(m)?e.check({tokenize:tq},t,n)(m):n(m)}}function tq(e,t,n){return lt(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function nq(e){return fE([NF(),LF(),ZF(e),GF(),WF()])}const rq={};function aq(e){const t=this,n=e||rq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),u=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(nq(n)),o.push(kF()),u.push(jF(n))}function rN({children:e,className:t}){return c.jsx("div",{className:Te("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:c.jsx(qB,{remarkPlugins:[aq,e$],children:e})})}function iq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,u]=b.useState(!1),f=b.useRef(null),m=e!==t;return b.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),c.jsxs(Zn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[c.jsxs(Aa,{children:[c.jsxs(Ta,{children:["System prompt append",m&&c.jsx(lq,{})]}),!o&&!l&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>u(!0),children:[c.jsx(pf,{className:"h-3 w-3"})," Edit"]})]}),c.jsx(Ra,{children:o?c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),u(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ge,{size:"xs",variant:"ghost",onClick:()=>{a(),u(!1)},disabled:!m,children:"Revert"}),c.jsx(ge,{size:"xs",onClick:()=>u(!1),children:"Done"})]}),c.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):c.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?c.jsx(rN,{children:e}):c.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function lq(){return c.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const aN={"claude-code":"Claude Code",codex:"Codex"},sq=[Jd.CLAUDE_CODE,Jd.CODEX];function oq({open:e,onOpenChange:t,agent:n}){const a=dn(),l=n.clientId,o=n.runtimeProvider,[u,f]=b.useState(l),[m,h]=b.useState(o),[y,g]=b.useState(!1),w=Ve({queryKey:["clients-rebind"],queryFn:Ei,enabled:e}).data??[],k=dA({queries:w.map(U=>({queryKey:["client-capabilities",U.id],queryFn:()=>dy(U.id),enabled:e}))}),j=b.useMemo(()=>{const U=new Map;return k.forEach((V,F)=>{const ne=w[F];if(!ne)return;const oe=V.data;oe!=null&&oe.capabilities&&U.set(ne.id,oe.capabilities)}),U},[k,w]);b.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const C=u?j.get(u)??null:null,E=(C==null?void 0:C[m])??null,R=!E||E.state==="missing"||E.state==="error",z=!!u&&(u!==l||m!==o)&&(!R||y),I=m!==o,B=u!==l,O=jt({mutationFn:()=>{if(!u)throw new Error("clientId required");return ND(n.uuid,{clientId:u,runtimeProvider:m,force:R&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),D=O.error instanceof qu||O.error instanceof Error?O.error.message:null;return c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{className:"max-w-lg",children:[c.jsx(cn,{children:c.jsx(rn,{children:"Re-bind agent"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",c.jsx("span",{className:"mono",children:cq(l,w,o)})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Computer"}),c.jsx("select",{value:u??"",onChange:U=>f(U.target.value||null),className:"w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-body",children:w.map(U=>c.jsx("option",{value:U.id,children:uq(U)},U.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Runtime"}),c.jsx("div",{className:"space-y-2",children:sq.map(U=>{const V=(C==null?void 0:C[U])??null,F=!!V&&V.state!=="missing",ne=m===U;return c.jsxs("label",{className:ne?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":F?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[c.jsx("input",{type:"radio",name:"rebind-runtime",checked:ne,onChange:()=>h(U),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:aN[U]}),c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:fq(V,U)})]})]},U)})})]}),(B||I)&&c.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[c.jsxs("p",{children:[c.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),I&&c.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),R&&c.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[c.jsx("input",{type:"checkbox",checked:y,onChange:U=>g(U.target.checked),className:"mt-0.5"}),c.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),D&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:D})]}),c.jsxs(zn,{children:[c.jsx(ge,{variant:"outline",onClick:()=>t(!1),disabled:O.isPending,children:"Cancel"}),c.jsx(ge,{onClick:()=>O.mutate(),disabled:!z||O.isPending,children:O.isPending?"Re-binding…":"Re-bind"})]})]})})}function uq(e){return`${e.hostname??e.id} · ${e.status}`}function cq(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${aN[n]}`}const dq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function fq(e,t){if(!e)return"Not reported on this computer.";switch(e.state){case"ok":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, authenticated.`;case"unauthenticated":return`Installed${e.sdkVersion?` v${e.sdkVersion}`:""}, not authenticated. ${dq[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const hq={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function mq(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return c.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:c.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(fu,{state:"blocked",size:8}),c.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),c.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),c.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>c.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:hq[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&c.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[c.jsx(Mr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&c.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&c.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&c.jsx(ge,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),c.jsx(ge,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),c.jsx(ge,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[c.jsx(BR,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function gu(e){return`agent-cfg-${e}`}function ou({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:u}){return c.jsxs("section",{id:e,className:Te("space-y-3",o),...u,children:[c.jsxs("div",{className:"flex items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),c.jsx("div",{className:"space-y-3",children:l})]})}function pq(){return c.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const gq={"claude-code":{name:"Claude Code",caption:"Anthropic's Claude Code runtime. Re-bind via the agent's settings to switch computer or runtime."},codex:{name:"Codex",caption:"OpenAI's Codex CLI runtime. Re-bind via the agent's settings to switch computer or runtime."}};function yq(e){const t=gq[e.runtimeProvider];return c.jsxs("div",{className:"space-y-3",children:[c.jsx(vq,{name:t.name,caption:t.caption,locked:!0}),c.jsx(bq,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function vq({name:e,caption:t,locked:n}){return c.jsxs(Zn,{children:[c.jsx(Aa,{children:c.jsxs(Ta,{children:["Where it runs",n&&c.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[c.jsx(Dk,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),c.jsxs(Ra,{className:"space-y-1 text-body",children:[c.jsxs("div",{className:"inline-flex items-center gap-2",children:[c.jsx(Mk,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),c.jsx("span",{className:"font-medium",children:e})]}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function bq(e){const t=!!e.computerLabel;return c.jsxs(Zn,{children:[c.jsxs(Aa,{children:[c.jsx(Ta,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[c.jsx(fg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&c.jsxs(ge,{size:"xs",variant:"outline",onClick:e.onRebind,children:[c.jsx(fg,{className:"h-3 w-3"}),"Re-bind"]})]}),c.jsx(Ra,{className:"text-body",children:t?c.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function xq(e){return e.isUnclaimed?"Saving: configuration stored; will apply when a computer claims this agent.":e.isOffline?"Saving: configuration stored; will apply when the computer reconnects.":e.activeSessions>0?`Saving: new chats use this immediately; ${e.activeSessions} active chat${e.activeSessions===1?"":"s"} switch on their next message.`:"Saving: new chats use this immediately."}function wq(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function Sq(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Mp(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function pS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:Sq(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Ip(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],u=new Set(o.map(h=>h.key)),f=wq(n,u),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:pS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:pS(f)}}),remove:a=>t(l=>{const u=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:u}}),undo:a=>t(l=>{const u=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:u}})}}function kq(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:Mp(e.payload.mcpServers,"mcp"),env:Mp(e.payload.env,"env"),git:Mp(e.payload.gitRepos,"git")}}function jq(e){const[t,n]=b.useState(null);b.useEffect(()=>{e&&t===null&&n(kq(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",u=a.promptAppend!==l,f=a.model!==o,m=b.useMemo(()=>{const z=[],I=U=>U.reduce((V,F)=>F.status==="unchanged"?V:V+1,0),B=I(a.mcp),O=I(a.env),D=I(a.git);return u&&z.push("prompt"),f&&z.push("model"),B>0&&z.push("mcp"),O>0&&z.push("env"),D>0&&z.push("git"),{anyDirty:z.length>0,dirtySections:z,counts:{prompt:u?1:0,model:f?1:0,mcp:B,env:O,git:D}}},[a,u,f]),h=b.useCallback(z=>{n(I=>I&&z(I))},[]),y=b.useCallback(z=>h(I=>({...I,promptAppend:z})),[h]),g=b.useCallback(()=>h(z=>({...z,promptAppend:l})),[h,l]),x=b.useCallback(z=>h(I=>({...I,model:z})),[h]),w=b.useCallback(()=>h(z=>({...z,model:o})),[h,o]),k=b.useMemo(()=>Ip("mcp",h),[h]),j=b.useMemo(()=>Ip("env",h),[h]),C=b.useMemo(()=>Ip("git",h),[h]),E=b.useCallback(()=>{n(null)},[]),R=b.useCallback(()=>{if(!t||!e)return{};const z={};u&&(z.prompt={append:t.promptAppend}),f&&(z.model=t.model);const I=m.counts.mcp>0,B=m.counts.env>0,O=m.counts.git>0;return I&&(z.mcpServers=t.mcp.filter(D=>D.status!=="deleted").map(D=>D.value)),B&&(z.env=t.env.filter(D=>D.status!=="deleted").map(D=>{const U=D.value;return U.sensitive&&U.value===Wd?{key:U.key,value:Wd,sensitive:!0}:U})),O&&(z.gitRepos=t.git.filter(D=>D.status!=="deleted").map(D=>D.value)),z},[t,e,u,f,m]);return{draft:a,summary:m,promptDirty:u,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:x,revertModel:w,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:C.add,updateGit:C.update,deleteGit:C.remove,undoDeleteGit:C.undo,resetAll:E,buildPayloadPatch:R}}const jn={overview:"ad-overview",setup:"ad-setup",prompt:gu("prompt"),tools:gu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function Cq(e){const t=[{key:"overview",label:"Profile",anchor:jn.overview}];return e||t.push({key:"setup",label:"Setup",anchor:jn.setup},{key:"prompt",label:"Prompt",anchor:jn.prompt},{key:"tools",label:"Tools",anchor:jn.tools},{key:"advanced",label:"Advanced",anchor:jn.advanced}),t.push({key:"danger",label:"Danger zone",anchor:jn.danger,divider:!0,danger:!0}),t}function Eq(){var mn,ft,Nr,Dn,ec,Mi,Ii,Li,Br,Ui,Ia,tc;const t=pk().uuid??"",n=On(),a=dn(),l=Ve({queryKey:["agent",t],queryFn:()=>jD(t),enabled:!!t}),o=Ve({queryKey:["agent-config",t],queryFn:()=>Y6(t),enabled:!!t&&((mn=l.data)==null?void 0:mn.type)!=="human"}),u=Ve({queryKey:["agent-client-status",t],queryFn:()=>W6(t),enabled:!!t&&((ft=l.data)==null?void 0:ft.type)!=="human"}),f=Ve({queryKey:["agent-sessions-active",t],queryFn:()=>Wk(t,{state:"active"}),enabled:!!t&&((Nr=l.data)==null?void 0:Nr.type)!=="human"}),m=Ve({queryKey:["clients"],queryFn:Ei,enabled:!!t&&((Dn=l.data)==null?void 0:Dn.type)!=="human",refetchInterval:3e4}),h=jq(o.data),[y,g]=b.useState(null),[x,w]=b.useState(null),[k,j]=b.useState(!1),C=jt({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const we=h.buildPayloadPatch();return X6(t,{expectedVersion:o.data.version,payload:we})},onSuccess:we=>{a.setQueryData(["agent-config",t],we),g(null),w(null),j(!0)},onError:we=>{if(j(!1),we instanceof qu&&we.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(we instanceof Error?we.message:String(we))}});b.useEffect(()=>{if(!k)return;const we=setTimeout(()=>j(!1),2500);return()=>clearTimeout(we)},[k]),b.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const E=b.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),R=b.useCallback(we=>{const Ge=document.getElementById(we);Ge&&Ge.scrollIntoView({behavior:"smooth",block:"start"})},[]),z=jt({mutationFn:we=>Y1(t,we),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),I=jt({mutationFn:()=>AD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),B=jt({mutationFn:()=>TD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),O=jt({mutationFn:()=>_D(t),onSuccess:()=>n("/team")}),D=jt({mutationFn:()=>RD(t)}),[U,V]=b.useState(!1),[F,ne]=b.useState(""),[oe,Se]=b.useState(null),[G,W]=b.useState(!1),Z=Ve({queryKey:["clients"],queryFn:Ei,enabled:U}),re=jt({mutationFn:we=>Y1(t,{clientId:we}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),V(!1),ne(""),Se(null)},onError:we=>Se(we instanceof Error?we.message:String(we))}),[ve,Re]=b.useState(!1),[_,L]=b.useState(null),P=jt({mutationFn:()=>J6(t,h.buildPayloadPatch()),onSuccess:we=>{const Ge=we.diff.length?we.diff.map(pn=>`${pn.op} ${pn.path}`).join(`
|
|
381
|
+
`):"(no changes)";L(Ge)},onError:we=>L(`Dry run failed: ${we instanceof Error?we.message:String(we)}`)});b.useEffect(()=>{if(!h.summary.anyDirty)return;const we=Ge=>{Ge.preventDefault(),Ge.returnValue=""};return window.addEventListener("beforeunload",we),()=>window.removeEventListener("beforeunload",we)},[h.summary.anyDirty]);const A=((ec=l.data)==null?void 0:ec.type)==="human",q=b.useMemo(()=>Cq(A),[A]),X=b.useRef(null),[ue,xe]=b.useState(!1);b.useEffect(()=>{if(A)return;const we=X.current;if(!we||typeof IntersectionObserver>"u")return;const Ge=new IntersectionObserver(pn=>{const Wr=pn[0];Wr&&xe(!Wr.isIntersecting&&Wr.boundingClientRect.top<0)},{threshold:0});return Ge.observe(we),()=>Ge.disconnect()},[A]);const[be,fe]=b.useState(jn.overview);b.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const we=[];for(const Ge of q){const pn=document.getElementById(Ge.anchor);if(!pn)continue;const Wr=new IntersectionObserver(lo=>{for(const nc of lo)nc.isIntersecting&&fe(Ge.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});Wr.observe(pn),we.push(Wr)}return()=>{for(const Ge of we)Ge.disconnect()}},[q]);const ee=b.useMemo(()=>{const we=new Set;for(const Ge of h.summary.dirtySections)Ge==="prompt"&&we.add(jn.prompt),Ge==="model"&&we.add(jn.setup),Ge==="mcp"&&we.add(jn.tools),(Ge==="env"||Ge==="git")&&we.add(jn.advanced);return we},[h.summary.dirtySections]);if(l.isLoading)return c.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:c.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return c.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const me=l.data;if(!me)return c.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const _e=me.type==="human",Le=u.data,it=((Mi=f.data)==null?void 0:Mi.length)??0,pt=!_e&&!(Le!=null&&Le.clientId),Pr=!_e&&Le?!Le.online&&!!Le.clientId:!1,Oa=me,Cl=Oa.runtimeState??null,Da=Oa.runtimeType??null,Ma=Oa.totalSessions??null,Jr=me.uuid.slice(0,8),ro=xq({activeSessions:it,isUnclaimed:pt,isOffline:Pr}),ao=h.draft.mcp.filter(we=>we.status!=="deleted"),fn=h.draft.env.filter(we=>we.status!=="deleted"),io=h.draft.git.filter(we=>we.status!=="deleted"),le=we=>new Set(ao.filter(Ge=>Ge.key!==we).map(Ge=>Ge.value.name.toLowerCase())),ye=we=>new Set(fn.filter(Ge=>Ge.key!==we).map(Ge=>Ge.value.key)),Ue=we=>new Set(io.filter(Ge=>Ge.key!==we).map(Ge=>{const{value:pn}=Ge;return pn.localPath?pn.localPath:((pn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),Be={sessions:Ma??"—",active:it,runtime:Da??(_e?"human":"—"),model:((Li=(Ii=o.data)==null?void 0:Ii.payload.model)==null?void 0:Li.trim())||"—"},nt=(Le==null?void 0:Le.clientId)??null,hn=nt?((Br=m.data)==null?void 0:Br.find(we=>we.id===nt))??null:null,ur=nt?(hn==null?void 0:hn.hostname)??nt:null,Wt=me.runtimeProvider??"claude-code",$t=Wt==="codex"?"Codex":"Claude Code";return c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:[c.jsx(Oy,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),q.map(we=>c.jsxs("div",{children:[we.divider&&c.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),c.jsx(Nq,{label:we.label,active:be===we.anchor,danger:we.danger??!1,dirty:ee.has(we.anchor),onClick:()=>R(we.anchor)})]},we.key))]}),c.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[c.jsxs(eU,{style:{marginBottom:"var(--sp-2)"},children:[c.jsx(tU,{onClick:()=>n("/team"),children:"Agents"}),c.jsx(nU,{}),c.jsx(rU,{mono:!0,children:me.name??Jr})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:c.jsx(Qu,{width:18,height:20,style:{color:"var(--accent)"}})}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-title",title:`agt_${Jr}`,children:me.displayName}),c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",me.name??Jr]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[c.jsx(zr,{tone:me.type==="autonomous_agent"?"accent":"neutral",children:me.type}),me.visibility&&c.jsx(zr,{tone:me.visibility==="organization"?"accent":"outline",children:me.visibility}),(Le==null?void 0:Le.offlineSince)&&c.jsxs("span",{className:"mono",children:["offline since ",gl(Le.offlineSince)]})]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(_u,{state:Cl}),c.jsxs(ge,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${me.uuid}`),children:[c.jsx(ly,{className:"h-3 w-3"})," Open chat"]}),!_e&&me.status==="active"&&c.jsxs(ge,{variant:"outline",size:"xs",onClick:()=>{D.reset(),D.mutate()},disabled:D.isPending,children:[c.jsx(Mk,{className:"h-3 w-3"}),D.isPending?"Testing…":"Test"]})]})]}),c.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[c.jsx(Ad,{label:"sessions",value:Be.sessions}),c.jsx(Ad,{label:"active",value:Be.active,accent:typeof Be.active=="number"&&Be.active>0?"var(--accent)":void 0}),c.jsx(Ad,{label:"runtime",value:Be.runtime}),c.jsx(Ad,{label:"model",value:Be.model})]})]}),c.jsx("div",{ref:X,"aria-hidden":!0,style:{height:0}}),!_e&&c.jsx(lU,{runtimeLabel:$t,computerLabel:ur,visible:ue}),c.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[(D.data||D.error)&&c.jsx(Oq,{result:D.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>D.reset()}),c.jsx(ou,{anchorId:jn.overview,title:"Profile",right:c.jsxs(ge,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${me.uuid}`),title:"Manage platform bindings in Integrations",children:[c.jsx(fg,{className:"h-3 w-3"}),"Manage bindings"]}),children:c.jsx(xU,{agent:me,onSave:async we=>{await z.mutateAsync(we)}})}),!_e&&c.jsxs(c.Fragment,{children:[c.jsxs(ou,{anchorId:jn.setup,title:"Setup",caption:((Ui=o.data)==null?void 0:Ui.version)!=null?c.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&c.jsxs(c.Fragment,{children:[" · ",c.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&c.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&c.jsx(yq,{runtimeProvider:Wt,computerLabel:ur,canBindComputer:pt&&me.status==="active",bindComputerPending:re.isPending,onBindComputer:()=>V(!0),onRebind:me.clientId?()=>W(!0):void 0,modelSlot:c.jsx(RU,{value:h.draft.model,baseline:((Ia=o.data)==null?void 0:Ia.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:me.status!=="active",provider:Wt})})]}),c.jsx(ou,{anchorId:jn.prompt,title:"Prompt",children:o.data?c.jsx(iq,{value:h.draft.promptAppend,baseline:((tc=o.data)==null?void 0:tc.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:me.status!=="active"}):null}),c.jsx(ou,{anchorId:jn.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?c.jsx(kU,{items:h.draft.mcp,otherNames:le,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:me.status!=="active"}):null}),c.jsx(ou,{anchorId:jn.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{id:gu("env"),children:c.jsx(hU,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:me.status!=="active"})}),c.jsx("div",{id:gu("git"),children:c.jsx(pU,{items:h.draft.git,otherPaths:Ue,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:me.status!=="active"})}),_&&c.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:_}),h.summary.anyDirty&&c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:c.jsx("button",{type:"button",onClick:()=>P.mutate(),className:"underline bg-transparent border-0 cursor-pointer",style:{color:"var(--fg-3)"},disabled:P.isPending,children:P.isPending?"Computing dry-run…":"Preview server-side diff"})})]})})]}),c.jsx(pq,{}),c.jsx(sU,{agent:me,suspendPending:I.isPending,reactivatePending:B.isPending,deletePending:O.isPending,onSuspend:()=>I.mutate(),onReactivate:()=>B.mutate(),onDelete:()=>O.mutate()})]}),!_e&&c.jsx(mq,{summary:h.summary,saveHint:ro,conflictMessage:x,errorMessage:y,saving:C.isPending,justSaved:k,onSave:()=>C.mutate(),onDiscard:()=>{h.summary.anyDirty&&Re(!0)},onReloadRemote:E,onJumpTo:we=>R(gu(we))})]}),c.jsx(_q,{open:ve,onOpenChange:Re,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),g(null),w(null),Re(!1)}}),c.jsx(nn,{open:U,onOpenChange:we=>{V(we),we||(ne(""),Se(null),re.reset())},children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Bind computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),Z.isLoading?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):Z.error?c.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",Z.error instanceof Error?Z.error.message:"Unknown"]}):c.jsx(Aq,{clients:Z.data??[],selected:F,onSelect:ne}),oe&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:oe})]}),c.jsxs(zn,{children:[c.jsx(ge,{variant:"outline",onClick:()=>V(!1),children:"Cancel"}),c.jsx(ge,{disabled:!F||re.isPending,onClick:()=>{Se(null),re.mutate(F)},children:re.isPending?"Binding…":"Bind"})]})]})}),c.jsx(oq,{open:G,onOpenChange:W,agent:me})]})}function Nq({label:e,active:t,danger:n,dirty:a,onClick:l}){return c.jsx("button",{type:"button",onClick:l,className:Te("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"flex-1 truncate",children:e}),a&&c.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&c.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function _q(e){return c.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:e.title})}),c.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(ge,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function Aq({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?c.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",c.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):c.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,u=l.status==="online"||l.status==="active";return c.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:c.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Te("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[c.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:u?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),c.jsxs("span",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),c.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),c.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const Tq={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},Rq={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},zq={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function Oq({result:e,onDismiss:t}){const n=Rq[e.status],a=zq[e.status],l=e.connection;return c.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zr,{tone:a,children:Tq[e.status]}),e.responseTime!=null&&c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&c.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[c.jsx("div",{children:l.runtimeState&&c.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?c.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):c.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&c.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&c.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),c.jsx(ge,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function Ju({title:e,subtitle:t,right:n,className:a,style:l,...o}){return c.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-4) var(--sp-5) var(--sp-3)",...l},...o,children:[c.jsx("h1",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t&&c.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),c.jsx("div",{style:{flex:1}}),n]})}function Dq(){return c.jsxs("div",{className:"-m-6",children:[c.jsx(Ju,{title:"Context",subtitle:"The team's living source of truth"}),c.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:c.jsx(Zn,{children:c.jsx("div",{className:"text-body",style:{padding:"var(--sp-6) var(--sp-5)",color:"var(--fg-3)",textAlign:"center"},children:"Tree visualization is on the way. This view will surface structure, relationships, and recent changes to the context-tree at a glance."})})})]})}const eo=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));eo.displayName="Card";const to=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));to.displayName="CardHeader";const Wu=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("text-subtitle leading-none",e),...t}));Wu.displayName="CardTitle";const iN=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("text-body text-muted-foreground",e),...t}));iN.displayName="CardDescription";const no=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));no.displayName="CardContent";const Mq=b.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));Mq.displayName="CardFooter";function Iq(){const{token:e}=pk(),t=On(),{isAuthenticated:n,adoptTokens:a}=zt(),[l,o]=b.useState(null),[u,f]=b.useState(null),[m,h]=b.useState(!1),[y,g]=b.useState(null);if(b.useEffect(()=>{e&&(async()=>{try{const C=await fetch(`/api/v1/invitations/${encodeURIComponent(e)}/preview`);if(!C.ok){f("This invitation is no longer valid");return}o(await C.json())}catch{f("Network error while loading invitation")}})()},[e]),b.useEffect(()=>{n&&(async()=>{try{const C=await Ne.get("/me/organizations"),E=await Ne.get("/me"),R=C.find(z=>z.id===E.member.organizationId);g((R==null?void 0:R.displayName)??null)}catch{}})()},[n]),!e)return c.jsx(gS,{message:"Bad invitation URL"});if(u)return c.jsx(gS,{message:"This invitation is no longer valid"});if(!l)return c.jsx(Lq,{});const x=async()=>{h(!0);try{const C=await Ne.post("/me/organizations/join",{token:e});await a(C.tokens),Nk("invite"),t("/",{replace:!0})}catch(C){f(C instanceof Error?C.message:"Failed to join team")}finally{h(!1)}},w=`/api/v1/auth/github/start?next=${encodeURIComponent(`/invite/${e}`)}`,k=n&&y&&y!==l.organizationDisplayName,j=Uq(l.expiresAt);return c.jsx(Wy,{children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsx(to,{className:"text-center",children:c.jsxs(Wu,{className:"text-title",children:["You're invited to join",c.jsx("br",{}),l.organizationDisplayName]})}),c.jsxs(no,{className:"space-y-4",children:[k&&c.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[c.jsx(oy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsxs("span",{children:["You'll switch from ",c.jsx("span",{className:"font-medium",children:y})," to"," ",c.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?c.jsx(ge,{className:"w-full",disabled:m,onClick:x,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):c.jsx(ge,{asChild:!0,className:"w-full",children:c.jsxs("a",{href:w,children:[c.jsx(Ok,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&c.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),c.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",c.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",c.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function Wy({children:e}){return c.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[c.jsx("header",{className:"px-4 py-3",children:c.jsxs(Fu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[c.jsx(iy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),c.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function Lq(){return c.jsx(Wy,{children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsxs(to,{className:"text-center",children:[c.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),c.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),c.jsxs(no,{className:"space-y-4",children:[c.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),c.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function gS({message:e}){return c.jsx(Wy,{children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsxs(to,{className:"text-center",children:[c.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:c.jsx(oy,{className:"h-6 w-6"})}),c.jsx(Wu,{className:"text-title",children:e})]}),c.jsxs(no,{className:"space-y-4",children:[c.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),c.jsx(ge,{asChild:!0,variant:"outline",className:"w-full",children:c.jsxs(Fu,{to:"/",children:[c.jsx(iy,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function Uq(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const n=t-Date.now();if(n<=0)return null;const a=Math.floor(n/6e4),l=Math.floor(a/60),o=Math.floor(l/24);return o>7?null:o>=1?{text:`Expires in ${o} ${o===1?"day":"days"}`,urgent:!1}:l>=1?{text:`Expires in ${l} ${l===1?"hour":"hours"}`,urgent:!0}:{text:`Expires in ${Math.max(1,a)} ${a===1?"minute":"minutes"}`,urgent:!0}}function Pq(e){if(typeof e!="object"||e===null||!("from"in e))return null;const t=e.from;if(typeof t!="object"||t===null||!("pathname"in t)||typeof t.pathname!="string"||t.pathname==="/login")return null;const n="search"in t&&typeof t.search=="string"?t.search:"",a="hash"in t&&typeof t.hash=="string"?t.hash:"",l=`${t.pathname}${n}${a}`,o=RC(l);return o===Sw&&l!==Sw?null:o}function Bq(){const{isAuthenticated:e}=zt(),t=Vn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=Pq(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?c.jsx(ir,{to:a,replace:!0}):c.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[c.jsx("header",{className:"px-4 py-3",children:c.jsxs(Fu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[c.jsx(iy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),c.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:c.jsxs(eo,{className:"w-full max-w-sm",children:[c.jsxs(to,{className:"text-center",children:[c.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:c.jsx(Qu,{width:28,height:32})}),c.jsxs(Wu,{className:"text-title",children:["First Tree ",c.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),c.jsxs(no,{className:"space-y-4",children:[c.jsx(ge,{asChild:!0,className:"w-full",children:c.jsxs("a",{href:l,children:[c.jsx(Ok,{className:"h-4 w-4"}),"Continue with GitHub"]})}),c.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",c.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",c.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[c.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),c.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),c.jsx(ge,{asChild:!0,variant:"outline",className:"w-full",children:c.jsxs("a",{href:o,children:[c.jsx(cz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function $q(){const e=On(),{adoptTokens:t}=zt(),[n,a]=b.useState(null);return b.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),u=o.get("access"),f=o.get("refresh"),m=RC(o.get("next")),h=o.get("joinPath");if(!u||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Nk(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:u,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}const Hs=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("table",{ref:a,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0,...t},...n}));Hs.displayName="DenseTable";const Zs=b.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:e,...t}));Zs.displayName="DenseTableHeader";const Vs=b.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:e,...t}));Vs.displayName="DenseTableBody";const Or=b.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>c.jsx("tr",{ref:o,className:Te("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));Or.displayName="DenseTableRow";const tt=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("th",{ref:a,className:Te("text-left text-label whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3_5)",color:"var(--fg-3)",fontWeight:500,borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));tt.displayName="DenseTableHead";const Ke=b.forwardRef(({className:e,style:t,...n},a)=>c.jsx("td",{ref:a,className:Te("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Ke.displayName="DenseTableCell";function Fq(){const{data:e}=Ve({queryKey:["members","user-name-map"],queryFn:_f,staleTime:3e4});return b.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.userId,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}const qq=1500;function Hq({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:u,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=b.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),qq))},x=t!==void 0?Math.max(1,Math.round(t/60)):null,w=c.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?c.jsxs(c.Fragment,{children:[e,x!==null&&c.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",x,"m"]})]}):"Generating token…"}),k=c.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?c.jsx(Mr,{className:"h-3.5 w-3.5"}):c.jsx(zk,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return c.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?c.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):c.jsxs(c.Fragment,{children:[w,k]}),f&&c.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&c.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[c.jsx(Zq,{}),l]}),n==="success"&&o&&c.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[c.jsx(Mr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),c.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&u&&c.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:u})]})}function Zq(){return c.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const Vq=3e3,Qq=1200;function Kq({open:e,onOpenChange:t}){const n=dn(),{user:a}=zt(),[l,o]=b.useState("loading"),[u,f]=b.useState(null),[m,h]=b.useState(null),[y,g]=b.useState(null),x=b.useRef(new Set);return b.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),x.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return x.current=new Set(k),(async()=>{try{const j=await nO();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),b.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ei}),C=x.current,E=j.find(R=>!C.has(R.id)&&R.status==="connected"&&R.userId===a.id);E&&(g(E.hostname??null),o("success"))}catch{}},Vq);return()=>clearInterval(k)},[e,l,n,a]),b.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},Qq);return()=>clearTimeout(w)},[l,t,n]),c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{children:[c.jsxs(cn,{children:[c.jsx(rn,{children:"Connect computer"}),c.jsx(yy,{children:"Run this command on the machine you want to pair with this Hub."})]}),c.jsx(Hq,{command:(u==null?void 0:u.command)??null,expiresInSeconds:u==null?void 0:u.expiresIn,phase:l,successContent:c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),c.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:c.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function Gq({embedded:e=!1}={}){const t=dn(),n=xf(),a=Fq(),{role:l}=zt(),o=l==="admin",[u,f]=b.useState(null),[m,h]=b.useState(null),[y,g]=b.useState(null),[x,w]=b.useState(null),[k,j]=b.useState(!1),{data:C}=Ve({queryKey:["clients"],queryFn:Ei,refetchInterval:1e4}),{data:E}=Ve({queryKey:["activity"],queryFn:Hu,refetchInterval:1e4}),R=jt({mutationFn:tO,onSuccess:()=>{h(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),z=jt({mutationFn:eO,onSuccess:()=>{g(null),w(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:V=>{V instanceof qu?w(V.message):w(V instanceof Error?V.message:String(V))}}),I=b.useMemo(()=>{const V=new Map;for(const F of(E==null?void 0:E.agents)??[]){if(!F.clientId)continue;const ne=V.get(F.clientId)??[];ne.push(F),V.set(F.clientId,ne)}return V},[E==null?void 0:E.agents]),B=V=>I.get(V)??[],O=(C??[]).filter(V=>V.status==="connected").length,D=(C??[]).reduce((V,F)=>V+F.agentCount,0),U=(C??[]).filter(V=>V.authState!=="ok").length;return c.jsxs("div",{className:e?"":"-m-6",children:[c.jsx(Ju,{title:"Computers",subtitle:C&&C.length>0?c.jsxs(c.Fragment,{children:[C.length," total · ",O," connected · ",D," agents bound",U>0&&c.jsxs(c.Fragment,{children:[" · ",c.jsxs("span",{style:{color:"var(--state-error)"},children:[U," need re-auth"]})]})]}):null,right:c.jsx("div",{className:"flex items-center gap-1.5",children:c.jsxs(ge,{size:"xs",onClick:()=>j(!0),children:[c.jsx(Ir,{className:"h-3 w-3"}),"Connect computer"]})})}),c.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[c.jsx(Kq,{open:k,onOpenChange:j}),y&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:c.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[c.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),c.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",c.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:y.hostname??y.id.slice(0,8)}),". Retire refuses if any agent is still pinned to this computer — you must delete those agents first (reassign is not available in this milestone)."]}),B(y.id).length>0&&c.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[c.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),c.jsx("ul",{className:"text-body space-y-0.5",children:B(y.id).map(V=>c.jsx("li",{className:"font-medium",children:n(V.agentId)},V.agentId))})]}),x&&c.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:x}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ge,{variant:"outline",size:"sm",onClick:()=>{g(null),w(null)},children:"Cancel"}),c.jsx(ge,{variant:"destructive",size:"sm",onClick:()=>z.mutate(y.id),disabled:z.isPending,children:z.isPending?"Retiring…":"Retire"})]})]})}),m&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:c.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[c.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),c.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",c.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:m.hostname??m.id.slice(0,8)})," ","and affect all bound agents:"]}),c.jsx("ul",{className:"mb-4 space-y-1",children:B(m.id).length===0?c.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):B(m.id).map(V=>c.jsxs("li",{className:"text-body flex items-center gap-2",children:[c.jsx("span",{className:"font-medium",children:n(V.agentId)}),c.jsx(_u,{state:V.runtimeState})]},V.agentId))}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(ge,{variant:"outline",size:"sm",onClick:()=>h(null),children:"Cancel"}),c.jsx(ge,{variant:"destructive",size:"sm",onClick:()=>R.mutate(m.id),disabled:R.isPending,children:R.isPending?"Disconnecting…":"Disconnect"})]})]})}),!C||C.length===0?c.jsx(Zn,{children:c.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers connected. Use the button above to generate a connect command."})}):c.jsxs(Zn,{children:[c.jsxs(Eg,{right:c.jsx("span",{className:"mono text-caption normal-case tracking-normal",style:{color:"var(--fg-3)"},children:"click a row to expand"}),children:["Registered · ",C.length]}),c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{style:{width:16}}),c.jsx(tt,{children:"Hostname"}),o&&c.jsx(tt,{children:"Owner"}),c.jsx(tt,{children:"OS"}),c.jsx(tt,{children:"SDK"}),c.jsx(tt,{children:"Agents"}),c.jsx(tt,{children:"Connected"}),c.jsx(tt,{children:"Status"}),c.jsx(tt,{})]})}),c.jsx(Vs,{children:C.map(V=>{const F=u===V.id,ne=B(V.id);return c.jsx(n7,{client:V,boundAgents:ne,isExpanded:F,agentName:n,showOwner:o,ownerName:a,onToggle:()=>f(F?null:V.id),onDisconnect:()=>h(V),onRetire:()=>{w(null),g(V)},onReconnect:()=>j(!0)},V.id)})})]})]})]})]})}const Yq={"claude-code":"Claude Code",codex:"Codex"},Xq=[Jd.CLAUDE_CODE,Jd.CODEX],yS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},Jq={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function Wq({clientId:e,enabled:t}){const{data:n,isLoading:a}=Ve({queryKey:["client-capabilities",e],queryFn:()=>dy(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return c.jsxs(c.Fragment,{children:[c.jsx(Oy,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):c.jsx("div",{className:"flex flex-col gap-1",children:Xq.map(o=>c.jsx(e7,{provider:o,entry:l?l[o]??null:null},o))})]})}function e7({provider:e,entry:t}){const n=Yq[e];if(!t)return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",yS[e]]})]});switch(t.state){case"ok":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",Jq[e]]})]});case"missing":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",yS[e]]})]});case"error":return c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:n}),c.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function t7(){return c.jsxs("span",{className:"mono inline-flex items-center gap-1.5 uppercase text-caption",style:{color:"var(--state-error)"},children:[c.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--state-error)",display:"inline-block"}}),"AUTH EXPIRED"]})}function n7({client:e,boundAgents:t,isExpanded:n,agentName:a,showOwner:l,ownerName:o,onToggle:u,onDisconnect:f,onRetire:m,onReconnect:h}){const y=l?9:8,g=e.status!=="connected",x=e.authState!=="ok",w=e.status==="connected"?"idle":"offline";return c.jsxs(c.Fragment,{children:[c.jsxs(Or,{interactive:!0,selected:n,onClick:u,children:[c.jsx(Ke,{style:{width:16},children:c.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?c.jsx(Rk,{className:"h-3.5 w-3.5"}):c.jsx(NR,{className:"h-3.5 w-3.5"})})}),c.jsx(Ke,{className:"font-medium",children:e.hostname??"—"}),l&&c.jsx(Ke,{style:{color:"var(--fg-2)"},children:o(e.userId)}),c.jsx(Ke,{style:{color:"var(--fg-3)"},children:e.os??"—"}),c.jsx(Ke,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),c.jsx(Ke,{children:c.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?gl(e.connectedAt):"—"}),c.jsx(Ke,{children:x?c.jsx(t7,{}):c.jsx(_u,{state:w})}),c.jsx(Ke,{style:{width:1,whiteSpace:"nowrap"},children:c.jsxs("div",{className:"flex gap-1 justify-end",children:[g&&c.jsxs(ge,{variant:"ghost",size:"xs",className:"text-label",style:x?{color:"var(--state-error)"}:void 0,onClick:k=>{k.stopPropagation(),h()},children:[c.jsx(MR,{className:"h-3 w-3"})," Reconnect"]}),c.jsxs(ge,{variant:"ghost",size:"xs",className:"text-label",onClick:k=>{k.stopPropagation(),f()},children:[c.jsx(lz,{className:"h-3 w-3"})," Disconnect"]}),c.jsxs(ge,{variant:"ghost",size:"xs",className:"text-label",style:{color:"var(--fg-4)"},onClick:k=>{k.stopPropagation(),m()},children:[c.jsx(Bs,{className:"h-3 w-3"})," Retire"]})]})})]}),n&&c.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[c.jsx(Ke,{}),c.jsxs(Ke,{colSpan:y-1,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[c.jsx(Wq,{clientId:e.id,enabled:n}),c.jsxs(Oy,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),t.length===0?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No agents bound to this computer"}):c.jsx("div",{className:"flex flex-col gap-1",children:t.map(k=>c.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[c.jsx("span",{className:"mono font-medium",style:{minWidth:180},children:a(k.agentId)}),c.jsx(_u,{state:k.runtimeState}),k.activeSessions!==null&&c.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[k.activeSessions," / ",k.totalSessions??0," sessions"]})]},k.agentId))})]})]})]})}function r7(){return c.jsx(Gq,{embedded:!0})}function a7(){return Ne.get(an("/adapter-mappings"))}function i7(e){return Ne.post(an("/adapter-mappings"),e)}function l7(e){return Ne.delete(`/adapter-mappings/${e}`)}function s7(){return Ne.get(an("/adapters/status"))}function o7(){return Ne.get(an("/adapters"))}function u7(e){return Ne.post(an("/adapters"),e)}function c7(e,t){return Ne.patch(`/adapters/${e}`,t)}function d7(e){return Ne.delete(`/adapters/${e}`)}const f7=Object.values(FL),vS={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function bS(e){const[t,n]=b.useState(vS),[a,l]=b.useState("");b.useEffect(()=>{e.open&&(n({...vS,platform:e.initialPlatform??"feishu",status:e.initialStatus??"active"}),l(""))},[e.open,e.initialPlatform,e.initialStatus]);function o(f){if(f.preventDefault(),l(""),e.kind==="user"){if(!t.externalUserId)return;e.onSubmit({kind:"user-create",draft:{platform:t.platform,externalUserId:t.externalUserId,displayName:t.displayName||null}});return}if(t.platform==="feishu"){if(!e.editingId&&(!t.feishuAppId||!t.feishuAppSecret)){l("App ID and App Secret are required");return}}else if(t.platform==="kael"){if(!e.editingId&&(!t.kaelUserId||!t.kaelProjectId)){l("User ID and Project ID are required");return}}else{const h=t.credentialsJson.trim();if(!e.editingId&&!h){l("Credentials are required");return}if(h)try{JSON.parse(h)}catch{l("Invalid JSON");return}}const m=h7(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const u=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return c.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:u})}),c.jsxs("form",{onSubmit:o,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-platform",children:"Platform"}),c.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:f7.map(f=>c.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-ext-id",children:"External user ID"}),c.jsx(_t,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-name",children:"Display name (optional)"}),c.jsx(_t,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):c.jsxs(c.Fragment,{children:[t.platform==="feishu"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),c.jsx(_t,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsxs(ct,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),c.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&c.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"binding-status",children:"Status"}),c.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[c.jsx("option",{value:"active",children:"active"}),c.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(ge,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function h7(e){if(e.platform==="feishu")return!e.feishuAppId&&!e.feishuAppSecret||!e.feishuAppId||!e.feishuAppSecret?null:{app_id:e.feishuAppId,app_secret:e.feishuAppSecret};if(e.platform==="kael")return!e.kaelUserId&&!e.kaelProjectId||!e.kaelUserId||!e.kaelProjectId?null:{kaelUserId:e.kaelUserId,kaelProjectId:e.kaelProjectId};const t=e.credentialsJson.trim();return t?JSON.parse(t):null}function m7(){var A;const e=On(),t=dn(),[n,a]=kk(),l=n.get("agent"),o=xf(),u=Ve({queryKey:["adapters"],queryFn:o7}),f=Ve({queryKey:["adapter-mappings"],queryFn:a7}),m=Ve({queryKey:["adapter-statuses"],queryFn:s7,refetchInterval:15e3}),y=((A=Ve({queryKey:["agents","name-map"],queryFn:()=>Vu({limit:100}),staleTime:3e4}).data)==null?void 0:A.items)??[],g=b.useMemo(()=>{const q=new Map;for(const X of m.data??[])q.set(X.configId,X);return q},[m.data]),x=b.useMemo(()=>{const q=u.data??[];return l?q.filter(X=>X.agentId===l):q},[u.data,l]),w=b.useMemo(()=>{const q=f.data??[];return l?q.filter(X=>X.agentId===l):q},[f.data,l]),k=x.reduce((q,X)=>{var ue;return q+((ue=g.get(X.id))!=null&&ue.connected?1:0)},0),j=x.length-k,C=u.isLoading||f.isLoading,[E,R]=b.useState(null),[z,I]=b.useState(""),[B,O]=b.useState(null),[D,U]=b.useState(null),[V,F]=b.useState(null),[ne,oe]=b.useState(null),Se=jt({mutationFn:q=>u7({platform:q.platform,agentId:q.agentId,credentials:q.credentials,status:q.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),G=jt({mutationFn:q=>{const X={status:q.status};return q.credentials&&(X.credentials=q.credentials),c7(q.id,X)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),O(null)}}),W=jt({mutationFn:d7,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),Z=jt({mutationFn:q=>i7({platform:q.platform,externalUserId:q.externalUserId,agentId:q.agentId,boundVia:"manual",displayName:q.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),U(null)}}),re=jt({mutationFn:l7,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function ve(q){if(l){q==="bot"?O({agentId:l,editingId:null}):U({agentId:l});return}I(""),R({kind:q})}function Re(){!E||!z||(E.kind==="bot"?O({agentId:z,editingId:null}):U({agentId:z}),R(null))}function _(q){if(B){if(q.kind==="bot-create")Se.mutate({agentId:B.agentId,platform:q.draft.platform,status:q.draft.status,credentials:q.draft.credentials});else if(q.kind==="bot-update"){if(!B.editingId)return;G.mutate({id:B.editingId,status:q.status,credentials:q.credentials})}}}function L(q){!D||q.kind!=="user-create"||Z.mutate({agentId:D.agentId,platform:q.draft.platform,externalUserId:q.draft.externalUserId,displayName:q.draft.displayName})}const P=l?y.find(q=>q.uuid===l):null;return c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&c.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[c.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(P==null?void 0:P.displayName)??l,c.jsx("button",{type:"button",onClick:()=>{const q=new URLSearchParams(n);q.delete("agent"),a(q,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:c.jsx(wu,{className:"h-3 w-3"})})]})]}),c.jsxs(Zn,{className:"mb-3.5",children:[c.jsxs(Eg,{right:c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[c.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[c.jsx(fu,{state:"idle",size:6})," ",k," online"]}),c.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[c.jsx(fu,{state:"offline",size:6})," ",j," offline"]})]}),c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>ve("bot"),children:[c.jsx(Ir,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",x.length]}),C?c.jsx(Dd,{children:"Loading…"}):x.length?c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{children:"Agent"}),c.jsx(tt,{children:"Platform"}),c.jsx(tt,{children:"Status"}),c.jsx(tt,{children:"Connection"}),c.jsx(tt,{children:"Created"}),c.jsx(tt,{style:{width:96,textAlign:"right"}})]})}),c.jsx(Vs,{children:x.map(q=>{var ue;const X=((ue=g.get(q.id))==null?void 0:ue.connected)??!1;return c.jsxs(Or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[c.jsx(Ke,{children:c.jsx("span",{className:"mono font-medium",children:o(q.agentId)})}),c.jsx(Ke,{children:c.jsx(zr,{children:q.platform})}),c.jsx(Ke,{children:c.jsx(zr,{tone:q.status==="active"?"accent":"outline",children:q.status})}),c.jsx(Ke,{children:c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[c.jsx(fu,{state:X?"idle":"offline",size:7}),c.jsx("span",{style:{color:"var(--fg-3)"},children:X?"Online":"Offline"})]})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(q.createdAt)}),c.jsxs(Ke,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:xe=>xe.stopPropagation(),children:[c.jsx(ge,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>O({agentId:q.agentId,editingId:q.id,initialPlatform:p7(q.platform),initialStatus:g7(q.status)}),children:"Edit"}),c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>F(q.id),disabled:W.isPending,title:"Delete",children:c.jsx(Bs,{className:"h-3.5 w-3.5"})})]})]},q.id)})})]}):c.jsx(Dd,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),c.jsxs(Zn,{children:[c.jsxs(Eg,{right:c.jsxs(ge,{size:"xs",variant:"outline",onClick:()=>ve("user"),children:[c.jsx(Ir,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),C?c.jsx(Dd,{children:"Loading…"}):w.length?c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{children:"Agent"}),c.jsx(tt,{children:"Platform"}),c.jsx(tt,{children:"External user ID"}),c.jsx(tt,{children:"Display name"}),c.jsx(tt,{children:"Bound via"}),c.jsx(tt,{children:"Created"}),c.jsx(tt,{style:{width:32}})]})}),c.jsx(Vs,{children:w.map(q=>c.jsxs(Or,{interactive:!0,onClick:()=>e(`/agents/${q.agentId}`),children:[c.jsx(Ke,{children:c.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(q.agentId)})}),c.jsx(Ke,{children:c.jsx(zr,{children:q.platform})}),c.jsx(Ke,{children:c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:q.externalUserId})}),c.jsx(Ke,{style:{color:"var(--fg-2)"},children:q.displayName??"—"}),c.jsx(Ke,{children:c.jsx(zr,{tone:"outline",children:q.boundVia??"—"})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(q.createdAt)}),c.jsx(Ke,{onClick:X=>X.stopPropagation(),children:c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>oe(q.id),disabled:re.isPending,title:"Delete",children:c.jsx(Bs,{className:"h-3.5 w-3.5"})})})]},q.id))})]}):c.jsx(Dd,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),c.jsx(y7,{open:E!=null,kind:(E==null?void 0:E.kind)??"bot",agents:y,agentId:z,onAgentChange:I,onCancel:()=>R(null),onConfirm:Re}),c.jsx(bS,{open:B!=null,kind:"bot",editingId:(B==null?void 0:B.editingId)??null,initialPlatform:B==null?void 0:B.initialPlatform,initialStatus:B==null?void 0:B.initialStatus,agentLabel:B?o(B.agentId):"",pending:Se.isPending||G.isPending,errorMessage:(Se.error??G.error)instanceof Error?(Se.error??G.error).message:null,onOpenChange:q=>{q||(O(null),Se.reset(),G.reset())},onSubmit:_}),c.jsx(bS,{open:D!=null,kind:"user",editingId:null,agentLabel:D?o(D.agentId):"",pending:Z.isPending,errorMessage:Z.error instanceof Error?Z.error.message:null,onOpenChange:q=>{q||(U(null),Z.reset())},onSubmit:L}),c.jsx(xS,{open:V!=null,onOpenChange:q=>!q&&F(null),title:"Remove this bot binding?",description:"The bot will stop routing to this agent and any platform credentials stored here will be dropped.",confirmLabel:"Remove binding",pending:W.isPending,onConfirm:()=>{V!=null&&(W.mutate(V),F(null))}}),c.jsx(xS,{open:ne!=null,onOpenChange:q=>!q&&oe(null),title:"Remove this binding?",description:"The external user will stop routing to this agent. You can add the mapping again later.",confirmLabel:"Remove binding",pending:re.isPending,onConfirm:()=>{ne!=null&&(re.mutate(ne),oe(null))}})]})}function p7(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function g7(e){return e==="inactive"?"inactive":"active"}function Dd({children:e}){return c.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function y7(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return c.jsx(nn,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),c.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[c.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>c.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),c.jsxs(zn,{children:[c.jsx(ge,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),c.jsx(ge,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function xS(e){return c.jsx(nn,{open:e.open,onOpenChange:e.onOpenChange,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:e.title})}),c.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),c.jsx(ge,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function v7({embedded:e=!1}={}){return c.jsxs("div",{className:e?"":"-m-6",children:[c.jsx(Ju,{title:"Integrations",subtitle:"External platform bindings"}),c.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:c.jsx(m7,{})})]})}function b7(){return c.jsx(v7,{embedded:!0})}function x7(){return c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[c.jsx(wS,{to:"/settings/computers",label:"Computers"}),c.jsx(wS,{to:"/settings/integrations",label:"Integrations"})]}),c.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:c.jsx(Ps,{})})]})}function wS({to:e,label:t}){return c.jsx(hf,{to:e,className:({isActive:n})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!n&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:n})=>c.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:n?"var(--bg-active)":"transparent",color:n?"var(--fg)":"var(--fg-3)",fontWeight:n?500:400,borderRadius:"var(--radius-input)"},children:c.jsx("span",{className:"flex-1 truncate",children:t})})})}function Ug(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,xs)}const Lp=200;function w7(e){if(!e||e.length===0)return{};const t={},n=["name","displayName","clientId"];for(const a of e){const l=a.path[0];if(typeof l=="string"&&n.includes(l)){const o=l;t[o]||(t[o]=a.message)}else t._root=a.message}return t}function S7(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,xs)}function k7(e){switch(e){case"taken":return"That agent name is already in use in this organization. Pick a different one.";case"reserved":return"That agent name is reserved — pick a different one.";case"invalid":return"Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_)."}}function j7({open:e,onOpenChange:t,onCreated:n}){const a=dn(),{refreshMe:l,organizationId:o}=zt(),[u,f]=b.useState(""),[m,h]=b.useState(""),[y,g]=b.useState(!1),[x,w]=b.useState("claude-code"),[k,j]=b.useState("form"),[C,E]=b.useState([]),[R,z]=b.useState(null),[I,B]=b.useState(!1),[O,D]=b.useState({}),[U,V]=b.useState({status:"idle"});b.useEffect(()=>{e&&(f(""),h(""),g(!1),w("claude-code"),j("form"),E([]),z(null),B(!1),D({}),V({status:"idle"}))},[e]),b.useEffect(()=>{y||h(Ug(u))},[u,y]);const F=b.useRef(0);b.useEffect(()=>{if(!e||!m){V({status:"idle"});return}if(!kg.test(m)){V({status:"bad",reason:"invalid"});return}if(jg(m)){V({status:"bad",reason:"reserved"});return}const _=++F.current;V({status:"checking"});const L=window.setTimeout(()=>{ED(m).then(P=>{_===F.current&&(P.available?V({status:"ok"}):V({status:"bad",reason:P.reason}))}).catch(()=>{_===F.current&&V({status:"idle"})})},300);return()=>window.clearTimeout(L)},[m,e]);const ne=jt({mutationFn:async _=>{const L=u.trim()||m.trim()||"Untitled assistant";return CD({name:m||void 0,type:"personal_assistant",displayName:L,clientId:_.clientId,runtimeProvider:x,...o?{organizationId:o}:{}})},onSuccess:_=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(_,x)}}),oe=b.useMemo(()=>{const _=ne.error;if(!_)return{};if(_ instanceof qu){const L=w7(_.issues);return Object.keys(L).length>0?L:_.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:_.message}}return _ instanceof Error?{_root:_.message}:{}},[ne.error]),Se=U.status==="bad"?k7(U.reason):void 0,G={...Se?{name:Se}:{},...oe,...O};function W(){const _={};return m?m.length>xs?_.name=`Agent name must be at most ${xs} characters (got ${m.length}).`:kg.test(m)?jg(m)&&(_.name="That agent name is reserved — pick a different one."):_.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":u.trim().length>0&&(_.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),u.length>Lp&&(_.displayName=`Display name must be at most ${Lp} characters (got ${u.length}).`),_}async function Z(_){var P,A;_.preventDefault();const L=W();if(D(L),!(Object.keys(L).length>0)&&U.status!=="bad"){B(!0);try{const X=(await Ei()).filter(xe=>xe.status==="connected");if(X.length===0){ne.mutate({clientId:void 0});return}if(X.length===1){ne.mutate({clientId:(P=X[0])==null?void 0:P.id});return}const ue=[...X].sort((xe,be)=>be.lastSeenAt.localeCompare(xe.lastSeenAt));E(ue),z(((A=ue[0])==null?void 0:A.id)??null),j("pick-computer")}catch{ne.mutate({clientId:void 0})}finally{B(!1)}}}function re(){R&&ne.mutate({clientId:R})}const ve=U.status==="bad",Re=u.trim().length>0&&!ve&&!ne.isPending&&!I;return k==="pick-computer"?c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{className:"max-w-lg",children:[c.jsx(cn,{children:c.jsx(rn,{children:"Choose a computer"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",c.jsx("span",{className:"font-medium",children:u||m})," ","should run:"]}),c.jsx("div",{className:"space-y-2",children:C.map(_=>{const L=R===_.id;return c.jsxs("label",{className:L?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[c.jsx("input",{type:"radio",name:"target-computer",checked:L,onChange:()=>z(_.id),className:"mt-1"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-body font-medium truncate",children:_.hostname??_.id}),c.jsxs("div",{className:"text-caption text-muted-foreground",children:[_.os??"unknown OS"," · last seen ",new Date(_.lastSeenAt).toLocaleString()]})]})]},_.id)})}),G.clientId&&c.jsx("p",{className:"text-body text-destructive",children:G.clientId}),G._root&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:G._root})]}),c.jsxs(zn,{children:[c.jsx(ge,{variant:"outline",onClick:()=>j("form"),disabled:ne.isPending,children:"Back"}),c.jsx(ge,{onClick:re,disabled:!R||ne.isPending,children:ne.isPending?"Creating…":"Create"})]})]})}):c.jsx(nn,{open:e,onOpenChange:t,children:c.jsxs(Jt,{className:"max-w-lg",children:[c.jsx(cn,{children:c.jsx(rn,{children:"New Agent"})}),c.jsxs("form",{onSubmit:Z,className:"space-y-5",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"new-agent-display-name",children:"Display name"}),c.jsx(_t,{id:"new-agent-display-name",value:u,onChange:_=>{f(_.target.value),O.displayName&&D(L=>({...L,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Lp,"aria-invalid":G.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),c.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),G.displayName&&c.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:G.displayName})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"new-agent-name",children:"Agent name"}),c.jsxs("div",{className:"flex items-stretch",children:[c.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),c.jsx(_t,{id:"new-agent-name",value:m,onChange:_=>{const L=S7(_.target.value);h(L),g(!0),O.name&&D(P=>({...P,name:void 0}))},onBlur:_=>{const L=Ug(_.target.value);L!==m&&h(L)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:xs,"aria-invalid":G.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),c.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",xs," characters. Permanent after creation."]}),m&&!G.name&&U.status!=="idle"&&c.jsxs("p",{id:"new-agent-name-status",className:"text-caption",style:{color:U.status==="ok"?"var(--state-idle)":U.status==="checking"?"var(--fg-3)":"var(--fg-4)"},children:[U.status==="checking"&&"Checking availability…",U.status==="ok"&&"Available."]}),G.name&&c.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:G.name})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Where it runs"}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:x==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[c.jsx("input",{type:"radio",name:"runtime",checked:x==="claude-code",onChange:()=>w("claude-code"),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),c.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),c.jsxs("label",{className:x==="codex"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[c.jsx("input",{type:"radio",name:"runtime",checked:x==="codex",onChange:()=>w("codex"),className:"mt-1"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",children:"Codex"}),c.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",c.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),G._root&&c.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:G._root}),c.jsx(zn,{children:c.jsx(ge,{type:"submit",disabled:!Re,children:I?"Checking computers…":ne.isPending?"Creating…":"Create"})})]})]})})}function ev({children:e,count:t,right:n}){return c.jsxs("div",{className:"flex items-baseline justify-between",style:{padding:"var(--sp-1) var(--sp-1) var(--sp-2)"},children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[c.jsx("h2",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t!==void 0&&c.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:t})]}),n]})}function C7(e){const t=new Date(e),n=Date.now(),a=t.getTime()-n;if(a<=0)return`expired ${t.toLocaleDateString()}`;const l=Math.ceil(a/(1440*60*1e3));return`expires ${l===1?"in less than a day":`in ${l} days`} · ${t.toLocaleDateString()}`}function E7(){const{organizationId:e}=zt(),[t,n]=b.useState(null),[a,l]=b.useState(null),[o,u]=b.useState(!1),[f,m]=b.useState(!1);b.useEffect(()=>{e&&(async()=>{try{const y=await Ne.get(k1(e,"/invitations"));n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){u(!0),l(null);try{const y=await Ne.post(k1(e,"/invitations/rotate"));n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{u(!1)}}};return c.jsxs(eo,{children:[c.jsxs(to,{children:[c.jsx(Wu,{children:"Invite link"}),c.jsxs(iN,{children:["Anyone with this link can join your team as a member. Links expire after ",k6," days; rotating revokes the old link instantly and resets the timer."]})]}),c.jsxs(no,{className:"space-y-3",children:[a&&c.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),c.jsx(ge,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),c.jsx(ge,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),c.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${C7(t.expiresAt)}`:" · no expiry"]})]}):c.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const N7=Object.values(_6);function _7(){const e=dn(),{memberId:t,role:n}=zt(),a=n==="admin",[l,o]=b.useState(null),{data:u,isLoading:f,error:m}=Ve({queryKey:["members"],queryFn:_f}),h=jt({mutationFn:bU,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function y(g){window.confirm("Delete this member? Their human agent will also be deactivated.")&&h.mutate(g)}return c.jsxs(c.Fragment,{children:[c.jsx("section",{children:f?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):m?c.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",m instanceof Error?m.message:"Unknown error"]}):(u==null?void 0:u.length)===0?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:a?"No members yet — share the Invite link to add teammates.":"No members yet."}):c.jsxs(Hs,{className:"table-fixed",children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{style:{width:160},children:"Display name"}),c.jsx(tt,{style:{width:140},children:"Username"}),c.jsx(tt,{style:{width:120},children:"Role"}),c.jsx(tt,{style:{width:150},children:"Created"}),c.jsx(tt,{"aria-hidden":!0}),a&&c.jsx(tt,{style:{width:80,textAlign:"right"}})]})}),c.jsx(Vs,{children:u==null?void 0:u.map(g=>{const x=t===g.id;return c.jsxs(Or,{children:[c.jsxs(Ke,{children:[c.jsx("span",{className:"font-medium",children:g.displayName}),x&&c.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),c.jsx(Ke,{children:c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",g.username]})}),c.jsx(Ke,{className:"text-label",style:{color:"var(--fg-3)"},children:g.role==="admin"?"Admin":"Member"}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(g.createdAt)}),c.jsx(Ke,{"aria-hidden":!0}),a&&c.jsx(Ke,{style:{whiteSpace:"nowrap"},children:c.jsxs("div",{className:"flex gap-0.5 justify-end",children:[c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({id:g.id,username:g.username,displayName:g.displayName,role:g.role}),title:"Edit",children:c.jsx(pf,{className:"h-3.5 w-3.5"})}),!x&&c.jsx(ge,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(g.id),disabled:h.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:c.jsx(Bs,{className:"h-3.5 w-3.5"})})]})})]},g.id)})})]})}),c.jsx(A7,{target:l,onClose:()=>o(null),onSaved:()=>{o(null),e.invalidateQueries({queryKey:["members"]})}})]})}function A7({target:e,onClose:t,onSaved:n}){const[a,l]=b.useState(""),[o,u]=b.useState("member"),[f,m]=b.useState(null);b.useEffect(()=>{e&&(l(e.displayName),u(e.role),m(null))},[e]);const h=jt({mutationFn:async()=>{if(!e)throw new Error("No target");const x={};return a.trim()&&a!==e.displayName&&(x.displayName=a.trim()),o!==e.role&&(x.role=o),Object.keys(x).length===0?e:vU(e.id,x)},onSuccess:()=>{m(null),n()},onError:x=>{m(x instanceof Error?x.message:String(x))}});function y(x){x.preventDefault(),h.mutate()}const g=e!==null;return c.jsx(nn,{open:g,onOpenChange:x=>x?void 0:t(),children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Edit Member"})}),e&&c.jsxs("form",{onSubmit:y,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{children:"Username"}),c.jsx(_t,{value:e.username,disabled:!0,className:"font-mono"}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"edit-member-display",children:"Display Name"}),c.jsx(_t,{id:"edit-member-display",value:a,onChange:x=>l(x.target.value),required:!0,maxLength:200})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(ct,{htmlFor:"edit-member-role",children:"Role"}),c.jsx("select",{id:"edit-member-role",value:o,onChange:x=>u(x.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:N7.map(x=>c.jsx("option",{value:x,children:x},x))}),c.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&c.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),c.jsxs(zn,{children:[c.jsx(ge,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),c.jsx(ge,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function T7(){var m;const{role:e}=zt(),t=e==="admin",[n,a]=b.useState(!1),{data:l}=Ve({queryKey:["members"],queryFn:_f}),o=Ve({queryKey:["agents","team-page"],queryFn:()=>Vu({limit:100})}),u=(l==null?void 0:l.length)??0,f=(((m=o.data)==null?void 0:m.items)??[]).filter(h=>h.type!=="human").length;return c.jsxs(c.Fragment,{children:[c.jsx(Ju,{title:"Team",subtitle:`${u} ${u===1?"human":"humans"} and ${f} ${f===1?"agent":"agents"} working together`,right:t&&c.jsxs(ge,{size:"xs",variant:"ghost",onClick:()=>a(!0),children:[c.jsx(Ik,{className:"h-3 w-3"}),"Invite link"]})}),c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)",display:"flex",flexDirection:"column",gap:"var(--sp-5)"},children:[c.jsx(R7,{}),c.jsx(z7,{data:o.data,isLoading:o.isLoading,error:o.error})]}),c.jsx(nn,{open:n,onOpenChange:a,children:c.jsxs(Jt,{children:[c.jsx(cn,{children:c.jsx(rn,{children:"Invite link"})}),c.jsx(E7,{})]})})]})}function R7(){return c.jsxs("section",{children:[c.jsx(ev,{children:"Humans"}),c.jsx(_7,{})]})}function z7({data:e,isLoading:t,error:n}){const a=On(),l=dn(),o=XC(),{memberId:u}=zt(),[f,m]=b.useState(!1),{data:h}=Ve({queryKey:["activity"],queryFn:Hu,refetchInterval:1e4}),y=b.useMemo(()=>{const w=new Map;for(const k of(h==null?void 0:h.agents)??[])w.set(k.agentId,k);return w},[h==null?void 0:h.agents]),g=b.useMemo(()=>{const w=((e==null?void 0:e.items)??[]).filter(C=>C.type!=="human");if(!u)return w;const k=[],j=[];for(const C of w)(C.managerId===u?k:j).push(C);return[...k,...j]},[e==null?void 0:e.items,u]);function x(w,k){m(!1),l.invalidateQueries({queryKey:["agents"]}),l.invalidateQueries({queryKey:["activity"]})}return c.jsxs(c.Fragment,{children:[c.jsxs("section",{children:[c.jsx(ev,{right:c.jsxs(ge,{size:"xs",variant:"ghost",className:"normal-case tracking-normal",onClick:()=>m(!0),children:[c.jsx(Ir,{className:"h-3 w-3"}),"New agent"]}),children:"Agents"}),t?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n?c.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",n instanceof Error?n.message:"Unknown error"]}):g.length===0?c.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents yet — create one with “New agent”."}):c.jsxs(Hs,{children:[c.jsx(Zs,{children:c.jsxs(Or,{children:[c.jsx(tt,{style:{width:160},children:"Display name"}),c.jsx(tt,{style:{width:140},children:"Agent name"}),c.jsx(tt,{style:{minWidth:150},children:"Type"}),c.jsx(tt,{style:{minWidth:160},children:"Managed by"}),c.jsx(tt,{style:{minWidth:100},children:"Visibility"}),c.jsx(tt,{style:{minWidth:110},children:"Status"}),c.jsx(tt,{style:{minWidth:150},children:"Created"})]})}),c.jsx(Vs,{children:g.map(w=>{const k=y.get(w.uuid);return c.jsxs(Or,{interactive:!0,onClick:()=>a(`/agents/${encodeURIComponent(w.uuid)}`),children:[c.jsx(Ke,{children:c.jsx("span",{className:"font-medium",children:w.displayName})}),c.jsx(Ke,{children:w.name?c.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",w.name]}):c.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),c.jsx(Ke,{className:"text-label",style:{color:"var(--fg-3)"},children:O7(w.type)}),c.jsxs(Ke,{className:"text-label",style:{color:"var(--fg-2)"},children:[w.managerId?o(w.managerId):"—",w.managerId&&w.managerId===u&&c.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),c.jsx(Ke,{className:"text-label",style:{color:"var(--fg-3)"},children:D7(w.visibility)}),c.jsx(Ke,{children:c.jsx(_u,{state:(k==null?void 0:k.runtimeState)??null})}),c.jsx(Ke,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:gl(w.createdAt)})]},w.uuid)})})]})]}),c.jsx(j7,{open:f,onOpenChange:m,onCreated:x})]})}function O7(e){return e==="autonomous_agent"?"Autonomous agent":e==="personal_assistant"?"Personal assistant":e}function D7(e){return e==="organization"?"Shared":e==="private"?"Private":e}function M7(e){return Ne.get(`/orgs/${encodeURIComponent(e)}`)}function I7(e,t){return Ne.patch(`/orgs/${encodeURIComponent(e)}`,t)}function L7(){const{organizationId:e}=zt(),t=dn(),n=Ve({queryKey:["organization",e],queryFn:()=>e?M7(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=b.useState(""),[o,u]=b.useState(""),[f,m]=b.useState(!1);b.useEffect(()=>{n.data&&(l(n.data.displayName),u(n.data.name))},[n.data]);const h=jt({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const g={},x=a.trim(),w=o.trim();return x&&x!==n.data.displayName&&(g.displayName=x),w&&w!==n.data.name&&(g.name=w),Object.keys(g).length===0?Promise.resolve(n.data):I7(e,g)},onSuccess:g=>{t.setQueryData(["organization",e],g),t.invalidateQueries({queryKey:["me-organizations"]}),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return c.jsxs("section",{children:[c.jsx(ev,{right:c.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),c.jsxs(ge,{type:"submit",form:"team-identity-form",size:"xs",variant:"outline",disabled:h.isPending||!n.data,children:[c.jsx(Mr,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]}),children:"Team identity"}),n.isLoading?c.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?c.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):c.jsxs("form",{id:"team-identity-form",onSubmit:y,children:[c.jsx(SS,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),c.jsx(SS,{label:"URL slug",hint:"Lowercase letters, digits, hyphens. Used in invite URLs.",value:o,onChange:g=>u(g.toLowerCase()),mono:!0,pattern:"[a-z0-9][a-z0-9-]*"}),h.error instanceof Error&&c.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})]})}function SS({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return c.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"1fr var(--sp-45)",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),c.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),c.jsx("input",{value:n,onChange:u=>a(u.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]})}function U7(){return c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:c.jsx(L7,{})})}function P7(){const{role:e}=zt();return e===null?c.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?c.jsx(ir,{to:"/team",replace:!0}):c.jsxs(c.Fragment,{children:[c.jsx(Ju,{title:"Team settings",subtitle:"Organization name, slug, and metadata"}),c.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:c.jsx(U7,{})})]})}function B7(){const{role:e}=zt();return e!=="admin"?c.jsx(Ps,{}):c.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[c.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[c.jsx(kS,{to:"/team",end:!0,label:"Members"}),c.jsx(kS,{to:"/team/settings",label:"Team settings"})]}),c.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:c.jsx(Ps,{})})]})}function kS({to:e,label:t,end:n}){return c.jsx(hf,{to:e,end:n,className:({isActive:a})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!a&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:a})=>c.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:a?"var(--bg-active)":"transparent",color:a?"var(--fg)":"var(--fg-3)",fontWeight:a?500:400,borderRadius:"var(--radius-input)"},children:c.jsx("span",{className:"flex-1 truncate",children:t})})})}function sf(e){const t=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&t.set("limit",String(e.limit)),e!=null&&e.cursor&&t.set("cursor",e.cursor),e!=null&&e.filter&&t.set("filter",e.filter);const n=t.toString();return Ne.get(an(`/chats${n?`?${n}`:""}`))}function $7(e){return Ne.post(an("/chats"),e)}function F7(e){return Ne.post(`/chats/${encodeURIComponent(e)}/read`)}function lN(e,t){return Ne.post(`/chats/${encodeURIComponent(e)}/participants`,t)}function q7(e){return Ne.post(`/chats/${encodeURIComponent(e)}/workspace-join`)}function H7({active:e,count:t,warn:n,className:a,children:l,style:o,...u}){return c.jsxs("button",{type:"button",className:Te("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...u,children:[l,t!==void 0&&c.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const of="draft";function Z7(e){if(!e)return"";const t=new Date(e),a=Date.now()-t.getTime();if(a<6e4)return"now";if(a<60*6e4)return`${Math.round(a/6e4)}m`;if(a<1440*6e4)return`${Math.round(a/36e5)}h`;const l=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),o=u=>{var f;return((f=l.find(m=>m.type===u))==null?void 0:f.value)??""};return`${o("month")}/${o("day")} ${o("hour")}:${o("minute")}`}function V7(e){return e.membershipKind==="watching"?e.lastMessagePreview?`Watching · ${e.lastMessagePreview}`:"Watching":e.lastMessagePreview??""}function Q7({selectedChatId:e,onSelectChat:t,onNewChat:n}){const[a,l]=b.useState("all"),[o,u]=b.useState(""),[f,m]=b.useState([]),[h,y]=b.useState(!1),[g,x]=b.useState(null),{data:w,isLoading:k}=Ve({queryKey:["me","chats",a],queryFn:()=>sf({filter:a}),refetchInterval:15e3}),j=()=>{f.length>0&&m([]),x(null)},C=(w==null?void 0:w.rows)??[],E=b.useMemo(()=>[...C,...f],[C,f]),R=b.useMemo(()=>{const U=o.trim().toLowerCase();return U?E.filter(V=>V.title.toLowerCase().includes(U)||(V.lastMessagePreview??"").toLowerCase().includes(U)?!0:V.participants.map(Se=>Se.displayName.toLowerCase()).join(" ").includes(U)):E},[E,o]),z=async()=>{if(h)return;const U=w==null?void 0:w.nextCursor;if(U){y(!0),x(null);try{const V=await sf({filter:a,cursor:U});m(F=>[...F,...V.rows]),B(V.nextCursor)}catch(V){x(V instanceof Error?V.message:"Failed to load more")}finally{y(!1)}}},[I,B]=b.useState(null),O=(w==null?void 0:w.nextCursor)??null;b.useEffect(()=>{B(O)},[O]);const D=b.useMemo(()=>E.reduce((U,V)=>U+(V.unreadMentionCount>0?1:0),0),[E]);return c.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:320,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[c.jsxs("div",{className:"shrink-0 flex flex-col",style:{gap:6,padding:"var(--sp-2_5) var(--sp-3) var(--sp-2)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[c.jsxs("button",{type:"button",onClick:n,className:"w-full inline-flex items-center transition-colors text-body hover:bg-[var(--bg-hover)]",style:{gap:6,padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:e===of?"var(--bg-active)":"transparent",color:e===of?"var(--accent)":"var(--fg)",cursor:"pointer",fontWeight:500},title:"New chat",children:[c.jsx(Ir,{className:"h-3.5 w-3.5",strokeWidth:2}),"New chat"]}),c.jsxs("div",{className:"flex items-center",style:{gap:8},children:[c.jsx("div",{className:"flex gap-1 shrink-0",children:D>0&&c.jsx(H7,{active:a==="unread",count:D,onClick:()=>{l(a==="unread"?"all":"unread"),j()},children:"unread"})}),c.jsxs("div",{className:"relative",style:{flex:1,minWidth:0},children:[c.jsx(sy,{className:"h-3 w-3 absolute pointer-events-none",style:{left:4,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),c.jsx("input",{value:o,onChange:U=>u(U.target.value),placeholder:"Search…",className:"w-full outline-none text-caption",style:{padding:"var(--sp-0_5) var(--sp-1) var(--sp-0_5) var(--sp-5)",background:"transparent",border:"none",color:"var(--fg-2)"}})]})]})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[k&&R.length===0&&c.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:"Loading…"}),!k&&R.length===0&&c.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:o?"No matches":c.jsxs(c.Fragment,{children:[c.jsx("p",{style:{margin:0},children:"No conversations yet."}),c.jsx("p",{className:"text-label",style:{margin:"var(--sp-1) 0 0",color:"var(--fg-4)"},children:"Start with New chat."})]})}),R.map(U=>{const V=e===U.chatId,F=V7(U),ne=F&&F!==U.title?F:"",oe=U.unreadMentionCount>0;return c.jsx("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:c.jsxs("button",{type:"button",onClick:()=>t(U.chatId),className:Te("w-full text-left transition-colors flex flex-col","hover:bg-[var(--bg-hover)]"),style:{padding:"var(--sp-2) var(--sp-3)",background:V?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${V?"var(--accent)":"transparent"}`},children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:6},children:[oe&&c.jsx("span",{"aria-label":`${U.unreadMentionCount} unread mentions`,role:"status",style:{width:6,height:6,borderRadius:"50%",background:"var(--state-error)",flexShrink:0,alignSelf:"center"}}),c.jsx("span",{className:"truncate text-subtitle",style:{color:oe?"var(--fg)":"var(--fg-2)",fontWeight:oe?700:500,flex:1,minWidth:0},children:U.title}),U.lastMessageAt&&c.jsx("span",{className:"mono text-caption shrink-0",style:{color:"var(--fg-4)"},children:Z7(U.lastMessageAt)})]}),c.jsx("div",{className:"truncate text-body",style:{color:oe?"var(--fg-2)":"var(--fg-3)",marginTop:2},children:ne||"—"})]})},U.chatId)}),I&&R.length>0&&c.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)"},children:[c.jsx("button",{type:"button",onClick:z,disabled:h,className:"w-full text-body mono",style:{padding:"var(--sp-1_25) var(--sp-2)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",color:"var(--fg-2)",cursor:h?"default":"pointer",opacity:h?.6:1},children:h?"Loading…":"Load more"}),g&&c.jsx("p",{className:"mono text-caption",style:{color:"var(--state-error)",marginTop:4},children:g})]})]})]})}function sN(e){return Ne.get(`/chats/${encodeURIComponent(e)}`)}function K7(e,t){return Ne.patch(`/chats/${encodeURIComponent(e)}`,{topic:t})}function Pg(e,t){return Ne.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function G7(e,t){return Ne.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function Y7(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const l=a.result;if(typeof l!="string"){n(new Error("Unexpected FileReader result"));return}const o=l.indexOf(",");t(o>=0?l.slice(o+1):l)},a.onerror=()=>n(a.error??new Error("FileReader error")),a.readAsDataURL(e)})}function X7(e){return Ne.post(`/agents/${encodeURIComponent(e)}/chats`,{})}function J7(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit)),t!=null&&t.cursor&&n.set("cursor",t.cursor);const a=n.toString();return Ne.get(`/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function W7(e,t){if(t<=0||t>e.length)return null;let n=t-1;for(;n>=0;){const l=e[n];if(l===void 0)return null;if(l==="@")break;if(!/[A-Za-z0-9_-]/.test(l))return null;n--}if(n<0||e[n]!=="@")return null;if(n>0){const l=e[n-1];if(l!==void 0&&/[A-Za-z0-9_.@-]/.test(l))return null}const a=e.slice(n+1,t).toLowerCase();return{triggerIndex:n,query:a}}function eH(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let u=1/0;l.startsWith(t)?u=0:o.startsWith(t)?u=1:o.includes(t)&&(u=2),u!==1/0&&n.push({c:a,score:u})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function tH(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),u=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${u}${m}`,y=l.length+u.length+(f?1:0);return{text:h,cursor:y}}function oN({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,u]=b.useState(0),[f,m]=b.useState(null),h=b.useMemo(()=>l?null:W7(e,t),[e,t,l]),y=b.useMemo(()=>h?eH(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";b.useEffect(()=>{u(0)},[g]),b.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const x=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!x;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(E){if(!h)return;const R=tH(e,h,t,E);R&&a(R)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:E=>{if(!w||!h)return!1;if(E.key==="ArrowDown")return E.preventDefault(),u(R=>y.length===0?0:(R+1)%y.length),!0;if(E.key==="ArrowUp")return E.preventDefault(),u(R=>y.length===0?0:(R-1+y.length)%y.length),!0;if(E.key==="Enter"||E.key==="Tab"){const R=y[o]??y[0];return R?(E.preventDefault(),j(R),!0):!1}return E.key==="Escape"?(E.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function uN({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=b.useRef(null);return b.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:c.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Te("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,minWidth:240,maxWidth:360,background:"var(--bg-raised)",borderColor:"var(--border)"},children:t.map((f,m)=>{const h=m===n;return c.jsxs("button",{type:"button",role:"option","aria-selected":h,"data-mention-index":m,onMouseDown:y=>{y.preventDefault(),a(f)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:h?"var(--bg-hover)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"font-medium",children:f.displayName??(f.name?`@${f.name}`:"—")}),f.name&&f.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",f.name]})]},f.agentId)})})}function nH({onCreated:e}){const t=dn(),{agentId:n}=zt(),a=vy(),[l,o]=b.useState([]),[u,f]=b.useState(""),[m,h]=b.useState(0),[y,g]=b.useState(null),[x,w]=b.useState(!1),[k,j]=b.useState(!1),C=b.useRef(null),E=b.useRef(!1),R=b.useRef(null),{data:z}=Ve({queryKey:["activity"],queryFn:Hu,refetchInterval:15e3}),I=b.useMemo(()=>{const G=(z==null?void 0:z.agents)??[],W=[];for(const Z of G){if(n&&Z.agentId===n)continue;const re=a(Z.agentId);!re||!re.name||W.push({agentId:Z.agentId,name:re.name,displayName:re.displayName})}return W},[z,a,n]);b.useEffect(()=>{if(E.current||l.length>0||I.length===0)return;const G=aH(I,(z==null?void 0:z.agents)??[]);G&&(o([G]),E.current=!0)},[I,z,l.length]);const B=b.useMemo(()=>{const G=I.map(W=>({agentId:W.agentId,name:W.name}));return TC(u,G)},[u,I]),O=oN({value:u,cursor:m,candidates:I,disabled:x,onSelect:G=>{f(G.text),h(G.cursor),requestAnimationFrame(()=>{const W=C.current;W&&(W.focus(),W.setSelectionRange(G.cursor,G.cursor))})}});b.useEffect(()=>{B.length!==0&&o(G=>{const W=new Set(G);let Z=!1;for(const re of B)W.has(re)||(W.add(re),Z=!0);return Z?[...W]:G})},[B]),b.useEffect(()=>{if(!k)return;const G=W=>{R.current&&(R.current.contains(W.target)||j(!1))};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[k]);const D=jt({mutationFn:async({participantIds:G,text:W})=>{const Z=await $7({participantIds:G}),re=W.trim();return re.length>0&&await Pg(Z.chatId,re),Z.chatId},onSuccess:G=>{f(""),o([]),E.current=!1,t.invalidateQueries({queryKey:["me","chats"]}),e(G)},onError:G=>{g(G instanceof Error?G.message:"Failed to create chat")}}),U=b.useMemo(()=>!(x||D.isPending||l.length===0||u.trim().length===0||l.length>=2&&B.length===0),[x,D.isPending,l.length,u,B.length]),V=b.useMemo(()=>l.length===0?"Add at least one participant":u.trim().length===0?null:l.length>=2&&B.length===0?"Group chats need an @ to wake at least one participant":null,[l.length,u,B.length]),F=async()=>{if(!U)return;const G=Array.from(new Set([...l,...B]));g(null),w(!0);try{await D.mutateAsync({participantIds:G,text:u})}finally{w(!1)}},ne=G=>{o(W=>W.filter(Z=>Z!==G))},oe=G=>{o(W=>W.includes(G)?W:[...W,G]),j(!1)},Se=b.useMemo(()=>I.filter(G=>!l.includes(G.agentId)),[I,l]);return c.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"var(--bg-base)"},children:c.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",style:{padding:"var(--sp-6)"},children:c.jsxs("div",{style:{width:"100%",maxWidth:"clamp(55rem, 75%, 70rem)"},children:[c.jsx("p",{className:"text-title",style:{color:"var(--fg)",textAlign:"center",marginBottom:"var(--sp-5)"},children:"What's the task?"}),c.jsxs("div",{style:{borderRadius:10,background:"var(--bg-raised)",boxShadow:"var(--shadow-md)",overflow:"visible"},children:[c.jsx(rH,{chips:l,candidates:I,chipCandidates:Se,pickerOpen:k,setPickerOpen:j,pickerContainerRef:R,onAdd:oe,onRemove:ne}),c.jsxs("div",{style:{position:"relative"},children:[c.jsx(uN,{trigger:O.trigger,results:O.results,highlightIndex:O.highlightIndex,anchorRef:C,onPick:O.pick}),c.jsx("textarea",{ref:C,value:u,onChange:G=>{f(G.target.value),h(G.target.selectionStart??G.target.value.length)},onSelect:G=>{h(G.currentTarget.selectionStart??u.length)},placeholder:l.length>=2?"Describe the task. Use @ to address one or more.":"Describe the task…",rows:1,onKeyDown:G=>{O.handleKey(G)||G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),F())},disabled:x||D.isPending,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2) var(--sp-3)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}}),l.length>=2&&B.length===0&&u.trim().length>0&&c.jsxs("div",{"aria-hidden":"true",className:"text-subtitle font-normal",style:{position:"absolute",inset:0,padding:"var(--sp-2) var(--sp-3)",margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",pointerEvents:"none",color:"transparent",overflow:"hidden"},children:[u,c.jsx("span",{style:{color:"var(--fg-4)"},children:" ← @ a group member to send"})]})]}),c.jsx("div",{className:"flex items-center justify-end",style:{padding:"var(--sp-1_5) var(--sp-2_5)"},children:c.jsx("button",{type:"button",onClick:()=>void F(),disabled:!U,title:V??"Send (Enter)","aria-label":"Send",className:Te("inline-flex items-center justify-center transition-opacity",!U&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:c.jsx(Tk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})})]}),y&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:8},children:y})]})})})}function rH({chips:e,candidates:t,chipCandidates:n,pickerOpen:a,setPickerOpen:l,pickerContainerRef:o,onAdd:u,onRemove:f}){return c.jsxs("div",{className:"flex items-center flex-wrap",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) var(--sp-1)"},children:[e.map(m=>{const h=t.find(g=>g.agentId===m),y=(h==null?void 0:h.displayName)??(h==null?void 0:h.name)??m;return c.jsxs("span",{className:"group inline-flex items-center text-label",style:{gap:2,padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg)"},children:[c.jsx("span",{children:y}),c.jsx("button",{type:"button",onClick:()=>f(m),title:"Remove participant",className:"opacity-0 group-hover:opacity-100 transition-opacity",style:{background:"none",border:"none",padding:0,marginLeft:2,cursor:"pointer",color:"var(--fg-3)",display:"inline-flex",alignItems:"center"},children:c.jsx(wu,{className:"h-3 w-3"})})]},m)}),c.jsxs("div",{ref:o,style:{position:"relative"},children:[c.jsx("button",{type:"button",onClick:()=>l(!a),title:"Add participant","aria-label":"Add participant",disabled:n.length===0,className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:n.length===0?"var(--fg-4)":"var(--fg-3)",cursor:n.length===0?"not-allowed":"pointer"},children:c.jsx(Ir,{className:"h-3 w-3"})}),a&&n.length>0&&c.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",left:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:n.map(m=>c.jsxs("button",{type:"button",role:"option","aria-selected":"false",onClick:()=>u(m.agentId),className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"font-medium",children:m.displayName??(m.name?`@${m.name}`:"—")}),m.name&&m.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",m.name]})]},m.agentId))})]})]})}function aH(e,t){var o;const n=new Set(e.map(u=>u.agentId)),a=[...t].filter(u=>n.has(u.agentId)&&u.runtimeUpdatedAt).sort((u,f)=>(f.runtimeUpdatedAt??"").localeCompare(u.runtimeUpdatedAt??""))[0];if(a)return a.agentId;const l=t.find(u=>n.has(u.agentId)&&u.type==="personal_assistant");return l?l.agentId:((o=e[0])==null?void 0:o.agentId)??null}const iH="first-tree-hub-images",lH=1,Qs="images";let Md=null;function cN(){return Md||(Md=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(iH,lH);t.onupgradeneeded=()=>{const n=t.result;n.objectStoreNames.contains(Qs)||n.createObjectStore(Qs,{keyPath:"imageId"})},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}),Md)}async function sH(e){const t=await cN();if(!t)throw new Error("Image storage unavailable (IndexedDB disabled or blocked)");await new Promise((n,a)=>{const l=t.transaction(Qs,"readwrite"),o=l.objectStore(Qs),u={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(u),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function oH(e){const t=await cN();return t?new Promise(n=>{const o=t.transaction(Qs,"readonly").objectStore(Qs).get(e);o.onsuccess=()=>{const u=o.result;if(!u){n(null);return}n({base64:u.base64,mimeType:u.mimeType})},o.onerror=()=>n(null)}):null}function uH(e){let t=-1;for(const l of e)l.kind==="turn_end"&&l.seq>t&&(t=l.seq);const n=e.filter(l=>l.kind==="turn_end"?!1:l.kind==="error"?!0:l.seq>t),a=new Map;for(const l of n){if(l.kind!=="tool_call")continue;const o=jS(l.payload);if(!o)continue;const u=a.get(o)??-1;l.seq>u&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=jS(l.payload);return o?a.get(o)===l.seq:!0})}function jS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Df(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(u=>u.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function cH(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function CS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function dH({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function fH({event:e}){const t=rO(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return c.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[a?c.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):c.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),c.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?CS(t.args):void 0,children:[c.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",c.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?c.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",CS(t.args),")"]}):null,t.durationMs!==void 0&&!a?c.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",cH(t.durationMs)]}):null]})]})}function hH({event:e,agentNameFn:t,agentId:n}){const a=iO(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[c.jsx(dN,{name:l,isSelf:!1}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[c.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Df(e.createdAt)}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),c.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function mH({event:e}){return c.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[c.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),c.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Df(e.createdAt)})]})}function pH({event:e}){const t=aO(e.payload),n=Df(e.createdAt);return c.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[c.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),c.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function dN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return c.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:c.jsx(Qu,{width:9,height:10,style:{color:"var(--accent)"}})})}function gH({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return c.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[c.jsx(dN,{name:a,isSelf:l}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[c.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),c.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Df(e.createdAt)}),c.jsx("span",{style:{marginLeft:"auto"},children:c.jsx(dH,{msg:e,myAgentId:t})})]}),c.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&yH(e.content)?c.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&vH(e.content)?c.jsx(bH,{content:e.content}):e.format==="text"?c.jsx(rN,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):c.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function yH(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.data=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")}function vH(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.imageId=="string"&&typeof t.mimeType=="string"&&t.mimeType.startsWith("image/")&&typeof t.filename=="string"}function bH({content:e}){const[t,n]=b.useState({kind:"loading"});return b.useEffect(()=>{let a=!1;return oH(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?c.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?c.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):c.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function ES({agentId:e,chatId:t}){var fe;const n=dn(),a=xf(),l=vy(),{agentId:o}=zt(),[u,f]=b.useState(""),[m,h]=b.useState(0),[y,g]=b.useState([]),[x,w]=b.useState(!1),[k,j]=b.useState(null),C=b.useRef(null),E=b.useRef(null),R=b.useRef(null),z=b.useRef(!1),I=b.useRef(new Set);b.useEffect(()=>{z.current=!1},[t]);const{data:B}=Ve({queryKey:["chat-messages",t],queryFn:()=>J7(t,{limit:50}),refetchInterval:5e3}),{data:O}=Ve({queryKey:["session-events",e,t],queryFn:()=>lO(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:D}=Ve({queryKey:["chat-detail",t],queryFn:()=>sN(t),enabled:!!t}),{data:U}=Ve({queryKey:["activity"],queryFn:Hu,refetchInterval:15e3}),V=jt({mutationFn:ee=>Pg(t,ee),onSuccess:()=>{f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:O1(e)})}}),F=b.useCallback(ee=>{const _e=ee.filter(pt=>pt.type.startsWith("image/"));if(_e.length===0)return;const Le=_e.find(pt=>pt.size>5242880);if(Le){j(`Image too large (${(Le.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const it=_e.map(pt=>({id:crypto.randomUUID(),file:pt,previewUrl:URL.createObjectURL(pt)}));g(pt=>[...pt,...it]),j(null)},[]),ne=b.useCallback(ee=>{g(me=>{const _e=me.find(Le=>Le.id===ee);return _e&&URL.revokeObjectURL(_e.previewUrl),me.filter(Le=>Le.id!==ee)})},[]),oe=async()=>{const ee=u.trim(),me=y;if(!(!ee&&me.length===0)&&!x&&!(X&&ue.length===0)){if(xe.length>0)try{await lN(t,{participantIds:xe}),await n.invalidateQueries({queryKey:["chat-detail",t]})}catch(_e){j(_e instanceof Error?_e.message:"Failed to add participants");return}if(me.length>0){w(!0),j(null);try{for(const _e of me){const Le=await Y7(_e.file),it=crypto.randomUUID();await sH({imageId:it,base64:Le,mimeType:_e.file.type}),await G7(t,{data:Le,mimeType:_e.file.type,filename:_e.file.name,size:_e.file.size,imageId:it}),URL.revokeObjectURL(_e.previewUrl)}g([]),ee&&await Pg(t,ee),f(""),n.invalidateQueries({queryKey:["chat-messages",t]}),n.invalidateQueries({queryKey:O1(e)})}catch(_e){j(_e instanceof Error?_e.message:"Failed to send image")}finally{w(!1)}return}V.mutate(ee)}},[Se,G]=b.useState(!1),[W,Z]=b.useState(""),re=b.useRef(null);b.useEffect(()=>{var ee;Se&&((ee=re.current)==null||ee.focus())},[Se]);const ve=jt({mutationFn:ee=>K7(t,ee),onSuccess:()=>{G(!1),n.invalidateQueries({queryKey:["chat-detail",t]}),n.invalidateQueries({queryKey:["agent-sessions",e]}),n.invalidateQueries({queryKey:["session",e,t]})}}),Re=()=>{const ee=W.trim();ve.mutate(ee.length>0?ee:null)},_=b.useMemo(()=>{const ee=(B==null?void 0:B.items)??[],me=uH((O==null?void 0:O.items)??[]),_e=[...ee.map(Le=>({kind:"message",at:Le.createdAt,key:`m-${Le.id}`,data:Le})),...me.map(Le=>({kind:"event",at:Le.createdAt,key:`e-${Le.id}`,data:Le}))];return _e.sort((Le,it)=>Le.at.localeCompare(it.at)),_e},[B,O]),L=_.length;b.useEffect(()=>{var ee;L>0&&((ee=R.current)==null||ee.scrollIntoView({behavior:"smooth"}))},[L]);const P=a(e),A=b.useMemo(()=>{var ee;return new Set(((ee=D==null?void 0:D.participants)==null?void 0:ee.map(me=>me.agentId))??[])},[D==null?void 0:D.participants]),q=b.useMemo(()=>{const ee=new Set;for(const _e of(D==null?void 0:D.participants)??[])ee.add(_e.agentId);for(const _e of(U==null?void 0:U.agents)??[])ee.add(_e.agentId);ee.size===0&&ee.add(e);const me=[];for(const _e of ee){if(_e===o)continue;const Le=l(_e);!Le||!Le.name||me.push({agentId:_e,name:Le.name,displayName:Le.displayName})}return me},[D==null?void 0:D.participants,U==null?void 0:U.agents,e,l,o]),X=b.useMemo(()=>{if(!D)return!1;if(D.type==="group")return!0;const ee=D.participants.some(me=>me.agentId===o);return D.type==="direct"&&!ee&&D.participants.length>=2},[D,o]);b.useEffect(()=>{if(I.current.has(t)||!B||!O||!D||_.length>0||u.length>0||X||P===e)return;const ee=`Hi ${P}! What can you help with?`;f(ee),h(ee.length),I.current.add(t),requestAnimationFrame(()=>{const me=E.current;me&&(me.focus(),me.setSelectionRange(ee.length,ee.length))})},[t,e,B,O,D,_.length,u.length,P,X]);const ue=b.useMemo(()=>{const ee=q.map(me=>({agentId:me.agentId,name:me.name}));return TC(u,ee)},[u,q]),xe=b.useMemo(()=>A.size===0?[]:ue.filter(ee=>!A.has(ee)),[ue,A]),be=oN({value:u,cursor:m,candidates:q,disabled:V.isPending||x,onSelect:ee=>{f(ee.text),h(ee.cursor),requestAnimationFrame(()=>{const me=E.current;me&&(me.focus(),me.setSelectionRange(ee.cursor,ee.cursor))})}});return c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6)",borderBottom:"var(--hairline) solid var(--border)"},children:c.jsxs("div",{className:"flex items-center",style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%",gap:10},children:[c.jsx("div",{className:"flex items-center min-w-0",style:{gap:8,flex:1},children:Se?c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:re,value:W,onChange:ee=>Z(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"?(ee.preventDefault(),Re()):ee.key==="Escape"&&(ee.preventDefault(),G(!1))},disabled:ve.isPending,maxLength:500,placeholder:(D==null?void 0:D.title)??"Chat name",className:"outline-none text-subtitle",style:{fieldSizing:"content",minWidth:200,maxWidth:480,color:"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",padding:"var(--sp-0_5) var(--sp-1_5)"}}),c.jsx("button",{type:"button",onClick:Re,disabled:ve.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:c.jsx(Mr,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button",onClick:()=>G(!1),disabled:ve.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:c.jsx(wu,{className:"h-3.5 w-3.5"})})]}):c.jsx("button",{type:"button",onClick:()=>{Z((D==null?void 0:D.topic)??""),G(!0)},title:"Click to rename",className:"truncate text-subtitle text-left min-w-0",style:{color:"var(--fg)",background:"transparent",border:"none",padding:0,cursor:"pointer"},children:(D==null?void 0:D.title)??"…"})}),c.jsx(xH,{chatId:t,participantIds:((fe=D==null?void 0:D.participants)==null?void 0:fe.map(ee=>ee.agentId))??[e],candidates:q,agentIdentity:l,onAdded:()=>n.invalidateQueries({queryKey:["chat-detail",t]})})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-6)"},children:c.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[L===0&&c.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[c.jsx(ly,{className:"h-8 w-8",style:{opacity:.3}}),"Send a message to start the conversation"]}),c.jsx("div",{className:"flex flex-col",style:{gap:4},children:_.map(ee=>{if(ee.kind==="event"){const me=ee.data;switch(me.kind){case"tool_call":return c.jsx(fH,{event:me},ee.key);case"assistant_text":return c.jsx(hH,{event:me,agentId:e,agentNameFn:a},ee.key);case"thinking":return c.jsx(mH,{event:me},ee.key);case"error":return c.jsx(pH,{event:me},ee.key);default:return null}}return c.jsx(gH,{msg:ee.data,myAgentId:o,agentNameFn:a},ee.key)})}),c.jsx("div",{ref:R})]})}),c.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6) var(--sp-3)"},children:c.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[c.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ee=>ee.preventDefault(),onDrop:ee=>{ee.preventDefault(),F(Array.from(ee.dataTransfer.files))},children:[y.length>0&&c.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:y.map(ee=>c.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[c.jsx("img",{src:ee.previewUrl,alt:ee.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),c.jsx("button",{type:"button",onClick:()=>ne(ee.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:c.jsx(wu,{className:"h-2 w-2"})})]},ee.id))}),c.jsxs("div",{style:{position:"relative"},children:[c.jsx(uN,{trigger:be.trigger,results:be.results,highlightIndex:be.highlightIndex,anchorRef:E,onPick:be.pick}),c.jsx("textarea",{ref:E,value:u,onChange:ee=>{f(ee.target.value),h(ee.target.selectionStart??ee.target.value.length)},onSelect:ee=>{h(ee.currentTarget.selectionStart??u.length)},onFocus:()=>{X&&(z.current||u.length>0||q.length===0||(z.current=!0,f("@"),h(1),requestAnimationFrame(()=>{const ee=E.current;ee&&ee.setSelectionRange(1,1)})))},onPaste:ee=>{const me=Array.from(ee.clipboardData.files);me.length>0&&(ee.preventDefault(),F(me))},placeholder:X?"Type @ to pick a recipient, then your message":`Message @${P} · / for commands · @ to mention`,rows:2,onKeyDown:ee=>{be.handleKey(ee)||ee.key==="Enter"&&!ee.shiftKey&&(ee.preventDefault(),oe())},disabled:V.isPending||x,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),c.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[c.jsxs("span",{className:"mono flex items-center",style:{gap:10},children:[c.jsx("button",{type:"button",onClick:()=>{const ee=E.current;if(!ee)return;const me=ee.selectionStart??u.length,_e=ee.selectionEnd??me,Le=`${u.slice(0,me)}@${u.slice(_e)}`;f(Le),h(me+1),requestAnimationFrame(()=>{ee.focus(),ee.setSelectionRange(me+1,me+1)})},title:"Mention an agent (or type @)",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:c.jsx(bR,{className:"h-3.5 w-3.5"})}),c.jsx("button",{type:"button",onClick:()=>{var ee;return(ee=C.current)==null?void 0:ee.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:c.jsx(KR,{className:"h-3.5 w-3.5"})}),c.jsx("input",{ref:C,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ee=>{ee.target.files&&(F(Array.from(ee.target.files)),ee.target.value="")}})]}),c.jsxs("span",{className:"flex items-center",style:{gap:8},children:[x&&c.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),c.jsx("button",{type:"button",onClick:oe,disabled:V.isPending||x||!u.trim()&&y.length===0||X&&ue.length===0,title:X&&ue.length===0?"Pick at least one recipient with @ before sending in a group chat":"Send (Enter)","aria-label":"Send",className:Te("inline-flex items-center justify-center transition-opacity",(V.isPending||x||!u.trim()&&y.length===0||X&&ue.length===0)&&"opacity-40 cursor-not-allowed"),style:{width:28,height:28,borderRadius:"var(--radius-input)",background:"var(--fg)",color:"var(--bg-raised)",border:"none"},children:c.jsx(Tk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})]}),(V.isError||k)&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:k??(V.error instanceof Error?V.error.message:"Failed to send")})]})})]})}function xH({chatId:e,participantIds:t,candidates:n,agentIdentity:a,onAdded:l}){const[o,u]=b.useState(!1),f=b.useRef(null);b.useEffect(()=>{if(!o)return;const y=g=>{f.current&&(f.current.contains(g.target)||u(!1))};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o]);const m=jt({mutationFn:y=>lN(e,{participantIds:[y]}),onSuccess:()=>{u(!1),l()}}),h=b.useMemo(()=>n.filter(y=>!t.includes(y.agentId)),[n,t]);return c.jsxs("div",{className:"inline-flex items-center flex-wrap",style:{gap:4},children:[t.map(y=>{const g=a(y),x=(g==null?void 0:g.displayName)??(g==null?void 0:g.name)??y.slice(0,8);return c.jsx("span",{className:"inline-flex items-center text-label",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-sunken)",color:"var(--fg-2)"},children:x},y)}),c.jsxs("div",{ref:f,style:{position:"relative"},children:[c.jsx("button",{type:"button",onClick:()=>u(!o),disabled:h.length===0||m.isPending,title:h.length===0?"All available agents are already in this chat":"Add participant","aria-label":"Add participant",className:"inline-flex items-center transition-colors hover:bg-[var(--bg-sunken)]",style:{padding:"var(--sp-0_5) var(--sp-1)",borderRadius:"var(--radius-chip)",border:"var(--hairline) solid var(--border)",background:"transparent",color:h.length===0?"var(--fg-4)":"var(--fg-3)",cursor:h.length===0?"not-allowed":"pointer"},children:c.jsx(Ir,{className:"h-3 w-3"})}),o&&h.length>0&&c.jsx("div",{role:"listbox","aria-label":"Add participant",className:"absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg",style:{top:"calc(100% + var(--sp-1))",right:0,minWidth:280,background:"var(--bg-raised)",borderColor:"var(--border)"},children:h.map(y=>c.jsxs("button",{type:"button",role:"option","aria-selected":"false",onClick:()=>m.mutate(y.agentId),disabled:m.isPending,className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:[c.jsx("span",{className:"font-medium",children:y.displayName??(y.name?`@${y.name}`:"—")}),y.name&&y.displayName&&c.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",y.name]})]},y.agentId))})]})]})}function NS(e,t){return e?e.find(n=>n.chatId===t)??null:null}function wH(e,t){var l;const n=e.filter(o=>o.agentId!==t),a=n.find(o=>o.type!==void 0&&o.type!=="human");return a?a.agentId:((l=n[0])==null?void 0:l.agentId)??null}function SH({chatId:e}){const t=dn(),{agentId:n}=zt(),a=b.useRef(new Map),{data:l}=Ve({queryKey:["chat-detail",e],queryFn:()=>sN(e),enabled:!!e}),{data:o}=Ve({queryKey:["me","chats","all"],queryFn:()=>sf({filter:"all"}),refetchInterval:3e4}),{data:u}=Ve({queryKey:["me","chats","watching"],queryFn:()=>sf({filter:"watching"}),refetchInterval:3e4}),f=b.useMemo(()=>NS(o==null?void 0:o.rows,e)??NS(u==null?void 0:u.rows,e)??null,[o,u,e]),m=b.useMemo(()=>f?f.participants.map(j=>({agentId:j.agentId,type:j.type})):l?l.participants.map(j=>({agentId:j.agentId,type:void 0})):[],[f,l]),h=b.useMemo(()=>wH(m,n),[m,n]),g=jt({mutationFn:()=>F7(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]})}}).mutate,x=(f==null?void 0:f.lastMessageAt)??"";b.useEffect(()=>{!f||a.current.get(e)===x||(a.current.set(e,x),g())},[e,f,x,g]);const w=jt({mutationFn:()=>q7(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]}),t.invalidateQueries({queryKey:["chat-detail",e]})}}),k=(f==null?void 0:f.membershipKind)==="watching";return h?k?c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.jsxs("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border)"},children:[c.jsxs("div",{className:"flex items-center",style:{gap:8},children:[c.jsx("span",{className:"text-subtitle",style:{color:"var(--fg)"},children:(f==null?void 0:f.title)??"Chat"}),c.jsx("span",{className:"mono uppercase text-eyebrow",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--fg-3)",background:"var(--bg-sunken)"},children:"watching"})]}),c.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)",marginTop:4},children:"You can read this chat. Join to reply."})]}),c.jsx("div",{className:"flex-1 overflow-hidden",children:c.jsx(ES,{agentId:h,chatId:e})}),c.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:c.jsxs("div",{style:{maxWidth:640,margin:"0 auto"},children:[c.jsx(ge,{type:"button",onClick:()=>w.mutate(),disabled:w.isPending,style:{width:"100%"},children:w.isPending?"Joining…":"Join to reply"}),w.isError&&c.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:6},children:w.error instanceof Error?w.error.message:"Failed to join"})]})})]}):c.jsx(ES,{agentId:h,chatId:e}):c.jsx("div",{className:"flex-1 flex items-center justify-center",style:{padding:"var(--sp-8)"},children:c.jsxs("div",{className:"text-center",style:{color:"var(--fg-3)"},children:[c.jsx("div",{className:"text-subtitle",style:{color:"var(--fg-2)",marginBottom:6},children:"Loading chat…"}),c.jsx("div",{className:"text-body",children:"Resolving participants."})]})})}function kH(){return c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-sm",children:[c.jsx(Qu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),c.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),c.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}const jH=3e4,CH=1e3,EH=3e3;function NH(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function _H(){var xe;const{refreshMe:e,organizationId:t,memberId:n}=zt(),a=On(),l=XT(t,n),o=WT(l),u=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=u?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=b.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=b.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[x,w]=b.useState(null),[k,j]=b.useState(null),[C,E]=b.useState(null),[R,z]=b.useState(()=>u),[I,B]=b.useState(()=>f),[O,D]=b.useState([]),[U,V]=b.useState("form"),[F,ne]=b.useState(null),[oe]=b.useState(()=>GT()),Se=b.useRef(null),G=b.useRef(null),W=b.useRef(null),Z=b.useRef(0);b.useEffect(()=>()=>{G.current&&(G.current.cancelled=!0)},[]),b.useEffect(()=>{eR(l,{displayName:m,selectedRuntime:y,connectToken:R,connectTokenExpiresAt:I})},[l,m,y,R,I]),b.useEffect(()=>{(async()=>{try{const be=await Ne.get("/me/organizations");D(be)}catch{}})()},[]),b.useEffect(()=>{if(U!=="form")return;let be=!1;const fe=async()=>{const me=++Z.current;try{const _e=await Ei();if(be||me!==Z.current)return;const it=_e.filter(pt=>pt.status==="connected").sort((pt,Pr)=>Pr.lastSeenAt.localeCompare(pt.lastSeenAt))[0]??null;if(w(pt=>(pt==null?void 0:pt.id)===(it==null?void 0:it.id)?pt:it),it){W.current!==it.id&&(W.current=null,E(null),j(null));try{const pt=await dy(it.id);if(be||me!==Z.current)return;W.current=it.id,E(it.id),j(pt.capabilities)}catch{}}else W.current=null,E(null),j(null)}catch{}};fe();const ee=setInterval(fe,EH);return()=>{be=!0,clearInterval(ee)}},[U]),b.useEffect(()=>{if(x)return;if(R&&I&&I>Date.now()){const fe=Math.max(I-Date.now(),0),ee=window.setTimeout(()=>{z(null),B(null)},fe);return()=>window.clearTimeout(ee)}R&&(z(null),B(null));let be=!1;return(async()=>{try{const fe=await Ne.post("/me/connect-tokens",{});be||(z(fe.token),B(Date.now()+fe.expiresIn*1e3))}catch(fe){be||ne(fe instanceof Error?fe.message:"Failed to generate connect token")}})(),()=>{be=!0}},[x,R,I]);const re=x&&C===x.id?k:null;b.useEffect(()=>{g(be=>{if(!re)return be;const fe=Object.entries(re).filter(([,ee])=>ee.state==="ok").map(([ee])=>ee);return be&&fe.includes(be)?be:fe[0]??null})},[re]);const ve=re?Object.entries(re).filter(([,be])=>be.state==="ok").map(([be])=>be):[],Re=((xe=O.find(be=>be.id===t))==null?void 0:xe.displayName)??"",_=m.trim(),L=_||"your agent",P=R?`npm install -g @agent-team-foundation/first-tree-hub
|
|
382
|
+
first-tree-hub connect ${R}`:null,A=b.useCallback(async be=>{G.current&&(G.current.cancelled=!0);const fe={cancelled:!1};G.current=fe;const ee=Date.now();for(;!fe.cancelled;){let me=!1;try{const _e=await Ne.get(`/agents/${encodeURIComponent(be)}/client-status`);if(fe.cancelled)return;me=_e.online===!0}catch{if(fe.cancelled)return}if(me){try{const _e=await X7(be);if(fe.cancelled||(tR(l),await e(),fe.cancelled))return;a(`/?a=${encodeURIComponent(be)}&c=${encodeURIComponent(_e.id)}`,{replace:!0})}catch(_e){if(fe.cancelled)return;ne(_e instanceof Error?_e.message:"Failed to open chat"),V("timeout")}return}if(Date.now()-ee>jH){fe.cancelled||V("timeout");return}await new Promise(_e=>setTimeout(_e,CH))}},[l,e,a]),q=!!(_&&x&&y&&ve.includes(y)&&U==="form"),X=b.useCallback(async()=>{if(!x||!y||!_)return;ne(null),V("creating");const be=Ug(_);let fe;try{fe=(await Ne.post(an("/agents"),{type:"personal_assistant",displayName:_,...be?{name:be}:{},clientId:x.id,runtimeProvider:y,...t?{organizationId:t}:{}})).uuid,Se.current=fe}catch(ee){ne(ee instanceof Error?ee.message:"Failed to create agent"),V("form");return}await A(fe)},[_,x,y,A,t]),ue=b.useCallback(async()=>{const be=Se.current;be&&(ne(null),V("creating"),await A(be))},[A]);return c.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:c.jsxs("div",{style:{width:"100%",maxWidth:560},children:[U==="form"&&c.jsx(AH,{joinPath:oe,teamName:Re,displayName:m,setDisplayName:h,trimmedName:_,connectedClient:x,cliCommand:P,okRuntimes:ve,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:re!==null,error:F,canCreate:q,onCreate:X}),U==="creating"&&c.jsx(IH,{nameOrFallback:L}),U==="timeout"&&c.jsx(LH,{nameOrFallback:L,hostname:(x==null?void 0:x.hostname)??null,error:F,onRetry:ue})]})})}function AH({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:u,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:x,onCreate:w}){const k=b.useRef(null),C=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",E=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return b.useEffect(()=>{var R;l||(R=k.current)==null||R.focus()},[l]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[c.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[c.jsx("span",{style:{color:"var(--fg-2)"},children:C}),c.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),c.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),c.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[c.jsx(TH,{}),c.jsx(_S,{number:"01",state:l?"complete":"active",children:c.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[c.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),c.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange:R=>a(R.target.value),placeholder:"e.g. Code Reviewer",maxLength:200,className:"onboarding-name-input text-body font-medium",style:{flex:"0 1 28ch",minWidth:"22ch",maxWidth:"30ch",padding:"var(--sp-0_5) 0",background:"transparent",border:0,borderBottom:"var(--hairline) solid var(--border-faint)",borderRadius:0,boxShadow:"none",color:"var(--fg)",outline:"none",caretColor:"var(--accent)",transition:"border-color 160ms ease, color 160ms ease"},onFocus:R=>{R.currentTarget.style.borderBottomColor="var(--accent)"},onBlur:R=>{R.currentTarget.style.borderBottomColor="var(--border-faint)"}})]})}),c.jsx(_S,{number:"02",state:x?"complete":l?"active":"idle",children:c.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[c.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&c.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?c.jsx(OH,{hostname:o.hostname??o.id}):c.jsxs(c.Fragment,{children:[c.jsx(RH,{command:u}),c.jsx(zH,{})]}),o&&c.jsx(DH,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&c.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&c.jsxs("div",{style:{marginTop:x?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!x&&c.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:E}),x&&c.jsxs(ge,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter:R=>{R.currentTarget.style.transform="scale(1.01)",R.currentTarget.style.boxShadow="var(--shadow-md)"},onMouseLeave:R=>{R.currentTarget.style.transform="scale(1)",R.currentTarget.style.boxShadow="var(--shadow-md)"},children:[c.jsxs("span",{children:["Create ",l]}),c.jsx(gR,{className:"h-4 w-4"})]}),c.jsx("p",{className:"text-caption",style:{margin:x?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function TH(){return c.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function _S({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return c.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[c.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?c.jsx(Mr,{className:"h-3 w-3"}):e}),c.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function RH({command:e}){const[t,n]=b.useState(!1),l=(e?e.split(`
|
|
383
|
+
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",u=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return c.jsx("div",{style:{marginTop:"var(--sp-2)"},children:c.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[c.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:u||"Generating token…"}),c.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?c.jsx(Mr,{className:"h-3.5 w-3.5"}):c.jsx(zk,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function zH(){return c.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[c.jsx(MH,{}),c.jsx("span",{children:"Waiting for your computer…"})]})}function OH({hostname:e}){return c.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[c.jsx(Mr,{className:"h-3.5 w-3.5"}),c.jsxs("span",{children:[c.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function DH({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?c.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):c.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[c.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),c.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[c.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const u=t===l;return c.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:u?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:u?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[c.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:u,onChange:()=>n(l),className:"sr-only"}),c.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:u?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:u?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:u?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:u&&c.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),NH(l)]},l)})]})]})}function MH(){return c.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[c.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),c.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function IH({nameOrFallback:e}){return c.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[c.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),c.jsx(UH,{}),c.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function LH({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return c.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[c.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?c.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):c.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[c.jsx("p",{children:"This usually means:"}),c.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[c.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),c.jsxs("li",{children:["The connection to ",l," dropped"]})]}),c.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",c.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),c.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:c.jsx(ge,{onClick:a,children:"Try again"})})]})}function UH(){return c.jsxs("span",{className:"flex items-center",style:{gap:6},children:[c.jsx(Up,{delayMs:0}),c.jsx(Up,{delayMs:160}),c.jsx(Up,{delayMs:320})]})}function Up({delayMs:e}){return c.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function PH({selectedChatId:e,onSelectChat:t}){const{wizardStep:n}=zt();return e===of?c.jsx(nH,{onCreated:t}):e?c.jsx(SH,{chatId:e}):n!==null&&n!=="completed"?c.jsx(_H,{}):c.jsx(kH,{})}function BH(){const[e,t]=kk(),n=e.get("c"),a=e.get("a");GC(),b.useEffect(()=>{if(a&&n){t({c:n},{replace:!0});return}a&&!n&&t({},{replace:!0})},[a,n,t]);const l=b.useCallback(u=>{t({c:u})},[t]),o=b.useCallback(()=>{t({c:of})},[t]);return c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx(Q7,{selectedChatId:n,onSelectChat:l,onNewChat:o}),c.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:c.jsx(PH,{selectedChatId:n,onSelectChat:l})})]})}const $H=new lA({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function FH(){return c.jsx(sA,{client:$H,children:c.jsx(rR,{children:c.jsx(IT,{children:c.jsxs(dT,{children:[c.jsx(Tt,{path:"/login",element:c.jsx(Bq,{})}),c.jsx(Tt,{path:"/signup",element:c.jsx(ir,{to:"/login",replace:!0})}),c.jsx(Tt,{path:"/auth/github/complete",element:c.jsx($q,{})}),c.jsx(Tt,{path:"/invite/:token",element:c.jsx(Iq,{})}),c.jsx(Tt,{element:c.jsx(oR,{}),children:c.jsxs(Tt,{element:c.jsx(G6,{children:c.jsx(nM,{})}),children:[c.jsx(Tt,{index:!0,element:c.jsx(BH,{})}),c.jsx(Tt,{path:"context",element:c.jsx(Dq,{})}),c.jsx(Tt,{path:"agents/:uuid",element:c.jsx(Eq,{})}),c.jsxs(Tt,{path:"team",element:c.jsx(B7,{}),children:[c.jsx(Tt,{index:!0,element:c.jsx(T7,{})}),c.jsx(Tt,{path:"settings",element:c.jsx(P7,{})})]}),c.jsxs(Tt,{path:"settings",element:c.jsx(x7,{}),children:[c.jsx(Tt,{index:!0,element:c.jsx(ir,{to:"computers",replace:!0})}),c.jsx(Tt,{path:"computers",element:c.jsx(r7,{})}),c.jsx(Tt,{path:"integrations",element:c.jsx(b7,{})})]}),c.jsx(Tt,{path:"agents",element:c.jsx(ir,{to:"/team",replace:!0})}),c.jsx(Tt,{path:"clients",element:c.jsx(ir,{to:"/settings/computers",replace:!0})}),c.jsx(Tt,{path:"integrations",element:c.jsx(ir,{to:"/settings/integrations",replace:!0})}),c.jsx(Tt,{path:"team/members",element:c.jsx(ir,{to:"/team",replace:!0})}),c.jsx(Tt,{path:"team/agents",element:c.jsx(ir,{to:"/team",replace:!0})}),c.jsx(Tt,{path:"team/invite",element:c.jsx(ir,{to:"/team",replace:!0})}),c.jsx(Tt,{path:"admin",element:c.jsx(qH,{})})]})})]})})})})}function qH(){const e=Vn();return e.hash==="#bindings"?c.jsx(ir,{to:`/settings/integrations${e.search}`,replace:!0}):c.jsx(ir,{to:`/team${e.hash}`,replace:!0})}const fN=document.getElementById("root");if(!fN)throw new Error("Root element not found");D2.createRoot(fN).render(c.jsx(b.StrictMode,{children:c.jsx(FH,{})}));export{gR as A,Qu as F,Fu as L,st as c,c as j,b as r};
|