@agent-team-foundation/first-tree-hub 0.11.4 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bootstrap-D-Yf8yOc.mjs → bootstrap-C_K2CKXC.mjs} +7 -0
- package/dist/cli/index.mjs +73 -11
- package/dist/client-BPUdUaZT-CyCrpCTP.mjs +2033 -0
- package/dist/client-BhCtO2df-BGOu-rRN.mjs +7 -0
- package/dist/{dist-BQtAQNRD.mjs → dist-LgF7LHpE.mjs} +1 -1
- package/dist/{dist-ClFs4WMj.mjs → dist-UOZ6vMUW.mjs} +372 -197
- package/dist/drizzle/0033_onboarding_dismissed_at.sql +13 -0
- package/dist/drizzle/0034_pending_questions.sql +34 -0
- package/dist/drizzle/meta/_journal.json +14 -0
- package/dist/{errors-BmyRwN0Y-Dad3eV8F.mjs → errors-CF5evtJt-B0NTIVPt.mjs} +2 -1
- package/dist/{feishu-AI3pwmqN.mjs → feishu-C6qlhju2.mjs} +1 -1
- package/dist/{getMachineId-bsd-c2VImogj.mjs → getMachineId-bsd-BmasEOJr.mjs} +1 -1
- package/dist/{getMachineId-bsd-DyySs8xz.mjs → getMachineId-bsd-Dh3h0DDE.mjs} +1 -1
- package/dist/{getMachineId-darwin-Cl7TSzgO.mjs → getMachineId-darwin-CuhM3hfZ.mjs} +1 -1
- package/dist/{getMachineId-darwin-DKgI8b1d.mjs → getMachineId-darwin-D9wR0SLj.mjs} +1 -1
- package/dist/{getMachineId-linux-1OIMWfdh.mjs → getMachineId-linux-CYfb0oxZ.mjs} +1 -1
- package/dist/{getMachineId-linux-cT7EbP10.mjs → getMachineId-linux-D8ZaSjAC.mjs} +1 -1
- package/dist/{getMachineId-unsupported-CkX-YOG1.mjs → getMachineId-unsupported-Cu3iisaD.mjs} +1 -1
- package/dist/{getMachineId-unsupported-CmVlhzIo.mjs → getMachineId-unsupported-DZqI4ZT5.mjs} +1 -1
- package/dist/{getMachineId-win-C2cM60YT.mjs → getMachineId-win-8ZJbtrdf.mjs} +1 -1
- package/dist/{getMachineId-win-Chl03TYe.mjs → getMachineId-win-DT-hqwVp.mjs} +1 -1
- package/dist/index.mjs +9 -9
- package/dist/{invitation-Dnn5gGGX-DXryyvRG.mjs → invitation-Bg0TRiyx-BsZH4GCS.mjs} +2 -2
- package/dist/invitation-C299fxkP-KyCNax4T.mjs +4 -0
- package/dist/{observability-BAScT_5S-gw1ODB_o.mjs → observability-BAScT_5S-BcW9HgkG.mjs} +13 -13
- package/dist/{observability-CYsdAcoF.mjs → observability-eLA9iNK_.mjs} +3 -3
- package/dist/{saas-connect-CVoRK0Ex.mjs → saas-connect-Drn9g6cR.mjs} +1195 -1685
- package/dist/web/assets/index-B_Tf2I6v.css +1 -0
- package/dist/web/assets/{index-Bm6hgcvt.js → index-Bnyz7inW.js} +1 -1
- package/dist/web/assets/index-Dy3jIUX5.js +391 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/client-By1K4VVT-DuI6EnSh.mjs +0 -4
- package/dist/client-CLdRbuml-svTO0Eat.mjs +0 -524
- package/dist/invitation-DWlyNb8x-BvXubk24.mjs +0 -4
- package/dist/web/assets/index-fNb_M0nL.css +0 -1
- package/dist/web/assets/index-k2bWRKc-.js +0 -388
- /package/dist/{esm-Ci8E1Gtj.mjs → esm-iadMkGbV.mjs} +0 -0
- /package/dist/{src-aJMV60mR.mjs → src-DNBS5Yjj.mjs} +0 -0
|
@@ -1,388 +0,0 @@
|
|
|
1
|
-
var c1=e=>{throw TypeError(e)};var Jm=(e,t,n)=>t.has(e)||c1("Cannot "+n);var D=(e,t,n)=>(Jm(e,t,"read from private field"),n?n.call(e):t.get(e)),je=(e,t,n)=>t.has(e)?c1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),pe=(e,t,n,a)=>(Jm(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),Ue=(e,t,n)=>(Jm(e,t,"access private method"),n);var xd=(e,t,n,a)=>({set _(l){pe(e,t,l,n)},get _(){return D(e,t,a)}});function X2(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const o=Object.getOwnPropertyDescriptor(a,l);o&&Object.defineProperty(e,l,o.get?o:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wm={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 d1;function J2(){if(d1)return Xo;d1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,o){var c=null;if(o!==void 0&&(c=""+o),l.key!==void 0&&(c=""+l.key),"key"in l){o={};for(var f in l)f!=="key"&&(o[f]=l[f])}else o=l;return l=o.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:o}}return Xo.Fragment=t,Xo.jsx=n,Xo.jsxs=n,Xo}var f1;function W2(){return f1||(f1=1,Wm.exports=J2()),Wm.exports}var u=W2(),ep={exports:{}},Fe={};/**
|
|
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 h1;function eT(){if(h1)return Fe;h1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function w(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function C(L,P,T){this.props=L,this.context=P,this.refs=E,this.updater=T||k}C.prototype.isReactComponent={},C.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")},C.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function R(){}R.prototype=C.prototype;function O(L,P,T){this.props=L,this.context=P,this.refs=E,this.updater=T||k}var M=O.prototype=new R;M.constructor=O,j(M,C.prototype),M.isPureReactComponent=!0;var B=Array.isArray;function z(){}var $={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function Q(L,P,T){var Z=T.ref;return{$$typeof:e,type:L,key:P,ref:Z!==void 0?Z:null,props:T}}function I(L,P){return Q(L.type,P,L.props)}function ne(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function le(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(T){return P[T]})}var we=/\/+/g;function Y(L,P){return typeof L=="object"&&L!==null&&L.key!=null?le(""+L.key):P.toString(36)}function J(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(z,z):(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 H(L,P,T,Z,W){var ce=typeof L;(ce==="undefined"||ce==="boolean")&&(L=null);var ve=!1;if(L===null)ve=!0;else switch(ce){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(L.$$typeof){case e:case t:ve=!0;break;case y:return ve=L._init,H(ve(L._payload),P,T,Z,W)}}if(ve)return W=W(L),ve=Z===""?"."+Y(L,0):Z,B(W)?(T="",ve!=null&&(T=ve.replace(we,"$&/")+"/"),H(W,P,T,"",function(Qe){return Qe})):W!=null&&(ne(W)&&(W=I(W,T+(W.key==null||L&&L.key===W.key?"":(""+W.key).replace(we,"$&/")+"/")+ve)),P.push(W)),1;ve=0;var ge=Z===""?".":Z+":";if(B(L))for(var fe=0;fe<L.length;fe++)Z=L[fe],ce=ge+Y(Z,fe),ve+=H(Z,P,T,ce,W);else if(fe=w(L),typeof fe=="function")for(L=fe.call(L),fe=0;!(Z=L.next()).done;)Z=Z.value,ce=ge+Y(Z,fe++),ve+=H(Z,P,T,ce,W);else if(ce==="object"){if(typeof L.then=="function")return H(J(L),P,T,Z,W);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 ve}function ee(L,P,T){if(L==null)return L;var Z=[],W=0;return H(L,Z,"","",function(ce){return P.call(T,ce,W++)}),Z}function be(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(T){(L._status===0||L._status===-1)&&(L._status=1,L._result=T)},function(T){(L._status===0||L._status===-1)&&(L._status=2,L._result=T)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var Ae=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)},A={map:ee,forEach:function(L,P,T){ee(L,function(){P.apply(this,arguments)},T)},count:function(L){var P=0;return ee(L,function(){P++}),P},toArray:function(L){return ee(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 Fe.Activity=g,Fe.Children=A,Fe.Component=C,Fe.Fragment=n,Fe.Profiler=l,Fe.PureComponent=O,Fe.StrictMode=a,Fe.Suspense=m,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return $.H.useMemoCache(L)}},Fe.cache=function(L){return function(){return L.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(L,P,T){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Z=j({},L.props),W=L.key;if(P!=null)for(ce in P.key!==void 0&&(W=""+P.key),P)!U.call(P,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&P.ref===void 0||(Z[ce]=P[ce]);var ce=arguments.length-2;if(ce===1)Z.children=T;else if(1<ce){for(var ve=Array(ce),ge=0;ge<ce;ge++)ve[ge]=arguments[ge+2];Z.children=ve}return Q(L.type,W,Z)},Fe.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Fe.createElement=function(L,P,T){var Z,W={},ce=null;if(P!=null)for(Z in P.key!==void 0&&(ce=""+P.key),P)U.call(P,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(W[Z]=P[Z]);var ve=arguments.length-2;if(ve===1)W.children=T;else if(1<ve){for(var ge=Array(ve),fe=0;fe<ve;fe++)ge[fe]=arguments[fe+2];W.children=ge}if(L&&L.defaultProps)for(Z in ve=L.defaultProps,ve)W[Z]===void 0&&(W[Z]=ve[Z]);return Q(L,ce,W)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(L){return{$$typeof:f,render:L}},Fe.isValidElement=ne,Fe.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:be}},Fe.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},Fe.startTransition=function(L){var P=$.T,T={};$.T=T;try{var Z=L(),W=$.S;W!==null&&W(T,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(z,Ae)}catch(ce){Ae(ce)}finally{P!==null&&T.types!==null&&(P.types=T.types),$.T=P}},Fe.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},Fe.use=function(L){return $.H.use(L)},Fe.useActionState=function(L,P,T){return $.H.useActionState(L,P,T)},Fe.useCallback=function(L,P){return $.H.useCallback(L,P)},Fe.useContext=function(L){return $.H.useContext(L)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(L,P){return $.H.useDeferredValue(L,P)},Fe.useEffect=function(L,P){return $.H.useEffect(L,P)},Fe.useEffectEvent=function(L){return $.H.useEffectEvent(L)},Fe.useId=function(){return $.H.useId()},Fe.useImperativeHandle=function(L,P,T){return $.H.useImperativeHandle(L,P,T)},Fe.useInsertionEffect=function(L,P){return $.H.useInsertionEffect(L,P)},Fe.useLayoutEffect=function(L,P){return $.H.useLayoutEffect(L,P)},Fe.useMemo=function(L,P){return $.H.useMemo(L,P)},Fe.useOptimistic=function(L,P){return $.H.useOptimistic(L,P)},Fe.useReducer=function(L,P,T){return $.H.useReducer(L,P,T)},Fe.useRef=function(L){return $.H.useRef(L)},Fe.useState=function(L){return $.H.useState(L)},Fe.useSyncExternalStore=function(L,P,T){return $.H.useSyncExternalStore(L,P,T)},Fe.useTransition=function(){return $.H.useTransition()},Fe.version="19.2.4",Fe}var m1;function ey(){return m1||(m1=1,ep.exports=eT()),ep.exports}var x=ey();const tT=mf(x),ty=X2({__proto__:null,default:tT},[x]);var tp={exports:{}},Jo={},np={exports:{}},rp={};/**
|
|
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 p1;function nT(){return p1||(p1=1,(function(e){function t(H,ee){var be=H.length;H.push(ee);e:for(;0<be;){var Ae=be-1>>>1,A=H[Ae];if(0<l(A,ee))H[Ae]=ee,H[be]=A,be=Ae;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var ee=H[0],be=H.pop();if(be!==ee){H[0]=be;e:for(var Ae=0,A=H.length,L=A>>>1;Ae<L;){var P=2*(Ae+1)-1,T=H[P],Z=P+1,W=H[Z];if(0>l(T,be))Z<A&&0>l(W,T)?(H[Ae]=W,H[Z]=be,Ae=Z):(H[Ae]=T,H[P]=be,Ae=P);else if(Z<A&&0>l(W,be))H[Ae]=W,H[Z]=be,Ae=Z;else break e}}return ee}function l(H,ee){var be=H.sortIndex-ee.sortIndex;return be!==0?be:H.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var m=[],h=[],y=1,g=null,b=3,w=!1,k=!1,j=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function M(H){for(var ee=n(h);ee!==null;){if(ee.callback===null)a(h);else if(ee.startTime<=H)a(h),ee.sortIndex=ee.expirationTime,t(m,ee);else break;ee=n(h)}}function B(H){if(j=!1,M(H),!k)if(n(m)!==null)k=!0,z||(z=!0,le());else{var ee=n(h);ee!==null&&J(B,ee.startTime-H)}}var z=!1,$=-1,U=5,Q=-1;function I(){return E?!0:!(e.unstable_now()-Q<U)}function ne(){if(E=!1,z){var H=e.unstable_now();Q=H;var ee=!0;try{e:{k=!1,j&&(j=!1,R($),$=-1),w=!0;var be=b;try{t:{for(M(H),g=n(m);g!==null&&!(g.expirationTime>H&&I());){var Ae=g.callback;if(typeof Ae=="function"){g.callback=null,b=g.priorityLevel;var A=Ae(g.expirationTime<=H);if(H=e.unstable_now(),typeof A=="function"){g.callback=A,M(H),ee=!0;break t}g===n(m)&&a(m),M(H)}else a(m);g=n(m)}if(g!==null)ee=!0;else{var L=n(h);L!==null&&J(B,L.startTime-H),ee=!1}}break e}finally{g=null,b=be,w=!1}ee=void 0}}finally{ee?le():z=!1}}}var le;if(typeof O=="function")le=function(){O(ne)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,Y=we.port2;we.port1.onmessage=ne,le=function(){Y.postMessage(null)}}else le=function(){C(ne,0)};function J(H,ee){$=C(function(){H(e.unstable_now())},ee)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var ee=3;break;default:ee=b}var be=b;b=ee;try{return H()}finally{b=be}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(H,ee){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var be=b;b=H;try{return ee()}finally{b=be}},e.unstable_scheduleCallback=function(H,ee,be){var Ae=e.unstable_now();switch(typeof be=="object"&&be!==null?(be=be.delay,be=typeof be=="number"&&0<be?Ae+be:Ae):be=Ae,H){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=be+A,H={id:y++,callback:ee,priorityLevel:H,startTime:be,expirationTime:A,sortIndex:-1},be>Ae?(H.sortIndex=be,t(h,H),n(m)===null&&H===n(h)&&(j?(R($),$=-1):j=!0,J(B,be-Ae))):(H.sortIndex=A,t(m,H),k||w||(k=!0,z||(z=!0,le()))),H},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(H){var ee=b;return function(){var be=b;b=ee;try{return H.apply(this,arguments)}finally{b=be}}}})(rp)),rp}var g1;function rT(){return g1||(g1=1,np.exports=nT()),np.exports}var ap={exports:{}},jn={};/**
|
|
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 y1;function aT(){if(y1)return jn;y1=1;var e=ey();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(m,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:m,containerInfo:h,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,jn.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)},jn.flushSync=function(m){var h=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=y,a.d.f()}},jn.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))},jn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},jn.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,g=f(y,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:w}):y==="script"&&a.d.X(m,{crossOrigin:g,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},jn.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)},jn.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})}},jn.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)},jn.requestFormReset=function(m){a.d.r(m)},jn.unstable_batchedUpdates=function(m,h){return m(h)},jn.useFormState=function(m,h,y){return c.H.useFormState(m,h,y)},jn.useFormStatus=function(){return c.H.useHostTransitionStatus()},jn.version="19.2.4",jn}var v1;function sk(){if(v1)return ap.exports;v1=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(),ap.exports=aT(),ap.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 b1;function iT(){if(b1)return Jo;b1=1;var e=rT(),t=ey(),n=sk();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===s)return m(p),r;if(v===d)return m(p),i;v=v.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=v;else{for(var S=!1,_=p.child;_;){if(_===s){S=!0,s=p,d=v;break}if(_===d){S=!0,d=p,s=v;break}_=_.sibling}if(!S){for(_=v.child;_;){if(_===s){S=!0,s=v,d=p;break}if(_===d){S=!0,d=v,s=p;break}_=_.sibling}if(!S)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function y(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=y(r),i!==null)return i;r=r.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),O=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function le(r){return r===null||typeof r!="object"?null:(r=ne&&r[ne]||r["@@iterator"],typeof r=="function"?r:null)}var we=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===we?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case z:return"SuspenseList";case Q:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case k:return"Portal";case O:return r.displayName||"Context";case R:return(r._context.displayName||"Context")+".Consumer";case M:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case $:return i=r.displayName||null,i!==null?i:Y(r.type)||"Memo";case U:i=r._payload,r=r._init;try{return Y(r(i))}catch{}}return null}var J=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be={pending:!1,data:null,method:null,action:null},Ae=[],A=-1;function L(r){return{current:r}}function P(r){0>A||(r.current=Ae[A],Ae[A]=null,A--)}function T(r,i){A++,Ae[A]=r.current,r.current=i}var Z=L(null),W=L(null),ce=L(null),ve=L(null);function ge(r,i){switch(T(ce,i),T(W,r),T(Z,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?O0(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=O0(i),r=M0(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}P(Z),T(Z,r)}function fe(){P(Z),P(W),P(ce)}function Qe(r){r.memoizedState!==null&&T(ve,r);var i=Z.current,s=M0(i,r.type);i!==s&&(T(W,r),T(Z,s))}function Oe(r){W.current===r&&(P(Z),P(W)),ve.current===r&&(P(ve),Qo._currentValue=be)}var ut,ae;function Se(r){if(ut===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ut=i&&i[1]||"",ae=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ut+r+ae}var Me=!1;function Ge(r,i){if(!r||Me)return"";Me=!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 X=te}Reflect.construct(r,[],de)}else{try{de.call()}catch(te){X=te}r.call(de.prototype)}}else{try{throw Error()}catch(te){X=te}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(te){if(te&&X&&typeof te.stack=="string")return[te.stack,X.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],_=v[1];if(S&&_){var F=S.split(`
|
|
44
|
-
`),G=_.split(`
|
|
45
|
-
`);for(p=d=0;d<F.length&&!F[d].includes("DetermineComponentFrameRoot");)d++;for(;p<G.length&&!G[p].includes("DetermineComponentFrameRoot");)p++;if(d===F.length||p===G.length)for(d=F.length-1,p=G.length-1;1<=d&&0<=p&&F[d]!==G[p];)p--;for(;1<=d&&0<=p;d--,p--)if(F[d]!==G[p]){if(d!==1||p!==1)do if(d--,p--,0>p||F[d]!==G[p]){var ie=`
|
|
46
|
-
`+F[d].replace(" at new "," at ");return r.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",r.displayName)),ie}while(1<=d&&0<=p);break}}}finally{Me=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Se(s):""}function Rn(r,i){switch(r.tag){case 26:case 27:case 5:return Se(r.type);case 16:return Se("Lazy");case 13:return r.child!==i&&i!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return Ge(r.type,!1);case 11:return Ge(r.type.render,!1);case 1:return Ge(r.type,!0);case 31:return Se("Activity");default:return""}}function zn(r){try{var i="",s=null;do i+=Rn(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,Ia=e.unstable_scheduleCallback,ra=e.unstable_cancelCallback,ro=e.unstable_shouldYield,ao=e.unstable_requestPaint,mn=e.unstable_now,io=e.unstable_getCurrentPriorityLevel,se=e.unstable_ImmediatePriority,ye=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,$e=e.unstable_LowPriority,rt=e.unstable_IdlePriority,pn=e.log,mr=e.unstable_setDisableYieldValue,rn=null,qt=null;function gn(r){if(typeof pn=="function"&&mr(r),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(rn,r)}catch{}}var mt=Math.clz32?Math.clz32:ic,Dr=Math.log,Pn=Math.LN2;function ic(r){return r>>>=0,r===0?32:31-(Dr(r)/Pn|0)|0}var Ii=256,Li=262144,Ui=4194304;function Zr(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Pi(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var _=d&134217727;return _!==0?(d=_&~v,d!==0?p=Zr(d):(S&=_,S!==0?p=Zr(S):s||(s=_&~r,s!==0&&(p=Zr(s))))):(_=d&~v,_!==0?p=Zr(_):S!==0?p=Zr(S):s||(s=d&~r,s!==0&&(p=Zr(s)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,s=i&-i,v>=s||v===32&&(s&4194048)!==0)?i:p}function La(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function lc(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xe(){var r=Ui;return Ui<<=1,(Ui&62914560)===0&&(Ui=4194304),r}function Ye(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function yn(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function aa(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 _=r.entanglements,F=r.expirationTimes,G=r.hiddenUpdates;for(s=S&~s;0<s;){var ie=31-mt(s),de=1<<ie;_[ie]=0,F[ie]=-1;var X=G[ie];if(X!==null)for(G[ie]=null,ie=0;ie<X.length;ie++){var te=X[ie];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-mt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function sc(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-mt(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function yv(r,i){var s=i&-i;return s=(s&42)!==0?1:$f(s),(s&(r.suspendedLanes|i))!==0?0:s}function $f(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 Ff(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function vv(){var r=ee.p;return r!==0?r:(r=window.event,r===void 0?32:r1(r.type))}function bv(r,i){var s=ee.p;try{return ee.p=r,i()}finally{ee.p=s}}var Ua=Math.random().toString(36).slice(2),vn="__reactFiber$"+Ua,Bn="__reactProps$"+Ua,El="__reactContainer$"+Ua,qf="__reactEvents$"+Ua,BN="__reactListeners$"+Ua,$N="__reactHandles$"+Ua,xv="__reactResources$"+Ua,so="__reactMarker$"+Ua;function Hf(r){delete r[vn],delete r[Bn],delete r[qf],delete r[BN],delete r[$N]}function Nl(r){var i=r[vn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[El]||s[vn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=$0(r);r!==null;){if(s=r[vn])return s;r=$0(r)}return i}r=s,s=r.parentNode}return null}function _l(r){if(r=r[vn]||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 Tl(r){var i=r[xv];return i||(i=r[xv]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function un(r){r[so]=!0}var wv=new Set,Sv={};function Bi(r,i){Al(r,i),Al(r+"Capture",i)}function Al(r,i){for(Sv[r]=i,r=0;r<i.length;r++)wv.add(i[r])}var FN=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]*$"),kv={},jv={};function qN(r){return Da.call(jv,r)?!0:Da.call(kv,r)?!1:FN.test(r)?jv[r]=!0:(kv[r]=!0,!1)}function oc(r,i,s){if(qN(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 uc(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 ia(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 pr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Cv(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function HN(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 Zf(r){if(!r._valueTracker){var i=Cv(r)?"checked":"value";r._valueTracker=HN(r,i,""+r[i])}}function Ev(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=Cv(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function cc(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 ZN=/[\n"\\]/g;function gr(r){return r.replace(ZN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Vf(r,i,s,d,p,v,S,_){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=""+pr(i)):r.value!==""+pr(i)&&(r.value=""+pr(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Qf(r,S,pr(i)):s!=null?Qf(r,S,pr(s)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+pr(_):r.removeAttribute("name")}function Nv(r,i,s,d,p,v,S,_){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)){Zf(r);return}s=s!=null?""+pr(s):"",i=i!=null?""+pr(i):s,_||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=_?r.checked:!!d,r.defaultChecked=!!d,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Zf(r)}function Qf(r,i,s){i==="number"&&cc(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=""+pr(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 _v(r,i,s){if(i!=null&&(i=""+pr(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+pr(s):""}function Tv(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(J(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=pr(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),Zf(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 VN=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 Av(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||VN.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function Rv(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&&Av(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&Av(r,v,i[v])}function Kf(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 QN=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"]]),KN=/^[\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 dc(r){return KN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function la(){}var Gf=null;function Yf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ol=null,Ml=null;function zv(r){var i=_l(r);if(i&&(r=i.stateNode)){var s=r[Bn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Vf(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="'+gr(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[Bn]||null;if(!p)throw Error(a(90));Vf(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&&Ev(d)}break e;case"textarea":_v(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Rl(r,!!s.multiple,i,!1)}}}var Xf=!1;function Ov(r,i,s){if(Xf)return r(i,s);Xf=!0;try{var d=r(i);return d}finally{if(Xf=!1,(Ol!==null||Ml!==null)&&(Jc(),Ol&&(i=Ol,r=Ml,Ml=Ol=null,zv(i),r)))for(i=0;i<r.length;i++)zv(r[i])}}function uo(r,i){var s=r.stateNode;if(s===null)return null;var d=s[Bn]||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 sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jf=!1;if(sa)try{var co={};Object.defineProperty(co,"passive",{get:function(){Jf=!0}}),window.addEventListener("test",co,co),window.removeEventListener("test",co,co)}catch{Jf=!1}var Pa=null,Wf=null,fc=null;function Mv(){if(fc)return fc;var r,i=Wf,s=i.length,d,p="value"in Pa?Pa.value:Pa.textContent,v=p.length;for(r=0;r<s&&i[r]===p[r];r++);var S=s-r;for(d=1;d<=S&&i[s-d]===p[v-d];d++);return fc=p.slice(r,1<d?1-d:void 0)}function hc(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 mc(){return!0}function Dv(){return!1}function $n(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 _ in r)r.hasOwnProperty(_)&&(s=r[_],this[_]=s?s(v):v[_]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?mc:Dv,this.isPropagationStopped=Dv,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=mc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=mc)},persist:function(){},isPersistent:mc}),i}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pc=$n($i),fo=g({},$i,{view:0,detail:0}),GN=$n(fo),eh,th,ho,gc=g({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rh,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"?(eh=r.screenX-ho.screenX,th=r.screenY-ho.screenY):th=eh=0,ho=r),eh)},movementY:function(r){return"movementY"in r?r.movementY:th}}),Iv=$n(gc),YN=g({},gc,{dataTransfer:0}),XN=$n(YN),JN=g({},fo,{relatedTarget:0}),nh=$n(JN),WN=g({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),e_=$n(WN),t_=g({},$i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),n_=$n(t_),r_=g({},$i,{data:0}),Lv=$n(r_),a_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i_={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"},l_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function s_(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=l_[r])?!!i[r]:!1}function rh(){return s_}var o_=g({},fo,{key:function(r){if(r.key){var i=a_[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=hc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?i_[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rh,charCode:function(r){return r.type==="keypress"?hc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?hc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),u_=$n(o_),c_=g({},gc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uv=$n(c_),d_=g({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rh}),f_=$n(d_),h_=g({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),m_=$n(h_),p_=g({},gc,{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}),g_=$n(p_),y_=g({},$i,{newState:0,oldState:0}),v_=$n(y_),b_=[9,13,27,32],ah=sa&&"CompositionEvent"in window,mo=null;sa&&"documentMode"in document&&(mo=document.documentMode);var x_=sa&&"TextEvent"in window&&!mo,Pv=sa&&(!ah||mo&&8<mo&&11>=mo),Bv=" ",$v=!1;function Fv(r,i){switch(r){case"keyup":return b_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Dl=!1;function w_(r,i){switch(r){case"compositionend":return qv(i);case"keypress":return i.which!==32?null:($v=!0,Bv);case"textInput":return r=i.data,r===Bv&&$v?null:r;default:return null}}function S_(r,i){if(Dl)return r==="compositionend"||!ah&&Fv(r,i)?(r=Mv(),fc=Wf=Pa=null,Dl=!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 Pv&&i.locale!=="ko"?null:i.data;default:return null}}var k_={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 Hv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!k_[r.type]:i==="textarea"}function Zv(r,i,s,d){Ol?Ml?Ml.push(d):Ml=[d]:Ol=d,i=id(i,"onChange"),0<i.length&&(s=new pc("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var po=null,go=null;function j_(r){N0(r,0)}function yc(r){var i=oo(r);if(Ev(i))return r}function Vv(r,i){if(r==="change")return i}var Qv=!1;if(sa){var ih;if(sa){var lh="oninput"in document;if(!lh){var Kv=document.createElement("div");Kv.setAttribute("oninput","return;"),lh=typeof Kv.oninput=="function"}ih=lh}else ih=!1;Qv=ih&&(!document.documentMode||9<document.documentMode)}function Gv(){po&&(po.detachEvent("onpropertychange",Yv),go=po=null)}function Yv(r){if(r.propertyName==="value"&&yc(go)){var i=[];Zv(i,go,r,Yf(r)),Ov(j_,i)}}function C_(r,i,s){r==="focusin"?(Gv(),po=i,go=s,po.attachEvent("onpropertychange",Yv)):r==="focusout"&&Gv()}function E_(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return yc(go)}function N_(r,i){if(r==="click")return yc(i)}function __(r,i){if(r==="input"||r==="change")return yc(i)}function T_(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var er=typeof Object.is=="function"?Object.is:T_;function yo(r,i){if(er(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)||!er(r[p],i[p]))return!1}return!0}function Xv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Jv(r,i){var s=Xv(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=Xv(s)}}function Wv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Wv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function eb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=cc(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=cc(r.document)}return i}function sh(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 A_=sa&&"documentMode"in document&&11>=document.documentMode,Il=null,oh=null,vo=null,uh=!1;function tb(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;uh||Il==null||Il!==cc(d)||(d=Il,"selectionStart"in d&&sh(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=id(oh,"onSelect"),0<d.length&&(i=new pc("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=Il)))}function Fi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var Ll={animationend:Fi("Animation","AnimationEnd"),animationiteration:Fi("Animation","AnimationIteration"),animationstart:Fi("Animation","AnimationStart"),transitionrun:Fi("Transition","TransitionRun"),transitionstart:Fi("Transition","TransitionStart"),transitioncancel:Fi("Transition","TransitionCancel"),transitionend:Fi("Transition","TransitionEnd")},ch={},nb={};sa&&(nb=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 qi(r){if(ch[r])return ch[r];if(!Ll[r])return r;var i=Ll[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in nb)return ch[r]=i[s];return r}var rb=qi("animationend"),ab=qi("animationiteration"),ib=qi("animationstart"),R_=qi("transitionrun"),z_=qi("transitionstart"),O_=qi("transitioncancel"),lb=qi("transitionend"),sb=new Map,dh="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(" ");dh.push("scrollEnd");function Ir(r,i){sb.set(r,i),Bi(i,[r])}var vc=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)},yr=[],Ul=0,fh=0;function bc(){for(var r=Ul,i=fh=Ul=0;i<r;){var s=yr[i];yr[i++]=null;var d=yr[i];yr[i++]=null;var p=yr[i];yr[i++]=null;var v=yr[i];if(yr[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&&ob(s,p,v)}}function xc(r,i,s,d){yr[Ul++]=r,yr[Ul++]=i,yr[Ul++]=s,yr[Ul++]=d,fh|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function hh(r,i,s,d){return xc(r,i,s,d),wc(r)}function Hi(r,i){return xc(r,null,null,i),wc(r)}function ob(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-mt(s),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),v):null}function wc(r){if(50<Bo)throw Bo=0,Sm=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 M_(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 tr(r,i,s,d){return new M_(r,i,s,d)}function mh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function oa(r,i){var s=r.alternate;return s===null?(s=tr(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 ub(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 Sc(r,i,s,d,p,v){var S=0;if(d=r,typeof r=="function")mh(r)&&(S=1);else if(typeof r=="string")S=P2(r,s,Z.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Q:return r=tr(31,s,i,p),r.elementType=Q,r.lanes=v,r;case j:return Zi(s.children,p,v,i);case E:S=8,p|=24;break;case C:return r=tr(12,s,i,p|2),r.elementType=C,r.lanes=v,r;case B:return r=tr(13,s,i,p),r.elementType=B,r.lanes=v,r;case z:return r=tr(19,s,i,p),r.elementType=z,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case O:S=10;break e;case R:S=9;break e;case M:S=11;break e;case $: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=tr(S,s,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function Zi(r,i,s,d){return r=tr(7,r,d,i),r.lanes=s,r}function ph(r,i,s){return r=tr(6,r,null,i),r.lanes=s,r}function cb(r){var i=tr(18,null,null,0);return i.stateNode=r,i}function gh(r,i,s){return i=tr(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var db=new WeakMap;function vr(r,i){if(typeof r=="object"&&r!==null){var s=db.get(r);return s!==void 0?s:(i={value:r,source:i,stack:zn(i)},db.set(r,i),i)}return{value:r,source:i,stack:zn(i)}}var Bl=[],$l=0,kc=null,bo=0,br=[],xr=0,Ba=null,Vr=1,Qr="";function ua(r,i){Bl[$l++]=bo,Bl[$l++]=kc,kc=r,bo=i}function fb(r,i,s){br[xr++]=Vr,br[xr++]=Qr,br[xr++]=Ba,Ba=r;var d=Vr;r=Qr;var p=32-mt(d)-1;d&=~(1<<p),s+=1;var v=32-mt(i)+p;if(30<v){var S=p-p%5;v=(d&(1<<S)-1).toString(32),d>>=S,p-=S,Vr=1<<32-mt(i)+p|s<<p|d,Qr=v+r}else Vr=1<<v|s<<p|d,Qr=r}function yh(r){r.return!==null&&(ua(r,1),fb(r,1,0))}function vh(r){for(;r===kc;)kc=Bl[--$l],Bl[$l]=null,bo=Bl[--$l],Bl[$l]=null;for(;r===Ba;)Ba=br[--xr],br[xr]=null,Qr=br[--xr],br[xr]=null,Vr=br[--xr],br[xr]=null}function hb(r,i){br[xr++]=Vr,br[xr++]=Qr,br[xr++]=Ba,Vr=i.id,Qr=i.overflow,Ba=r}var bn=null,_t=null,at=!1,$a=null,wr=!1,bh=Error(a(519));function Fa(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xo(vr(i,r)),bh}function mb(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[vn]=r,i[Bn]=d,s){case"dialog":Je("cancel",i),Je("close",i);break;case"iframe":case"object":case"embed":Je("load",i);break;case"video":case"audio":for(s=0;s<Fo.length;s++)Je(Fo[s],i);break;case"source":Je("error",i);break;case"img":case"image":case"link":Je("error",i),Je("load",i);break;case"details":Je("toggle",i);break;case"input":Je("invalid",i),Nv(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",i);break;case"textarea":Je("invalid",i),Tv(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||R0(i.textContent,s)?(d.popover!=null&&(Je("beforetoggle",i),Je("toggle",i)),d.onScroll!=null&&Je("scroll",i),d.onScrollEnd!=null&&Je("scrollend",i),d.onClick!=null&&(i.onclick=la),i=!0):i=!1,i||Fa(r,!0)}function pb(r){for(bn=r.return;bn;)switch(bn.tag){case 5:case 31:case 13:wr=!1;return;case 27:case 3:wr=!0;return;default:bn=bn.return}}function Fl(r){if(r!==bn)return!1;if(!at)return pb(r),at=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||Lm(r.type,r.memoizedProps)),s=!s),s&&_t&&Fa(r),pb(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));_t=B0(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));_t=B0(r)}else i===27?(i=_t,ni(r.type)?(r=Fm,Fm=null,_t=r):_t=i):_t=bn?kr(r.stateNode.nextSibling):null;return!0}function Vi(){_t=bn=null,at=!1}function xh(){var r=$a;return r!==null&&(Zn===null?Zn=r:Zn.push.apply(Zn,r),$a=null),r}function xo(r){$a===null?$a=[r]:$a.push(r)}var wh=L(null),Qi=null,ca=null;function qa(r,i,s){T(wh,i._currentValue),i._currentValue=s}function da(r){r._currentValue=wh.current,P(wh)}function Sh(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 kh(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 _=v;v=p;for(var F=0;F<i.length;F++)if(_.context===i[F]){v.lanes|=s,_=v.alternate,_!==null&&(_.lanes|=s),Sh(v.return,s,r),d||(S=null);break e}v=_.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),Sh(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 _=p.type;er(p.pendingProps.value,S.value)||(r!==null?r.push(_):r=[_])}}else if(p===ve.current){if(S=p.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Qo):r=[Qo])}p=p.return}r!==null&&kh(i,r,s,d),i.flags|=262144}function jc(r){for(r=r.firstContext;r!==null;){if(!er(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ki(r){Qi=r,ca=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function xn(r){return gb(Qi,r)}function Cc(r,i){return Qi===null&&Ki(r),gb(r,i)}function gb(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ca===null){if(r===null)throw Error(a(308));ca=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ca=ca.next=i;return s}var D_=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()})}},I_=e.unstable_scheduleCallback,L_=e.unstable_NormalPriority,Qt={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jh(){return{controller:new D_,data:new Map,refCount:0}}function wo(r){r.refCount--,r.refCount===0&&I_(L_,function(){r.controller.abort()})}var So=null,Ch=0,Hl=0,Zl=null;function U_(r,i){if(So===null){var s=So=[];Ch=0,Hl=_m(),Zl={status:"pending",value:void 0,then:function(d){s.push(d)}}}return Ch++,i.then(yb,yb),i}function yb(){if(--Ch===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 P_(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 vb=H.S;H.S=function(r,i){t0=mn(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&U_(r,i),vb!==null&&vb(r,i)};var Gi=L(null);function Eh(){var r=Gi.current;return r!==null?r:kt.pooledCache}function Ec(r,i){i===null?T(Gi,Gi.current):T(Gi,i.pool)}function bb(){var r=Eh();return r===null?null:{parent:Qt._currentValue,pool:r}}var Vl=Error(a(460)),Nh=Error(a(474)),Nc=Error(a(542)),_c={then:function(){}};function xb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function wb(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(la,la),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,kb(r),r;default:if(typeof i.status=="string")i.then(la,la);else{if(r=kt,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,kb(r),r}throw Xi=i,Vl}}function Yi(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Xi=s,Vl):s}}var Xi=null;function Sb(){if(Xi===null)throw Error(a(459));var r=Xi;return Xi=null,r}function kb(r){if(r===Vl||r===Nc)throw Error(a(483))}var Ql=null,ko=0;function Tc(r){var i=ko;return ko+=1,Ql===null&&(Ql=[]),wb(Ql,r,i)}function jo(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Ac(r,i){throw i.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function jb(r){function i(V,q){if(r){var K=V.deletions;K===null?(V.deletions=[q],V.flags|=16):K.push(q)}}function s(V,q){if(!r)return null;for(;q!==null;)i(V,q),q=q.sibling;return null}function d(V){for(var q=new Map;V!==null;)V.key!==null?q.set(V.key,V):q.set(V.index,V),V=V.sibling;return q}function p(V,q){return V=oa(V,q),V.index=0,V.sibling=null,V}function v(V,q,K){return V.index=K,r?(K=V.alternate,K!==null?(K=K.index,K<q?(V.flags|=67108866,q):K):(V.flags|=67108866,q)):(V.flags|=1048576,q)}function S(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function _(V,q,K,ue){return q===null||q.tag!==6?(q=ph(K,V.mode,ue),q.return=V,q):(q=p(q,K),q.return=V,q)}function F(V,q,K,ue){var ze=K.type;return ze===j?ie(V,q,K.props.children,ue,K.key):q!==null&&(q.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===U&&Yi(ze)===q.type)?(q=p(q,K.props),jo(q,K),q.return=V,q):(q=Sc(K.type,K.key,K.props,null,V.mode,ue),jo(q,K),q.return=V,q)}function G(V,q,K,ue){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=gh(K,V.mode,ue),q.return=V,q):(q=p(q,K.children||[]),q.return=V,q)}function ie(V,q,K,ue,ze){return q===null||q.tag!==7?(q=Zi(K,V.mode,ue,ze),q.return=V,q):(q=p(q,K),q.return=V,q)}function de(V,q,K){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=ph(""+q,V.mode,K),q.return=V,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case w:return K=Sc(q.type,q.key,q.props,null,V.mode,K),jo(K,q),K.return=V,K;case k:return q=gh(q,V.mode,K),q.return=V,q;case U:return q=Yi(q),de(V,q,K)}if(J(q)||le(q))return q=Zi(q,V.mode,K,null),q.return=V,q;if(typeof q.then=="function")return de(V,Tc(q),K);if(q.$$typeof===O)return de(V,Cc(V,q),K);Ac(V,q)}return null}function X(V,q,K,ue){var ze=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ze!==null?null:_(V,q,""+K,ue);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===ze?F(V,q,K,ue):null;case k:return K.key===ze?G(V,q,K,ue):null;case U:return K=Yi(K),X(V,q,K,ue)}if(J(K)||le(K))return ze!==null?null:ie(V,q,K,ue,null);if(typeof K.then=="function")return X(V,q,Tc(K),ue);if(K.$$typeof===O)return X(V,q,Cc(V,K),ue);Ac(V,K)}return null}function te(V,q,K,ue,ze){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return V=V.get(K)||null,_(q,V,""+ue,ze);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case w:return V=V.get(ue.key===null?K:ue.key)||null,F(q,V,ue,ze);case k:return V=V.get(ue.key===null?K:ue.key)||null,G(q,V,ue,ze);case U:return ue=Yi(ue),te(V,q,K,ue,ze)}if(J(ue)||le(ue))return V=V.get(K)||null,ie(q,V,ue,ze,null);if(typeof ue.then=="function")return te(V,q,K,Tc(ue),ze);if(ue.$$typeof===O)return te(V,q,K,Cc(q,ue),ze);Ac(q,ue)}return null}function Ce(V,q,K,ue){for(var ze=null,ct=null,_e=q,Ze=q=0,nt=null;_e!==null&&Ze<K.length;Ze++){_e.index>Ze?(nt=_e,_e=null):nt=_e.sibling;var dt=X(V,_e,K[Ze],ue);if(dt===null){_e===null&&(_e=nt);break}r&&_e&&dt.alternate===null&&i(V,_e),q=v(dt,q,Ze),ct===null?ze=dt:ct.sibling=dt,ct=dt,_e=nt}if(Ze===K.length)return s(V,_e),at&&ua(V,Ze),ze;if(_e===null){for(;Ze<K.length;Ze++)_e=de(V,K[Ze],ue),_e!==null&&(q=v(_e,q,Ze),ct===null?ze=_e:ct.sibling=_e,ct=_e);return at&&ua(V,Ze),ze}for(_e=d(_e);Ze<K.length;Ze++)nt=te(_e,V,Ze,K[Ze],ue),nt!==null&&(r&&nt.alternate!==null&&_e.delete(nt.key===null?Ze:nt.key),q=v(nt,q,Ze),ct===null?ze=nt:ct.sibling=nt,ct=nt);return r&&_e.forEach(function(si){return i(V,si)}),at&&ua(V,Ze),ze}function Le(V,q,K,ue){if(K==null)throw Error(a(151));for(var ze=null,ct=null,_e=q,Ze=q=0,nt=null,dt=K.next();_e!==null&&!dt.done;Ze++,dt=K.next()){_e.index>Ze?(nt=_e,_e=null):nt=_e.sibling;var si=X(V,_e,dt.value,ue);if(si===null){_e===null&&(_e=nt);break}r&&_e&&si.alternate===null&&i(V,_e),q=v(si,q,Ze),ct===null?ze=si:ct.sibling=si,ct=si,_e=nt}if(dt.done)return s(V,_e),at&&ua(V,Ze),ze;if(_e===null){for(;!dt.done;Ze++,dt=K.next())dt=de(V,dt.value,ue),dt!==null&&(q=v(dt,q,Ze),ct===null?ze=dt:ct.sibling=dt,ct=dt);return at&&ua(V,Ze),ze}for(_e=d(_e);!dt.done;Ze++,dt=K.next())dt=te(_e,V,Ze,dt.value,ue),dt!==null&&(r&&dt.alternate!==null&&_e.delete(dt.key===null?Ze:dt.key),q=v(dt,q,Ze),ct===null?ze=dt:ct.sibling=dt,ct=dt);return r&&_e.forEach(function(Y2){return i(V,Y2)}),at&&ua(V,Ze),ze}function wt(V,q,K,ue){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var ze=K.key;q!==null;){if(q.key===ze){if(ze=K.type,ze===j){if(q.tag===7){s(V,q.sibling),ue=p(q,K.props.children),ue.return=V,V=ue;break e}}else if(q.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===U&&Yi(ze)===q.type){s(V,q.sibling),ue=p(q,K.props),jo(ue,K),ue.return=V,V=ue;break e}s(V,q);break}else i(V,q);q=q.sibling}K.type===j?(ue=Zi(K.props.children,V.mode,ue,K.key),ue.return=V,V=ue):(ue=Sc(K.type,K.key,K.props,null,V.mode,ue),jo(ue,K),ue.return=V,V=ue)}return S(V);case k:e:{for(ze=K.key;q!==null;){if(q.key===ze)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){s(V,q.sibling),ue=p(q,K.children||[]),ue.return=V,V=ue;break e}else{s(V,q);break}else i(V,q);q=q.sibling}ue=gh(K,V.mode,ue),ue.return=V,V=ue}return S(V);case U:return K=Yi(K),wt(V,q,K,ue)}if(J(K))return Ce(V,q,K,ue);if(le(K)){if(ze=le(K),typeof ze!="function")throw Error(a(150));return K=ze.call(K),Le(V,q,K,ue)}if(typeof K.then=="function")return wt(V,q,Tc(K),ue);if(K.$$typeof===O)return wt(V,q,Cc(V,K),ue);Ac(V,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,q!==null&&q.tag===6?(s(V,q.sibling),ue=p(q,K),ue.return=V,V=ue):(s(V,q),ue=ph(K,V.mode,ue),ue.return=V,V=ue),S(V)):s(V,q)}return function(V,q,K,ue){try{ko=0;var ze=wt(V,q,K,ue);return Ql=null,ze}catch(_e){if(_e===Vl||_e===Nc)throw _e;var ct=tr(29,_e,null,V.mode);return ct.lanes=ue,ct.return=V,ct}finally{}}}var Ji=jb(!0),Cb=jb(!1),Ha=!1;function _h(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Th(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Za(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Va(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(ht&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=wc(r),ob(r,null,s),i}return xc(r,d,i,s),wc(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,sc(r,s)}}function Ah(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 Rh=!1;function Eo(){if(Rh){var r=Zl;if(r!==null)throw r}}function No(r,i,s,d){Rh=!1;var p=r.updateQueue;Ha=!1;var v=p.firstBaseUpdate,S=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var F=_,G=F.next;F.next=null,S===null?v=G:S.next=G,S=F;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,_=ie.lastBaseUpdate,_!==S&&(_===null?ie.firstBaseUpdate=G:_.next=G,ie.lastBaseUpdate=F))}if(v!==null){var de=p.baseState;S=0,ie=G=F=null,_=v;do{var X=_.lane&-536870913,te=X!==_.lane;if(te?(tt&X)===X:(d&X)===X){X!==0&&X===Hl&&(Rh=!0),ie!==null&&(ie=ie.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Ce=r,Le=_;X=i;var wt=s;switch(Le.tag){case 1:if(Ce=Le.payload,typeof Ce=="function"){de=Ce.call(wt,de,X);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Le.payload,X=typeof Ce=="function"?Ce.call(wt,de,X):Ce,X==null)break e;de=g({},de,X);break e;case 2:Ha=!0}}X=_.callback,X!==null&&(r.flags|=64,te&&(r.flags|=8192),te=p.callbacks,te===null?p.callbacks=[X]:te.push(X))}else te={lane:X,tag:_.tag,payload:_.payload,callback:_.callback,next:null},ie===null?(G=ie=te,F=de):ie=ie.next=te,S|=X;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;te=_,_=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);ie===null&&(F=de),p.baseState=F,p.firstBaseUpdate=G,p.lastBaseUpdate=ie,v===null&&(p.shared.lanes=0),Xa|=S,r.lanes=S,r.memoizedState=de}}function Eb(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Nb(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)Eb(s[r],i)}var Kl=L(null),Rc=L(0);function _b(r,i){r=xa,T(Rc,r),T(Kl,i),xa=r|i.baseLanes}function zh(){T(Rc,xa),T(Kl,Kl.current)}function Oh(){xa=Rc.current,P(Kl),P(Rc)}var nr=L(null),Sr=null;function Qa(r){var i=r.alternate;T(Ht,Ht.current&1),T(nr,r),Sr===null&&(i===null||Kl.current!==null||i.memoizedState!==null)&&(Sr=r)}function Mh(r){T(Ht,Ht.current),T(nr,r),Sr===null&&(Sr=r)}function Tb(r){r.tag===22?(T(Ht,Ht.current),T(nr,r),Sr===null&&(Sr=r)):Ka()}function Ka(){T(Ht,Ht.current),T(nr,nr.current)}function rr(r){P(nr),Sr===r&&(Sr=null),P(Ht)}var Ht=L(0);function zc(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Bm(s)||$m(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 fa=0,qe=null,bt=null,Kt=null,Oc=!1,Gl=!1,Wi=!1,Mc=0,_o=0,Yl=null,B_=0;function Pt(){throw Error(a(321))}function Dh(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!er(r[s],i[s]))return!1;return!0}function Ih(r,i,s,d,p,v){return fa=v,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=r===null||r.memoizedState===null?fx:Xh,Wi=!1,v=s(d,p),Wi=!1,Gl&&(v=Rb(i,s,d,p)),Ab(r),v}function Ab(r){H.H=Ro;var i=bt!==null&&bt.next!==null;if(fa=0,Kt=bt=qe=null,Oc=!1,_o=0,Yl=null,i)throw Error(a(300));r===null||Gt||(r=r.dependencies,r!==null&&jc(r)&&(Gt=!0))}function Rb(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,Kt=bt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}H.H=hx,v=i(s,d)}while(Gl);return v}function $_(){var r=H.H,i=r.useState()[0];return i=typeof i.then=="function"?To(i):i,r=r.useState()[0],(bt!==null?bt.memoizedState:null)!==r&&(qe.flags|=1024),i}function Lh(){var r=Mc!==0;return Mc=0,r}function Uh(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function Ph(r){if(Oc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Oc=!1}fa=0,Kt=bt=qe=null,Gl=!1,_o=Mc=0,Yl=null}function On(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?qe.memoizedState=Kt=r:Kt=Kt.next=r,Kt}function Zt(){if(bt===null){var r=qe.alternate;r=r!==null?r.memoizedState:null}else r=bt.next;var i=Kt===null?qe.memoizedState:Kt.next;if(i!==null)Kt=i,bt=r;else{if(r===null)throw qe.alternate===null?Error(a(467)):Error(a(310));bt=r,r={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Kt===null?qe.memoizedState=Kt=r:Kt=Kt.next=r}return Kt}function Dc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(r){var i=_o;return _o+=1,Yl===null&&(Yl=[]),r=wb(Yl,r,i),i=qe,(Kt===null?i.memoizedState:Kt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?fx:Xh),r}function Ic(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return To(r);if(r.$$typeof===O)return xn(r)}throw Error(a(438,String(r)))}function Bh(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=Dc(),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]=I;return i.index++,s}function ha(r,i){return typeof i=="function"?i(r):i}function Lc(r){var i=Zt();return $h(i,bt,r)}function $h(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 _=S=null,F=null,G=i,ie=!1;do{var de=G.lane&-536870913;if(de!==G.lane?(tt&de)===de:(fa&de)===de){var X=G.revertLane;if(X===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),de===Hl&&(ie=!0);else if((fa&X)===X){G=G.next,X===Hl&&(ie=!0);continue}else de={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},F===null?(_=F=de,S=v):F=F.next=de,qe.lanes|=X,Xa|=X;de=G.action,Wi&&s(v,de),v=G.hasEagerState?G.eagerState:s(v,de)}else X={lane:de,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},F===null?(_=F=X,S=v):F=F.next=X,qe.lanes|=de,Xa|=de;G=G.next}while(G!==null&&G!==i);if(F===null?S=v:F.next=_,!er(v,r.memoizedState)&&(Gt=!0,ie&&(s=Zl,s!==null)))throw s;r.memoizedState=v,r.baseState=S,r.baseQueue=F,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Fh(r){var i=Zt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,v=i.memoizedState;if(p!==null){s.pending=null;var S=p=p.next;do v=r(v,S.action),S=S.next;while(S!==p);er(v,i.memoizedState)||(Gt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),s.lastRenderedState=v}return[v,d]}function zb(r,i,s){var d=qe,p=Zt(),v=at;if(v){if(s===void 0)throw Error(a(407));s=s()}else s=i();var S=!er((bt||p).memoizedState,s);if(S&&(p.memoizedState=s,Gt=!0),p=p.queue,Zh(Db.bind(null,d,p,r),[r]),p.getSnapshot!==i||S||Kt!==null&&Kt.memoizedState.tag&1){if(d.flags|=2048,Xl(9,{destroy:void 0},Mb.bind(null,d,p,s,i),null),kt===null)throw Error(a(349));v||(fa&127)!==0||Ob(d,i,s)}return s}function Ob(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=Dc(),qe.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function Mb(r,i,s,d){i.value=s,i.getSnapshot=d,Ib(i)&&Lb(r)}function Db(r,i,s){return s(function(){Ib(i)&&Lb(r)})}function Ib(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!er(r,s)}catch{return!0}}function Lb(r){var i=Hi(r,2);i!==null&&Vn(i,r,2)}function qh(r){var i=On();if(typeof r=="function"){var s=r;if(r=s(),Wi){gn(!0);try{s()}finally{gn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:r},i}function Ub(r,i,s,d){return r.baseState=s,$h(r,bt,typeof d=="function"?d:ha)}function F_(r,i,s,d,p){if(Bc(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)}};H.T!==null?s(!0):v.isTransition=!1,d(v),s=i.pending,s===null?(v.next=i.pending=v,Pb(i,v)):(v.next=s.next,i.pending=s.next=v)}}function Pb(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=H.T,S={};H.T=S;try{var _=s(p,d),F=H.S;F!==null&&F(S,_),Bb(r,i,_)}catch(G){Hh(r,i,G)}finally{v!==null&&S.types!==null&&(v.types=S.types),H.T=v}}else try{v=s(p,d),Bb(r,i,v)}catch(G){Hh(r,i,G)}}function Bb(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){$b(r,i,d)},function(d){return Hh(r,i,d)}):$b(r,i,s)}function $b(r,i,s){i.status="fulfilled",i.value=s,Fb(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,Pb(r,s)))}function Hh(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,Fb(i),i=i.next;while(i!==d)}r.action=null}function Fb(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function qb(r,i){return i}function Hb(r,i){if(at){var s=kt.formState;if(s!==null){e:{var d=qe;if(at){if(_t){t:{for(var p=_t,v=wr;p.nodeType!==8;){if(!v){p=null;break t}if(p=kr(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){_t=kr(p.nextSibling),d=p.data==="F!";break e}}Fa(d)}d=!1}d&&(i=s[0])}}return s=On(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qb,lastRenderedState:i},s.queue=d,s=ux.bind(null,qe,d),d.dispatch=s,d=qh(!1),v=Yh.bind(null,qe,!1,d.queue),d=On(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=F_.bind(null,qe,p,v,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function Zb(r){var i=Zt();return Vb(i,bt,r)}function Vb(r,i,s){if(i=$h(r,i,qb)[0],r=Lc(ha)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=To(i)}catch(S){throw S===Vl?Nc:S}else d=i;i=Zt();var p=i.queue,v=p.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,Xl(9,{destroy:void 0},q_.bind(null,p,s),null)),[d,v,r]}function q_(r,i){r.action=i}function Qb(r){var i=Zt(),s=bt;if(s!==null)return Vb(i,s,r);Zt(),i=i.memoizedState,s=Zt();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=Dc(),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 Kb(){return Zt().memoizedState}function Uc(r,i,s,d){var p=On();qe.flags|=r,p.memoizedState=Xl(1|i,{destroy:void 0},s,d===void 0?null:d)}function Pc(r,i,s,d){var p=Zt();d=d===void 0?null:d;var v=p.memoizedState.inst;bt!==null&&d!==null&&Dh(d,bt.memoizedState.deps)?p.memoizedState=Xl(i,v,s,d):(qe.flags|=r,p.memoizedState=Xl(1|i,v,s,d))}function Gb(r,i){Uc(8390656,8,r,i)}function Zh(r,i){Pc(2048,8,r,i)}function H_(r){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=Dc(),qe.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function Yb(r){var i=Zt().memoizedState;return H_({ref:i,nextImpl:r}),function(){if((ht&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Xb(r,i){return Pc(4,2,r,i)}function Jb(r,i){return Pc(4,4,r,i)}function Wb(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 ex(r,i,s){s=s!=null?s.concat([r]):null,Pc(4,4,Wb.bind(null,i,r),s)}function Vh(){}function tx(r,i){var s=Zt();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Dh(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function nx(r,i){var s=Zt();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Dh(i,d[1]))return d[0];if(d=r(),Wi){gn(!0);try{r()}finally{gn(!1)}}return s.memoizedState=[d,i],d}function Qh(r,i,s){return s===void 0||(fa&1073741824)!==0&&(tt&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=r0(),qe.lanes|=r,Xa|=r,s)}function rx(r,i,s,d){return er(s,i)?s:Kl.current!==null?(r=Qh(r,s,d),er(r,i)||(Gt=!0),r):(fa&42)===0||(fa&1073741824)!==0&&(tt&261930)===0?(Gt=!0,r.memoizedState=s):(r=r0(),qe.lanes|=r,Xa|=r,i)}function ax(r,i,s,d,p){var v=ee.p;ee.p=v!==0&&8>v?v:8;var S=H.T,_={};H.T=_,Yh(r,!1,i,s);try{var F=p(),G=H.S;if(G!==null&&G(_,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var ie=P_(F,d);Ao(r,i,ie,lr(r))}else Ao(r,i,d,lr(r))}catch(de){Ao(r,i,{then:function(){},status:"rejected",reason:de},lr())}finally{ee.p=v,S!==null&&_.types!==null&&(S.types=_.types),H.T=S}}function Z_(){}function Kh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=ix(r).queue;ax(r,p,i,be,s===null?Z_:function(){return lx(r),s(d)})}function ix(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:be},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ha,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function lx(r){var i=ix(r);i.next===null&&(i=r.alternate.memoizedState),Ao(r,i.next.queue,{},lr())}function Gh(){return xn(Qo)}function sx(){return Zt().memoizedState}function ox(){return Zt().memoizedState}function V_(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=lr();r=Za(s);var d=Va(i,r,s);d!==null&&(Vn(d,i,s),Co(d,i,s)),i={cache:jh()},r.payload=i;return}i=i.return}}function Q_(r,i,s){var d=lr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Bc(r)?cx(i,s):(s=hh(r,i,s,d),s!==null&&(Vn(s,r,d),dx(s,i,d)))}function ux(r,i,s){var d=lr();Ao(r,i,s,d)}function Ao(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Bc(r))cx(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,_=v(S,s);if(p.hasEagerState=!0,p.eagerState=_,er(_,S))return xc(r,i,p,0),kt===null&&bc(),!1}catch{}finally{}if(s=hh(r,i,p,d),s!==null)return Vn(s,r,d),dx(s,i,d),!0}return!1}function Yh(r,i,s,d){if(d={lane:2,revertLane:_m(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Bc(r)){if(i)throw Error(a(479))}else i=hh(r,s,d,2),i!==null&&Vn(i,r,2)}function Bc(r){var i=r.alternate;return r===qe||i!==null&&i===qe}function cx(r,i){Gl=Oc=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function dx(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,sc(r,s)}}var Ro={readContext:xn,use:Ic,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};Ro.useEffectEvent=Pt;var fx={readContext:xn,use:Ic,useCallback:function(r,i){return On().memoizedState=[r,i===void 0?null:i],r},useContext:xn,useEffect:Gb,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Uc(4194308,4,Wb.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Uc(4194308,4,r,i)},useInsertionEffect:function(r,i){Uc(4,2,r,i)},useMemo:function(r,i){var s=On();i=i===void 0?null:i;var d=r();if(Wi){gn(!0);try{r()}finally{gn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=On();if(s!==void 0){var p=s(i);if(Wi){gn(!0);try{s(i)}finally{gn(!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=Q_.bind(null,qe,r),[d.memoizedState,r]},useRef:function(r){var i=On();return r={current:r},i.memoizedState=r},useState:function(r){r=qh(r);var i=r.queue,s=ux.bind(null,qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Vh,useDeferredValue:function(r,i){var s=On();return Qh(s,r,i)},useTransition:function(){var r=qh(!1);return r=ax.bind(null,qe,r.queue,!0,!1),On().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=qe,p=On();if(at){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),kt===null)throw Error(a(349));(tt&127)!==0||Ob(d,i,s)}p.memoizedState=s;var v={value:s,getSnapshot:i};return p.queue=v,Gb(Db.bind(null,d,v,r),[r]),d.flags|=2048,Xl(9,{destroy:void 0},Mb.bind(null,d,v,s,i),null),s},useId:function(){var r=On(),i=kt.identifierPrefix;if(at){var s=Qr,d=Vr;s=(d&~(1<<32-mt(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Mc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=B_++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Gh,useFormState:Hb,useActionState:Hb,useOptimistic:function(r){var i=On();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=Yh.bind(null,qe,!0,s),s.dispatch=i,[r,i]},useMemoCache:Bh,useCacheRefresh:function(){return On().memoizedState=V_.bind(null,qe)},useEffectEvent:function(r){var i=On(),s={impl:r};return i.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Xh={readContext:xn,use:Ic,useCallback:tx,useContext:xn,useEffect:Zh,useImperativeHandle:ex,useInsertionEffect:Xb,useLayoutEffect:Jb,useMemo:nx,useReducer:Lc,useRef:Kb,useState:function(){return Lc(ha)},useDebugValue:Vh,useDeferredValue:function(r,i){var s=Zt();return rx(s,bt.memoizedState,r,i)},useTransition:function(){var r=Lc(ha)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:To(r),i]},useSyncExternalStore:zb,useId:sx,useHostTransitionStatus:Gh,useFormState:Zb,useActionState:Zb,useOptimistic:function(r,i){var s=Zt();return Ub(s,bt,r,i)},useMemoCache:Bh,useCacheRefresh:ox};Xh.useEffectEvent=Yb;var hx={readContext:xn,use:Ic,useCallback:tx,useContext:xn,useEffect:Zh,useImperativeHandle:ex,useInsertionEffect:Xb,useLayoutEffect:Jb,useMemo:nx,useReducer:Fh,useRef:Kb,useState:function(){return Fh(ha)},useDebugValue:Vh,useDeferredValue:function(r,i){var s=Zt();return bt===null?Qh(s,r,i):rx(s,bt.memoizedState,r,i)},useTransition:function(){var r=Fh(ha)[0],i=Zt().memoizedState;return[typeof r=="boolean"?r:To(r),i]},useSyncExternalStore:zb,useId:sx,useHostTransitionStatus:Gh,useFormState:Qb,useActionState:Qb,useOptimistic:function(r,i){var s=Zt();return bt!==null?Ub(s,bt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:Bh,useCacheRefresh:ox};hx.useEffectEvent=Yb;function Jh(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 Wh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=lr(),p=Za(d);p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(Vn(i,r,d),Co(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=lr(),p=Za(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=Va(r,p,d),i!==null&&(Vn(i,r,d),Co(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=lr(),d=Za(s);d.tag=2,i!=null&&(d.callback=i),i=Va(r,d,s),i!==null&&(Vn(i,r,s),Co(i,r,s))}};function mx(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 px(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&&Wh.enqueueReplaceState(i,i.state,null)}function el(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=g({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function gx(r){vc(r)}function yx(r){console.error(r)}function vx(r){vc(r)}function $c(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function bx(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 em(r,i,s){return s=Za(s),s.tag=3,s.payload={element:null},s.callback=function(){$c(r,i)},s}function xx(r){return r=Za(r),r.tag=3,r}function wx(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(){bx(i,s,d)}}var S=s.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(r.callback=function(){bx(i,s,d),typeof p!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function K_(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=nr.current,s!==null){switch(s.tag){case 31:case 13:return Sr===null?Wc():s.alternate===null&&Bt===0&&(Bt=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===_c?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),Cm(r,d,p)),!1;case 22:return s.flags|=65536,d===_c?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)),Cm(r,d,p)),!1}throw Error(a(435,s.tag))}return Cm(r,d,p),Wc(),!1}if(at)return i=nr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==bh&&(r=Error(a(422),{cause:d}),xo(vr(r,s)))):(d!==bh&&(i=Error(a(423),{cause:d}),xo(vr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=vr(d,s),p=em(r.stateNode,d,p),Ah(r,p),Bt!==4&&(Bt=2)),!1;var v=Error(a(520),{cause:d});if(v=vr(v,s),Po===null?Po=[v]:Po.push(v),Bt!==4&&(Bt=2),i===null)return!0;d=vr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=em(s.stateNode,d,r),Ah(s,r),!1;case 1:if(i=s.type,v=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ja===null||!Ja.has(v))))return s.flags|=65536,p&=-p,s.lanes|=p,p=xx(p),wx(p,r,s,d),Ah(s,p),!1}s=s.return}while(s!==null);return!1}var tm=Error(a(461)),Gt=!1;function wn(r,i,s,d){i.child=r===null?Cb(i,null,s,d):Ji(i,r.child,s,d)}function Sx(r,i,s,d,p){s=s.render;var v=i.ref;if("ref"in d){var S={};for(var _ in d)_!=="ref"&&(S[_]=d[_])}else S=d;return Ki(i),d=Ih(r,i,s,S,v,p),_=Lh(),r!==null&&!Gt?(Uh(r,i,p),ma(r,i,p)):(at&&_&&yh(i),i.flags|=1,wn(r,i,d,p),i.child)}function kx(r,i,s,d,p){if(r===null){var v=s.type;return typeof v=="function"&&!mh(v)&&v.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=v,jx(r,i,v,d,p)):(r=Sc(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!um(r,p)){var S=v.memoizedProps;if(s=s.compare,s=s!==null?s:yo,s(S,d)&&r.ref===i.ref)return ma(r,i,p)}return i.flags|=1,r=oa(v,d),r.ref=i.ref,r.return=i,i.child=r}function jx(r,i,s,d,p){if(r!==null){var v=r.memoizedProps;if(yo(v,d)&&r.ref===i.ref)if(Gt=!1,i.pendingProps=d=v,um(r,p))(r.flags&131072)!==0&&(Gt=!0);else return i.lanes=r.lanes,ma(r,i,p)}return nm(r,i,s,d,p)}function Cx(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 Ex(r,i,v,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Ec(i,v!==null?v.cachePool:null),v!==null?_b(i,v):zh(),Tb(i);else return d=i.lanes=536870912,Ex(r,i,v!==null?v.baseLanes|s:s,s,d)}else v!==null?(Ec(i,v.cachePool),_b(i,v),Ka(),i.memoizedState=null):(r!==null&&Ec(i,null),zh(),Ka());return wn(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 Ex(r,i,s,d,p){var v=Eh();return v=v===null?null:{parent:Qt._currentValue,pool:v},i.memoizedState={baseLanes:s,cachePool:v},r!==null&&Ec(i,null),zh(),Tb(i),r!==null&&ql(r,i,d,!0),i.childLanes=p,null}function Fc(r,i){return i=Hc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function Nx(r,i,s){return Ji(i,r.child,null,s),r=Fc(i,i.pendingProps),r.flags|=2,rr(i),i.memoizedState=null,r}function G_(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(at){if(d.mode==="hidden")return r=Fc(i,d),i.lanes=536870912,zo(null,r);if(Mh(i),(r=_t)?(r=P0(r,wr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Vr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=cb(r),s.return=i,i.child=s,bn=i,_t=null)):r=null,r===null)throw Fa(i);return i.lanes=536870912,null}return Fc(i,d)}var v=r.memoizedState;if(v!==null){var S=v.dehydrated;if(Mh(i),p)if(i.flags&256)i.flags&=-257,i=Nx(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Gt||ql(r,i,s,!1),p=(s&r.childLanes)!==0,Gt||p){if(d=kt,d!==null&&(S=yv(d,s),S!==0&&S!==v.retryLane))throw v.retryLane=S,Hi(r,S),Vn(d,r,S),tm;Wc(),i=Nx(r,i,s)}else r=v.treeContext,_t=kr(S.nextSibling),bn=i,at=!0,$a=null,wr=!1,r!==null&&hb(i,r),i=Fc(i,d),i.flags|=4096;return i}return r=oa(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function qc(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 nm(r,i,s,d,p){return Ki(i),s=Ih(r,i,s,d,void 0,p),d=Lh(),r!==null&&!Gt?(Uh(r,i,p),ma(r,i,p)):(at&&d&&yh(i),i.flags|=1,wn(r,i,s,p),i.child)}function _x(r,i,s,d,p,v){return Ki(i),i.updateQueue=null,s=Rb(i,d,s,p),Ab(r),d=Lh(),r!==null&&!Gt?(Uh(r,i,v),ma(r,i,v)):(at&&d&&yh(i),i.flags|=1,wn(r,i,s,v),i.child)}function Tx(r,i,s,d,p){if(Ki(i),i.stateNode===null){var v=Pl,S=s.contextType;typeof S=="object"&&S!==null&&(v=xn(S)),v=new s(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Wh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},_h(i),S=s.contextType,v.context=typeof S=="object"&&S!==null?xn(S):Pl,v.state=i.memoizedState,S=s.getDerivedStateFromProps,typeof S=="function"&&(Jh(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&&Wh.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 _=i.memoizedProps,F=el(s,_);v.props=F;var G=v.context,ie=s.contextType;S=Pl,typeof ie=="object"&&ie!==null&&(S=xn(ie));var de=s.getDerivedStateFromProps;ie=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,ie||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_||G!==S)&&px(i,v,d,S),Ha=!1;var X=i.memoizedState;v.state=X,No(i,d,v,p),Eo(),G=i.memoizedState,_||X!==G||Ha?(typeof de=="function"&&(Jh(i,s,de,d),G=i.memoizedState),(F=Ha||mx(i,s,F,d,X,G,S))?(ie||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=G),v.props=d,v.state=G,v.context=S,d=F):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Th(r,i),S=i.memoizedProps,ie=el(s,S),v.props=ie,de=i.pendingProps,X=v.context,G=s.contextType,F=Pl,typeof G=="object"&&G!==null&&(F=xn(G)),_=s.getDerivedStateFromProps,(G=typeof _=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(S!==de||X!==F)&&px(i,v,d,F),Ha=!1,X=i.memoizedState,v.state=X,No(i,d,v,p),Eo();var te=i.memoizedState;S!==de||X!==te||Ha||r!==null&&r.dependencies!==null&&jc(r.dependencies)?(typeof _=="function"&&(Jh(i,s,_,d),te=i.memoizedState),(ie=Ha||mx(i,s,ie,d,X,te,F)||r!==null&&r.dependencies!==null&&jc(r.dependencies))?(G||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,te,F),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,te,F)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=te),v.props=d,v.state=te,v.context=F,d=ie):(typeof v.componentDidUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||S===r.memoizedProps&&X===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,qc(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=Ji(i,r.child,null,p),i.child=Ji(i,null,s,p)):wn(r,i,s,p),i.memoizedState=v.state,r=i.child):r=ma(r,i,p),r}function Ax(r,i,s,d){return Vi(),i.flags|=256,wn(r,i,s,d),i.child}var rm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function am(r){return{baseLanes:r,cachePool:bb()}}function im(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=ir),r}function Rx(r,i,s){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,S;if((S=v)||(S=r!==null&&r.memoizedState===null?!1:(Ht.current&2)!==0),S&&(p=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,r===null){if(at){if(p?Qa(i):Ka(),(r=_t)?(r=P0(r,wr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:Ba!==null?{id:Vr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=cb(r),s.return=i,i.child=s,bn=i,_t=null)):r=null,r===null)throw Fa(i);return $m(r)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,p?(Ka(),p=i.mode,_=Hc({mode:"hidden",children:_},p),d=Zi(d,p,s,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=am(s),d.childLanes=im(r,S,s),i.memoizedState=rm,zo(null,d)):(Qa(i),lm(i,_))}var F=r.memoizedState;if(F!==null&&(_=F.dehydrated,_!==null)){if(v)i.flags&256?(Qa(i),i.flags&=-257,i=sm(r,i,s)):i.memoizedState!==null?(Ka(),i.child=r.child,i.flags|=128,i=null):(Ka(),_=d.fallback,p=i.mode,d=Hc({mode:"visible",children:d.children},p),_=Zi(_,p,s,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,Ji(i,r.child,null,s),d=i.child,d.memoizedState=am(s),d.childLanes=im(r,S,s),i.memoizedState=rm,i=zo(null,d));else if(Qa(i),$m(_)){if(S=_.nextSibling&&_.nextSibling.dataset,S)var G=S.dgst;S=G,d=Error(a(419)),d.stack="",d.digest=S,xo({value:d,source:null,stack:null}),i=sm(r,i,s)}else if(Gt||ql(r,i,s,!1),S=(s&r.childLanes)!==0,Gt||S){if(S=kt,S!==null&&(d=yv(S,s),d!==0&&d!==F.retryLane))throw F.retryLane=d,Hi(r,d),Vn(S,r,d),tm;Bm(_)||Wc(),i=sm(r,i,s)}else Bm(_)?(i.flags|=192,i.child=r.child,i=null):(r=F.treeContext,_t=kr(_.nextSibling),bn=i,at=!0,$a=null,wr=!1,r!==null&&hb(i,r),i=lm(i,d.children),i.flags|=4096);return i}return p?(Ka(),_=d.fallback,p=i.mode,F=r.child,G=F.sibling,d=oa(F,{mode:"hidden",children:d.children}),d.subtreeFlags=F.subtreeFlags&65011712,G!==null?_=oa(G,_):(_=Zi(_,p,s,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,zo(null,d),d=i.child,_=r.child.memoizedState,_===null?_=am(s):(p=_.cachePool,p!==null?(F=Qt._currentValue,p=p.parent!==F?{parent:F,pool:F}:p):p=bb(),_={baseLanes:_.baseLanes|s,cachePool:p}),d.memoizedState=_,d.childLanes=im(r,S,s),i.memoizedState=rm,zo(r.child,d)):(Qa(i),s=r.child,r=s.sibling,s=oa(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 lm(r,i){return i=Hc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Hc(r,i){return r=tr(22,r,null,i),r.lanes=0,r}function sm(r,i,s){return Ji(i,r.child,null,s),r=lm(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function zx(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),Sh(r.return,i,s)}function om(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 Ox(r,i,s){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var S=Ht.current,_=(S&2)!==0;if(_?(S=S&1|2,i.flags|=128):S&=1,T(Ht,S),wn(r,i,d,s),d=at?bo:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&zx(r,s,i);else if(r.tag===19)zx(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&&zc(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),om(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&&zc(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}om(i,!0,s,null,v,d);break;case"together":om(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ma(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),Xa|=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=oa(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=oa(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function um(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&jc(r)))}function Y_(r,i,s){switch(i.tag){case 3:ge(i,i.stateNode.containerInfo),qa(i,Qt,r.memoizedState.cache),Vi();break;case 27:case 5:Qe(i);break;case 4:ge(i,i.stateNode.containerInfo);break;case 10:qa(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Mh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Qa(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Rx(r,i,s):(Qa(i),r=ma(r,i,s),r!==null?r.sibling:null);Qa(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(ql(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return Ox(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(Ht,Ht.current),d)break;return null;case 22:return i.lanes=0,Cx(r,i,s,i.pendingProps);case 24:qa(i,Qt,r.memoizedState.cache)}return ma(r,i,s)}function Mx(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Gt=!0;else{if(!um(r,s)&&(i.flags&128)===0)return Gt=!1,Y_(r,i,s);Gt=(r.flags&131072)!==0}else Gt=!1,at&&(i.flags&1048576)!==0&&fb(i,bo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Yi(i.elementType),i.type=r,typeof r=="function")mh(r)?(d=el(r,d),i.tag=1,i=Tx(null,i,r,d,s)):(i.tag=0,i=nm(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===M){i.tag=11,i=Sx(null,i,r,d,s);break e}else if(p===$){i.tag=14,i=kx(null,i,r,d,s);break e}}throw i=Y(r)||r,Error(a(306,i,""))}}return i;case 0:return nm(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=el(d,i.pendingProps),Tx(r,i,d,p,s);case 3:e:{if(ge(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Th(r,i),No(i,d,null,s);var S=i.memoizedState;if(d=S.cache,qa(i,Qt,d),d!==v.cache&&kh(i,[Qt],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=Ax(r,i,d,s);break e}else if(d!==p){p=vr(Error(a(424)),i),xo(p),i=Ax(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(_t=kr(r.firstChild),bn=i,at=!0,$a=null,wr=!0,s=Cb(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Vi(),d===p){i=ma(r,i,s);break e}wn(r,i,d,s)}i=i.child}return i;case 26:return qc(r,i),r===null?(s=Z0(i.type,null,i.pendingProps,null))?i.memoizedState=s:at||(s=i.type,r=i.pendingProps,d=ld(ce.current).createElement(s),d[vn]=i,d[Bn]=r,Sn(d,s,r),un(d),i.stateNode=d):i.memoizedState=Z0(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Qe(i),r===null&&at&&(d=i.stateNode=F0(i.type,i.pendingProps,ce.current),bn=i,wr=!0,p=_t,ni(i.type)?(Fm=p,_t=kr(d.firstChild)):_t=p),wn(r,i,i.pendingProps.children,s),qc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&at&&((p=d=_t)&&(d=E2(d,i.type,i.pendingProps,wr),d!==null?(i.stateNode=d,bn=i,_t=kr(d.firstChild),wr=!1,p=!0):p=!1),p||Fa(i)),Qe(i),p=i.type,v=i.pendingProps,S=r!==null?r.memoizedProps:null,d=v.children,Lm(p,v)?d=null:S!==null&&Lm(p,S)&&(i.flags|=32),i.memoizedState!==null&&(p=Ih(r,i,$_,null,null,s),Qo._currentValue=p),qc(r,i),wn(r,i,d,s),i.child;case 6:return r===null&&at&&((r=s=_t)&&(s=N2(s,i.pendingProps,wr),s!==null?(i.stateNode=s,bn=i,_t=null,r=!0):r=!1),r||Fa(i)),null;case 13:return Rx(r,i,s);case 4:return ge(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=Ji(i,null,d,s):wn(r,i,d,s),i.child;case 11:return Sx(r,i,i.type,i.pendingProps,s);case 7:return wn(r,i,i.pendingProps,s),i.child;case 8:return wn(r,i,i.pendingProps.children,s),i.child;case 12:return wn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,qa(i,i.type,d.value),wn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,Ki(i),p=xn(p),d=d(p),i.flags|=1,wn(r,i,d,s),i.child;case 14:return kx(r,i,i.type,i.pendingProps,s);case 15:return jx(r,i,i.type,i.pendingProps,s);case 19:return Ox(r,i,s);case 31:return G_(r,i,s);case 22:return Cx(r,i,s,i.pendingProps);case 24:return Ki(i),d=xn(Qt),r===null?(p=Eh(),p===null&&(p=kt,v=jh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=s),p=v),i.memoizedState={parent:d,cache:p},_h(i),qa(i,Qt,p)):((r.lanes&s)!==0&&(Th(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),qa(i,Qt,d)):(d=v.cache,qa(i,Qt,d),d!==p.cache&&kh(i,[Qt],s,!0))),wn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function pa(r){r.flags|=4}function cm(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(s0())r.flags|=8192;else throw Xi=_c,Nh}else r.flags&=-16777217}function Dx(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Y0(i))if(s0())r.flags|=8192;else throw Xi=_c,Nh}function Zc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?xe():536870912,r.lanes|=i,ts|=i)}function Oo(r,i){if(!at)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 Tt(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 X_(r,i,s){var d=i.pendingProps;switch(vh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(i),null;case 1:return Tt(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),da(Qt),fe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(Fl(i)?pa(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,xh())),Tt(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(pa(i),v!==null?(Tt(i),Dx(i,v)):(Tt(i),cm(i,p,null,d,s))):v?v!==r.memoizedState?(pa(i),Tt(i),Dx(i,v)):(Tt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&pa(i),Tt(i),cm(i,p,r,d,s)),null;case 27:if(Oe(i),s=ce.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&pa(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Tt(i),null}r=Z.current,Fl(i)?mb(i):(r=F0(p,d,s),i.stateNode=r,pa(i))}return Tt(i),null;case 5:if(Oe(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&pa(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return Tt(i),null}if(v=Z.current,Fl(i))mb(i);else{var S=ld(ce.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[vn]=i,v[Bn]=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(Sn(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&&pa(i)}}return Tt(i),cm(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&pa(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ce.current,Fl(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=bn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[vn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||R0(r.nodeValue,s)),r||Fa(i,!0)}else r=ld(r).createTextNode(d),r[vn]=i,i.stateNode=r}return Tt(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[vn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Tt(i),r=!1}else s=xh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(rr(i),i):(rr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Tt(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[vn]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Tt(i),p=!1}else p=xh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(rr(i),i):(rr(i),null)}return rr(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),Zc(i,i.updateQueue),Tt(i),null);case 4:return fe(),r===null&&zm(i.stateNode.containerInfo),Tt(i),null;case 10:return da(i.type),Tt(i),null;case 19:if(P(Ht),d=i.memoizedState,d===null)return Tt(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)Oo(d,!1);else{if(Bt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=zc(r),v!==null){for(i.flags|=128,Oo(d,!1),r=v.updateQueue,i.updateQueue=r,Zc(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)ub(s,r),s=s.sibling;return T(Ht,Ht.current&1|2),at&&ua(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&mn()>Yc&&(i.flags|=128,p=!0,Oo(d,!1),i.lanes=4194304)}else{if(!p)if(r=zc(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Zc(i,r),Oo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!at)return Tt(i),null}else 2*mn()-d.renderingStartTime>Yc&&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=mn(),r.sibling=null,s=Ht.current,T(Ht,p?s&1|2:s&1),at&&ua(i,d.treeForkCount),r):(Tt(i),null);case 22:case 23:return rr(i),Oh(),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&&(Tt(i),i.subtreeFlags&6&&(i.flags|=8192)):Tt(i),s=i.updateQueue,s!==null&&Zc(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(Gi),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),da(Qt),Tt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function J_(r,i){switch(vh(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return da(Qt),fe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Oe(i),null;case 31:if(i.memoizedState!==null){if(rr(i),i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(rr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Vi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return P(Ht),null;case 4:return fe(),null;case 10:return da(i.type),null;case 22:case 23:return rr(i),Oh(),r!==null&&P(Gi),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return da(Qt),null;case 25:return null;default:return null}}function Ix(r,i){switch(vh(i),i.tag){case 3:da(Qt),fe();break;case 26:case 27:case 5:Oe(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&rr(i);break;case 13:rr(i);break;case 19:P(Ht);break;case 10:da(i.type);break;case 22:case 23:rr(i),Oh(),r!==null&&P(Gi);break;case 24:da(Qt)}}function Mo(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(_){vt(i,i.return,_)}}function Ga(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var S=d.inst,_=S.destroy;if(_!==void 0){S.destroy=void 0,p=i;var F=s,G=_;try{G()}catch(ie){vt(p,F,ie)}}}d=d.next}while(d!==v)}}catch(ie){vt(i,i.return,ie)}}function Lx(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{Nb(i,s)}catch(d){vt(r,r.return,d)}}}function Ux(r,i,s){s.props=el(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){vt(r,i,d)}}function Do(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){vt(r,i,p)}}function Kr(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){vt(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){vt(r,i,p)}else s.current=null}function Px(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){vt(r,r.return,p)}}function dm(r,i,s){try{var d=r.stateNode;x2(d,r.type,s,i),d[Bn]=i}catch(p){vt(r,r.return,p)}}function Bx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ni(r.type)||r.tag===4}function fm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Bx(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ni(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function hm(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=la));else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(hm(r,i,s),r=r.sibling;r!==null;)hm(r,i,s),r=r.sibling}function Vc(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&ni(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Vc(r,i,s),r=r.sibling;r!==null;)Vc(r,i,s),r=r.sibling}function $x(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Sn(i,d,s),i[vn]=r,i[Bn]=s}catch(v){vt(r,r.return,v)}}var ga=!1,Yt=!1,mm=!1,Fx=typeof WeakSet=="function"?WeakSet:Set,cn=null;function W_(r,i){if(r=r.containerInfo,Dm=hd,r=eb(r),sh(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,_=-1,F=-1,G=0,ie=0,de=r,X=null;t:for(;;){for(var te;de!==s||p!==0&&de.nodeType!==3||(_=S+p),de!==v||d!==0&&de.nodeType!==3||(F=S+d),de.nodeType===3&&(S+=de.nodeValue.length),(te=de.firstChild)!==null;)X=de,de=te;for(;;){if(de===r)break t;if(X===s&&++G===p&&(_=S),X===v&&++ie===d&&(F=S),(te=de.nextSibling)!==null)break;de=X,X=de.parentNode}de=te}s=_===-1||F===-1?null:{start:_,end:F}}else s=null}s=s||{start:0,end:0}}else s=null;for(Im={focusedElem:r,selectionRange:s},hd=!1,cn=i;cn!==null;)if(i=cn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,cn=r;else for(;cn!==null;){switch(i=cn,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 Ce=el(s.type,p);r=d.getSnapshotBeforeUpdate(Ce,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(Le){vt(s,s.return,Le)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)Pm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Pm(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,cn=r;break}cn=i.return}}function qx(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:va(r,s),d&4&&Mo(5,s);break;case 1:if(va(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(S){vt(s,s.return,S)}else{var p=el(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(S){vt(s,s.return,S)}}d&64&&Lx(s),d&512&&Do(s,s.return);break;case 3:if(va(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{Nb(r,i)}catch(S){vt(s,s.return,S)}}break;case 27:i===null&&d&4&&$x(s);case 26:case 5:va(r,s),i===null&&d&4&&Px(s),d&512&&Do(s,s.return);break;case 12:va(r,s);break;case 31:va(r,s),d&4&&Vx(r,s);break;case 13:va(r,s),d&4&&Qx(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=o2.bind(null,s),_2(r,s))));break;case 22:if(d=s.memoizedState!==null||ga,!d){i=i!==null&&i.memoizedState!==null||Yt,p=ga;var v=Yt;ga=d,(Yt=i)&&!v?ba(r,s,(s.subtreeFlags&8772)!==0):va(r,s),ga=p,Yt=v}break;case 30:break;default:va(r,s)}}function Hx(r){var i=r.alternate;i!==null&&(r.alternate=null,Hx(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Hf(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 zt=null,Fn=!1;function ya(r,i,s){for(s=s.child;s!==null;)Zx(r,i,s),s=s.sibling}function Zx(r,i,s){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(rn,s)}catch{}switch(s.tag){case 26:Yt||Kr(s,i),ya(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Yt||Kr(s,i);var d=zt,p=Fn;ni(s.type)&&(zt=s.stateNode,Fn=!1),ya(r,i,s),Ho(s.stateNode),zt=d,Fn=p;break;case 5:Yt||Kr(s,i);case 6:if(d=zt,p=Fn,zt=null,ya(r,i,s),zt=d,Fn=p,zt!==null)if(Fn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(s.stateNode)}catch(v){vt(s,i,v)}else try{zt.removeChild(s.stateNode)}catch(v){vt(s,i,v)}break;case 18:zt!==null&&(Fn?(r=zt,L0(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),us(r)):L0(zt,s.stateNode));break;case 4:d=zt,p=Fn,zt=s.stateNode.containerInfo,Fn=!0,ya(r,i,s),zt=d,Fn=p;break;case 0:case 11:case 14:case 15:Ga(2,s,i),Yt||Ga(4,s,i),ya(r,i,s);break;case 1:Yt||(Kr(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Ux(s,i,d)),ya(r,i,s);break;case 21:ya(r,i,s);break;case 22:Yt=(d=Yt)||s.memoizedState!==null,ya(r,i,s),Yt=d;break;default:ya(r,i,s)}}function Vx(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{us(r)}catch(s){vt(i,i.return,s)}}}function Qx(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){vt(i,i.return,s)}}function e2(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Fx),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Fx),i;default:throw Error(a(435,r.tag))}}function Qc(r,i){var s=e2(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=u2.bind(null,r,d);d.then(p,p)}})}function qn(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,_=S;e:for(;_!==null;){switch(_.tag){case 27:if(ni(_.type)){zt=_.stateNode,Fn=!1;break e}break;case 5:zt=_.stateNode,Fn=!1;break e;case 3:case 4:zt=_.stateNode.containerInfo,Fn=!0;break e}_=_.return}if(zt===null)throw Error(a(160));Zx(v,S,p),zt=null,Fn=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Kx(i,r),i=i.sibling}var Lr=null;function Kx(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:qn(i,r),Hn(r),d&4&&(Ga(3,r,r.return),Mo(3,r),Ga(5,r,r.return));break;case 1:qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),d&64&&ga&&(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=Lr;if(qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(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[vn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),Sn(v,d,s),v[vn]=r,un(v),d=v;break e;case"link":var S=K0("link","href",p).get(d+(s.href||""));if(S){for(var _=0;_<S.length;_++)if(v=S[_],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(_,1);break t}}v=p.createElement(d),Sn(v,d,s),p.head.appendChild(v);break;case"meta":if(S=K0("meta","content",p).get(d+(s.content||""))){for(_=0;_<S.length;_++)if(v=S[_],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(_,1);break t}}v=p.createElement(d),Sn(v,d,s),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[vn]=r,un(v),d=v}r.stateNode=d}else G0(p,r.type,r.stateNode);else r.stateNode=Q0(p,d,r.memoizedProps);else v!==d?(v===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):v.count--,d===null?G0(p,r.type,r.stateNode):Q0(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&dm(r,r.memoizedProps,s.memoizedProps)}break;case 27:qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),s!==null&&d&4&&dm(r,r.memoizedProps,s.memoizedProps);break;case 5:if(qn(i,r),Hn(r),d&512&&(Yt||s===null||Kr(s,s.return)),r.flags&32){p=r.stateNode;try{zl(p,"")}catch(Ce){vt(r,r.return,Ce)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,dm(r,p,s!==null?s.memoizedProps:p)),d&1024&&(mm=!0);break;case 6:if(qn(i,r),Hn(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Ce){vt(r,r.return,Ce)}}break;case 3:if(ud=null,p=Lr,Lr=sd(i.containerInfo),qn(i,r),Lr=p,Hn(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{us(i.containerInfo)}catch(Ce){vt(r,r.return,Ce)}mm&&(mm=!1,Gx(r));break;case 4:d=Lr,Lr=sd(r.stateNode.containerInfo),qn(i,r),Hn(r),Lr=d;break;case 12:qn(i,r),Hn(r);break;case 31:qn(i,r),Hn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Qc(r,d)));break;case 13:qn(i,r),Hn(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Gc=mn()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Qc(r,d)));break;case 22:p=r.memoizedState!==null;var F=s!==null&&s.memoizedState!==null,G=ga,ie=Yt;if(ga=G||p,Yt=ie||F,qn(i,r),Yt=ie,ga=G,Hn(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||F||ga||Yt||tl(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){F=s=i;try{if(v=F.stateNode,p)S=v.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{_=F.stateNode;var de=F.memoizedProps.style,X=de!=null&&de.hasOwnProperty("display")?de.display:null;_.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(Ce){vt(F,F.return,Ce)}}}else if(i.tag===6){if(s===null){F=i;try{F.stateNode.nodeValue=p?"":F.memoizedProps}catch(Ce){vt(F,F.return,Ce)}}}else if(i.tag===18){if(s===null){F=i;try{var te=F.stateNode;p?U0(te,!0):U0(F.stateNode,!1)}catch(Ce){vt(F,F.return,Ce)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Qc(r,s))));break;case 19:qn(i,r),Hn(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Qc(r,d)));break;case 30:break;case 21:break;default:qn(i,r),Hn(r)}}function Hn(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(Bx(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,v=fm(r);Vc(r,v,p);break;case 5:var S=s.stateNode;s.flags&32&&(zl(S,""),s.flags&=-33);var _=fm(r);Vc(r,_,S);break;case 3:case 4:var F=s.stateNode.containerInfo,G=fm(r);hm(r,G,F);break;default:throw Error(a(161))}}catch(ie){vt(r,r.return,ie)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Gx(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Gx(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function va(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)qx(r,i.alternate,i),i=i.sibling}function tl(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Ga(4,i,i.return),tl(i);break;case 1:Kr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Ux(i,i.return,s),tl(i);break;case 27:Ho(i.stateNode);case 26:case 5:Kr(i,i.return),tl(i);break;case 22:i.memoizedState===null&&tl(i);break;case 30:tl(i);break;default:tl(i)}r=r.sibling}}function ba(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:ba(p,v,s),Mo(4,v);break;case 1:if(ba(p,v,s),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(G){vt(d,d.return,G)}if(d=v,p=d.updateQueue,p!==null){var _=d.stateNode;try{var F=p.shared.hiddenCallbacks;if(F!==null)for(p.shared.hiddenCallbacks=null,p=0;p<F.length;p++)Eb(F[p],_)}catch(G){vt(d,d.return,G)}}s&&S&64&&Lx(v),Do(v,v.return);break;case 27:$x(v);case 26:case 5:ba(p,v,s),s&&d===null&&S&4&&Px(v),Do(v,v.return);break;case 12:ba(p,v,s);break;case 31:ba(p,v,s),s&&S&4&&Vx(p,v);break;case 13:ba(p,v,s),s&&S&4&&Qx(p,v);break;case 22:v.memoizedState===null&&ba(p,v,s),Do(v,v.return);break;case 30:break;default:ba(p,v,s)}i=i.sibling}}function pm(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 gm(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 Ur(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Yx(r,i,s,d),i=i.sibling}function Yx(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Ur(r,i,s,d),p&2048&&Mo(9,i);break;case 1:Ur(r,i,s,d);break;case 3:Ur(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){Ur(r,i,s,d),r=i.stateNode;try{var v=i.memoizedProps,S=v.id,_=v.onPostCommit;typeof _=="function"&&_(S,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(F){vt(i,i.return,F)}}else Ur(r,i,s,d);break;case 31:Ur(r,i,s,d);break;case 13:Ur(r,i,s,d);break;case 23:break;case 22:v=i.stateNode,S=i.alternate,i.memoizedState!==null?v._visibility&2?Ur(r,i,s,d):Io(r,i):v._visibility&2?Ur(r,i,s,d):(v._visibility|=2,Jl(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&pm(S,i);break;case 24:Ur(r,i,s,d),p&2048&&gm(i.alternate,i);break;default:Ur(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,_=s,F=d,G=S.flags;switch(S.tag){case 0:case 11:case 15:Jl(v,S,_,F,p),Mo(8,S);break;case 23:break;case 22:var ie=S.stateNode;S.memoizedState!==null?ie._visibility&2?Jl(v,S,_,F,p):Io(v,S):(ie._visibility|=2,Jl(v,S,_,F,p)),p&&G&2048&&pm(S.alternate,S);break;case 24:Jl(v,S,_,F,p),p&&G&2048&&gm(S.alternate,S);break;default:Jl(v,S,_,F,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&&pm(d.alternate,d);break;case 24:Io(s,d),p&2048&&gm(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;)Xx(r,i,s),r=r.sibling}function Xx(r,i,s){switch(r.tag){case 26:Wl(r,i,s),r.flags&Lo&&r.memoizedState!==null&&B2(s,Lr,r.memoizedState,r.memoizedProps);break;case 5:Wl(r,i,s);break;case 3:case 4:var d=Lr;Lr=sd(r.stateNode.containerInfo),Wl(r,i,s),Lr=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 Jx(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];cn=d,e0(d,r)}Jx(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Wx(r),r=r.sibling}function Wx(r){switch(r.tag){case 0:case 11:case 15:Uo(r),r.flags&2048&&Ga(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,Kc(r)):Uo(r);break;default:Uo(r)}}function Kc(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];cn=d,e0(d,r)}Jx(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Ga(8,i,i.return),Kc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Kc(i));break;default:Kc(i)}r=r.sibling}}function e0(r,i){for(;cn!==null;){var s=cn;switch(s.tag){case 0:case 11:case 15:Ga(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:wo(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,cn=d;else e:for(s=r;cn!==null;){d=cn;var p=d.sibling,v=d.return;if(Hx(d),d===s){cn=null;break e}if(p!==null){p.return=v,cn=p;break e}cn=v}}}var t2={getCacheForType:function(r){var i=xn(Qt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return xn(Qt).controller.signal}},n2=typeof WeakMap=="function"?WeakMap:Map,ht=0,kt=null,Xe=null,tt=0,yt=0,ar=null,Ya=!1,es=!1,ym=!1,xa=0,Bt=0,Xa=0,nl=0,vm=0,ir=0,ts=0,Po=null,Zn=null,bm=!1,Gc=0,t0=0,Yc=1/0,Xc=null,Ja=null,an=0,Wa=null,ns=null,wa=0,xm=0,wm=null,n0=null,Bo=0,Sm=null;function lr(){return(ht&2)!==0&&tt!==0?tt&-tt:H.T!==null?_m():vv()}function r0(){if(ir===0)if((tt&536870912)===0||at){var r=Li;Li<<=1,(Li&3932160)===0&&(Li=262144),ir=r}else ir=536870912;return r=nr.current,r!==null&&(r.flags|=32),ir}function Vn(r,i,s){(r===kt&&(yt===2||yt===9)||r.cancelPendingCommit!==null)&&(rs(r,0),ei(r,tt,ir,!1)),yn(r,s),((ht&2)===0||r!==kt)&&(r===kt&&((ht&2)===0&&(nl|=s),Bt===4&&ei(r,tt,ir,!1)),Gr(r))}function a0(r,i,s){if((ht&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||La(r,i),p=d?i2(r,i):jm(r,i,!0),v=d;do{if(p===0){es&&!d&&ei(r,i,0,!1);break}else{if(s=r.current.alternate,v&&!r2(s)){p=jm(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 _=r;p=Po;var F=_.current.memoizedState.isDehydrated;if(F&&(rs(_,S).flags|=256),S=jm(_,S,!1),S!==2){if(ym&&!F){_.errorRecoveryDisabledLanes|=v,nl|=v,p=4;break e}v=Zn,Zn=p,v!==null&&(Zn===null?Zn=v:Zn.push.apply(Zn,v))}p=S}if(v=!1,p!==2)continue}}if(p===1){rs(r,0),ei(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ei(d,i,ir,!Ya);break e;case 2:Zn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=Gc+300-mn(),10<p)){if(ei(d,i,ir,!Ya),Pi(d,0,!0)!==0)break e;wa=i,d.timeoutHandle=D0(i0.bind(null,d,s,Zn,Xc,bm,i,ir,nl,ts,Ya,v,"Throttled",-0,0),p);break e}i0(d,s,Zn,Xc,bm,i,ir,nl,ts,Ya,v,null,-0,0)}}break}while(!0);Gr(r)}function i0(r,i,s,d,p,v,S,_,F,G,ie,de,X,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:la},Xx(i,v,de);var Ce=(v&62914560)===v?Gc-mn():(v&4194048)===v?t0-mn():0;if(Ce=$2(de,Ce),Ce!==null){wa=v,r.cancelPendingCommit=Ce(h0.bind(null,r,i,v,s,d,p,S,_,F,ie,de,null,X,te)),ei(r,v,S,!G);return}}h0(r,i,v,s,d,p,S,_,F)}function r2(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(!er(v(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ei(r,i,s,d){i&=~vm,i&=~nl,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-mt(p),S=1<<v;d[v]=-1,p&=~S}s!==0&&lo(r,s,i)}function Jc(){return(ht&6)===0?($o(0),!1):!0}function km(){if(Xe!==null){if(yt===0)var r=Xe.return;else r=Xe,ca=Qi=null,Ph(r),Ql=null,ko=0,r=Xe;for(;r!==null;)Ix(r.alternate,r),r=r.return;Xe=null}}function rs(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,k2(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),wa=0,km(),kt=r,Xe=s=oa(r.current,null),tt=i,yt=0,ar=null,Ya=!1,es=La(r,i),ym=!1,ts=ir=vm=nl=Xa=Bt=0,Zn=Po=null,bm=!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-mt(d),v=1<<p;i|=r[p],d&=~v}return xa=i,bc(),s}function l0(r,i){qe=null,H.H=Ro,i===Vl||i===Nc?(i=Sb(),yt=3):i===Nh?(i=Sb(),yt=4):yt=i===tm?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ar=i,Xe===null&&(Bt=1,$c(r,vr(i,r.current)))}function s0(){var r=nr.current;return r===null?!0:(tt&4194048)===tt?Sr===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Sr:!1}function o0(){var r=H.H;return H.H=Ro,r===null?Ro:r}function u0(){var r=H.A;return H.A=t2,r}function Wc(){Bt=4,Ya||(tt&4194048)!==tt&&nr.current!==null||(es=!0),(Xa&134217727)===0&&(nl&134217727)===0||kt===null||ei(kt,tt,ir,!1)}function jm(r,i,s){var d=ht;ht|=2;var p=o0(),v=u0();(kt!==r||tt!==i)&&(Xc=null,rs(r,i)),i=!1;var S=Bt;e:do try{if(yt!==0&&Xe!==null){var _=Xe,F=ar;switch(yt){case 8:km(),S=6;break e;case 3:case 2:case 9:case 6:nr.current===null&&(i=!0);var G=yt;if(yt=0,ar=null,as(r,_,F,G),s&&es){S=0;break e}break;default:G=yt,yt=0,ar=null,as(r,_,F,G)}}a2(),S=Bt;break}catch(ie){l0(r,ie)}while(!0);return i&&r.shellSuspendCounter++,ca=Qi=null,ht=d,H.H=p,H.A=v,Xe===null&&(kt=null,tt=0,bc()),S}function a2(){for(;Xe!==null;)c0(Xe)}function i2(r,i){var s=ht;ht|=2;var d=o0(),p=u0();kt!==r||tt!==i?(Xc=null,Yc=mn()+500,rs(r,i)):es=La(r,i);e:do try{if(yt!==0&&Xe!==null){i=Xe;var v=ar;t:switch(yt){case 1:yt=0,ar=null,as(r,i,v,1);break;case 2:case 9:if(xb(v)){yt=0,ar=null,d0(i);break}i=function(){yt!==2&&yt!==9||kt!==r||(yt=7),Gr(r)},v.then(i,i);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:xb(v)?(yt=0,ar=null,d0(i)):(yt=0,ar=null,as(r,i,v,7));break;case 5:var S=null;switch(Xe.tag){case 26:S=Xe.memoizedState;case 5:case 27:var _=Xe;if(S?Y0(S):_.stateNode.complete){yt=0,ar=null;var F=_.sibling;if(F!==null)Xe=F;else{var G=_.return;G!==null?(Xe=G,ed(G)):Xe=null}break t}}yt=0,ar=null,as(r,i,v,5);break;case 6:yt=0,ar=null,as(r,i,v,6);break;case 8:km(),Bt=6;break e;default:throw Error(a(462))}}l2();break}catch(ie){l0(r,ie)}while(!0);return ca=Qi=null,H.H=d,H.A=p,ht=s,Xe!==null?0:(kt=null,tt=0,bc(),Bt)}function l2(){for(;Xe!==null&&!ro();)c0(Xe)}function c0(r){var i=Mx(r.alternate,r,xa);r.memoizedProps=r.pendingProps,i===null?ed(r):Xe=i}function d0(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=_x(s,i,i.pendingProps,i.type,void 0,tt);break;case 11:i=_x(s,i,i.pendingProps,i.type.render,i.ref,tt);break;case 5:Ph(i);default:Ix(s,i),i=Xe=ub(i,xa),i=Mx(s,i,xa)}r.memoizedProps=r.pendingProps,i===null?ed(r):Xe=i}function as(r,i,s,d){ca=Qi=null,Ph(i),Ql=null,ko=0;var p=i.return;try{if(K_(r,p,i,s,tt)){Bt=1,$c(r,vr(s,r.current)),Xe=null;return}}catch(v){if(p!==null)throw Xe=p,v;Bt=1,$c(r,vr(s,r.current)),Xe=null;return}i.flags&32768?(at||d===1?r=!0:es||(tt&536870912)!==0?r=!1:(Ya=r=!0,(d===2||d===9||d===3||d===6)&&(d=nr.current,d!==null&&d.tag===13&&(d.flags|=16384))),f0(i,r)):ed(i)}function ed(r){var i=r;do{if((i.flags&32768)!==0){f0(i,Ya);return}r=i.return;var s=X_(i.alternate,i,xa);if(s!==null){Xe=s;return}if(i=i.sibling,i!==null){Xe=i;return}Xe=i=r}while(i!==null);Bt===0&&(Bt=5)}function f0(r,i){do{var s=J_(r.alternate,r);if(s!==null){s.flags&=32767,Xe=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){Xe=r;return}Xe=r=s}while(r!==null);Bt=6,Xe=null}function h0(r,i,s,d,p,v,S,_,F){r.cancelPendingCommit=null;do td();while(an!==0);if((ht&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=fh,aa(r,s,v,S,_,F),r===kt&&(Xe=kt=null,tt=0),ns=i,Wa=r,wa=s,xm=v,wm=p,n0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,c2(Pe,function(){return v0(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=H.T,H.T=null,p=ee.p,ee.p=2,S=ht,ht|=4;try{W_(r,i,s)}finally{ht=S,ee.p=p,H.T=d}}an=1,m0(),p0(),g0()}}function m0(){if(an===1){an=0;var r=Wa,i=ns,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=H.T,H.T=null;var d=ee.p;ee.p=2;var p=ht;ht|=4;try{Kx(i,r);var v=Im,S=eb(r.containerInfo),_=v.focusedElem,F=v.selectionRange;if(S!==_&&_&&_.ownerDocument&&Wv(_.ownerDocument.documentElement,_)){if(F!==null&&sh(_)){var G=F.start,ie=F.end;if(ie===void 0&&(ie=G),"selectionStart"in _)_.selectionStart=G,_.selectionEnd=Math.min(ie,_.value.length);else{var de=_.ownerDocument||document,X=de&&de.defaultView||window;if(X.getSelection){var te=X.getSelection(),Ce=_.textContent.length,Le=Math.min(F.start,Ce),wt=F.end===void 0?Le:Math.min(F.end,Ce);!te.extend&&Le>wt&&(S=wt,wt=Le,Le=S);var V=Jv(_,Le),q=Jv(_,wt);if(V&&q&&(te.rangeCount!==1||te.anchorNode!==V.node||te.anchorOffset!==V.offset||te.focusNode!==q.node||te.focusOffset!==q.offset)){var K=de.createRange();K.setStart(V.node,V.offset),te.removeAllRanges(),Le>wt?(te.addRange(K),te.extend(q.node,q.offset)):(K.setEnd(q.node,q.offset),te.addRange(K))}}}}for(de=[],te=_;te=te.parentNode;)te.nodeType===1&&de.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<de.length;_++){var ue=de[_];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}hd=!!Dm,Im=Dm=null}finally{ht=p,ee.p=d,H.T=s}}r.current=i,an=2}}function p0(){if(an===2){an=0;var r=Wa,i=ns,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=H.T,H.T=null;var d=ee.p;ee.p=2;var p=ht;ht|=4;try{qx(r,i.alternate,i)}finally{ht=p,ee.p=d,H.T=s}}an=3}}function g0(){if(an===4||an===3){an=0,ao();var r=Wa,i=ns,s=wa,d=n0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?an=5:(an=0,ns=Wa=null,y0(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ja=null),Ff(s),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(rn,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=H.T,p=ee.p,ee.p=2,H.T=null;try{for(var v=r.onRecoverableError,S=0;S<d.length;S++){var _=d[S];v(_.value,{componentStack:_.stack})}}finally{H.T=i,ee.p=p}}(wa&3)!==0&&td(),Gr(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===Sm?Bo++:(Bo=0,Sm=r):Bo=0,$o(0)}}function y0(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,wo(i)))}function td(){return m0(),p0(),g0(),v0()}function v0(){if(an!==5)return!1;var r=Wa,i=xm;xm=0;var s=Ff(wa),d=H.T,p=ee.p;try{ee.p=32>s?32:s,H.T=null,s=wm,wm=null;var v=Wa,S=wa;if(an=0,ns=Wa=null,wa=0,(ht&6)!==0)throw Error(a(331));var _=ht;if(ht|=4,Wx(v.current),Yx(v,v.current,S,s),ht=_,$o(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(rn,v)}catch{}return!0}finally{ee.p=p,H.T=d,y0(r,i)}}function b0(r,i,s){i=vr(s,i),i=em(r.stateNode,i,2),r=Va(r,i,2),r!==null&&(yn(r,2),Gr(r))}function vt(r,i,s){if(r.tag===3)b0(r,r,s);else for(;i!==null;){if(i.tag===3){b0(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ja===null||!Ja.has(d))){r=vr(s,r),s=xx(2),d=Va(i,s,2),d!==null&&(wx(s,d,i,r),yn(d,2),Gr(d));break}}i=i.return}}function Cm(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new n2;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)||(ym=!0,p.add(s),r=s2.bind(null,r,i,s),i.then(r,r))}function s2(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,kt===r&&(tt&s)===s&&(Bt===4||Bt===3&&(tt&62914560)===tt&&300>mn()-Gc?(ht&2)===0&&rs(r,0):vm|=s,ts===tt&&(ts=0)),Gr(r)}function x0(r,i){i===0&&(i=xe()),r=Hi(r,i),r!==null&&(yn(r,i),Gr(r))}function o2(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),x0(r,s)}function u2(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),x0(r,s)}function c2(r,i){return Ia(r,i)}var nd=null,is=null,Em=!1,rd=!1,Nm=!1,ti=0;function Gr(r){r!==is&&r.next===null&&(is===null?nd=is=r:is=is.next=r),rd=!0,Em||(Em=!0,f2())}function $o(r,i){if(!Nm&&rd){Nm=!0;do for(var s=!1,d=nd;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var S=d.suspendedLanes,_=d.pingedLanes;v=(1<<31-mt(42|r)+1)-1,v&=p&~(S&~_),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(s=!0,j0(d,v))}else v=tt,v=Pi(d,d===kt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||La(d,v)||(s=!0,j0(d,v));d=d.next}while(s);Nm=!1}}function d2(){w0()}function w0(){rd=Em=!1;var r=0;ti!==0&&S2()&&(r=ti);for(var i=mn(),s=null,d=nd;d!==null;){var p=d.next,v=S0(d,i);v===0?(d.next=null,s===null?nd=p:s.next=p,p===null&&(is=s)):(s=d,(r!==0||(v&3)!==0)&&(rd=!0)),d=p}an!==0&&an!==5||$o(r),ti!==0&&(ti=0)}function S0(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var S=31-mt(v),_=1<<S,F=p[S];F===-1?((_&s)===0||(_&d)!==0)&&(p[S]=lc(_,i)):F<=i&&(r.expiredLanes|=_),v&=~_}if(i=kt,s=tt,s=Pi(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(yt===2||yt===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&ra(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||La(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&ra(d),Ff(s)){case 2:case 8:s=ye;break;case 32:s=Pe;break;case 268435456:s=rt;break;default:s=Pe}return d=k0.bind(null,r),s=Ia(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&ra(d),r.callbackPriority=2,r.callbackNode=null,2}function k0(r,i){if(an!==0&&an!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(td()&&r.callbackNode!==s)return null;var d=tt;return d=Pi(r,r===kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(a0(r,d,i),S0(r,mn()),r.callbackNode!=null&&r.callbackNode===s?k0.bind(null,r):null)}function j0(r,i){if(td())return null;a0(r,i,!0)}function f2(){j2(function(){(ht&6)!==0?Ia(se,d2):w0()})}function _m(){if(ti===0){var r=Hl;r===0&&(r=Ii,Ii<<=1,(Ii&261888)===0&&(Ii=256)),ti=r}return ti}function C0(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:dc(""+r)}function E0(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 h2(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var v=C0((p[Bn]||null).action),S=d.submitter;S&&(i=(i=S[Bn]||null)?C0(i.formAction):S.getAttribute("formAction"),i!==null&&(v=i,S=null));var _=new pc("action","action",null,d,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ti!==0){var F=S?E0(p,S):new FormData(p);Kh(s,{pending:!0,data:F,method:p.method,action:v},null,F)}}else typeof v=="function"&&(_.preventDefault(),F=S?E0(p,S):new FormData(p),Kh(s,{pending:!0,data:F,method:p.method,action:v},v,F))},currentTarget:p}]})}}for(var Tm=0;Tm<dh.length;Tm++){var Am=dh[Tm],m2=Am.toLowerCase(),p2=Am[0].toUpperCase()+Am.slice(1);Ir(m2,"on"+p2)}Ir(rb,"onAnimationEnd"),Ir(ab,"onAnimationIteration"),Ir(ib,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(R_,"onTransitionRun"),Ir(z_,"onTransitionStart"),Ir(O_,"onTransitionCancel"),Ir(lb,"onTransitionEnd"),Al("onMouseEnter",["mouseout","mouseover"]),Al("onMouseLeave",["mouseout","mouseover"]),Al("onPointerEnter",["pointerout","pointerover"]),Al("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var 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(" "),g2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fo));function N0(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 _=d[S],F=_.instance,G=_.currentTarget;if(_=_.listener,F!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(ie){vc(ie)}p.currentTarget=null,v=F}else for(S=0;S<d.length;S++){if(_=d[S],F=_.instance,G=_.currentTarget,_=_.listener,F!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=G;try{v(p)}catch(ie){vc(ie)}p.currentTarget=null,v=F}}}}function Je(r,i){var s=i[qf];s===void 0&&(s=i[qf]=new Set);var d=r+"__bubble";s.has(d)||(_0(i,r,2,!1),s.add(d))}function Rm(r,i,s){var d=0;i&&(d|=4),_0(s,r,d,i)}var ad="_reactListening"+Math.random().toString(36).slice(2);function zm(r){if(!r[ad]){r[ad]=!0,wv.forEach(function(s){s!=="selectionchange"&&(g2.has(s)||Rm(s,!1,r),Rm(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[ad]||(i[ad]=!0,Rm("selectionchange",!1,i))}}function _0(r,i,s,d){switch(r1(i)){case 2:var p=H2;break;case 8:p=Z2;break;default:p=Qm}s=p.bind(null,i,s,r),p=void 0,!Jf||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 Om(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 _=d.stateNode.containerInfo;if(_===p)break;if(S===4)for(S=d.return;S!==null;){var F=S.tag;if((F===3||F===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;_!==null;){if(S=Nl(_),S===null)return;if(F=S.tag,F===5||F===6||F===26||F===27){d=v=S;continue e}_=_.parentNode}}d=d.return}Ov(function(){var G=v,ie=Yf(s),de=[];e:{var X=sb.get(r);if(X!==void 0){var te=pc,Ce=r;switch(r){case"keypress":if(hc(s)===0)break e;case"keydown":case"keyup":te=u_;break;case"focusin":Ce="focus",te=nh;break;case"focusout":Ce="blur",te=nh;break;case"beforeblur":case"afterblur":te=nh;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=Iv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=XN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=f_;break;case rb:case ab:case ib:te=e_;break;case lb:te=m_;break;case"scroll":case"scrollend":te=GN;break;case"wheel":te=g_;break;case"copy":case"cut":case"paste":te=n_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Uv;break;case"toggle":case"beforetoggle":te=v_}var Le=(i&4)!==0,wt=!Le&&(r==="scroll"||r==="scrollend"),V=Le?X!==null?X+"Capture":null:X;Le=[];for(var q=G,K;q!==null;){var ue=q;if(K=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||K===null||V===null||(ue=uo(q,V),ue!=null&&Le.push(qo(q,ue,K))),wt)break;q=q.return}0<Le.length&&(X=new te(X,Ce,null,s,ie),de.push({event:X,listeners:Le}))}}if((i&7)===0){e:{if(X=r==="mouseover"||r==="pointerover",te=r==="mouseout"||r==="pointerout",X&&s!==Gf&&(Ce=s.relatedTarget||s.fromElement)&&(Nl(Ce)||Ce[El]))break e;if((te||X)&&(X=ie.window===ie?ie:(X=ie.ownerDocument)?X.defaultView||X.parentWindow:window,te?(Ce=s.relatedTarget||s.toElement,te=G,Ce=Ce?Nl(Ce):null,Ce!==null&&(wt=o(Ce),Le=Ce.tag,Ce!==wt||Le!==5&&Le!==27&&Le!==6)&&(Ce=null)):(te=null,Ce=G),te!==Ce)){if(Le=Iv,ue="onMouseLeave",V="onMouseEnter",q="mouse",(r==="pointerout"||r==="pointerover")&&(Le=Uv,ue="onPointerLeave",V="onPointerEnter",q="pointer"),wt=te==null?X:oo(te),K=Ce==null?X:oo(Ce),X=new Le(ue,q+"leave",te,s,ie),X.target=wt,X.relatedTarget=K,ue=null,Nl(ie)===G&&(Le=new Le(V,q+"enter",Ce,s,ie),Le.target=K,Le.relatedTarget=wt,ue=Le),wt=ue,te&&Ce)t:{for(Le=y2,V=te,q=Ce,K=0,ue=V;ue;ue=Le(ue))K++;ue=0;for(var ze=q;ze;ze=Le(ze))ue++;for(;0<K-ue;)V=Le(V),K--;for(;0<ue-K;)q=Le(q),ue--;for(;K--;){if(V===q||q!==null&&V===q.alternate){Le=V;break t}V=Le(V),q=Le(q)}Le=null}else Le=null;te!==null&&T0(de,X,te,Le,!1),Ce!==null&&wt!==null&&T0(de,wt,Ce,Le,!0)}}e:{if(X=G?oo(G):window,te=X.nodeName&&X.nodeName.toLowerCase(),te==="select"||te==="input"&&X.type==="file")var ct=Vv;else if(Hv(X))if(Qv)ct=__;else{ct=E_;var _e=C_}else te=X.nodeName,!te||te.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?G&&Kf(G.elementType)&&(ct=Vv):ct=N_;if(ct&&(ct=ct(r,G))){Zv(de,ct,s,ie);break e}_e&&_e(r,X,G),r==="focusout"&&G&&X.type==="number"&&G.memoizedProps.value!=null&&Qf(X,"number",X.value)}switch(_e=G?oo(G):window,r){case"focusin":(Hv(_e)||_e.contentEditable==="true")&&(Il=_e,oh=G,vo=null);break;case"focusout":vo=oh=Il=null;break;case"mousedown":uh=!0;break;case"contextmenu":case"mouseup":case"dragend":uh=!1,tb(de,s,ie);break;case"selectionchange":if(A_)break;case"keydown":case"keyup":tb(de,s,ie)}var Ze;if(ah)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Dl?Fv(r,s)&&(nt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(nt="onCompositionStart");nt&&(Pv&&s.locale!=="ko"&&(Dl||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Dl&&(Ze=Mv()):(Pa=ie,Wf="value"in Pa?Pa.value:Pa.textContent,Dl=!0)),_e=id(G,nt),0<_e.length&&(nt=new Lv(nt,r,null,s,ie),de.push({event:nt,listeners:_e}),Ze?nt.data=Ze:(Ze=qv(s),Ze!==null&&(nt.data=Ze)))),(Ze=x_?w_(r,s):S_(r,s))&&(nt=id(G,"onBeforeInput"),0<nt.length&&(_e=new Lv("onBeforeInput","beforeinput",null,s,ie),de.push({event:_e,listeners:nt}),_e.data=Ze)),h2(de,r,G,s,ie)}N0(de,i)})}function qo(r,i,s){return{instance:r,listener:i,currentTarget:s}}function id(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 y2(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function T0(r,i,s,d,p){for(var v=i._reactName,S=[];s!==null&&s!==d;){var _=s,F=_.alternate,G=_.stateNode;if(_=_.tag,F!==null&&F===d)break;_!==5&&_!==26&&_!==27||G===null||(F=G,p?(G=uo(s,v),G!=null&&S.unshift(qo(s,G,F))):p||(G=uo(s,v),G!=null&&S.push(qo(s,G,F)))),s=s.return}S.length!==0&&r.push({event:i,listeners:S})}var v2=/\r\n?/g,b2=/\u0000|\uFFFD/g;function A0(r){return(typeof r=="string"?r:""+r).replace(v2,`
|
|
49
|
-
`).replace(b2,"")}function R0(r,i){return i=A0(i),A0(r)===i}function xt(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":uc(r,"class",d);break;case"tabIndex":uc(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":uc(r,s,d);break;case"style":Rv(r,d,v);break;case"data":if(i!=="object"){uc(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=dc(""+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"&&xt(r,i,"name",p.name,p,null),xt(r,i,"formEncType",p.formEncType,p,null),xt(r,i,"formMethod",p.formMethod,p,null),xt(r,i,"formTarget",p.formTarget,p,null)):(xt(r,i,"encType",p.encType,p,null),xt(r,i,"method",p.method,p,null),xt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=dc(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=la);break;case"onScroll":d!=null&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("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=dc(""+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":Je("beforetoggle",r),Je("toggle",r),oc(r,"popover",d);break;case"xlinkActuate":ia(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ia(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ia(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ia(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ia(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ia(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ia(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ia(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ia(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":oc(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=QN.get(s)||s,oc(r,s,d))}}function Mm(r,i,s,d,p,v){switch(s){case"style":Rv(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&&Je("scroll",r);break;case"onScrollEnd":d!=null&&Je("scrollend",r);break;case"onClick":d!=null&&(r.onclick=la);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sv.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[Bn]||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,""):oc(r,s,d)}}}function Sn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",r),Je("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:xt(r,i,v,S,s,null)}}p&&xt(r,i,"srcSet",s.srcSet,s,null),d&&xt(r,i,"src",s.src,s,null);return;case"input":Je("invalid",r);var _=v=S=p=null,F=null,G=null;for(d in s)if(s.hasOwnProperty(d)){var ie=s[d];if(ie!=null)switch(d){case"name":p=ie;break;case"type":S=ie;break;case"checked":F=ie;break;case"defaultChecked":G=ie;break;case"value":v=ie;break;case"defaultValue":_=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,i));break;default:xt(r,i,d,ie,s,null)}}Nv(r,v,_,F,G,S,p,!1);return;case"select":Je("invalid",r),d=S=v=null;for(p in s)if(s.hasOwnProperty(p)&&(_=s[p],_!=null))switch(p){case"value":v=_;break;case"defaultValue":S=_;break;case"multiple":d=_;default:xt(r,i,p,_,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":Je("invalid",r),v=p=d=null;for(S in s)if(s.hasOwnProperty(S)&&(_=s[S],_!=null))switch(S){case"value":d=_;break;case"defaultValue":p=_;break;case"children":v=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:xt(r,i,S,_,s,null)}Tv(r,d,p,v);return;case"option":for(F in s)if(s.hasOwnProperty(F)&&(d=s[F],d!=null))switch(F){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:xt(r,i,F,d,s,null)}return;case"dialog":Je("beforetoggle",r),Je("toggle",r),Je("cancel",r),Je("close",r);break;case"iframe":case"object":Je("load",r);break;case"video":case"audio":for(d=0;d<Fo.length;d++)Je(Fo[d],r);break;case"image":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"embed":case"source":case"link":Je("error",r),Je("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in s)if(s.hasOwnProperty(G)&&(d=s[G],d!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:xt(r,i,G,d,s,null)}return;default:if(Kf(i)){for(ie in s)s.hasOwnProperty(ie)&&(d=s[ie],d!==void 0&&Mm(r,i,ie,d,s,void 0));return}}for(_ in s)s.hasOwnProperty(_)&&(d=s[_],d!=null&&xt(r,i,_,d,s,null))}function x2(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,_=null,F=null,G=null,ie=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":F=de;default:d.hasOwnProperty(te)||xt(r,i,te,null,d,de)}}for(var X in d){var te=d[X];if(de=s[X],d.hasOwnProperty(X)&&(te!=null||de!=null))switch(X){case"type":v=te;break;case"name":p=te;break;case"checked":G=te;break;case"defaultChecked":ie=te;break;case"value":S=te;break;case"defaultValue":_=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(a(137,i));break;default:te!==de&&xt(r,i,X,te,d,de)}}Vf(r,S,_,F,G,ie,v,p);return;case"select":te=S=_=X=null;for(v in s)if(F=s[v],s.hasOwnProperty(v)&&F!=null)switch(v){case"value":break;case"multiple":te=F;default:d.hasOwnProperty(v)||xt(r,i,v,null,d,F)}for(p in d)if(v=d[p],F=s[p],d.hasOwnProperty(p)&&(v!=null||F!=null))switch(p){case"value":X=v;break;case"defaultValue":_=v;break;case"multiple":S=v;default:v!==F&&xt(r,i,p,v,d,F)}i=_,s=S,d=te,X!=null?Rl(r,!!s,X,!1):!!d!=!!s&&(i!=null?Rl(r,!!s,i,!0):Rl(r,!!s,s?[]:"",!1));return;case"textarea":te=X=null;for(_ in s)if(p=s[_],s.hasOwnProperty(_)&&p!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:xt(r,i,_,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":X=p;break;case"defaultValue":te=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&xt(r,i,S,p,d,v)}_v(r,X,te);return;case"option":for(var Ce in s)if(X=s[Ce],s.hasOwnProperty(Ce)&&X!=null&&!d.hasOwnProperty(Ce))switch(Ce){case"selected":r.selected=!1;break;default:xt(r,i,Ce,null,d,X)}for(F in d)if(X=d[F],te=s[F],d.hasOwnProperty(F)&&X!==te&&(X!=null||te!=null))switch(F){case"selected":r.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:xt(r,i,F,X,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 Le in s)X=s[Le],s.hasOwnProperty(Le)&&X!=null&&!d.hasOwnProperty(Le)&&xt(r,i,Le,null,d,X);for(G in d)if(X=d[G],te=s[G],d.hasOwnProperty(G)&&X!==te&&(X!=null||te!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:xt(r,i,G,X,d,te)}return;default:if(Kf(i)){for(var wt in s)X=s[wt],s.hasOwnProperty(wt)&&X!==void 0&&!d.hasOwnProperty(wt)&&Mm(r,i,wt,void 0,d,X);for(ie in d)X=d[ie],te=s[ie],!d.hasOwnProperty(ie)||X===te||X===void 0&&te===void 0||Mm(r,i,ie,X,d,te);return}}for(var V in s)X=s[V],s.hasOwnProperty(V)&&X!=null&&!d.hasOwnProperty(V)&&xt(r,i,V,null,d,X);for(de in d)X=d[de],te=s[de],!d.hasOwnProperty(de)||X===te||X==null&&te==null||xt(r,i,de,X,d,te)}function z0(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w2(){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,_=p.duration;if(v&&_&&z0(S)){for(S=0,_=p.responseEnd,d+=1;d<s.length;d++){var F=s[d],G=F.startTime;if(G>_)break;var ie=F.transferSize,de=F.initiatorType;ie&&z0(de)&&(F=F.responseEnd,S+=ie*(F<_?1:(_-G)/(F-G)))}if(--d,i+=8*(v+S)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Dm=null,Im=null;function ld(r){return r.nodeType===9?r:r.ownerDocument}function O0(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 M0(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 Lm(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 Um=null;function S2(){var r=window.event;return r&&r.type==="popstate"?r===Um?!1:(Um=r,!0):(Um=null,!1)}var D0=typeof setTimeout=="function"?setTimeout:void 0,k2=typeof clearTimeout=="function"?clearTimeout:void 0,I0=typeof Promise=="function"?Promise:void 0,j2=typeof queueMicrotask=="function"?queueMicrotask:typeof I0<"u"?function(r){return I0.resolve(null).then(r).catch(C2)}:D0;function C2(r){setTimeout(function(){throw r})}function ni(r){return r==="head"}function L0(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,_=v.nodeName;v[so]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&v.rel.toLowerCase()==="stylesheet"||s.removeChild(v),v=S}}else s==="body"&&Ho(r.ownerDocument.body);s=p}while(s);us(i)}function U0(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 Pm(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":Pm(s),Hf(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function E2(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=kr(r.nextSibling),r===null)break}return null}function N2(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=kr(r.nextSibling),r===null))return null;return r}function P0(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=kr(r.nextSibling),r===null))return null;return r}function Bm(r){return r.data==="$?"||r.data==="$~"}function $m(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function _2(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 kr(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 Fm=null;function B0(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return kr(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function $0(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function F0(r,i,s){switch(i=ld(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]);Hf(r)}var jr=new Map,q0=new Set;function sd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Sa=ee.d;ee.d={f:T2,r:A2,D:R2,C:z2,L:O2,m:M2,X:I2,S:D2,M:L2};function T2(){var r=Sa.f(),i=Jc();return r||i}function A2(r){var i=_l(r);i!==null&&i.tag===5&&i.type==="form"?lx(i):Sa.r(r)}var ls=typeof document>"u"?null:document;function H0(r,i,s){var d=ls;if(d&&typeof i=="string"&&i){var p=gr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),q0.has(p)||(q0.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Sn(i,"link",r),un(i),d.head.appendChild(i)))}}function R2(r){Sa.D(r),H0("dns-prefetch",r,null)}function z2(r,i){Sa.C(r,i),H0("preconnect",r,i)}function O2(r,i,s){Sa.L(r,i,s);var d=ls;if(d&&r&&i){var p='link[rel="preload"][as="'+gr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+gr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+gr(s.imageSizes)+'"]')):p+='[href="'+gr(r)+'"]';var v=p;switch(i){case"style":v=ss(r);break;case"script":v=os(r)}jr.has(v)||(r=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),jr.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(Zo(v))||i==="script"&&d.querySelector(Vo(v))||(i=d.createElement("link"),Sn(i,"link",r),un(i),d.head.appendChild(i)))}}function M2(r,i){Sa.m(r,i);var s=ls;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+gr(d)+'"][href="'+gr(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=os(r)}if(!jr.has(v)&&(r=g({rel:"modulepreload",href:r},i),jr.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"),Sn(d,"link",r),un(d),s.head.appendChild(d)}}}function D2(r,i,s){Sa.S(r,i,s);var d=ls;if(d&&r){var p=Tl(d).hoistableStyles,v=ss(r);i=i||"default";var S=p.get(v);if(!S){var _={loading:0,preload:null};if(S=d.querySelector(Zo(v)))_.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":i},s),(s=jr.get(v))&&qm(r,s);var F=S=d.createElement("link");un(F),Sn(F,"link",r),F._p=new Promise(function(G,ie){F.onload=G,F.onerror=ie}),F.addEventListener("load",function(){_.loading|=1}),F.addEventListener("error",function(){_.loading|=2}),_.loading|=4,od(S,i,d)}S={type:"stylesheet",instance:S,count:1,state:_},p.set(v,S)}}}function I2(r,i){Sa.X(r,i);var s=ls;if(s&&r){var d=Tl(s).hoistableScripts,p=os(r),v=d.get(p);v||(v=s.querySelector(Vo(p)),v||(r=g({src:r,async:!0},i),(i=jr.get(p))&&Hm(r,i),v=s.createElement("script"),un(v),Sn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function L2(r,i){Sa.M(r,i);var s=ls;if(s&&r){var d=Tl(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=jr.get(p))&&Hm(r,i),v=s.createElement("script"),un(v),Sn(v,"link",r),s.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function Z0(r,i,s,d){var p=(p=ce.current)?sd(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=Tl(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=Tl(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),jr.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},jr.set(r,s),v||U2(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=Tl(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="'+gr(r)+'"'}function Zo(r){return'link[rel="stylesheet"]['+r+"]"}function V0(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function U2(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}),Sn(i,"link",s),un(i),r.head.appendChild(i))}function os(r){return'[src="'+gr(r)+'"]'}function Vo(r){return"script[async]"+r}function Q0(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+gr(s.href)+'"]');if(d)return i.instance=d,un(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"),un(d),Sn(d,"style",p),od(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,un(v),v;d=V0(s),(p=jr.get(p))&&qm(d,p),v=(r.ownerDocument||r).createElement("link"),un(v);var S=v;return S._p=new Promise(function(_,F){S.onload=_,S.onerror=F}),Sn(v,"link",d),i.state.loading|=4,od(v,s.precedence,r),i.instance=v;case"script":return v=os(s.src),(p=r.querySelector(Vo(v)))?(i.instance=p,un(p),p):(d=s,(p=jr.get(v))&&(d=g({},s),Hm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),un(p),Sn(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,od(d,s.precedence,r));return i.instance}function od(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 _=d[S];if(_.dataset.precedence===i)v=_;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 qm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function Hm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var ud=null;function K0(r,i,s){if(ud===null){var d=new Map,p=ud=new Map;p.set(s,d)}else p=ud,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[vn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var S=v.getAttribute(i)||"";S=r+S;var _=d.get(S);_?_.push(v):d.set(S,[v])}}return d}function G0(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function P2(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 Y0(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function B2(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=cd.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=v,un(v);return}v=i.ownerDocument||i,d=V0(d),(p=jr.get(p))&&qm(d,p),v=v.createElement("link"),un(v);var S=v;S._p=new Promise(function(_,F){S.onload=_,S.onerror=F}),Sn(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=cd.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Zm=0;function $2(r,i){return r.stylesheets&&r.count===0&&fd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&fd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&Zm===0&&(Zm=62500*w2());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&fd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Zm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function cd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var dd=null;function fd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,dd=new Map,i.forEach(F2,r),dd=null,cd.call(r))}function F2(r,i){if(!(i.state.loading&4)){var s=dd.get(r);if(s)var d=s.get(null);else{s=new Map,dd.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=cd.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:O,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_threadCount:0};function q2(r,i,s,d,p,v,S,_,F){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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function X0(r,i,s,d,p,v,S,_,F,G,ie,de){return r=new q2(r,i,s,S,F,G,ie,de,_),i=1,v===!0&&(i|=24),v=tr(3,null,null,i),r.current=v,v.stateNode=r,i=jh(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:s,cache:i},_h(v),r}function J0(r){return r?(r=Pl,r):Pl}function W0(r,i,s,d,p,v){p=J0(p),d.context===null?d.context=p:d.pendingContext=p,d=Za(i),d.payload={element:s},v=v===void 0?null:v,v!==null&&(d.callback=v),s=Va(r,d,i),s!==null&&(Vn(s,r,i),Co(s,r,i))}function e1(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function Vm(r,i){e1(r,i),(r=r.alternate)&&e1(r,i)}function t1(r){if(r.tag===13||r.tag===31){var i=Hi(r,67108864);i!==null&&Vn(i,r,67108864),Vm(r,67108864)}}function n1(r){if(r.tag===13||r.tag===31){var i=lr();i=$f(i);var s=Hi(r,i);s!==null&&Vn(s,r,i),Vm(r,i)}}var hd=!0;function H2(r,i,s,d){var p=H.T;H.T=null;var v=ee.p;try{ee.p=2,Qm(r,i,s,d)}finally{ee.p=v,H.T=p}}function Z2(r,i,s,d){var p=H.T;H.T=null;var v=ee.p;try{ee.p=8,Qm(r,i,s,d)}finally{ee.p=v,H.T=p}}function Qm(r,i,s,d){if(hd){var p=Km(d);if(p===null)Om(r,i,d,md,s),a1(r,d);else if(Q2(p,r,i,s,d))d.stopPropagation();else if(a1(r,d),i&4&&-1<V2.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=Zr(v.pendingLanes);if(S!==0){var _=v;for(_.pendingLanes|=2,_.entangledLanes|=2;S;){var F=1<<31-mt(S);_.entanglements[1]|=F,S&=~F}Gr(v),(ht&6)===0&&(Yc=mn()+500,$o(0))}}break;case 31:case 13:_=Hi(v,2),_!==null&&Vn(_,v,2),Jc(),Vm(v,2)}if(v=Km(d),v===null&&Om(r,i,d,md,s),v===p)break;p=v}p!==null&&d.stopPropagation()}else Om(r,i,d,null,s)}}function Km(r){return r=Yf(r),Gm(r)}var md=null;function Gm(r){if(md=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=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return md=r,null}function r1(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 se:return 2;case ye:return 8;case Pe:case $e:return 32;case rt:return 268435456;default:return 32}default:return 32}}var Ym=!1,ri=null,ai=null,ii=null,Ko=new Map,Go=new Map,li=[],V2="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 a1(r,i){switch(r){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":ii=null;break;case"pointerover":case"pointerout":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&&t1(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function Q2(r,i,s,d,p){switch(i){case"focusin":return ri=Yo(ri,r,i,s,d,p),!0;case"dragenter":return ai=Yo(ai,r,i,s,d,p),!0;case"mouseover":return ii=Yo(ii,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 i1(r){var i=Nl(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,bv(r.priority,function(){n1(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,bv(r.priority,function(){n1(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 pd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=Km(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);Gf=d,s.target.dispatchEvent(d),Gf=null}else return i=_l(s),i!==null&&t1(i),r.blockedOn=s,!1;i.shift()}return!0}function l1(r,i,s){pd(r)&&s.delete(i)}function K2(){Ym=!1,ri!==null&&pd(ri)&&(ri=null),ai!==null&&pd(ai)&&(ai=null),ii!==null&&pd(ii)&&(ii=null),Ko.forEach(l1),Go.forEach(l1)}function gd(r,i){r.blockedOn===i&&(r.blockedOn=null,Ym||(Ym=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,K2)))}var yd=null;function s1(r){yd!==r&&(yd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yd===r&&(yd=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(Gm(d||s)===null)continue;break}var v=_l(s);v!==null&&(r.splice(i,3),i-=3,Kh(v,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function us(r){function i(F){return gd(F,r)}ri!==null&&gd(ri,r),ai!==null&&gd(ai,r),ii!==null&&gd(ii,r),Ko.forEach(i),Go.forEach(i);for(var s=0;s<li.length;s++){var d=li[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<li.length&&(s=li[0],s.blockedOn===null);)i1(s),s.blockedOn===null&&li.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],v=s[d+1],S=p[Bn]||null;if(typeof v=="function")S||s1(s);else if(S){var _=null;if(v&&v.hasAttribute("formAction")){if(p=v,S=v[Bn]||null)_=S.formAction;else if(Gm(p)!==null)continue}else _=S.action;typeof _=="function"?s[d+1]=_:(s.splice(d,3),d-=3),s1(s)}}}function o1(){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 Xm(r){this._internalRoot=r}vd.prototype.render=Xm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=lr();W0(s,d,r,i,null,null)},vd.prototype.unmount=Xm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;W0(r.current,2,null,r,null,null),Jc(),i[El]=null}};function vd(r){this._internalRoot=r}vd.prototype.unstable_scheduleHydration=function(r){if(r){var i=vv();r={blockedOn:null,target:r,priority:i};for(var s=0;s<li.length&&i!==0&&i<li[s].priority;s++);li.splice(s,0,r),s===0&&i1(r)}};var u1=t.version;if(u1!=="19.2.4")throw Error(a(527,u1,"19.2.4"));ee.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 G2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bd.isDisabled&&bd.supportsFiber)try{rn=bd.inject(G2),qt=bd}catch{}}return Jo.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=gx,v=yx,S=vx;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=X0(r,1,!1,null,null,s,d,null,p,v,S,o1),r[El]=i.current,zm(r),new Xm(i)},Jo.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",v=gx,S=yx,_=vx,F=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&&(_=s.onRecoverableError),s.formState!==void 0&&(F=s.formState)),i=X0(r,1,!0,i,s??null,d,p,F,v,S,_,o1),i.context=J0(null),s=i.current,d=lr(),d=$f(d),p=Za(d),p.callback=null,Va(s,p,d),s=d,i.current.lanes=s,yn(i,s),Gr(i),r[El]=i.current,zm(r),new vd(i)},Jo.version="19.2.4",Jo}var x1;function lT(){if(x1)return tp.exports;x1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),tp.exports=iT(),tp.exports}var sT=lT(),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(){}},sl,pi,js,GS,oT=(GS=class extends xl{constructor(){super();je(this,sl);je(this,pi);je(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(){D(this,pi)||this.setEventListener(D(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,pi))==null||t.call(this),pe(this,pi,void 0))}setEventListener(t){var n;pe(this,js,t),(n=D(this,pi))==null||n.call(this),pe(this,pi,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){D(this,sl)!==t&&(pe(this,sl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof D(this,sl)=="boolean"?D(this,sl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},sl=new WeakMap,pi=new WeakMap,js=new WeakMap,GS),ny=new oT,uT={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gi,Wg,YS,cT=(YS=class{constructor(){je(this,gi,uT);je(this,Wg,!1)}setTimeoutProvider(e){pe(this,gi,e)}setTimeout(e,t){return D(this,gi).setTimeout(e,t)}clearTimeout(e){D(this,gi).clearTimeout(e)}setInterval(e,t){return D(this,gi).setInterval(e,t)}clearInterval(e){D(this,gi).clearInterval(e)}},gi=new WeakMap,Wg=new WeakMap,YS),il=new cT;function dT(e){setTimeout(e,0)}var fT=typeof window>"u"||"Deno"in globalThis;function Nn(){}function hT(e,t){return typeof e=="function"?e(t):e}function Yp(e){return typeof e=="number"&&e>=0&&e!==1/0}function ok(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function Nr(e,t){return typeof e=="function"?e(t):e}function w1(e,t){const{type:n="all",exact:a,fetchStatus:l,predicate:o,queryKey:c,stale:f}=e;if(c){if(a){if(t.queryHash!==ry(c,t.options))return!1}else if(!bu(t.queryKey,c))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||o&&!o(t))}function S1(e,t){const{exact:n,status:a,predicate:l,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(gl(t.options.mutationKey)!==gl(o))return!1}else if(!bu(t.options.mutationKey,o))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function ry(e,t){return((t==null?void 0:t.queryKeyHashFn)||gl)(e)}function gl(e){return JSON.stringify(e,(t,n)=>Xp(n)?Object.keys(n).sort().reduce((a,l)=>(a[l]=n[l],a),{}):n)}function bu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>bu(e[n],t[n])):!1}var mT=Object.prototype.hasOwnProperty;function ay(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=k1(e)&&k1(t);if(!a&&!(Xp(e)&&Xp(t)))return t;const o=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),f=c.length,m=a?new Array(f):{};let h=0;for(let y=0;y<f;y++){const g=a?y:c[y],b=e[g],w=t[g];if(b===w){m[g]=b,(a?y<o:mT.call(e,g))&&h++;continue}if(b===null||w===null||typeof b!="object"||typeof w!="object"){m[g]=w;continue}const k=ay(b,w,n+1);m[g]=k,k===b&&h++}return o===f&&h===o?e:m}function xu(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 k1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Xp(e){if(!j1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!j1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function j1(e){return Object.prototype.toString.call(e)==="[object Object]"}function pT(e){return new Promise(t=>{il.setTimeout(t,e)})}function Jp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ay(e,t):t}function gT(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function yT(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var iy=Symbol();function uk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===iy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ly(e,t){return typeof e=="function"?e(...t):!!e}function vT(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 wu=(()=>{let e=()=>fT;return{isServer(){return e()},setIsServer(t){e=t}}})();function Wp(){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 bT=dT;function xT(){let e=[],t=0,n=f=>{f()},a=f=>{f()},l=bT;const o=f=>{t?e.push(f):l(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&l(()=>{a(()=>{f.forEach(m=>{n(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||c()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{l=f}}}var Ft=xT(),Cs,yi,Es,XS,wT=(XS=class extends xl{constructor(){super();je(this,Cs,!0);je(this,yi);je(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(){D(this,yi)||this.setEventListener(D(this,Es))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,yi))==null||t.call(this),pe(this,yi,void 0))}setEventListener(t){var n;pe(this,Es,t),(n=D(this,yi))==null||n.call(this),pe(this,yi,t(this.setOnline.bind(this)))}setOnline(t){D(this,Cs)!==t&&(pe(this,Cs,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return D(this,Cs)}},Cs=new WeakMap,yi=new WeakMap,Es=new WeakMap,XS),Gd=new wT;function ST(e){return Math.min(1e3*2**e,3e4)}function ck(e){return(e??"online")==="online"?Gd.isOnline():!0}var eg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function dk(e){let t=!1,n=0,a;const l=Wp(),o=()=>l.status!=="pending",c=j=>{var E;if(!o()){const C=new eg(j);b(C),(E=e.onCancel)==null||E.call(e,C)}},f=()=>{t=!0},m=()=>{t=!1},h=()=>ny.isFocused()&&(e.networkMode==="always"||Gd.isOnline())&&e.canRun(),y=()=>ck(e.networkMode)&&e.canRun(),g=j=>{o()||(a==null||a(),l.resolve(j))},b=j=>{o()||(a==null||a(),l.reject(j))},w=()=>new Promise(j=>{var E;a=C=>{(o()||h())&&j(C)},(E=e.onPause)==null||E.call(e)}).then(()=>{var j;a=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const E=n===0?e.initialPromise:void 0;try{j=E??e.fn()}catch(C){j=Promise.reject(C)}Promise.resolve(j).then(g).catch(C=>{var z;if(o())return;const R=e.retry??(wu.isServer()?0:3),O=e.retryDelay??ST,M=typeof O=="function"?O(n,C):O,B=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,C);if(t||!B){b(C);return}n++,(z=e.onFail)==null||z.call(e,n,C),pT(M).then(()=>h()?void 0:w()).then(()=>{t?b(C):k()})})};return{promise:l,status:()=>l.status,cancel:c,continue:()=>(a==null||a(),l),cancelRetry:f,continueRetry:m,canStart:y,start:()=>(y()?k():w().then(k),l)}}var ol,JS,fk=(JS=class{constructor(){je(this,ol)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yp(this.gcTime)&&pe(this,ol,il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wu.isServer()?1/0:300*1e3))}clearGcTimeout(){D(this,ol)&&(il.clearTimeout(D(this,ol)),pe(this,ol,void 0))}},ol=new WeakMap,JS),ul,Ns,Cr,cl,dn,Du,dl,cr,hk,ja,WS,kT=(WS=class extends fk{constructor(t){super();je(this,cr);je(this,ul);je(this,Ns);je(this,Cr);je(this,cl);je(this,dn);je(this,Du);je(this,dl);pe(this,dl,!1),pe(this,Du,t.defaultOptions),this.setOptions(t.options),this.observers=[],pe(this,cl,t.client),pe(this,Cr,D(this,cl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,pe(this,ul,E1(this.options)),this.state=t.state??D(this,ul),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,dn))==null?void 0:t.promise}setOptions(t){if(this.options={...D(this,Du),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=E1(this.options);n.data!==void 0&&(this.setState(C1(n.data,n.dataUpdatedAt)),pe(this,ul,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,Cr).remove(this)}setData(t,n){const a=Jp(this.state.data,t,this.options);return Ue(this,cr,ja).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){Ue(this,cr,ja).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,l;const n=(a=D(this,dn))==null?void 0:a.promise;return(l=D(this,dn))==null||l.cancel(t),n?n.then(Nn).catch(Nn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return D(this,ul)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Nr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===iy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ci(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ok(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=D(this,dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,Cr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(D(this,dn)&&(D(this,dl)||Ue(this,cr,hk).call(this)?D(this,dn).cancel({revert:!0}):D(this,dn).cancelRetry()),this.scheduleGc()),D(this,Cr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ue(this,cr,ja).call(this,{type:"invalidate"})}async fetch(t,n){var m,h,y,g,b,w,k,j,E,C,R,O;if(this.state.fetchStatus!=="idle"&&((m=D(this,dn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(D(this,dn))return D(this,dn).continueRetry(),D(this,dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(B=>B.options.queryFn);M&&this.setOptions(M.options)}const a=new AbortController,l=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(pe(this,dl,!0),a.signal)})},o=()=>{const M=uk(this.options,n),z=(()=>{const $={client:D(this,cl),queryKey:this.queryKey,meta:this.meta};return l($),$})();return pe(this,dl,!1),this.options.persister?this.options.persister(M,z,this):M(z)},f=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:D(this,cl),state:this.state,fetchFn:o};return l(M),M})();(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))&&Ue(this,cr,ja).call(this,{type:"fetch",meta:(g=f.fetchOptions)==null?void 0:g.meta}),pe(this,dn,dk({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:M=>{M instanceof eg&&M.revert&&this.setState({...D(this,Ns),fetchStatus:"idle"}),a.abort()},onFail:(M,B)=>{Ue(this,cr,ja).call(this,{type:"failed",failureCount:M,error:B})},onPause:()=>{Ue(this,cr,ja).call(this,{type:"pause"})},onContinue:()=>{Ue(this,cr,ja).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const M=await D(this,dn).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(w=(b=D(this,Cr).config).onSuccess)==null||w.call(b,M,this),(j=(k=D(this,Cr).config).onSettled)==null||j.call(k,M,this.state.error,this),M}catch(M){if(M instanceof eg){if(M.silent)return D(this,dn).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Ue(this,cr,ja).call(this,{type:"error",error:M}),(C=(E=D(this,Cr).config).onError)==null||C.call(E,M,this),(O=(R=D(this,Cr).config).onSettled)==null||O.call(R,this.state.data,M,this),M}finally{this.scheduleGc()}}},ul=new WeakMap,Ns=new WeakMap,Cr=new WeakMap,cl=new WeakMap,dn=new WeakMap,Du=new WeakMap,dl=new WeakMap,cr=new WeakSet,hk=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ja=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,...mk(a.data,this.options),fetchMeta:t.meta??null};case"success":const l={...a,...C1(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),Ft.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),D(this,Cr).notify({query:this,type:"updated",action:t})})},WS);function mk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ck(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function C1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function E1(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 Kn,it,Iu,Dn,fl,_s,Ca,vi,Lu,Ts,As,hl,ml,bi,Rs,gt,cu,tg,ng,rg,ag,ig,lg,sg,pk,ek,sy=(ek=class extends xl{constructor(t,n){super();je(this,gt);je(this,Kn);je(this,it);je(this,Iu);je(this,Dn);je(this,fl);je(this,_s);je(this,Ca);je(this,vi);je(this,Lu);je(this,Ts);je(this,As);je(this,hl);je(this,ml);je(this,bi);je(this,Rs,new Set);this.options=n,pe(this,Kn,t),pe(this,vi,null),pe(this,Ca,Wp()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(D(this,it).addObserver(this),N1(D(this,it),this.options)?Ue(this,gt,cu).call(this):this.updateResult(),Ue(this,gt,ag).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return og(D(this,it),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return og(D(this,it),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ue(this,gt,ig).call(this),Ue(this,gt,lg).call(this),D(this,it).removeObserver(this)}setOptions(t){const n=this.options,a=D(this,it);if(this.options=D(this,Kn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Nr(this.options.enabled,D(this,it))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ue(this,gt,sg).call(this),D(this,it).setOptions(this.options),n._defaulted&&!xu(this.options,n)&&D(this,Kn).getQueryCache().notify({type:"observerOptionsUpdated",query:D(this,it),observer:this});const l=this.hasListeners();l&&_1(D(this,it),a,this.options,n)&&Ue(this,gt,cu).call(this),this.updateResult(),l&&(D(this,it)!==a||Nr(this.options.enabled,D(this,it))!==Nr(n.enabled,D(this,it))||Ci(this.options.staleTime,D(this,it))!==Ci(n.staleTime,D(this,it)))&&Ue(this,gt,tg).call(this);const o=Ue(this,gt,ng).call(this);l&&(D(this,it)!==a||Nr(this.options.enabled,D(this,it))!==Nr(n.enabled,D(this,it))||o!==D(this,bi))&&Ue(this,gt,rg).call(this,o)}getOptimisticResult(t){const n=D(this,Kn).getQueryCache().build(D(this,Kn),t),a=this.createResult(n,t);return CT(this,a)&&(pe(this,Dn,a),pe(this,_s,this.options),pe(this,fl,D(this,it).state)),a}getCurrentResult(){return D(this,Dn)}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&&D(this,Ca).status==="pending"&&D(this,Ca).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(t){D(this,Rs).add(t)}getCurrentQuery(){return D(this,it)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=D(this,Kn).defaultQueryOptions(t),a=D(this,Kn).getQueryCache().build(D(this,Kn),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return Ue(this,gt,cu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),D(this,Dn)))}createResult(t,n){var Q;const a=D(this,it),l=this.options,o=D(this,Dn),c=D(this,fl),f=D(this,_s),h=t!==a?t.state:D(this,Iu),{state:y}=t;let g={...y},b=!1,w;if(n._optimisticResults){const I=this.hasListeners(),ne=!I&&N1(t,n),le=I&&_1(t,a,n,l);(ne||le)&&(g={...g,...mk(y.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:E}=g;w=g.data;let C=!1;if(n.placeholderData!==void 0&&w===void 0&&E==="pending"){let I;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(I=o.data,C=!0):I=typeof n.placeholderData=="function"?n.placeholderData((Q=D(this,As))==null?void 0:Q.state.data,D(this,As)):n.placeholderData,I!==void 0&&(E="success",w=Jp(o==null?void 0:o.data,I,n),b=!0)}if(n.select&&w!==void 0&&!C)if(o&&w===(c==null?void 0:c.data)&&n.select===D(this,Lu))w=D(this,Ts);else try{pe(this,Lu,n.select),w=n.select(w),w=Jp(o==null?void 0:o.data,w,n),pe(this,Ts,w),pe(this,vi,null)}catch(I){pe(this,vi,I)}D(this,vi)&&(k=D(this,vi),w=D(this,Ts),j=Date.now(),E="error");const R=g.fetchStatus==="fetching",O=E==="pending",M=E==="error",B=O&&R,z=w!==void 0,U={status:E,fetchStatus:g.fetchStatus,isPending:O,isSuccess:E==="success",isError:M,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&&!O,isLoadingError:M&&!z,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:M&&z,isStale:oy(t,n),refetch:this.refetch,promise:D(this,Ca),isEnabled:Nr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=U.data!==void 0,ne=U.status==="error"&&!I,le=J=>{ne?J.reject(U.error):I&&J.resolve(U.data)},we=()=>{const J=pe(this,Ca,U.promise=Wp());le(J)},Y=D(this,Ca);switch(Y.status){case"pending":t.queryHash===a.queryHash&&le(Y);break;case"fulfilled":(ne||U.data!==Y.value)&&we();break;case"rejected":(!ne||U.error!==Y.reason)&&we();break}}return U}updateResult(){const t=D(this,Dn),n=this.createResult(D(this,it),this.options);if(pe(this,fl,D(this,it).state),pe(this,_s,this.options),D(this,fl).data!==void 0&&pe(this,As,D(this,it)),xu(n,t))return;pe(this,Dn,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,o=typeof l=="function"?l():l;if(o==="all"||!o&&!D(this,Rs).size)return!0;const c=new Set(o??D(this,Rs));return this.options.throwOnError&&c.add("error"),Object.keys(D(this,Dn)).some(f=>{const m=f;return D(this,Dn)[m]!==t[m]&&c.has(m)})};Ue(this,gt,pk).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ue(this,gt,ag).call(this)}},Kn=new WeakMap,it=new WeakMap,Iu=new WeakMap,Dn=new WeakMap,fl=new WeakMap,_s=new WeakMap,Ca=new WeakMap,vi=new WeakMap,Lu=new WeakMap,Ts=new WeakMap,As=new WeakMap,hl=new WeakMap,ml=new WeakMap,bi=new WeakMap,Rs=new WeakMap,gt=new WeakSet,cu=function(t){Ue(this,gt,sg).call(this);let n=D(this,it).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Nn)),n},tg=function(){Ue(this,gt,ig).call(this);const t=Ci(this.options.staleTime,D(this,it));if(wu.isServer()||D(this,Dn).isStale||!Yp(t))return;const a=ok(D(this,Dn).dataUpdatedAt,t)+1;pe(this,hl,il.setTimeout(()=>{D(this,Dn).isStale||this.updateResult()},a))},ng=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(D(this,it)):this.options.refetchInterval)??!1},rg=function(t){Ue(this,gt,lg).call(this),pe(this,bi,t),!(wu.isServer()||Nr(this.options.enabled,D(this,it))===!1||!Yp(D(this,bi))||D(this,bi)===0)&&pe(this,ml,il.setInterval(()=>{(this.options.refetchIntervalInBackground||ny.isFocused())&&Ue(this,gt,cu).call(this)},D(this,bi)))},ag=function(){Ue(this,gt,tg).call(this),Ue(this,gt,rg).call(this,Ue(this,gt,ng).call(this))},ig=function(){D(this,hl)&&(il.clearTimeout(D(this,hl)),pe(this,hl,void 0))},lg=function(){D(this,ml)&&(il.clearInterval(D(this,ml)),pe(this,ml,void 0))},sg=function(){const t=D(this,Kn).getQueryCache().build(D(this,Kn),this.options);if(t===D(this,it))return;const n=D(this,it);pe(this,it,t),pe(this,Iu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},pk=function(t){Ft.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(D(this,Dn))}),D(this,Kn).getQueryCache().notify({query:D(this,it),type:"observerResultsUpdated"})})},ek);function jT(e,t){return Nr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function N1(e,t){return jT(e,t)||e.state.data!==void 0&&og(e,t,t.refetchOnMount)}function og(e,t,n){if(Nr(t.enabled,e)!==!1&&Ci(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&oy(e,t)}return!1}function _1(e,t,n,a){return(e!==t||Nr(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&oy(e,n)}function oy(e,t){return Nr(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function CT(e,t){return!xu(e.getCurrentResult(),t)}function T1(e){return{onFetch:(t,n)=>{var y,g,b,w,k;const a=t.options,l=(b=(g=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:g.fetchMore)==null?void 0:b.direction,o=((w=t.state.data)==null?void 0:w.pages)||[],c=((k=t.state.data)==null?void 0:k.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const h=async()=>{let j=!1;const E=O=>{vT(O,()=>t.signal,()=>j=!0)},C=uk(t.options,t.fetchOptions),R=async(O,M,B)=>{if(j)return Promise.reject();if(M==null&&O.pages.length)return Promise.resolve(O);const $=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:M,direction:B?"backward":"forward",meta:t.options.meta};return E(ne),ne})(),U=await C($),{maxPages:Q}=t.options,I=B?yT:gT;return{pages:I(O.pages,U,Q),pageParams:I(O.pageParams,M,Q)}};if(l&&o.length){const O=l==="backward",M=O?ET:A1,B={pages:o,pageParams:c},z=M(a,B);f=await R(B,z,O)}else{const O=e??o.length;do{const M=m===0?c[0]??a.initialPageParam:A1(a,f);if(m>0&&M==null)break;f=await R(f,M),m++}while(m<O)}return f};t.options.persister?t.fetchFn=()=>{var j,E;return(E=(j=t.options).persister)==null?void 0:E.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function A1(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 ET(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 Uu,Xr,Cn,pl,Jr,di,tk,NT=(tk=class extends fk{constructor(t){super();je(this,Jr);je(this,Uu);je(this,Xr);je(this,Cn);je(this,pl);pe(this,Uu,t.client),this.mutationId=t.mutationId,pe(this,Cn,t.mutationCache),pe(this,Xr,[]),this.state=t.state||gk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Xr).includes(t)||(D(this,Xr).push(t),this.clearGcTimeout(),D(this,Cn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){pe(this,Xr,D(this,Xr).filter(n=>n!==t)),this.scheduleGc(),D(this,Cn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():D(this,Cn).remove(this))}continue(){var t;return((t=D(this,pl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,f,m,h,y,g,b,w,k,j,E,C,R,O,M,B,z,$;const n=()=>{Ue(this,Jr,di).call(this,{type:"continue"})},a={client:D(this,Uu),meta:this.options.meta,mutationKey:this.options.mutationKey};pe(this,pl,dk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(U,Q)=>{Ue(this,Jr,di).call(this,{type:"failed",failureCount:U,error:Q})},onPause:()=>{Ue(this,Jr,di).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,Cn).canRun(this)}));const l=this.state.status==="pending",o=!D(this,pl).canStart();try{if(l)n();else{Ue(this,Jr,di).call(this,{type:"pending",variables:t,isPaused:o}),D(this,Cn).config.onMutate&&await D(this,Cn).config.onMutate(t,this,a);const Q=await((f=(c=this.options).onMutate)==null?void 0:f.call(c,t,a));Q!==this.state.context&&Ue(this,Jr,di).call(this,{type:"pending",context:Q,variables:t,isPaused:o})}const U=await D(this,pl).start();return await((h=(m=D(this,Cn).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=(b=D(this,Cn).config).onSettled)==null?void 0:w.call(b,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)),Ue(this,Jr,di).call(this,{type:"success",data:U}),U}catch(U){try{await((C=(E=D(this,Cn).config).onError)==null?void 0:C.call(E,U,t,this.state.context,this,a))}catch(Q){Promise.reject(Q)}try{await((O=(R=this.options).onError)==null?void 0:O.call(R,U,t,this.state.context,a))}catch(Q){Promise.reject(Q)}try{await((B=(M=D(this,Cn).config).onSettled)==null?void 0:B.call(M,void 0,U,this.state.variables,this.state.context,this,a))}catch(Q){Promise.reject(Q)}try{await(($=(z=this.options).onSettled)==null?void 0:$.call(z,void 0,U,t,this.state.context,a))}catch(Q){Promise.reject(Q)}throw Ue(this,Jr,di).call(this,{type:"error",error:U}),U}finally{D(this,Cn).runNext(this)}}},Uu=new WeakMap,Xr=new WeakMap,Cn=new WeakMap,pl=new WeakMap,Jr=new WeakSet,di=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ft.batch(()=>{D(this,Xr).forEach(a=>{a.onMutationUpdate(t)}),D(this,Cn).notify({mutation:this,type:"updated",action:t})})},tk);function gk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ea,Pr,Pu,nk,_T=(nk=class extends xl{constructor(t={}){super();je(this,Ea);je(this,Pr);je(this,Pu);this.config=t,pe(this,Ea,new Set),pe(this,Pr,new Map),pe(this,Pu,0)}build(t,n,a){const l=new NT({client:t,mutationCache:this,mutationId:++xd(this,Pu)._,options:t.defaultMutationOptions(n),state:a});return this.add(l),l}add(t){D(this,Ea).add(t);const n=wd(t);if(typeof n=="string"){const a=D(this,Pr).get(n);a?a.push(t):D(this,Pr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(D(this,Ea).delete(t)){const n=wd(t);if(typeof n=="string"){const a=D(this,Pr).get(n);if(a)if(a.length>1){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}else a[0]===t&&D(this,Pr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=wd(t);if(typeof n=="string"){const a=D(this,Pr).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=wd(t);if(typeof n=="string"){const l=(a=D(this,Pr).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(){Ft.batch(()=>{D(this,Ea).forEach(t=>{this.notify({type:"removed",mutation:t})}),D(this,Ea).clear(),D(this,Pr).clear()})}getAll(){return Array.from(D(this,Ea))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>S1(n,a))}findAll(t={}){return this.getAll().filter(n=>S1(t,n))}notify(t){Ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ft.batch(()=>Promise.all(t.map(n=>n.continue().catch(Nn))))}},Ea=new WeakMap,Pr=new WeakMap,Pu=new WeakMap,nk);function wd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Na,xi,Gn,_a,Aa,Bd,ug,rk,TT=(rk=class extends xl{constructor(n,a){super();je(this,Aa);je(this,Na);je(this,xi);je(this,Gn);je(this,_a);pe(this,Na,n),this.setOptions(a),this.bindMethods(),Ue(this,Aa,Bd).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=D(this,Na).defaultMutationOptions(n),xu(this.options,a)||D(this,Na).getMutationCache().notify({type:"observerOptionsUpdated",mutation:D(this,Gn),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&gl(a.mutationKey)!==gl(this.options.mutationKey)?this.reset():((l=D(this,Gn))==null?void 0:l.state.status)==="pending"&&D(this,Gn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=D(this,Gn))==null||n.removeObserver(this)}onMutationUpdate(n){Ue(this,Aa,Bd).call(this),Ue(this,Aa,ug).call(this,n)}getCurrentResult(){return D(this,xi)}reset(){var n;(n=D(this,Gn))==null||n.removeObserver(this),pe(this,Gn,void 0),Ue(this,Aa,Bd).call(this),Ue(this,Aa,ug).call(this)}mutate(n,a){var l;return pe(this,_a,a),(l=D(this,Gn))==null||l.removeObserver(this),pe(this,Gn,D(this,Na).getMutationCache().build(D(this,Na),this.options)),D(this,Gn).addObserver(this),D(this,Gn).execute(n)}},Na=new WeakMap,xi=new WeakMap,Gn=new WeakMap,_a=new WeakMap,Aa=new WeakSet,Bd=function(){var a;const n=((a=D(this,Gn))==null?void 0:a.state)??gk();pe(this,xi,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ug=function(n){Ft.batch(()=>{var a,l,o,c,f,m,h,y;if(D(this,_a)&&this.hasListeners()){const g=D(this,xi).variables,b=D(this,xi).context,w={client:D(this,Na),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(l=(a=D(this,_a)).onSuccess)==null||l.call(a,n.data,g,b,w)}catch(k){Promise.reject(k)}try{(c=(o=D(this,_a)).onSettled)==null||c.call(o,n.data,null,g,b,w)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=D(this,_a)).onError)==null||m.call(f,n.error,g,b,w)}catch(k){Promise.reject(k)}try{(y=(h=D(this,_a)).onSettled)==null||y.call(h,void 0,n.error,g,b,w)}catch(k){Promise.reject(k)}}}this.listeners.forEach(g=>{g(D(this,xi))})})},rk);function R1(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function AT(e,t,n){const a=e.slice(0);return a[t]=n,a}var zs,or,Os,Ms,Er,wi,Bu,$u,Fu,qu,kn,cg,dg,fg,hg,mg,ak,RT=(ak=class extends xl{constructor(t,n,a){super();je(this,kn);je(this,zs);je(this,or);je(this,Os);je(this,Ms);je(this,Er);je(this,wi);je(this,Bu);je(this,$u);je(this,Fu);je(this,qu,[]);pe(this,zs,t),pe(this,Ms,a),pe(this,Os,[]),pe(this,Er,[]),pe(this,or,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&D(this,Er).forEach(t=>{t.subscribe(n=>{Ue(this,kn,hg).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,D(this,Er).forEach(t=>{t.destroy()})}setQueries(t,n){pe(this,Os,t),pe(this,Ms,n),Ft.batch(()=>{const a=D(this,Er),l=Ue(this,kn,fg).call(this,D(this,Os));l.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=l.map(g=>g.observer),c=o.map(g=>g.getCurrentResult()),f=a.length!==o.length,m=o.some((g,b)=>g!==a[b]),h=f||m,y=h?!0:c.some((g,b)=>{const w=D(this,or)[b];return!w||!xu(g,w)});!h&&!y||(h&&(pe(this,qu,l),pe(this,Er,o)),pe(this,or,c),this.hasListeners()&&(h&&(R1(a,o).forEach(g=>{g.destroy()}),R1(o,a).forEach(g=>{g.subscribe(b=>{Ue(this,kn,hg).call(this,g,b)})})),Ue(this,kn,mg).call(this)))})}getCurrentResult(){return D(this,or)}getQueries(){return D(this,Er).map(t=>t.getCurrentQuery())}getObservers(){return D(this,Er)}getOptimisticResult(t,n){const a=Ue(this,kn,fg).call(this,t),l=a.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=a.map(c=>c.defaultedQueryOptions.queryHash);return[l,c=>Ue(this,kn,dg).call(this,c??l,n,o),()=>Ue(this,kn,cg).call(this,l,a)]}},zs=new WeakMap,or=new WeakMap,Os=new WeakMap,Ms=new WeakMap,Er=new WeakMap,wi=new WeakMap,Bu=new WeakMap,$u=new WeakMap,Fu=new WeakMap,qu=new WeakMap,kn=new WeakSet,cg=function(t,n){return n.map((a,l)=>{const o=t[l];return a.defaultedQueryOptions.notifyOnChangeProps?o:a.observer.trackResult(o,c=>{n.forEach(f=>{f.observer.trackProp(c)})})})},dg=function(t,n,a){if(n){const l=D(this,Fu),o=a!==void 0&&l!==void 0&&(l.length!==a.length||a.some((c,f)=>c!==l[f]));return(!D(this,wi)||D(this,or)!==D(this,$u)||o||n!==D(this,Bu))&&(pe(this,Bu,n),pe(this,$u,D(this,or)),a!==void 0&&pe(this,Fu,a),pe(this,wi,ay(D(this,wi),n(t)))),D(this,wi)}return t},fg=function(t){const n=new Map;D(this,Er).forEach(l=>{const o=l.options.queryHash;if(!o)return;const c=n.get(o);c?c.push(l):n.set(o,[l])});const a=[];return t.forEach(l=>{var m;const o=D(this,zs).defaultQueryOptions(l),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new sy(D(this,zs),o);a.push({defaultedQueryOptions:o,observer:f})}),a},hg=function(t,n){const a=D(this,Er).indexOf(t);a!==-1&&(pe(this,or,AT(D(this,or),a,n)),Ue(this,kn,mg).call(this))},mg=function(){var t;if(this.hasListeners()){const n=D(this,wi),a=Ue(this,kn,cg).call(this,D(this,or),D(this,qu)),l=Ue(this,kn,dg).call(this,a,(t=D(this,Ms))==null?void 0:t.combine);n!==l&&Ft.batch(()=>{this.listeners.forEach(o=>{o(D(this,or))})})}},ak),Wr,ik,zT=(ik=class extends xl{constructor(t={}){super();je(this,Wr);this.config=t,pe(this,Wr,new Map)}build(t,n,a){const l=n.queryKey,o=n.queryHash??ry(l,n);let c=this.get(o);return c||(c=new kT({client:t,queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(c)),c}add(t){D(this,Wr).has(t.queryHash)||(D(this,Wr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=D(this,Wr).get(t.queryHash);n&&(t.destroy(),n===t&&D(this,Wr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Wr).get(t)}getAll(){return[...D(this,Wr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>w1(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>w1(t,a)):n}notify(t){Ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ft.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ft.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Wr=new WeakMap,ik),$t,Si,ki,Ds,Is,ji,Ls,Us,lk,OT=(lk=class{constructor(e={}){je(this,$t);je(this,Si);je(this,ki);je(this,Ds);je(this,Is);je(this,ji);je(this,Ls);je(this,Us);pe(this,$t,e.queryCache||new zT),pe(this,Si,e.mutationCache||new _T),pe(this,ki,e.defaultOptions||{}),pe(this,Ds,new Map),pe(this,Is,new Map),pe(this,ji,0)}mount(){xd(this,ji)._++,D(this,ji)===1&&(pe(this,Ls,ny.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,$t).onFocus())})),pe(this,Us,Gd.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,$t).onOnline())})))}unmount(){var e,t;xd(this,ji)._--,D(this,ji)===0&&((e=D(this,Ls))==null||e.call(this),pe(this,Ls,void 0),(t=D(this,Us))==null||t.call(this),pe(this,Us,void 0))}isFetching(e){return D(this,$t).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,Si).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,$t).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=D(this,$t).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ci(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return D(this,$t).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=D(this,$t).get(a.queryHash),o=l==null?void 0:l.state.data,c=hT(t,o);if(c!==void 0)return D(this,$t).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return Ft.batch(()=>D(this,$t).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=D(this,$t).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=D(this,$t);Ft.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=D(this,$t);return Ft.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Ft.batch(()=>D(this,$t).findAll(e).map(l=>l.cancel(n)));return Promise.all(a).then(Nn).catch(Nn)}invalidateQueries(e,t={}){return Ft.batch(()=>(D(this,$t).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=Ft.batch(()=>D(this,$t).findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let o=l.fetch(void 0,n);return n.throwOnError||(o=o.catch(Nn)),l.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(a).then(Nn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=D(this,$t).build(this,t);return n.isStaleByTime(Ci(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Nn).catch(Nn)}fetchInfiniteQuery(e){return e.behavior=T1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Nn).catch(Nn)}ensureInfiniteQueryData(e){return e.behavior=T1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gd.isOnline()?D(this,Si).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,$t)}getMutationCache(){return D(this,Si)}getDefaultOptions(){return D(this,ki)}setDefaultOptions(e){pe(this,ki,e)}setQueryDefaults(e,t){D(this,Ds).set(gl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,Ds).values()],n={};return t.forEach(a=>{bu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){D(this,Is).set(gl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,Is).values()],n={};return t.forEach(a=>{bu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,ki).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ry(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===iy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,ki).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,$t).clear(),D(this,Si).clear()}},$t=new WeakMap,Si=new WeakMap,ki=new WeakMap,Ds=new WeakMap,Is=new WeakMap,ji=new WeakMap,Ls=new WeakMap,Us=new WeakMap,lk),yk=x.createContext(void 0),nn=e=>{const t=x.useContext(yk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},MT=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(yk.Provider,{value:e,children:t})),vk=x.createContext(!1),bk=()=>x.useContext(vk);vk.Provider;function DT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IT=x.createContext(DT()),xk=()=>x.useContext(IT),wk=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?ly(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},Sk=e=>{x.useEffect(()=>{e.clearReset()},[e])},kk=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(l&&e.data===void 0||ly(n,[e.error,a])),jk=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))}},LT=(e,t)=>e.isLoading&&e.isFetching&&!t,pg=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,gg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function UT({queries:e,...t},n){const a=nn(),l=bk(),o=xk(),c=x.useMemo(()=>e.map(j=>{const E=a.defaultQueryOptions(j);return E._optimisticResults=l?"isRestoring":"optimistic",E}),[e,a,l]);c.forEach(j=>{jk(j);const E=a.getQueryCache().get(j.queryHash);wk(j,o,E)}),Sk(o);const[f]=x.useState(()=>new RT(a,c,t)),[m,h,y]=f.getOptimisticResult(c,t.combine),g=!l&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(j=>g?f.subscribe(Ft.batchCalls(j)):Nn,[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setQueries(c,t)},[c,t,f]);const w=m.some((j,E)=>pg(c[E],j))?m.flatMap((j,E)=>{const C=c[E];if(C&&pg(C,j)){const R=new sy(a,C);return gg(C,R,o)}return[]}):[];if(w.length>0)throw Promise.all(w);const k=m.find((j,E)=>{const C=c[E];return C&&kk({result:j,errorResetBoundary:o,throwOnError:C.throwOnError,query:a.getQueryCache().get(C.queryHash),suspense:C.suspense})});if(k!=null&&k.error)throw k.error;return h(y())}function PT(e,t,n){var b,w,k,j;const a=bk(),l=xk(),o=nn(),c=o.defaultQueryOptions(e);(w=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||w.call(b,c);const f=o.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",jk(c),wk(c,l,f),Sk(l);const m=!o.getQueryCache().get(c.queryHash),[h]=x.useState(()=>new t(o,c)),y=h.getOptimisticResult(c),g=!a&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(E=>{const C=g?h.subscribe(Ft.batchCalls(E)):Nn;return h.updateResult(),C},[h,g]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),x.useEffect(()=>{h.setOptions(c)},[c,h]),pg(c,y))throw gg(c,h,l);if(kk({result:y,errorResetBoundary:l,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw y.error;if((j=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||j.call(k,c,y),c.experimental_prefetchInRender&&!wu.isServer()&<(y,a)){const E=m?gg(c,h,l):f==null?void 0:f.promise;E==null||E.catch(Nn).finally(()=>{h.updateResult()})}return c.notifyOnChangeProps?y:h.trackResult(y)}function He(e,t){return PT(e,sy)}function St(e,t){const n=nn(),[a]=x.useState(()=>new TT(n,e));x.useEffect(()=>{a.setOptions(e)},[a,e]);const l=x.useSyncExternalStore(x.useCallback(c=>a.subscribe(Ft.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),o=x.useCallback((c,f)=>{a.mutate(c,f).catch(Nn)},[a]);if(l.error&&ly(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 z1="popstate";function O1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function BT(e={}){function t(a,l){var h;let o=(h=l.state)==null?void 0:h.masked,{pathname:c,search:f,hash:m}=o||a.location;return yg("",{pathname:c,search:f,hash:m},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,l){return typeof l=="string"?l:Su(l)}return FT(t,n,null,e)}function Mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $T(){return Math.random().toString(36).substring(2,10)}function M1(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 yg(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||$T(),unstable_mask:l}}function Su({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 FT(e,t,n,a={}){let{window:l=document.defaultView,v5Compat:o=!1}=a,c=l.history,f="POP",m=null,h=y();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function y(){return(c.state||{idx:null}).idx}function g(){f="POP";let E=y(),C=E==null?null:E-h;h=E,m&&m({action:f,location:j.location,delta:C})}function b(E,C){f="PUSH";let R=O1(E)?E:yg(j.location,E,C);h=y()+1;let O=M1(R,h),M=j.createHref(R.unstable_mask||R);try{c.pushState(O,"",M)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;l.location.assign(M)}o&&m&&m({action:f,location:j.location,delta:1})}function w(E,C){f="REPLACE";let R=O1(E)?E:yg(j.location,E,C);h=y();let O=M1(R,h),M=j.createHref(R.unstable_mask||R);c.replaceState(O,"",M),o&&m&&m({action:f,location:j.location,delta:0})}function k(E){return qT(E)}let j={get action(){return f},get location(){return e(l,c)},listen(E){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(z1,g),m=E,()=>{l.removeEventListener(z1,g),m=null}},createHref(E){return t(l,E)},createURL:k,encodeLocation(E){let C=k(E);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:w,go(E){return c.go(E)}};return j}function qT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Mt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Su(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function Ck(e,t,n="/"){return HT(e,t,n,!1)}function HT(e,t,n,a){let l=typeof t=="string"?Ks(t):t,o=Ra(l.pathname||"/",n);if(o==null)return null;let c=Ek(e);ZT(c);let f=null;for(let m=0;f==null&&m<c.length;++m){let h=nA(o);f=eA(c[m],h,a)}return f}function Ek(e,t=[],n=[],a="",l=!1){let o=(c,f,m=l,h)=>{let y={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&m)return;Mt(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=ta([a,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(Mt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Ek(c.children,t,b,g,m)),!(c.path==null&&!c.index)&&t.push({path:g,score:JT(g,c.index),routesMeta:b})};return e.forEach((c,f)=>{var m;if(c.path===""||!((m=c.path)!=null&&m.includes("?")))o(c,f);else for(let h of Nk(c.path))o(c,f,!0,h)}),t}function Nk(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(a.length===0)return l?[o,""]:[o];let c=Nk(a.join("/")),f=[];return f.push(...c.map(m=>m===""?o:[o,m].join("/"))),l&&f.push(...c),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function ZT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:WT(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var VT=/^:[\w-]+$/,QT=3,KT=2,GT=1,YT=10,XT=-2,D1=e=>e==="*";function JT(e,t){let n=e.split("/"),a=n.length;return n.some(D1)&&(a+=XT),t&&(a+=KT),n.filter(l=>!D1(l)).reduce((l,o)=>l+(VT.test(o)?QT:o===""?GT:YT),a)}function WT(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 eA(e,t,n=!1){let{routesMeta:a}=e,l={},o="/",c=[];for(let f=0;f<a.length;++f){let m=a[f],h=f===a.length-1,y=o==="/"?t:t.slice(o.length)||"/",g=Yd({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},y),b=m.route;if(!g&&h&&n&&!a[a.length-1].route.index&&(g=Yd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),c.push({params:l,pathname:ta([o,g.pathname]),pathnameBase:lA(ta([o,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(o=ta([o,g.pathnameBase]))}return c}function Yd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=tA(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let o=l[0],c=o.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},b)=>{if(y==="*"){let k=f[b]||"";c=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const w=f[b];return g&&!w?h[y]=void 0:h[y]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:c,pattern:e}}function tA(e,t=!1,n=!0){Tr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,m,h,y)=>{if(a.push({paramName:f,isOptional:m!=null}),m){let g=y.charAt(h+c.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function nA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tr(!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 Ra(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 rA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function aA(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=I1(n.substring(1),"/"):o=I1(n,t)):o=t,{pathname:o,search:sA(a),hash:oA(l)}}function I1(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 ip(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 iA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uy(e){let t=iA(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function pf(e,t,n,a=!1){let l;typeof e=="string"?l=Ks(e):(l={...e},Mt(!l.pathname||!l.pathname.includes("?"),ip("?","pathname","search",l)),Mt(!l.pathname||!l.pathname.includes("#"),ip("#","pathname","hash",l)),Mt(!l.search||!l.search.includes("#"),ip("#","search","hash",l)));let o=e===""||l.pathname==="",c=o?"/":l.pathname,f;if(c==null)f=n;else{let g=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),g-=1;l.pathname=b.join("/")}f=g>=0?t[g]:"/"}let m=aA(l,f),h=c&&c!=="/"&&c.endsWith("/"),y=(o||c===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(h||y)&&(m.pathname+="/"),m}var ta=e=>e.join("/").replace(/\/\/+/g,"/"),lA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,uA=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 cA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function dA(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var _k=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tk(e,t){let n=e;if(typeof n!="string"||!rA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,l=!1;if(_k)try{let o=new URL(window.location.href),c=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=Ra(c.pathname,t);c.origin===o.origin&&f!=null?n=f+c.search+c.hash:l=!0}catch{Tr(!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 Ak=["POST","PUT","PATCH","DELETE"];new Set(Ak);var fA=["GET",...Ak];new Set(fA);var Gs=x.createContext(null);Gs.displayName="DataRouter";var gf=x.createContext(null);gf.displayName="DataRouterState";var hA=x.createContext(!1),Rk=x.createContext({isTransitioning:!1});Rk.displayName="ViewTransition";var mA=x.createContext(new Map);mA.displayName="Fetchers";var pA=x.createContext(null);pA.displayName="Await";var hr=x.createContext(null);hr.displayName="Navigation";var Hu=x.createContext(null);Hu.displayName="Location";var Rr=x.createContext({outlet:null,matches:[],isDataRoute:!1});Rr.displayName="Route";var cy=x.createContext(null);cy.displayName="RouteError";var zk="REACT_ROUTER_ERROR",gA="REDIRECT",yA="ROUTE_ERROR_RESPONSE";function vA(e){if(e.startsWith(`${zk}:${gA}:{`))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 bA(e){if(e.startsWith(`${zk}:${yA}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new uA(t.status,t.statusText,t.data)}catch{}}function xA(e,{relative:t}={}){Mt(Ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=x.useContext(hr),{hash:l,pathname:o,search:c}=Zu(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:ta([n,o])),a.createHref({pathname:f,search:c,hash:l})}function Ys(){return x.useContext(Hu)!=null}function Yn(){return Mt(Ys(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Hu).location}var Ok="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Mk(e){x.useContext(hr).static||x.useLayoutEffect(e)}function Un(){let{isDataRoute:e}=x.useContext(Rr);return e?DA():wA()}function wA(){Mt(Ys(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Gs),{basename:t,navigator:n}=x.useContext(hr),{matches:a}=x.useContext(Rr),{pathname:l}=Yn(),o=JSON.stringify(uy(a)),c=x.useRef(!1);return Mk(()=>{c.current=!0}),x.useCallback((m,h={})=>{if(Tr(c.current,Ok),!c.current)return;if(typeof m=="number"){n.go(m);return}let y=pf(m,JSON.parse(o),l,h.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:ta([t,y.pathname])),(h.replace?n.replace:n.push)(y,h.state,h)},[t,n,o,l,e])}var SA=x.createContext(null);function kA(e){let t=x.useContext(Rr).outlet;return x.useMemo(()=>t&&x.createElement(SA.Provider,{value:e},t),[t,e])}function Dk(){let{matches:e}=x.useContext(Rr),t=e[e.length-1];return t?t.params:{}}function Zu(e,{relative:t}={}){let{matches:n}=x.useContext(Rr),{pathname:a}=Yn(),l=JSON.stringify(uy(n));return x.useMemo(()=>pf(e,JSON.parse(l),a,t==="path"),[e,l,a,t])}function jA(e,t){return Ik(e,t)}function Ik(e,t,n){var E;Mt(Ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=x.useContext(hr),{matches:l}=x.useContext(Rr),o=l[l.length-1],c=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",h=o&&o.route;{let C=h&&h.path||"";Uk(f,!h||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=Yn(),g;if(t){let C=typeof t=="string"?Ks(t):t;Mt(m==="/"||((E=C.pathname)==null?void 0:E.startsWith(m)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=y;let b=g.pathname||"/",w=b;if(m!=="/"){let C=m.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=Ck(e,{pathname:w});Tr(h||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Tr(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=TA(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},c,C.params),pathname:ta([m,a.encodeLocation?a.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:ta([m,a.encodeLocation?a.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),l,n);return t&&j?x.createElement(Hu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},j):j}function CA(){let e=MA(),t=cA(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:o},"ErrorBoundary")," or"," ",x.createElement("code",{style:o},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:l},n):null,c)}var EA=x.createElement(CA,null),Lk=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=bA(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(Rr.Provider,{value:this.props.routeContext},x.createElement(cy.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(NA,{error:e},t):t}};Lk.contextType=hA;var lp=new WeakMap;function NA({children:e,error:t}){let{basename:n}=x.useContext(hr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=vA(t.digest);if(a){let l=lp.get(t);if(l)throw l;let o=Tk(a.location,n);if(_k&&!lp.get(t))if(o.isExternal||a.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw lp.set(t,c),c}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function _A({routeContext:e,match:t,children:n}){let a=x.useContext(Gs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Rr.Provider,{value:e},n)}function TA(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);Mt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let c=!1,f=-1;if(n&&a){c=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:b,errors:w}=a,k=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!w||w[g.route.id]===void 0);if(g.route.lazy||k){n.isStatic&&(c=!0),f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let m=n==null?void 0:n.onError,h=a&&m?(y,g)=>{var b,w;m(y,{location:a.location,params:((w=(b=a.matches)==null?void 0:b[0])==null?void 0:w.params)??{},unstable_pattern:dA(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,b)=>{let w,k=!1,j=null,E=null;a&&(w=o&&g.route.id?o[g.route.id]:void 0,j=g.route.errorElement||EA,c&&(f<0&&b===0?(Uk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,E=null):f===b&&(k=!0,E=g.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,b+1)),R=()=>{let O;return w?O=j:k?O=E:g.route.Component?O=x.createElement(g.route.Component,null):g.route.element?O=g.route.element:O=y,x.createElement(_A,{match:g,routeContext:{outlet:y,matches:C,isDataRoute:a!=null},children:O})};return a&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?x.createElement(Lk,{location:a.location,revalidation:a.revalidation,component:j,error:w,children:R(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:h}):R()},null)}function dy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AA(e){let t=x.useContext(Gs);return Mt(t,dy(e)),t}function RA(e){let t=x.useContext(gf);return Mt(t,dy(e)),t}function zA(e){let t=x.useContext(Rr);return Mt(t,dy(e)),t}function fy(e){let t=zA(e),n=t.matches[t.matches.length-1];return Mt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function OA(){return fy("useRouteId")}function MA(){var a;let e=x.useContext(cy),t=RA("useRouteError"),n=fy("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function DA(){let{router:e}=AA("useNavigate"),t=fy("useNavigate"),n=x.useRef(!1);return Mk(()=>{n.current=!0}),x.useCallback(async(l,o={})=>{Tr(n.current,Ok),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...o}))},[e,t])}var L1={};function Uk(e,t,n){!t&&!L1[e]&&(L1[e]=!0,Tr(!1,n))}x.memo(IA);function IA({routes:e,future:t,state:n,isStatic:a,onError:l}){return Ik(e,void 0,{state:n,isStatic:a,onError:l})}function ur({to:e,replace:t,state:n,relative:a}){Mt(Ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=x.useContext(hr);Tr(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=x.useContext(Rr),{pathname:c}=Yn(),f=Un(),m=pf(e,uy(o),c,a==="path"),h=JSON.stringify(m);return x.useEffect(()=>{f(JSON.parse(h),{replace:t,state:n,relative:a})},[f,h,a,t,n]),null}function Ps(e){return kA(e.context)}function Ot(e){Mt(!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 LA({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:l,static:o=!1,unstable_useTransitions:c}){Mt(!Ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),m=x.useMemo(()=>({basename:f,navigator:l,static:o,unstable_useTransitions:c,future:{}}),[f,l,o,c]);typeof n=="string"&&(n=Ks(n));let{pathname:h="/",search:y="",hash:g="",state:b=null,key:w="default",unstable_mask:k}=n,j=x.useMemo(()=>{let E=Ra(h,f);return E==null?null:{location:{pathname:E,search:y,hash:g,state:b,key:w,unstable_mask:k},navigationType:a}},[f,h,y,g,b,w,a,k]);return Tr(j!=null,`<Router basename="${f}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:x.createElement(hr.Provider,{value:m},x.createElement(Hu.Provider,{children:t,value:j}))}function UA({children:e,location:t}){return jA(vg(e),t)}function vg(e,t=[]){let n=[];return x.Children.forEach(e,(a,l)=>{if(!x.isValidElement(a))return;let o=[...t,l];if(a.type===x.Fragment){n.push.apply(n,vg(a.props.children,o));return}Mt(a.type===Ot,`[${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>`),Mt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let c={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=vg(a.props.children,o)),n.push(c)}),n}var $d="get",Fd="application/x-www-form-urlencoded";function yf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PA(e){return yf(e)&&e.tagName.toLowerCase()==="button"}function BA(e){return yf(e)&&e.tagName.toLowerCase()==="form"}function $A(e){return yf(e)&&e.tagName.toLowerCase()==="input"}function FA(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qA(e,t){return e.button===0&&(!t||t==="_self")&&!FA(e)}function bg(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 HA(e,t){let n=bg(e);return t&&t.forEach((a,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}var Sd=null;function ZA(){if(Sd===null)try{new FormData(document.createElement("form"),0),Sd=!1}catch{Sd=!0}return Sd}var VA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sp(e){return e!=null&&!VA.has(e)?(Tr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fd}"`),null):e}function QA(e,t){let n,a,l,o,c;if(BA(e)){let f=e.getAttribute("action");a=f?Ra(f,t):null,n=e.getAttribute("method")||$d,l=sp(e.getAttribute("enctype"))||Fd,o=new FormData(e)}else if(PA(e)||$A(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?Ra(m,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||$d,l=sp(e.getAttribute("formenctype"))||sp(f.getAttribute("enctype"))||Fd,o=new FormData(f,e),!ZA()){let{name:h,type:y,value:g}=e;if(y==="image"){let b=h?`${h}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else h&&o.append(h,g)}}else{if(yf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=$d,a=null,l=Fd,c=e}return o&&l==="text/plain"&&(c=o,o=void 0),{action:a,method:n.toLowerCase(),encType:l,formData:o,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function hy(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function KA(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&&Ra(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function GA(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 YA(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 XA(e,t,n){let a=await Promise.all(e.map(async l=>{let o=t.routes[l.route.id];if(o){let c=await GA(o,n);return c.links?c.links():[]}return[]}));return tR(a.flat(1).filter(YA).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function U1(e,t,n,a,l,o){let c=(m,h)=>n[h]?m.route.id!==n[h].route.id:!0,f=(m,h)=>{var y;return n[h].pathname!==m.pathname||((y=n[h].route.path)==null?void 0:y.endsWith("*"))&&n[h].params["*"]!==m.params["*"]};return o==="assets"?t.filter((m,h)=>c(m,h)||f(m,h)):o==="data"?t.filter((m,h)=>{var g;let y=a.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(c(m,h)||f(m,h))return!0;if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function JA(e,t,{includeHydrateFallback:n}={}){return WA(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 WA(e){return[...new Set(e)]}function eR(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function tR(e,t){let n=new Set;return new Set(t),e.reduce((a,l)=>{let o=JSON.stringify(eR(l));return n.has(o)||(n.add(o),a.push({key:o,link:l})),a},[])}function Pk(){let e=x.useContext(Gs);return hy(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nR(){let e=x.useContext(gf);return hy(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var my=x.createContext(void 0);my.displayName="FrameworkContext";function Bk(){let e=x.useContext(my);return hy(e,"You must render this element inside a <HydratedRouter> element"),e}function rR(e,t){let n=x.useContext(my),[a,l]=x.useState(!1),[o,c]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=C=>{C.forEach(R=>{c(R.isIntersecting)})},E=new IntersectionObserver(j,{threshold:.5});return b.current&&E.observe(b.current),()=>{E.disconnect()}}},[e]),x.useEffect(()=>{if(a){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[a]);let w=()=>{l(!0)},k=()=>{l(!1),c(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:Wo(f,w),onBlur:Wo(m,k),onMouseEnter:Wo(h,w),onMouseLeave:Wo(y,k),onTouchStart:Wo(g,w)}]:[!1,b,{}]}function Wo(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function aR({page:e,...t}){let{router:n}=Pk(),a=x.useMemo(()=>Ck(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?x.createElement(lR,{page:e,matches:a,...t}):null}function iR(e){let{manifest:t,routeModules:n}=Bk(),[a,l]=x.useState([]);return x.useEffect(()=>{let o=!1;return XA(e,t,n).then(c=>{o||l(c)}),()=>{o=!0}},[e,t,n]),a}function lR({page:e,matches:t,...n}){let a=Yn(),{future:l,manifest:o,routeModules:c}=Bk(),{basename:f}=Pk(),{loaderData:m,matches:h}=nR(),y=x.useMemo(()=>U1(e,t,h,o,a,"data"),[e,t,h,o,a]),g=x.useMemo(()=>U1(e,t,h,o,a,"assets"),[e,t,h,o,a]),b=x.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,E=!1;if(t.forEach(R=>{var M;let O=o.routes[R.route.id];!O||!O.hasLoader||(!y.some(B=>B.route.id===R.route.id)&&R.route.id in m&&((M=c[R.route.id])!=null&&M.shouldRevalidate)||O.hasClientLoader?E=!0:j.add(R.route.id))}),j.size===0)return[];let C=KA(e,f,l.unstable_trailingSlashAwareDataRequests,"data");return E&&j.size>0&&C.searchParams.set("_routes",t.filter(R=>j.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[f,l.unstable_trailingSlashAwareDataRequests,m,a,o,y,t,e,c]),w=x.useMemo(()=>JA(g,o),[g,o]),k=iR(g);return x.createElement(x.Fragment,null,b.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),w.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:E})=>x.createElement("link",{key:j,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function sR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var oR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oR&&(window.__reactRouterVersion="7.13.1")}catch{}function uR({basename:e,children:t,unstable_useTransitions:n,window:a}){let l=x.useRef();l.current==null&&(l.current=BT({window:a,v5Compat:!0}));let o=l.current,[c,f]=x.useState({action:o.action,location:o.location}),m=x.useCallback(h=>{n===!1?f(h):x.startTransition(()=>f(h))},[n]);return x.useLayoutEffect(()=>o.listen(m),[o,m]),x.createElement(LA,{basename:e,children:t,location:c.location,navigationType:c.action,navigator:o,unstable_useTransitions:n})}var $k=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vu=x.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:l,reloadDocument:o,replace:c,unstable_mask:f,state:m,target:h,to:y,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:w,...k},j){let{basename:E,navigator:C,unstable_useTransitions:R}=x.useContext(hr),O=typeof y=="string"&&$k.test(y),M=Tk(y,E);y=M.to;let B=xA(y,{relative:l}),z=Yn(),$=null;if(f){let J=pf(f,[],z.unstable_mask?z.unstable_mask.pathname:"/",!0);E!=="/"&&(J.pathname=J.pathname==="/"?E:ta([E,J.pathname])),$=C.createHref(J)}let[U,Q,I]=rR(a,k),ne=fR(y,{replace:c,unstable_mask:f,state:m,target:h,preventScrollReset:g,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:w,unstable_useTransitions:R});function le(J){t&&t(J),J.defaultPrevented||ne(J)}let we=!(M.isExternal||o),Y=x.createElement("a",{...k,...I,href:(we?$:void 0)||M.absoluteURL||B,onClick:we?le:t,ref:sR(j,Q),target:h,"data-discover":!O&&n==="render"?"true":void 0});return U&&!O?x.createElement(x.Fragment,null,Y,x.createElement(aR,{page:B})):Y});Vu.displayName="Link";var vf=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:l=!1,style:o,to:c,viewTransition:f,children:m,...h},y){let g=Zu(c,{relative:h.relative}),b=Yn(),w=x.useContext(gf),{navigator:k,basename:j}=x.useContext(hr),E=w!=null&&yR(g)&&f===!0,C=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,R=b.pathname,O=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(R=R.toLowerCase(),O=O?O.toLowerCase():null,C=C.toLowerCase()),O&&j&&(O=Ra(O,j)||O);const M=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let B=R===C||!l&&R.startsWith(C)&&R.charAt(M)==="/",z=O!=null&&(O===C||!l&&O.startsWith(C)&&O.charAt(C.length)==="/"),$={isActive:B,isPending:z,isTransitioning:E},U=B?t:void 0,Q;typeof a=="function"?Q=a($):Q=[a,B?"active":null,z?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let I=typeof o=="function"?o($):o;return x.createElement(Vu,{...h,"aria-current":U,className:Q,ref:y,style:I,to:c,viewTransition:f},typeof m=="function"?m($):m)});vf.displayName="NavLink";var cR=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:l,state:o,method:c=$d,action:f,onSubmit:m,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b,...w},k)=>{let{unstable_useTransitions:j}=x.useContext(hr),E=pR(),C=gR(f,{relative:h}),R=c.toLowerCase()==="get"?"get":"post",O=typeof f=="string"&&$k.test(f),M=B=>{if(m&&m(B),B.defaultPrevented)return;B.preventDefault();let z=B.nativeEvent.submitter,$=(z==null?void 0:z.getAttribute("formmethod"))||c,U=()=>E(z||B.currentTarget,{fetcherKey:t,method:$,navigate:n,replace:l,state:o,relative:h,preventScrollReset:y,viewTransition:g,unstable_defaultShouldRevalidate:b});j&&n!==!1?x.startTransition(()=>U()):U()};return x.createElement("form",{ref:k,method:R,action:C,onSubmit:a?m:M,...w,"data-discover":!O&&e==="render"?"true":void 0})});cR.displayName="Form";function dR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fk(e){let t=x.useContext(Gs);return Mt(t,dR(e)),t}function fR(e,{target:t,replace:n,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:h}={}){let y=Un(),g=Yn(),b=Zu(e,{relative:c});return x.useCallback(w=>{if(qA(w,t)){w.preventDefault();let k=n!==void 0?n:Su(g)===Su(b),j=()=>y(e,{replace:k,unstable_mask:a,state:l,preventScrollReset:o,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:m});h?x.startTransition(()=>j()):j()}},[g,y,b,n,a,l,t,e,o,c,f,m,h])}function qk(e){Tr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=x.useRef(bg(e)),n=x.useRef(!1),a=Yn(),l=x.useMemo(()=>HA(a.search,n.current?null:t.current),[a.search]),o=Un(),c=x.useCallback((f,m)=>{const h=bg(typeof f=="function"?f(new URLSearchParams(l)):f);n.current=!0,o("?"+h,m)},[o,l]);return[l,c]}var hR=0,mR=()=>`__${String(++hR)}__`;function pR(){let{router:e}=Fk("useSubmit"),{basename:t}=x.useContext(hr),n=OA(),a=e.fetch,l=e.navigate;return x.useCallback(async(o,c={})=>{let{action:f,method:m,encType:h,formData:y,body:g}=QA(o,t);if(c.navigate===!1){let b=c.fetcherKey||mR();await a(b,n,c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,flushSync:c.flushSync})}else await l(c.action||f,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||m,formEncType:c.encType||h,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,l,t,n])}function gR(e,{relative:t}={}){let{basename:n}=x.useContext(hr),a=x.useContext(Rr);Mt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),o={...Zu(e||".",{relative:t})},c=Yn();if(e==null){o.search=c.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(y=>y==="")){f.delete("index"),m.filter(g=>g).forEach(g=>f.append("index",g));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ta([n,o.pathname])),Su(o)}function yR(e,{relative:t}={}){let n=x.useContext(Rk);Mt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Fk("useViewTransitionState"),l=Zu(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ra(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=Ra(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Yd(l.pathname,c)!=null||Yd(l.pathname,o)!=null}const vR="/api/v1";async function bR(e,t){const n=await fetch(`${vR}/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 Hk="/api/v1",py="first-tree-hub:tokens";let xg=null;function eu(e){xg=e}function hn(e){if(!xg)throw new Error(`withOrg("${e}") called before an organization is selected`);return`/orgs/${encodeURIComponent(xg)}${e}`}function P1(e,t){return`/orgs/${encodeURIComponent(e)}${t}`}function bf(){const e=localStorage.getItem(py);if(!e)return null;try{return JSON.parse(e)}catch{return null}}function wg(e){localStorage.setItem(py,JSON.stringify(e))}function Zk(){localStorage.removeItem(py)}class Qu extends Error{constructor(t,n,a){super(n),this.status=t,this.issues=a,this.name="ApiError"}}let tu=null;async function xR(){const e=bf();return e!=null&&e.refreshToken?Vk(e.refreshToken):null}async function Vk(e){return tu||(tu=(async()=>{try{const t=await fetch(`${Hk}/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 wg(a),a}catch{return null}finally{tu=null}})(),tu)}async function nu(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(`${Hk}${e}`,{method:n,headers:m,body:a!==void 0?JSON.stringify(a):void 0})},o=bf();let c=await l(o==null?void 0:o.accessToken);if(c.status===401&&(o!=null&&o.refreshToken)){const f=await Vk(o.refreshToken);f&&(c=await l(f.accessToken))}if(!c.ok){c.status===401&&(Zk(),window.dispatchEvent(new CustomEvent("auth:logout")));const f=await c.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(c.status,m,h)}if(c.status!==204)return await c.json()}const ke={get:e=>nu(e),post:(e,t)=>nu(e,{method:"POST",body:t}),patch:(e,t)=>nu(e,{method:"PATCH",body:t}),put:(e,t)=>nu(e,{method:"PUT",body:t}),delete:e=>nu(e,{method:"DELETE"})},gy="onboarding:joinPath",wR="onboarding:draft";function Qk(e){typeof window>"u"||window.sessionStorage.setItem(gy,e)}function SR(){if(typeof window>"u")return null;const e=window.sessionStorage.getItem(gy);return e==="solo"||e==="invite"?e:null}function kR(){typeof window>"u"||window.sessionStorage.removeItem(gy)}function jR(e,t){return`${e??"unknown-org"}:${t??"unknown-member"}`}function yy(e){return`${wR}:${e}`}function CR(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 ER(e){if(typeof window>"u")return null;const t=window.sessionStorage.getItem(yy(e));if(!t)return null;try{return CR(JSON.parse(t))}catch{return null}}function NR(e,t){typeof window>"u"||window.sessionStorage.setItem(yy(e),JSON.stringify(t))}function _R(e){typeof window>"u"||window.sessionStorage.removeItem(yy(e))}const Kk=x.createContext(null),Sg="first-tree-hub:selectedOrganizationId";function TR(){try{return localStorage.getItem(Sg)}catch{return null}}function op(e){try{e===null?localStorage.removeItem(Sg):localStorage.setItem(Sg,e)}catch{}}function AR({children:e}){const t=nn(),[n,a]=x.useState(()=>!!bf()),[l,o]=x.useState(null),[c,f]=x.useState([]),[m,h]=x.useState(()=>{const M=TR();return eu(M),M}),[y,g]=x.useState(null),[b,w]=x.useState(!1),k=x.useCallback(()=>{Zk(),op(null),eu(null),t.clear(),a(!1),o(null),f([]),h(null),g(null),w(!1)},[t]),j=x.useCallback(async()=>{var M;try{const B=await ke.get("/me");o(B.user??null);const z=B.memberships??[];f(z);const $=((M=B.wizard)==null?void 0:M.step)??null;g($),$==="completed"&&kR(),h(U=>{var ne;const Q=U&&z.some(le=>le.organizationId===U)?U:null;if(Q)return eu(Q),Q;const I=B.defaultOrganizationId??((ne=z[0])==null?void 0:ne.organizationId)??null;return op(I),eu(I),I})}catch{}finally{w(!0)}},[]),E=x.useCallback(async(M,B)=>{const z=await bR(M,B);wg({accessToken:z.accessToken,refreshToken:z.refreshToken}),a(!0),await j()},[j]),C=x.useCallback(async M=>{wg(M),a(!0),await j()},[j]),R=x.useCallback(async M=>{op(M),eu(M),t.clear(),h(M),await j()},[j,t]);x.useEffect(()=>{n&&!l&&j()},[n,l,j]),x.useEffect(()=>{const M=()=>k();return window.addEventListener("auth:logout",M),()=>window.removeEventListener("auth:logout",M)},[k]);const O=x.useMemo(()=>c.length===0?null:c.find(B=>B.organizationId===m)??c[0]??null,[c,m]);return u.jsx(Kk.Provider,{value:{isAuthenticated:n,meLoaded:b,user:l,memberships:c,currentMembership:O,organizationId:(O==null?void 0:O.organizationId)??null,memberId:(O==null?void 0:O.id)??null,role:(O==null?void 0:O.role)??null,agentId:(O==null?void 0:O.agentId)??null,wizardStep:y,login:E,adoptTokens:C,selectOrganization:R,refreshMe:j,logout:k},children:e})}function Rt(){const e=x.useContext(Kk);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}const RR="modulepreload",zR=function(e){return"/"+e},B1={},OR=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));l=c(n.map(h=>{if(h=zR(h),h in B1)return;B1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":RR,y||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,k)=>{b.addEventListener("load",w),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})},MR=x.lazy(()=>OR(()=>import("./index-Bm6hgcvt.js"),[]).then(e=>({default:e.LandingPage}))),$1=()=>u.jsx("div",{className:"landing-marketing min-h-screen bg-background"});function DR(){const{isAuthenticated:e,meLoaded:t}=Rt(),n=Yn();return e?t?u.jsx(Ps,{}):u.jsx($1,{}):n.pathname==="/"?u.jsx(x.Suspense,{fallback:u.jsx($1,{}),children:u.jsx(MR,{})}):u.jsx(ur,{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 Gk=(...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 IR=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 LR=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 F1=e=>{const t=LR(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 UR={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 PR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
91
|
-
* @license lucide-react v0.577.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const BR=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:o,iconNode:c,...f},m)=>x.createElement("svg",{ref:m,...UR,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:Gk("lucide",l),...!o&&!PR(f)&&{"aria-hidden":"true"},...f},[...c.map(([h,y])=>x.createElement(h,y)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
-
* @license lucide-react v0.577.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const st=(e,t)=>{const n=x.forwardRef(({className:a,...l},o)=>x.createElement(BR,{ref:o,iconNode:t,className:Gk(`lucide-${IR(F1(e))}`,`lucide-${e}`,a),...l}));return n.displayName=F1(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 $R=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],vy=st("arrow-left",$R);/**
|
|
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 FR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qR=st("arrow-right",FR);/**
|
|
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 HR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Yk=st("arrow-up",HR);/**
|
|
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 ZR=[["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"}]],VR=st("at-sign",ZR);/**
|
|
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 QR=[["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"}]],KR=st("bell",QR);/**
|
|
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 GR=[["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"}]],YR=st("bot",GR);/**
|
|
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 XR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=st("check",XR);/**
|
|
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 JR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Xk=st("chevron-down",JR);/**
|
|
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 WR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ez=st("chevron-right",WR);/**
|
|
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 tz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],nz=st("circle-check",tz);/**
|
|
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 rz=[["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"}]],xf=st("copy",rz);/**
|
|
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 az=[["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"}]],iz=st("eye-off",az);/**
|
|
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 lz=[["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"}]],Jk=st("eye",lz);/**
|
|
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 sz=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],oz=st("folder-tree",sz);/**
|
|
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 uz=[["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"}]],Wk=st("github",uz);/**
|
|
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 cz=[["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"}]],dz=st("layout-dashboard",cz);/**
|
|
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 fz=[["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"}]],kg=st("link-2",fz);/**
|
|
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 hz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mz=st("loader-circle",hz);/**
|
|
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 pz=[["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"}]],ej=st("lock",pz);/**
|
|
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 gz=[["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"}]],yz=st("log-out",gz);/**
|
|
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 vz=[["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"}]],by=st("message-square",vz);/**
|
|
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 bz=[["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"}]],xz=st("moon",bz);/**
|
|
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 wz=[["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"}]],Sz=st("paperclip",wz);/**
|
|
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 kz=[["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"}]],wf=st("pencil",kz);/**
|
|
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 jz=[["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"}]],tj=st("play",jz);/**
|
|
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 Cz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],qr=st("plus",Cz);/**
|
|
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 Ez=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Nz=st("refresh-cw",Ez);/**
|
|
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 _z=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],xy=st("search",_z);/**
|
|
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 Tz=[["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"}]],Az=st("sun",Tz);/**
|
|
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:"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"}]],ku=st("trash-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 zz=[["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"}]],wl=st("triangle-alert",zz);/**
|
|
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 Oz=[["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"}]],Mz=st("undo-2",Oz);/**
|
|
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 Dz=[["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"}]],nj=st("user-plus",Dz);/**
|
|
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 Iz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ju=st("x",Iz);/**
|
|
271
|
-
* @license lucide-react v0.577.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const Lz=[["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"}]],Uz=st("zap",Lz);function rj(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=rj(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function aj(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=rj(e))&&(a&&(a+=" "),a+=t);return a}const Pz=(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},Bz=(e,t)=>({classGroupId:e,validator:t}),ij=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Xd="-",q1=[],$z="arbitrary..",Fz=e=>{const t=Hz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return qz(c);const f=c.split(Xd),m=f[0]===""&&f.length>1?1:0;return lj(f,m,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const m=a[c],h=n[c];return m?h?Pz(h,m):m:h||q1}return n[c]||q1}}},lj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const l=e[t],o=n.nextPart.get(l);if(o){const h=lj(e,t+1,o);if(h)return h}const c=n.validators;if(c===null)return;const f=t===0?e.join(Xd):e.slice(t).join(Xd),m=c.length;for(let h=0;h<m;h++){const y=c[h];if(y.validator(f))return y.classGroupId}},qz=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?$z+a:void 0})(),Hz=e=>{const{theme:t,classGroups:n}=e;return Zz(n,t)},Zz=(e,t)=>{const n=ij();for(const a in e){const l=e[a];wy(l,n,a,t)}return n},wy=(e,t,n,a)=>{const l=e.length;for(let o=0;o<l;o++){const c=e[o];Vz(c,t,n,a)}},Vz=(e,t,n,a)=>{if(typeof e=="string"){Qz(e,t,n);return}if(typeof e=="function"){Kz(e,t,n,a);return}Gz(e,t,n,a)},Qz=(e,t,n)=>{const a=e===""?t:sj(t,e);a.classGroupId=n},Kz=(e,t,n,a)=>{if(Yz(e)){wy(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Bz(n,e))},Gz=(e,t,n,a)=>{const l=Object.entries(e),o=l.length;for(let c=0;c<o;c++){const[f,m]=l[c];wy(m,sj(t,f),n,a)}},sj=(e,t)=>{let n=e;const a=t.split(Xd),l=a.length;for(let o=0;o<l;o++){const c=a[o];let f=n.nextPart.get(c);f||(f=ij(),n.nextPart.set(c,f)),n=f}return n},Yz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Xz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const l=(o,c)=>{n[o]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(o){let c=n[o];if(c!==void 0)return c;if((c=a[o])!==void 0)return l(o,c),c},set(o,c){o in n?n[o]=c:l(o,c)}}},jg="!",H1=":",Jz=[],Z1=(e,t,n,a,l)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:l}),Wz=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const o=[];let c=0,f=0,m=0,h;const y=l.length;for(let j=0;j<y;j++){const E=l[j];if(c===0&&f===0){if(E===H1){o.push(l.slice(m,j)),m=j+1;continue}if(E==="/"){h=j;continue}}E==="["?c++:E==="]"?c--:E==="("?f++:E===")"&&f--}const g=o.length===0?l:l.slice(m);let b=g,w=!1;g.endsWith(jg)?(b=g.slice(0,-1),w=!0):g.startsWith(jg)&&(b=g.slice(1),w=!0);const k=h&&h>m?h-m:void 0;return Z1(o,w,b,k)};if(t){const l=t+H1,o=a;a=c=>c.startsWith(l)?o(c.slice(l.length)):Z1(Jz,!1,c,void 0,!0)}if(n){const l=a;a=o=>n({className:o,parseClassName:l})}return a},e3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let l=[];for(let o=0;o<n.length;o++){const c=n[o],f=c[0]==="[",m=t.has(c);f||m?(l.length>0&&(l.sort(),a.push(...l),l=[]),a.push(c)):l.push(c)}return l.length>0&&(l.sort(),a.push(...l)),a}},t3=e=>({cache:Xz(e.cacheSize),parseClassName:Wz(e),sortModifiers:e3(e),...Fz(e)}),n3=/\s+/,r3=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:o}=t,c=[],f=e.trim().split(n3);let m="";for(let h=f.length-1;h>=0;h-=1){const y=f[h],{isExternal:g,modifiers:b,hasImportantModifier:w,baseClassName:k,maybePostfixModifierPosition:j}=n(y);if(g){m=y+(m.length>0?" "+m:m);continue}let E=!!j,C=a(E?k.substring(0,j):k);if(!C){if(!E){m=y+(m.length>0?" "+m:m);continue}if(C=a(k),!C){m=y+(m.length>0?" "+m:m);continue}E=!1}const R=b.length===0?"":b.length===1?b[0]:o(b).join(":"),O=w?R+jg:R,M=O+C;if(c.indexOf(M)>-1)continue;c.push(M);const B=l(C,E);for(let z=0;z<B.length;++z){const $=B[z];c.push(O+$)}m=y+(m.length>0?" "+m:m)}return m},a3=(...e)=>{let t=0,n,a,l="";for(;t<e.length;)(n=e[t++])&&(a=oj(n))&&(l&&(l+=" "),l+=a);return l},oj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=oj(e[a]))&&(n&&(n+=" "),n+=t);return n},i3=(e,...t)=>{let n,a,l,o;const c=m=>{const h=t.reduce((y,g)=>g(y),e());return n=t3(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=r3(m,n);return l(m,y),y};return o=c,(...m)=>o(a3(...m))},l3=[],ln=e=>{const t=n=>n[e]||l3;return t.isThemeGetter=!0,t},uj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,o3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,u3=/\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$/,c3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,d3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,f3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oi=e=>s3.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),ui=e=>!!e&&Number.isInteger(Number(e)),up=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),ka=e=>o3.test(e),dj=()=>!0,h3=e=>u3.test(e)&&!c3.test(e),Sy=()=>!1,m3=e=>d3.test(e),p3=e=>f3.test(e),g3=e=>!Ee(e)&&!Ne(e),y3=e=>zi(e,mj,Sy),Ee=e=>uj.test(e),rl=e=>zi(e,pj,h3),V1=e=>zi(e,C3,Ke),v3=e=>zi(e,yj,dj),b3=e=>zi(e,gj,Sy),Q1=e=>zi(e,fj,Sy),x3=e=>zi(e,hj,p3),kd=e=>zi(e,vj,m3),Ne=e=>cj.test(e),ru=e=>Sl(e,pj),w3=e=>Sl(e,gj),K1=e=>Sl(e,fj),S3=e=>Sl(e,mj),k3=e=>Sl(e,hj),jd=e=>Sl(e,vj,!0),j3=e=>Sl(e,yj,!0),zi=(e,t,n)=>{const a=uj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Sl=(e,t,n=!1)=>{const a=cj.exec(e);return a?a[1]?t(a[1]):n:!1},fj=e=>e==="position"||e==="percentage",hj=e=>e==="image"||e==="url",mj=e=>e==="length"||e==="size"||e==="bg-size",pj=e=>e==="length",C3=e=>e==="number",gj=e=>e==="family-name",yj=e=>e==="number"||e==="weight",vj=e=>e==="shadow",E3=()=>{const e=ln("color"),t=ln("font"),n=ln("text"),a=ln("font-weight"),l=ln("tracking"),o=ln("leading"),c=ln("breakpoint"),f=ln("container"),m=ln("spacing"),h=ln("radius"),y=ln("shadow"),g=ln("inset-shadow"),b=ln("text-shadow"),w=ln("drop-shadow"),k=ln("blur"),j=ln("perspective"),E=ln("aspect"),C=ln("ease"),R=ln("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...M(),Ne,Ee],z=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],U=()=>[Ne,Ee,m],Q=()=>[oi,"full","auto",...U()],I=()=>[ui,"none","subgrid",Ne,Ee],ne=()=>["auto",{span:["full",ui,Ne,Ee]},ui,Ne,Ee],le=()=>[ui,"auto",Ne,Ee],we=()=>["auto","min","max","fr",Ne,Ee],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...U()],ee=()=>[oi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],be=()=>[oi,"screen","full","dvw","lvw","svw","min","max","fit",...U()],Ae=()=>[oi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],A=()=>[e,Ne,Ee],L=()=>[...M(),K1,Q1,{position:[Ne,Ee]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",S3,y3,{size:[Ne,Ee]}],Z=()=>[up,ru,rl],W=()=>["","none","full",h,Ne,Ee],ce=()=>["",Ke,ru,rl],ve=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Ke,up,K1,Q1],Qe=()=>["","none",k,Ne,Ee],Oe=()=>["none",Ke,Ne,Ee],ut=()=>["none",Ke,Ne,Ee],ae=()=>[Ke,Ne,Ee],Se=()=>[oi,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ka],breakpoint:[ka],color:[dj],container:[ka],"drop-shadow":[ka],ease:["in","out","in-out"],font:[g3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ka],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ka],shadow:[ka],spacing:["px",Ke],text:[ka],"text-shadow":[ka],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oi,Ee,Ne,E]}],container:["container"],columns:[{columns:[Ke,Ee,Ne,f]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:B()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[ui,"auto",Ne,Ee]}],basis:[{basis:[oi,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,oi,"auto","initial","none",Ee]}],grow:[{grow:["",Ke,Ne,Ee]}],shrink:[{shrink:["",Ke,Ne,Ee]}],order:[{order:[ui,"first","last","none",Ne,Ee]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":we()}],"auto-rows":[{"auto-rows":we()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:ee()}],"inline-size":[{inline:["auto",...be()]}],"min-inline-size":[{"min-inline":["auto",...be()]}],"max-inline-size":[{"max-inline":["none",...be()]}],"block-size":[{block:["auto",...Ae()]}],"min-block-size":[{"min-block":["auto",...Ae()]}],"max-block-size":[{"max-block":["none",...Ae()]}],w:[{w:[f,"screen",...ee()]}],"min-w":[{"min-w":[f,"screen","none",...ee()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...ee()]}],h:[{h:["screen","lh",...ee()]}],"min-h":[{"min-h":["screen","lh","none",...ee()]}],"max-h":[{"max-h":["screen","lh",...ee()]}],"font-size":[{text:["base",n,ru,rl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,j3,v3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",up,Ee]}],"font-family":[{font:[w3,b3,t]}],"font-features":[{"font-features":[Ee]}],"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,Ne,Ee]}],"line-clamp":[{"line-clamp":[Ke,"none",Ne,V1]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ne,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ne,rl]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ne,Ee]}],"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",Ne,Ee]}],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",Ne,Ee]}],"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:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ui,Ne,Ee],radial:["",Ne,Ee],conic:[ui,Ne,Ee]},k3,x3]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ne,Ee]}],"outline-w":[{outline:["",Ke,ru,rl]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",y,jd,kd]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",g,jd,kd]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ke,rl]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",b,jd,kd]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ke,Ne,Ee]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"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":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"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":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"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":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"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":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"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":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"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":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ne,Ee]}],"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":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,Ee]}],filter:[{filter:["","none",Ne,Ee]}],blur:[{blur:Qe()}],brightness:[{brightness:[Ke,Ne,Ee]}],contrast:[{contrast:[Ke,Ne,Ee]}],"drop-shadow":[{"drop-shadow":["","none",w,jd,kd]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ke,Ne,Ee]}],"hue-rotate":[{"hue-rotate":[Ke,Ne,Ee]}],invert:[{invert:["",Ke,Ne,Ee]}],saturate:[{saturate:[Ke,Ne,Ee]}],sepia:[{sepia:["",Ke,Ne,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,Ee]}],"backdrop-blur":[{"backdrop-blur":Qe()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ne,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ne,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ne,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ne,Ee]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ne,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ne,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ne,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ne,Ee]}],"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",Ne,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ne,Ee]}],ease:[{ease:["linear","initial",C,Ne,Ee]}],delay:[{delay:[Ke,Ne,Ee]}],animate:[{animate:["none",R,Ne,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ne,Ee]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:Oe()}],"rotate-x":[{"rotate-x":Oe()}],"rotate-y":[{"rotate-y":Oe()}],"rotate-z":[{"rotate-z":Oe()}],scale:[{scale:ut()}],"scale-x":[{"scale-x":ut()}],"scale-y":[{"scale-y":ut()}],"scale-z":[{"scale-z":ut()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[Ne,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ne,Ee]}],"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",Ne,Ee]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ke,ru,rl,V1]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},N3=i3(E3);function Te(...e){return N3(aj(e))}function Cu(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 bj(e){return e?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date(e)):"—"}function _3(e){return ke.delete(`/clients/${encodeURIComponent(e)}`)}function Ku(){return ke.get(hn("/activity"))}function Ni(){return ke.get("/me/clients")}function ky(e){return ke.get(`/clients/${e}`)}function T3(e){return ke.post(`/clients/${e}/disconnect`)}function A3(){return ke.post("/me/connect-tokens")}const G1=e=>["agent-sessions",e];function R3(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 z3(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 O3(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.text!="string"?null:{text:t.text}}function xj(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 ke.get(`/agents/${e}/sessions${a?`?${a}`:""}`)}function M3(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 ke.get(`/agents/${e}/sessions/${t}/events${l?`?${l}`:""}`)}var Y1=1,D3=.9,I3=.8,L3=.17,cp=.1,dp=.999,U3=.9999,P3=.99,B3=/[\\\/_+.#"@\[\(\{&]/,$3=/[\\\/_+.#"@\[\(\{&]/g,F3=/[\s-]/,wj=/[\s-]/g;function Cg(e,t,n,a,l,o,c){if(o===t.length)return l===e.length?Y1:P3;var f=`${l},${o}`;if(c[f]!==void 0)return c[f];for(var m=a.charAt(o),h=n.indexOf(m,l),y=0,g,b,w,k;h>=0;)g=Cg(e,t,n,a,h+1,o+1,c),g>y&&(h===l?g*=Y1:B3.test(e.charAt(h-1))?(g*=I3,w=e.slice(l,h-1).match($3),w&&l>0&&(g*=Math.pow(dp,w.length))):F3.test(e.charAt(h-1))?(g*=D3,k=e.slice(l,h-1).match(wj),k&&l>0&&(g*=Math.pow(dp,k.length))):(g*=L3,l>0&&(g*=Math.pow(dp,h-l))),e.charAt(h)!==t.charAt(o)&&(g*=U3)),(g<cp&&n.charAt(h-1)===a.charAt(o+1)||a.charAt(o+1)===a.charAt(o)&&n.charAt(h-1)!==a.charAt(o))&&(b=Cg(e,t,n,a,h+1,o+2,c),b*cp>g&&(g=b*cp)),g>y&&(y=g),h=n.indexOf(m,h+1);return c[f]=y,y}function X1(e){return e.toLowerCase().replace(wj," ")}function q3(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Cg(e,t,X1(e),X1(t),0,0,{})}function Ei(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function J1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _i(...e){return t=>{let n=!1;const a=e.map(l=>{const o=J1(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():J1(e[l],null)}}}}function kl(...e){return x.useCallback(_i(...e),e)}function H3(e,t){const n=x.createContext(t),a=o=>{const{children:c,...f}=o,m=x.useMemo(()=>f,Object.values(f));return u.jsx(n.Provider,{value:m,children:c})};a.displayName=e+"Provider";function l(o){const c=x.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[a,l]}function Z3(e,t=[]){let n=[];function a(o,c){const f=x.createContext(c),m=n.length;n=[...n,c];const h=g=>{var C;const{scope:b,children:w,...k}=g,j=((C=b==null?void 0:b[e])==null?void 0:C[m])||f,E=x.useMemo(()=>k,Object.values(k));return u.jsx(j.Provider,{value:E,children:w})};h.displayName=o+"Provider";function y(g,b){var j;const w=((j=b==null?void 0:b[e])==null?void 0:j[m])||f,k=x.useContext(w);if(k)return k;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[h,y]}const l=()=>{const o=n.map(c=>x.createContext(c));return function(f){const m=(f==null?void 0:f[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[a,V3(l,...t)]}function V3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(o){const c=a.reduce((f,{useScope:m,scopeName:h})=>{const g=m(o)[`__scope${h}`];return{...f,...g}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Eu=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Q3=ty[" useId ".trim().toString()]||(()=>{}),K3=0;function Ta(e){const[t,n]=x.useState(Q3());return Eu(()=>{n(a=>a??String(K3++))},[e]),t?`radix-${t}`:""}var G3=ty[" useInsertionEffect ".trim().toString()]||Eu;function Y3({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,o,c]=X3({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:l;{const y=x.useRef(e!==void 0);x.useEffect(()=>{const g=y.current;g!==f&&console.warn(`${a} is changing from ${g?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=f},[f,a])}const h=x.useCallback(y=>{var g;if(f){const b=J3(y)?y(e):y;b!==e&&((g=c.current)==null||g.call(c,b))}else o(y)},[f,e,o,c]);return[m,h]}function X3({defaultProp:e,onChange:t}){const[n,a]=x.useState(e),l=x.useRef(n),o=x.useRef(t);return G3(()=>{o.current=t},[t]),x.useEffect(()=>{var c;l.current!==n&&((c=o.current)==null||c.call(o,n),l.current=n)},[n,l]),[n,a,o]}function J3(e){return typeof e=="function"}var jy=sk();const W3=mf(jy);function Sj(e){const t=eO(e),n=x.forwardRef((a,l)=>{const{children:o,...c}=a,f=x.Children.toArray(o),m=f.find(nO);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}function eO(e){const t=x.forwardRef((n,a)=>{const{children:l,...o}=n;if(x.isValidElement(l)){const c=aO(l),f=rO(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tO=Symbol("radix.slottable");function nO(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tO}function rO(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 aO(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 iO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],za=iO.reduce((e,t)=>{const n=Sj(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function lO(e,t){e&&jy.flushSync(()=>e.dispatchEvent(t))}function Nu(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function sO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e);x.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var oO="DismissableLayer",Eg="dismissableLayer.update",uO="dismissableLayer.pointerDownOutside",cO="dismissableLayer.focusOutside",W1,kj=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jj=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:o,onInteractOutside:c,onDismiss:f,...m}=e,h=x.useContext(kj),[y,g]=x.useState(null),b=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),k=kl(t,$=>g($)),j=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(E),R=y?j.indexOf(y):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,M=R>=C,B=hO($=>{const U=$.target,Q=[...h.branches].some(I=>I.contains(U));!M||Q||(l==null||l($),c==null||c($),$.defaultPrevented||f==null||f())},b),z=mO($=>{const U=$.target;[...h.branches].some(I=>I.contains(U))||(o==null||o($),c==null||c($),$.defaultPrevented||f==null||f())},b);return sO($=>{R===h.layers.size-1&&(a==null||a($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),x.useEffect(()=>{if(y)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(W1=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(y)),h.layers.add(y),ew(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=W1)}},[y,b,n,h]),x.useEffect(()=>()=>{y&&(h.layers.delete(y),h.layersWithOutsidePointerEventsDisabled.delete(y),ew())},[y,h]),x.useEffect(()=>{const $=()=>w({});return document.addEventListener(Eg,$),()=>document.removeEventListener(Eg,$)},[]),u.jsx(za.div,{...m,ref:k,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:Ei(e.onFocusCapture,z.onFocusCapture),onBlurCapture:Ei(e.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Ei(e.onPointerDownCapture,B.onPointerDownCapture)})});jj.displayName=oO;var dO="DismissableLayerBranch",fO=x.forwardRef((e,t)=>{const n=x.useContext(kj),a=x.useRef(null),l=kl(t,a);return x.useEffect(()=>{const o=a.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(za.div,{...e,ref:l})});fO.displayName=dO;function hO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e),a=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const o=f=>{if(f.target&&!a.current){let m=function(){Cj(uO,n,h,{discrete:!0})};const h={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);a.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",o),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function mO(e,t=globalThis==null?void 0:globalThis.document){const n=Nu(e),a=x.useRef(!1);return x.useEffect(()=>{const l=o=>{o.target&&!a.current&&Cj(cO,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 ew(){const e=new CustomEvent(Eg);document.dispatchEvent(e)}function Cj(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?lO(l,o):l.dispatchEvent(o)}var fp="focusScope.autoFocusOnMount",hp="focusScope.autoFocusOnUnmount",tw={bubbles:!1,cancelable:!0},pO="FocusScope",Ej=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:o,...c}=e,[f,m]=x.useState(null),h=Nu(l),y=Nu(o),g=x.useRef(null),b=kl(t,j=>m(j)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(a){let j=function(O){if(w.paused||!f)return;const M=O.target;f.contains(M)?g.current=M:fi(g.current,{select:!0})},E=function(O){if(w.paused||!f)return;const M=O.relatedTarget;M!==null&&(f.contains(M)||fi(g.current,{select:!0}))},C=function(O){if(document.activeElement===document.body)for(const B of O)B.removedNodes.length>0&&fi(f)};document.addEventListener("focusin",j),document.addEventListener("focusout",E);const R=new MutationObserver(C);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",E),R.disconnect()}}},[a,f,w.paused]),x.useEffect(()=>{if(f){rw.add(w);const j=document.activeElement;if(!f.contains(j)){const C=new CustomEvent(fp,tw);f.addEventListener(fp,h),f.dispatchEvent(C),C.defaultPrevented||(gO(wO(Nj(f)),{select:!0}),document.activeElement===j&&fi(f))}return()=>{f.removeEventListener(fp,h),setTimeout(()=>{const C=new CustomEvent(hp,tw);f.addEventListener(hp,y),f.dispatchEvent(C),C.defaultPrevented||fi(j??document.body,{select:!0}),f.removeEventListener(hp,y),rw.remove(w)},0)}}},[f,h,y,w]);const k=x.useCallback(j=>{if(!n&&!a||w.paused)return;const E=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(E&&C){const R=j.currentTarget,[O,M]=yO(R);O&&M?!j.shiftKey&&C===M?(j.preventDefault(),n&&fi(O,{select:!0})):j.shiftKey&&C===O&&(j.preventDefault(),n&&fi(M,{select:!0})):C===R&&j.preventDefault()}},[n,a,w.paused]);return u.jsx(za.div,{tabIndex:-1,...c,ref:b,onKeyDown:k})});Ej.displayName=pO;function gO(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(fi(a,{select:t}),document.activeElement!==n)return}function yO(e){const t=Nj(e),n=nw(t,e),a=nw(t.reverse(),e);return[n,a]}function Nj(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 nw(e,t){for(const n of e)if(!vO(n,{upTo:t}))return n}function vO(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 bO(e){return e instanceof HTMLInputElement&&"select"in e}function fi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bO(e)&&t&&e.select()}}var rw=xO();function xO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=aw(e,t),e.unshift(t)},remove(t){var n;e=aw(e,t),(n=e[0])==null||n.resume()}}}function aw(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function wO(e){return e.filter(t=>t.tagName!=="A")}var SO="Portal",_j=x.forwardRef((e,t)=>{var f;const{container:n,...a}=e,[l,o]=x.useState(!1);Eu(()=>o(!0),[]);const c=n||l&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return c?W3.createPortal(u.jsx(za.div,{...a,ref:t}),c):null});_j.displayName=SO;function kO(e,t){return x.useReducer((n,a)=>t[n][a]??n,e)}var Sf=e=>{const{present:t,children:n}=e,a=jO(t),l=typeof n=="function"?n({present:a.isPresent}):x.Children.only(n),o=kl(a.ref,CO(l));return typeof n=="function"||a.isPresent?x.cloneElement(l,{ref:o}):null};Sf.displayName="Presence";function jO(e){const[t,n]=x.useState(),a=x.useRef(null),l=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[f,m]=kO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Cd(a.current);o.current=f==="mounted"?h:"none"},[f]),Eu(()=>{const h=a.current,y=l.current;if(y!==e){const b=o.current,w=Cd(h);e?m("MOUNT"):w==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(y&&b!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Eu(()=>{if(t){let h;const y=t.ownerDocument.defaultView??window,g=w=>{const j=Cd(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&j&&(m("ANIMATION_END"),!l.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",h=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},b=w=>{w.target===t&&(o.current=Cd(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(h),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(h=>{a.current=h?getComputedStyle(h):null,n(h)},[])}}function Cd(e){return(e==null?void 0:e.animationName)||"none"}function CO(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 mp=0;function EO(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iw()),document.body.insertAdjacentElement("beforeend",e[1]??iw()),mp++,()=>{mp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mp--}},[])}function iw(){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 ea=function(){return ea=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},ea.apply(this,arguments)};function Tj(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 NO(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 qd="right-scroll-bar-position",Hd="width-before-scroll-bar",_O="with-scroll-bars-hidden",TO="--removed-body-scroll-bar-size";function pp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AO(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var RO=typeof window<"u"?x.useLayoutEffect:x.useEffect,lw=new WeakMap;function zO(e,t){var n=AO(null,function(a){return e.forEach(function(l){return pp(l,a)})});return RO(function(){var a=lw.get(n);if(a){var l=new Set(a),o=new Set(e),c=n.current;l.forEach(function(f){o.has(f)||pp(f,null)}),o.forEach(function(f){l.has(f)||pp(f,c)})}lw.set(n,e)},[e]),n}function OO(e){return e}function MO(e,t){t===void 0&&(t=OO);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var c=t(o,a);return n.push(c),function(){n=n.filter(function(f){return f!==c})}},assignSyncMedium:function(o){for(a=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(f){return o(f)},filter:function(){return n}}},assignMedium:function(o){a=!0;var c=[];if(n.length){var f=n;n=[],f.forEach(o),c=n}var m=function(){var y=c;c=[],y.forEach(o)},h=function(){return Promise.resolve().then(m)};h(),n={push:function(y){c.push(y),h()},filter:function(y){return c=c.filter(y),n}}}};return l}function DO(e){e===void 0&&(e={});var t=MO(null);return t.options=ea({async:!0,ssr:!1},e),t}var Aj=function(e){var t=e.sideCar,n=Tj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return x.createElement(a,ea({},n))};Aj.isSideCarExport=!0;function IO(e,t){return e.useMedium(t),Aj}var Rj=DO(),gp=function(){},kf=x.forwardRef(function(e,t){var n=x.useRef(null),a=x.useState({onScrollCapture:gp,onWheelCapture:gp,onTouchMoveCapture:gp}),l=a[0],o=a[1],c=e.forwardProps,f=e.children,m=e.className,h=e.removeScrollBar,y=e.enabled,g=e.shards,b=e.sideCar,w=e.noRelative,k=e.noIsolation,j=e.inert,E=e.allowPinchZoom,C=e.as,R=C===void 0?"div":C,O=e.gapMode,M=Tj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),B=b,z=zO([n,t]),$=ea(ea({},M),l);return x.createElement(x.Fragment,null,y&&x.createElement(B,{sideCar:Rj,removeScrollBar:h,shards:g,noRelative:w,noIsolation:k,inert:j,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:O}),c?x.cloneElement(x.Children.only(f),ea(ea({},$),{ref:z})):x.createElement(R,ea({},$,{className:m,ref:z}),f))});kf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kf.classNames={fullWidth:Hd,zeroRight:qd};var LO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=LO();return t&&e.setAttribute("nonce",t),e}function PO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function BO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $O=function(){var e=0,t=null;return{add:function(n){e==0&&(t=UO())&&(PO(t,n),BO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},FO=function(){var e=$O();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},zj=function(){var e=FO(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},qO={left:0,top:0,right:0,gap:0},yp=function(e){return parseInt(e||"",10)||0},HO=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[yp(n),yp(a),yp(l)]},ZO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qO;var t=HO(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])}},VO=zj(),ws="data-scroll-locked",QO=function(e,t,n,a){var l=e.left,o=e.top,c=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
276
|
-
.`.concat(_O,` {
|
|
277
|
-
overflow: hidden `).concat(a,`;
|
|
278
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
279
|
-
}
|
|
280
|
-
body[`).concat(ws,`] {
|
|
281
|
-
overflow: hidden `).concat(a,`;
|
|
282
|
-
overscroll-behavior: contain;
|
|
283
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
284
|
-
padding-left: `.concat(l,`px;
|
|
285
|
-
padding-top: `).concat(o,`px;
|
|
286
|
-
padding-right: `).concat(c,`px;
|
|
287
|
-
margin-left:0;
|
|
288
|
-
margin-top:0;
|
|
289
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
290
|
-
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.`).concat(qd,` {
|
|
294
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.`).concat(Hd,` {
|
|
298
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.`).concat(qd," .").concat(qd,` {
|
|
302
|
-
right: 0 `).concat(a,`;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.`).concat(Hd," .").concat(Hd,` {
|
|
306
|
-
margin-right: 0 `).concat(a,`;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
body[`).concat(ws,`] {
|
|
310
|
-
`).concat(TO,": ").concat(f,`px;
|
|
311
|
-
}
|
|
312
|
-
`)},sw=function(){var e=parseInt(document.body.getAttribute(ws)||"0",10);return isFinite(e)?e:0},KO=function(){x.useEffect(function(){return document.body.setAttribute(ws,(sw()+1).toString()),function(){var e=sw()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},GO=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;KO();var o=x.useMemo(function(){return ZO(l)},[l]);return x.createElement(VO,{styles:QO(o,!t,l,n?"":"!important")})},Ng=!1;if(typeof window<"u")try{var Ed=Object.defineProperty({},"passive",{get:function(){return Ng=!0,!0}});window.addEventListener("test",Ed,Ed),window.removeEventListener("test",Ed,Ed)}catch{Ng=!1}var cs=Ng?{passive:!1}:!1,YO=function(e){return e.tagName==="TEXTAREA"},Oj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!YO(e)&&n[t]==="visible")},XO=function(e){return Oj(e,"overflowY")},JO=function(e){return Oj(e,"overflowX")},ow=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=Mj(e,a);if(l){var o=Dj(e,a),c=o[1],f=o[2];if(c>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},WO=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},eM=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Mj=function(e,t){return e==="v"?XO(t):JO(t)},Dj=function(e,t){return e==="v"?WO(t):eM(t)},tM=function(e,t){return e==="h"&&t==="rtl"?-1:1},nM=function(e,t,n,a,l){var o=tM(e,window.getComputedStyle(t).direction),c=o*a,f=n.target,m=t.contains(f),h=!1,y=c>0,g=0,b=0;do{if(!f)break;var w=Dj(e,f),k=w[0],j=w[1],E=w[2],C=j-E-o*k;(k||C)&&Mj(e,f)&&(g+=C,b+=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(b)<1)&&(h=!0),h},Nd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uw=function(e){return[e.deltaX,e.deltaY]},cw=function(e){return e&&"current"in e?e.current:e},rM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aM=function(e){return`
|
|
313
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
-
`)},iM=0,ds=[];function lM(e){var t=x.useRef([]),n=x.useRef([0,0]),a=x.useRef(),l=x.useState(iM++)[0],o=x.useState(zj)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var j=NO([e.lockRef.current],(e.shards||[]).map(cw),!0).filter(Boolean);return j.forEach(function(E){return E.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),j.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(j,E){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var C=Nd(j),R=n.current,O="deltaX"in j?j.deltaX:R[0]-C[0],M="deltaY"in j?j.deltaY:R[1]-C[1],B,z=j.target,$=Math.abs(O)>Math.abs(M)?"h":"v";if("touches"in j&&$==="h"&&z.type==="range")return!1;var U=window.getSelection(),Q=U&&U.anchorNode,I=Q?Q===z||Q.contains(z):!1;if(I)return!1;var ne=ow($,z);if(!ne)return!0;if(ne?B=$:(B=$==="v"?"h":"v",ne=ow($,z)),!ne)return!1;if(!a.current&&"changedTouches"in j&&(O||M)&&(a.current=B),!B)return!0;var le=a.current||B;return nM(le,E,j,le==="h"?O:M)},[]),m=x.useCallback(function(j){var E=j;if(!(!ds.length||ds[ds.length-1]!==o)){var C="deltaY"in E?uw(E):Nd(E),R=t.current.filter(function(B){return B.name===E.type&&(B.target===E.target||E.target===B.shadowParent)&&rM(B.delta,C)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var O=(c.current.shards||[]).map(cw).filter(Boolean).filter(function(B){return B.contains(E.target)}),M=O.length>0?f(E,O[0]):!c.current.noIsolation;M&&E.cancelable&&E.preventDefault()}}},[]),h=x.useCallback(function(j,E,C,R){var O={name:j,delta:E,target:C,should:R,shadowParent:sM(C)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(M){return M!==O})},1)},[]),y=x.useCallback(function(j){n.current=Nd(j),a.current=void 0},[]),g=x.useCallback(function(j){h(j.type,uw(j),j.target,f(j,e.lockRef.current))},[]),b=x.useCallback(function(j){h(j.type,Nd(j),j.target,f(j,e.lockRef.current))},[]);x.useEffect(function(){return ds.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),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 x.createElement(x.Fragment,null,k?x.createElement(o,{styles:aM(l)}):null,w?x.createElement(GO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oM=IO(Rj,lM);var Ij=x.forwardRef(function(e,t){return x.createElement(kf,ea({},e,{ref:t,sideCar:oM}))});Ij.classNames=kf.classNames;var uM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fs=new WeakMap,_d=new WeakMap,Td={},vp=0,Lj=function(e){return e&&(e.host||Lj(e.parentNode))},cM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=Lj(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})},dM=function(e,t,n,a){var l=cM(t,Array.isArray(e)?e:[e]);Td[n]||(Td[n]=new WeakMap);var o=Td[n],c=[],f=new Set,m=new Set(l),h=function(g){!g||f.has(g)||(f.add(g),h(g.parentNode))};l.forEach(h);var y=function(g){!g||m.has(g)||Array.prototype.forEach.call(g.children,function(b){if(f.has(b))y(b);else try{var w=b.getAttribute(a),k=w!==null&&w!=="false",j=(fs.get(b)||0)+1,E=(o.get(b)||0)+1;fs.set(b,j),o.set(b,E),c.push(b),j===1&&k&&_d.set(b,!0),E===1&&b.setAttribute(n,"true"),k||b.setAttribute(a,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return y(t),f.clear(),vp++,function(){c.forEach(function(g){var b=fs.get(g)-1,w=o.get(g)-1;fs.set(g,b),o.set(g,w),b||(_d.has(g)||g.removeAttribute(a),_d.delete(g)),w||g.removeAttribute(n)}),vp--,vp||(fs=new WeakMap,fs=new WeakMap,_d=new WeakMap,Td={})}},fM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=uM(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),dM(a,l,n,"aria-hidden")):function(){return null}},jf="Dialog",[Uj]=Z3(jf),[hM,Hr]=Uj(jf),Pj=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:o,modal:c=!0}=e,f=x.useRef(null),m=x.useRef(null),[h,y]=Y3({prop:a,defaultProp:l??!1,onChange:o,caller:jf});return u.jsx(hM,{scope:t,triggerRef:f,contentRef:m,contentId:Ta(),titleId:Ta(),descriptionId:Ta(),open:h,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};Pj.displayName=jf;var Bj="DialogTrigger",mM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Bj,n),o=kl(t,l.triggerRef);return u.jsx(za.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Ny(l.open),...a,ref:o,onClick:Ei(e.onClick,l.onOpenToggle)})});mM.displayName=Bj;var Cy="DialogPortal",[pM,$j]=Uj(Cy,{forceMount:void 0}),Fj=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,o=Hr(Cy,t);return u.jsx(pM,{scope:t,forceMount:n,children:x.Children.map(a,c=>u.jsx(Sf,{present:n||o.open,children:u.jsx(_j,{asChild:!0,container:l,children:c})}))})};Fj.displayName=Cy;var Jd="DialogOverlay",qj=x.forwardRef((e,t)=>{const n=$j(Jd,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Hr(Jd,e.__scopeDialog);return o.modal?u.jsx(Sf,{present:a||o.open,children:u.jsx(yM,{...l,ref:t})}):null});qj.displayName=Jd;var gM=Sj("DialogOverlay.RemoveScroll"),yM=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Jd,n);return u.jsx(Ij,{as:gM,allowPinchZoom:!0,shards:[l.contentRef],children:u.jsx(za.div,{"data-state":Ny(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),yl="DialogContent",Hj=x.forwardRef((e,t)=>{const n=$j(yl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,o=Hr(yl,e.__scopeDialog);return u.jsx(Sf,{present:a||o.open,children:o.modal?u.jsx(vM,{...l,ref:t}):u.jsx(bM,{...l,ref:t})})});Hj.displayName=yl;var vM=x.forwardRef((e,t)=>{const n=Hr(yl,e.__scopeDialog),a=x.useRef(null),l=kl(t,n.contentRef,a);return x.useEffect(()=>{const o=a.current;if(o)return fM(o)},[]),u.jsx(Zj,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ei(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ei(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0;(c.button===2||f)&&o.preventDefault()}),onFocusOutside:Ei(e.onFocusOutside,o=>o.preventDefault())})}),bM=x.forwardRef((e,t)=>{const n=Hr(yl,e.__scopeDialog),a=x.useRef(!1),l=x.useRef(!1);return u.jsx(Zj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,f;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(a.current||(f=n.triggerRef.current)==null||f.focus(),o.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:o=>{var m,h;(m=e.onInteractOutside)==null||m.call(e,o),o.defaultPrevented||(a.current=!0,o.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const c=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&l.current&&o.preventDefault()}})}),Zj=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:o,...c}=e,f=Hr(yl,n),m=x.useRef(null),h=kl(t,m);return EO(),u.jsxs(u.Fragment,{children:[u.jsx(Ej,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:o,children:u.jsx(jj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ny(f.open),...c,ref:h,onDismiss:()=>f.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(xM,{titleId:f.titleId}),u.jsx(SM,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Ey="DialogTitle",Vj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Ey,n);return u.jsx(za.h2,{id:l.titleId,...a,ref:t})});Vj.displayName=Ey;var Qj="DialogDescription",Kj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Qj,n);return u.jsx(za.p,{id:l.descriptionId,...a,ref:t})});Kj.displayName=Qj;var Gj="DialogClose",Yj=x.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=Hr(Gj,n);return u.jsx(za.button,{type:"button",...a,ref:t,onClick:Ei(e.onClick,()=>l.onOpenChange(!1))})});Yj.displayName=Gj;function Ny(e){return e?"open":"closed"}var Xj="DialogTitleWarning",[JV,Jj]=H3(Xj,{contentName:yl,titleName:Ey,docsSlug:"dialog"}),xM=({titleId:e})=>{const t=Jj(Xj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
316
|
-
|
|
317
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
318
|
-
|
|
319
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},wM="DialogDescriptionWarning",SM=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Jj(wM).contentName}}.`;return x.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Wj=Pj,eC=Fj,tC=qj,nC=Hj,kM=Vj,jM=Kj,CM=Yj,EM=Symbol.for("react.lazy"),Wd=ty[" use ".trim().toString()];function NM(e){return typeof e=="object"&&e!==null&&"then"in e}function rC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===EM&&"_payload"in e&&NM(e._payload)}function aC(e){const t=TM(e),n=x.forwardRef((a,l)=>{let{children:o,...c}=a;rC(o)&&typeof Wd=="function"&&(o=Wd(o._payload));const f=x.Children.toArray(o),m=f.find(RM);if(m){const h=m.props.children,y=f.map(g=>g===m?x.Children.count(h)>1?x.Children.only(null):x.isValidElement(h)?h.props.children:null:g);return u.jsx(t,{...c,ref:l,children:x.isValidElement(h)?x.cloneElement(h,void 0,y):null})}return u.jsx(t,{...c,ref:l,children:o})});return n.displayName=`${e}.Slot`,n}var _M=aC("Slot");function TM(e){const t=x.forwardRef((n,a)=>{let{children:l,...o}=n;if(rC(l)&&typeof Wd=="function"&&(l=Wd(l._payload)),x.isValidElement(l)){const c=OM(l),f=zM(o,l.props);return l.type!==x.Fragment&&(f.ref=a?_i(a,c):c),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AM=Symbol("radix.slottable");function RM(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AM}function zM(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 OM(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 MM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oa=MM.reduce((e,t)=>{const n=aC(`Primitive.${t}`),a=x.forwardRef((l,o)=>{const{asChild:c,...f}=l,m=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(m,{...f,ref:o})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),au='[cmdk-group=""]',bp='[cmdk-group-items=""]',DM='[cmdk-group-heading=""]',iC='[cmdk-item=""]',dw=`${iC}:not([aria-disabled="true"])`,_g="cmdk-item-select",ps="data-value",IM=(e,t,n)=>q3(e,t,n),lC=x.createContext(void 0),Gu=()=>x.useContext(lC),sC=x.createContext(void 0),_y=()=>x.useContext(sC),oC=x.createContext(void 0),uC=x.forwardRef((e,t)=>{let n=gs(()=>{var P,T;return{search:"",value:(T=(P=e.value)!=null?P:e.defaultValue)!=null?T:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),a=gs(()=>new Set),l=gs(()=>new Map),o=gs(()=>new Map),c=gs(()=>new Set),f=cC(e),{label:m,children:h,value:y,onValueChange:g,filter:b,shouldFilter:w,loop:k,disablePointerSelection:j=!1,vimBindings:E=!0,...C}=e,R=Ta(),O=Ta(),M=Ta(),B=x.useRef(null),z=QM();vl(()=>{if(y!==void 0){let P=y.trim();n.current.value=P,$.emit()}},[y]),vl(()=>{z(6,we)},[]);let $=x.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,T,Z)=>{var W,ce,ve,ge;if(!Object.is(n.current[P],T)){if(n.current[P]=T,P==="search")le(),I(),z(1,ne);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let fe=document.getElementById(M);fe?fe.focus():(W=document.getElementById(R))==null||W.focus()}if(z(7,()=>{var fe;n.current.selectedItemId=(fe=Y())==null?void 0:fe.id,$.emit()}),Z||z(5,we),((ce=f.current)==null?void 0:ce.value)!==void 0){let fe=T??"";(ge=(ve=f.current).onValueChange)==null||ge.call(ve,fe);return}}$.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),U=x.useMemo(()=>({value:(P,T,Z)=>{var W;T!==((W=o.current.get(P))==null?void 0:W.value)&&(o.current.set(P,{value:T,keywords:Z}),n.current.filtered.items.set(P,Q(T,Z)),z(2,()=>{I(),$.emit()}))},item:(P,T)=>(a.current.add(P),T&&(l.current.has(T)?l.current.get(T).add(P):l.current.set(T,new Set([P]))),z(3,()=>{le(),I(),n.current.value||ne(),$.emit()}),()=>{o.current.delete(P),a.current.delete(P),n.current.filtered.items.delete(P);let Z=Y();z(4,()=>{le(),(Z==null?void 0:Z.getAttribute("id"))===P&&ne(),$.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:M,labelId:O,listInnerRef:B}),[]);function Q(P,T){var Z,W;let ce=(W=(Z=f.current)==null?void 0:Z.filter)!=null?W:IM;return P?ce(P,n.current.search,T):0}function I(){if(!n.current.search||f.current.shouldFilter===!1)return;let P=n.current.filtered.items,T=[];n.current.filtered.groups.forEach(W=>{let ce=l.current.get(W),ve=0;ce.forEach(ge=>{let fe=P.get(ge);ve=Math.max(fe,ve)}),T.push([W,ve])});let Z=B.current;J().sort((W,ce)=>{var ve,ge;let fe=W.getAttribute("id"),Qe=ce.getAttribute("id");return((ve=P.get(Qe))!=null?ve:0)-((ge=P.get(fe))!=null?ge:0)}).forEach(W=>{let ce=W.closest(bp);ce?ce.appendChild(W.parentElement===ce?W:W.closest(`${bp} > *`)):Z.appendChild(W.parentElement===Z?W:W.closest(`${bp} > *`))}),T.sort((W,ce)=>ce[1]-W[1]).forEach(W=>{var ce;let ve=(ce=B.current)==null?void 0:ce.querySelector(`${au}[${ps}="${encodeURIComponent(W[0])}"]`);ve==null||ve.parentElement.appendChild(ve)})}function ne(){let P=J().find(Z=>Z.getAttribute("aria-disabled")!=="true"),T=P==null?void 0:P.getAttribute(ps);$.setState("value",T||void 0)}function le(){var P,T,Z,W;if(!n.current.search||f.current.shouldFilter===!1){n.current.filtered.count=a.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let ve of a.current){let ge=(T=(P=o.current.get(ve))==null?void 0:P.value)!=null?T:"",fe=(W=(Z=o.current.get(ve))==null?void 0:Z.keywords)!=null?W:[],Qe=Q(ge,fe);n.current.filtered.items.set(ve,Qe),Qe>0&&ce++}for(let[ve,ge]of l.current)for(let fe of ge)if(n.current.filtered.items.get(fe)>0){n.current.filtered.groups.add(ve);break}n.current.filtered.count=ce}function we(){var P,T,Z;let W=Y();W&&(((P=W.parentElement)==null?void 0:P.firstChild)===W&&((Z=(T=W.closest(au))==null?void 0:T.querySelector(DM))==null||Z.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function Y(){var P;return(P=B.current)==null?void 0:P.querySelector(`${iC}[aria-selected="true"]`)}function J(){var P;return Array.from(((P=B.current)==null?void 0:P.querySelectorAll(dw))||[])}function H(P){let T=J()[P];T&&$.setState("value",T.getAttribute(ps))}function ee(P){var T;let Z=Y(),W=J(),ce=W.findIndex(ge=>ge===Z),ve=W[ce+P];(T=f.current)!=null&&T.loop&&(ve=ce+P<0?W[W.length-1]:ce+P===W.length?W[0]:W[ce+P]),ve&&$.setState("value",ve.getAttribute(ps))}function be(P){let T=Y(),Z=T==null?void 0:T.closest(au),W;for(;Z&&!W;)Z=P>0?ZM(Z,au):VM(Z,au),W=Z==null?void 0:Z.querySelector(dw);W?$.setState("value",W.getAttribute(ps)):ee(P)}let Ae=()=>H(J().length-1),A=P=>{P.preventDefault(),P.metaKey?Ae():P.altKey?be(1):ee(1)},L=P=>{P.preventDefault(),P.metaKey?H(0):P.altKey?be(-1):ee(-1)};return x.createElement(Oa.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:P=>{var T;(T=C.onKeyDown)==null||T.call(C,P);let Z=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||Z))switch(P.key){case"n":case"j":{E&&P.ctrlKey&&A(P);break}case"ArrowDown":{A(P);break}case"p":case"k":{E&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),H(0);break}case"End":{P.preventDefault(),Ae();break}case"Enter":{P.preventDefault();let W=Y();if(W){let ce=new Event(_g);W.dispatchEvent(ce)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:GM},m),Cf(e,P=>x.createElement(sC.Provider,{value:$},x.createElement(lC.Provider,{value:U},P))))}),LM=x.forwardRef((e,t)=>{var n,a;let l=Ta(),o=x.useRef(null),c=x.useContext(oC),f=Gu(),m=cC(e),h=(a=(n=m.current)==null?void 0:n.forceMount)!=null?a:c==null?void 0:c.forceMount;vl(()=>{if(!h)return f.item(l,c==null?void 0:c.id)},[h]);let y=dC(l,o,[e.value,e.children,o],e.keywords),g=_y(),b=Ti(z=>z.value&&z.value===y.current),w=Ti(z=>h||f.filter()===!1?!0:z.search?z.filtered.items.get(l)>0:!0);x.useEffect(()=>{let z=o.current;if(!(!z||e.disabled))return z.addEventListener(_g,k),()=>z.removeEventListener(_g,k)},[w,e.onSelect,e.disabled]);function k(){var z,$;j(),($=(z=m.current).onSelect)==null||$.call(z,y.current)}function j(){g.setState("value",y.current,!0)}if(!w)return null;let{disabled:E,value:C,onSelect:R,forceMount:O,keywords:M,...B}=e;return x.createElement(Oa.div,{ref:_i(o,t),...B,id:l,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!b,"data-disabled":!!E,"data-selected":!!b,onPointerMove:E||f.getDisablePointerSelection()?void 0:j,onClick:E?void 0:k},e.children)}),UM=x.forwardRef((e,t)=>{let{heading:n,children:a,forceMount:l,...o}=e,c=Ta(),f=x.useRef(null),m=x.useRef(null),h=Ta(),y=Gu(),g=Ti(w=>l||y.filter()===!1?!0:w.search?w.filtered.groups.has(c):!0);vl(()=>y.group(c),[]),dC(c,f,[e.value,e.heading,m]);let b=x.useMemo(()=>({id:c,forceMount:l}),[l]);return x.createElement(Oa.div,{ref:_i(f,t),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&x.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Cf(e,w=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},x.createElement(oC.Provider,{value:b},w))))}),PM=x.forwardRef((e,t)=>{let{alwaysRender:n,...a}=e,l=x.useRef(null),o=Ti(c=>!c.search);return!n&&!o?null:x.createElement(Oa.div,{ref:_i(l,t),...a,"cmdk-separator":"",role:"separator"})}),BM=x.forwardRef((e,t)=>{let{onValueChange:n,...a}=e,l=e.value!=null,o=_y(),c=Ti(h=>h.search),f=Ti(h=>h.selectedItemId),m=Gu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Oa.input,{ref:t,...a,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:l?e.value:c,onChange:h=>{l||o.setState("search",h.target.value),n==null||n(h.target.value)}})}),$M=x.forwardRef((e,t)=>{let{children:n,label:a="Suggestions",...l}=e,o=x.useRef(null),c=x.useRef(null),f=Ti(h=>h.selectedItemId),m=Gu();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,y=o.current,g,b=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let w=h.offsetHeight;y.style.setProperty("--cmdk-list-height",w.toFixed(1)+"px")})});return b.observe(h),()=>{cancelAnimationFrame(g),b.unobserve(h)}}},[]),x.createElement(Oa.div,{ref:_i(o,t),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":f,"aria-label":a,id:m.listId},Cf(e,h=>x.createElement("div",{ref:_i(c,m.listInnerRef),"cmdk-list-sizer":""},h)))}),FM=x.forwardRef((e,t)=>{let{open:n,onOpenChange:a,overlayClassName:l,contentClassName:o,container:c,...f}=e;return x.createElement(Wj,{open:n,onOpenChange:a},x.createElement(eC,{container:c},x.createElement(tC,{"cmdk-overlay":"",className:l}),x.createElement(nC,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(uC,{ref:t,...f}))))}),qM=x.forwardRef((e,t)=>Ti(n=>n.filtered.count===0)?x.createElement(Oa.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),HM=x.forwardRef((e,t)=>{let{progress:n,children:a,label:l="Loading...",...o}=e;return x.createElement(Oa.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Cf(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),Xn=Object.assign(uC,{List:$M,Item:LM,Input:BM,Group:UM,Separator:PM,Dialog:FM,Empty:qM,Loading:HM});function ZM(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function VM(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function cC(e){let t=x.useRef(e);return vl(()=>{t.current=e}),t}var vl=typeof window>"u"?x.useEffect:x.useLayoutEffect;function gs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function Ti(e){let t=_y(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function dC(e,t,n,a=[]){let l=x.useRef(),o=Gu();return vl(()=>{var c;let f=(()=>{var h;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(h=y.current.textContent)==null?void 0:h.trim():l.current}})(),m=a.map(h=>h.trim());o.value(e,f,m),(c=t.current)==null||c.setAttribute(ps,f),l.current=f}),l}var QM=()=>{let[e,t]=x.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 KM(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Cf({asChild:e,children:t},n){return e&&x.isValidElement(t)?x.cloneElement(KM(t),{ref:t.ref},n(t.props.children)):n(t)}var GM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const sn=Wj,YM=eC,fC=x.forwardRef(({className:e,...t},n)=>u.jsx(tC,{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}));fC.displayName="DialogOverlay";const en=x.forwardRef(({className:e,children:t,...n},a)=>u.jsxs(YM,{children:[u.jsx(fC,{}),u.jsxs(nC,{ref:a,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,u.jsxs(CM,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(ju,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));en.displayName="DialogContent";function fn({className:e,...t}){return u.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Ln({className:e,...t}){return u.jsx("div",{className:Te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}const on=x.forwardRef(({className:e,...t},n)=>u.jsx(kM,{ref:n,className:Te("text-subtitle leading-none tracking-tight",e),...t}));on.displayName="DialogTitle";const Ty=x.forwardRef(({className:e,...t},n)=>u.jsx(jM,{ref:n,className:Te("text-body text-muted-foreground",e),...t}));Ty.displayName="DialogDescription";const hC=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn,{ref:n,className:Te("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));hC.displayName=Xn.displayName;function XM({open:e,onOpenChange:t,children:n}){return u.jsx(sn,{open:e,onOpenChange:t,children:u.jsx(en,{className:"overflow-hidden p-0 shadow-lg",children:u.jsx(hC,{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 mC=x.forwardRef(({className:e,...t},n)=>u.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[u.jsx(xy,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),u.jsx(Xn.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})]}));mC.displayName=Xn.Input.displayName;const pC=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.List,{ref:n,className:Te("max-h-[var(--sp-75)] overflow-y-auto overflow-x-hidden",e),...t}));pC.displayName=Xn.List.displayName;const gC=x.forwardRef((e,t)=>u.jsx(Xn.Empty,{ref:t,className:"py-6 text-center text-body",...e}));gC.displayName=Xn.Empty.displayName;const Zd=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.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}));Zd.displayName=Xn.Group.displayName;const Tg=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.Separator,{ref:n,className:Te("-mx-1 h-px bg-border",e),...t}));Tg.displayName=Xn.Separator.displayName;const Vd=x.forwardRef(({className:e,...t},n)=>u.jsx(Xn.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}));Vd.displayName=Xn.Item.displayName;function Yu(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 ke.get(hn(`/agents${n?`?${n}`:""}`))}function yC(){return ke.get("/me/managed-agents")}function JM(e){return ke.get(`/agents/${encodeURIComponent(e)}`)}function WM(e){return ke.post(hn("/agents"),e)}function eD(e){return ke.get(hn(`/agents/names/${encodeURIComponent(e)}/availability`))}function fw(e,t){return ke.patch(`/agents/${encodeURIComponent(e)}`,t)}function tD(e,t){return ke.patch(`/agents/${encodeURIComponent(e)}/rebind`,t)}function nD(e){return ke.delete(`/agents/${encodeURIComponent(e)}`)}function rD(e){return ke.post(`/agents/${encodeURIComponent(e)}/suspend`,{})}function aD(e){return ke.post(`/agents/${encodeURIComponent(e)}/reactivate`,{})}function iD(e){return ke.post(`/agents/${encodeURIComponent(e)}/test`,{})}function Ef(){const{data:e}=He({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}),{data:t}=He({queryKey:["managed-agents","name-map"],queryFn:yC,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,a.displayName);if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,a.displayName);return a=>a?n.get(a)??a:"—"},[e,t])}function Ay(){const{data:e}=He({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}),{data:t}=He({queryKey:["managed-agents","name-map"],queryFn:yC,staleTime:3e4});return x.useMemo(()=>{const n=new Map;if(t)for(const a of t)n.set(a.uuid,{name:a.name,displayName:a.displayName});if(e!=null&&e.items)for(const a of e.items)n.set(a.uuid,{name:a.name,displayName:a.displayName});return a=>a?n.get(a)??null:null},[e,t])}const lD=[{path:"/",label:"Workspace"},{path:"/context",label:"Context"},{path:"/team",label:"Team"},{path:"/settings",label:"Settings"}];function sD({open:e,onOpenChange:t}){const n=Un(),a=Ef(),{data:l}=He({queryKey:["activity"],queryFn:Ku,enabled:e,staleTime:3e4}),o=(l==null?void 0:l.agents)??[],f=He({queryKey:["palette-sessions",o.map(h=>h.agentId).join(",")],queryFn:async()=>{const h=[];for(const y of o)try{const g=await xj(y.agentId);for(const b of g)h.push({agentId:y.agentId,session:b})}catch{}return h},enabled:e&&o.length>0,staleTime:3e4}).data??[],m=h=>{t(!1),n(h)};return u.jsxs(XM,{open:e,onOpenChange:t,children:[u.jsx(mC,{placeholder:"Jump to agent, chat, or page…"}),u.jsxs(pC,{children:[u.jsx(gC,{children:"No results"}),o.length>0&&u.jsx(Zd,{heading:"Agents",children:o.map(h=>{const y=a(h.agentId);return u.jsxs(Vd,{value:`agent ${y} ${h.agentId}`,onSelect:()=>m(`/?a=${h.agentId}`),children:[u.jsx(YR,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:y}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:h.agentId.slice(0,8)})]},h.agentId)})}),f.length>0&&u.jsxs(u.Fragment,{children:[u.jsx(Tg,{}),u.jsx(Zd,{heading:"Chats",children:f.map(({agentId:h,session:y})=>{const g=a(h);return u.jsxs(Vd,{value:`chat ${g} ${y.chatId}`,onSelect:()=>m(`/?a=${h}&c=${y.chatId}`),children:[u.jsx(by,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{className:"flex-1 truncate",children:g}),u.jsx("span",{className:"text-caption text-muted-foreground font-mono ml-2",children:y.chatId.slice(0,8)})]},`${h}-${y.chatId}`)})})]}),u.jsx(Tg,{}),u.jsx(Zd,{heading:"Pages",children:lD.map(h=>u.jsxs(Vd,{value:`page ${h.label}`,onSelect:()=>m(h.path),children:[u.jsx(dz,{className:"mr-2 h-4 w-4 shrink-0 opacity-70"}),u.jsx("span",{children:h.label})]},h.path))})]})]})}function oD(e,t){return t?e.filter(n=>n.userId===t&&n.status==="disconnected"&&n.agentCount>0):[]}function uD(){var a;const{user:e}=Rt(),{data:t}=He({queryKey:["clients"],queryFn:Ni,refetchInterval:1e4,enabled:!!e});if(!t||!e)return{rows:[],firstHostname:null};const n=oD(t,e.id);return{rows:n,firstHostname:((a=n[0])==null?void 0:a.hostname)??null}}const cD=160;function dD(){const e=Un(),{rows:t,firstHostname:n}=uD();if(t.length===0)return null;const a=t.length>1,l=a?`${t.length} computers disconnected. Click to manage.`:`${n??"Your computer"} is disconnected. Click to manage.`;return u.jsxs("button",{type:"button",onClick:()=>e("/settings/computers"),title:l,"aria-label":l,className:"inline-flex items-center cursor-pointer text-body font-medium",style:{gap:8,height:26,padding:"0 var(--sp-2_5) 0 var(--sp-2_25)",borderRadius:999,border:0,outline:"var(--hairline) solid color-mix(in oklch, var(--state-error) 38%, transparent)",outlineOffset:-1,background:"color-mix(in oklch, var(--state-error) 14%, transparent)",color:"color-mix(in oklch, var(--state-error) 80%, var(--fg))",minWidth:0},children:[u.jsx(fD,{}),a?u.jsxs("span",{style:{fontVariantNumeric:"tabular-nums"},children:[u.jsx("span",{className:"font-semibold",children:t.length})," computers disconnected"]}):u.jsxs("span",{className:"inline-flex items-center",style:{gap:5,minWidth:0},children:[u.jsx("span",{className:"mono text-label font-medium",style:{maxWidth:cD,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"color-mix(in oklch, var(--state-error) 60%, var(--fg))"},children:n??"computer"}),u.jsx("span",{style:{flexShrink:0},children:"disconnected"})]})]})}function fD(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",width:8,height:8,flexShrink:0,display:"inline-block"},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-error)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-error)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]})}function Xu(e){return u.jsxs("svg",{viewBox:"0 0 9 10",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",shapeRendering:"crispEdges","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"4",y:"0",width:"1",height:"1"}),u.jsx("rect",{x:"3",y:"1",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"2",width:"5",height:"1"}),u.jsx("rect",{x:"3",y:"3",width:"3",height:"1"}),u.jsx("rect",{x:"2",y:"4",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"5",width:"7",height:"1"}),u.jsx("rect",{x:"2",y:"6",width:"5",height:"1"}),u.jsx("rect",{x:"1",y:"7",width:"7",height:"1"}),u.jsx("rect",{x:"0",y:"8",width:"9",height:"1"}),u.jsx("rect",{x:"3",y:"9",width:"3",height:"1"})]})}function hw(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 ke.get(hn(`/notifications${n?`?${n}`:""}`))}function hD(e){return ke.post(hn(`/notifications/${e}/read`))}function mD(){return ke.post(hn("/notifications/read-all"))}const pD={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 gD(e){switch(e){case"high":return"var(--state-error)";case"medium":return"var(--state-blocked)";default:return"var(--accent-dim)"}}function yD({notification:e,onClick:t,clickable:n}){const a=(pD[e.type]??e.type).toString(),l=gD(e.severity),o=n??!0;return u.jsxs("button",{type:"button",onClick:t,className:Te("w-full text-left transition-colors text-body",o?"cursor-pointer":"cursor-default"),style:{padding:"var(--sp-1_5) var(--sp-2)",background:e.read?"transparent":"var(--bg-sunken)",borderLeft:`var(--hairline-bold) solid ${l}`,borderRadius:"0 var(--sp-0_75) var(--sp-0_75) 0"},onMouseEnter:c=>{o&&(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{c.currentTarget.style.background=e.read?"transparent":"var(--bg-sunken)"},children:[u.jsxs("div",{className:"flex items-baseline justify-between",style:{gap:8},children:[u.jsx("span",{className:"mono uppercase text-label",style:{color:e.severity==="high"?"var(--state-error)":"var(--fg-3)"},children:a.replace("_"," ")}),u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)",whiteSpace:"nowrap"},children:Cu(e.createdAt)})]}),u.jsx("div",{style:{color:"var(--fg-2)",marginTop:1,wordBreak:"break-word"},children:e.message})]})}function vD(){var w;const[e,t]=x.useState(!1),[n,a]=x.useState(null),l=x.useRef(null),o=Un(),c=nn(),{data:f}=He({queryKey:["notifications","bell"],queryFn:()=>hw({limit:8}),refetchInterval:1e4}),{data:m}=He({queryKey:["notifications","unread-count"],queryFn:()=>hw({read:!1,limit:100}),refetchInterval:1e4}),h=((w=m==null?void 0:m.items)==null?void 0:w.length)??0,y=h>0,g=x.useCallback(async k=>{k.read||(hD(k.id).catch(()=>{}),c.invalidateQueries({queryKey:["notifications"]})),t(!1),k.agentId&&k.chatId?o(`/?a=${k.agentId}&c=${k.chatId}`):k.agentId&&o(`/?a=${k.agentId}`)},[o,c]),b=x.useCallback(async()=>{a(null);try{await mD(),await c.invalidateQueries({queryKey:["notifications"]})}catch(k){a(k instanceof Error?k.message:"Failed to mark all as read")}},[c]);return u.jsxs("div",{className:"relative",children:[u.jsxs("button",{type:"button",onClick:()=>t(!e),className:"relative flex items-center justify-center rounded-md p-1.5 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[u.jsx(KR,{className:"h-4 w-4"}),y&&u.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center rounded-full px-1 font-medium text-label",style:{height:16,minWidth:16,background:"var(--state-error)",color:"var(--bg)"},children:h>99?"99+":h})]}),e&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"fixed inset-0 z-40 cursor-default",onClick:()=>t(!1)}),u.jsxs("div",{ref:l,className:"absolute right-0 top-full mt-1 z-50",style:{width:320,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:6,boxShadow:"var(--shadow-md)"},children:[u.jsxs("div",{className:"flex items-center justify-between",style:{padding:"var(--sp-2) var(--sp-3)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("span",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:"Notifications"}),y&&u.jsx("button",{type:"button",onClick:b,className:"hover:underline text-body",style:{color:"var(--accent)"},children:"Mark all read"})]}),n&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-1_5) var(--sp-3)",color:"var(--state-error)",background:"var(--bg-sunken)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:n}),u.jsx("div",{className:"flex flex-col overflow-y-auto",style:{maxHeight:360,padding:8,gap:4},children:!(f!=null&&f.items)||f.items.length===0?u.jsx("div",{className:"text-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-4_5) 0"},children:"No notifications"}):f.items.map(k=>u.jsx(yD,{notification:k,clickable:!!k.agentId,onClick:()=>g(k)},k.id))})]})]})]})}function bD(){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 xD(){const[e,t]=x.useState(bD);return x.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),window.localStorage.setItem("theme",e)},[e]),u.jsx("button",{type:"button",onClick:()=>t(e==="dark"?"light":"dark"),"aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:e==="dark"?u.jsx(Az,{className:"h-4 w-4"}):u.jsx(xz,{className:"h-4 w-4"})})}function wD(e){var n;const t=e.trim();return t?((n=t[0])==null?void 0:n.toUpperCase())??"?":"?"}function mw({src:e,name:t,size:n=28,className:a}){const l=`${n}px`;return e?u.jsx("img",{src:e,alt:t,width:n,height:n,className:a,style:{width:l,height:l,borderRadius:"50%",objectFit:"cover",display:"block"}}):u.jsx("span",{className:a,role:"img","aria-label":t,style:{width:l,height:l,borderRadius:"50%",background:"var(--accent)",color:"var(--bg-raised)",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:1,userSelect:"none"},children:u.jsx("span",{className:"text-subtitle font-semibold",children:wD(t)})})}const pw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gw=aj,SD=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return gw(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:o}=t,c=Object.keys(l).map(h=>{const y=n==null?void 0:n[h],g=o==null?void 0:o[h];if(y===null)return null;const b=pw(y)||pw(g);return l[h][b]}),f=n&&Object.entries(n).reduce((h,y)=>{let[g,b]=y;return b===void 0||(h[g]=b),h},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,y)=>{let{class:g,className:b,...w}=y;return Object.entries(w).every(k=>{let[j,E]=k;return Array.isArray(E)?E.includes({...o,...f}[j]):{...o,...f}[j]===E})?[...h,g,b]:h},[]);return gw(e,c,m,n==null?void 0:n.class,n==null?void 0:n.className)},kD=SD("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-input)] text-body font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 px-3 text-label",xs:"h-7 rounded-[var(--radius-chip)] px-2.5 text-label gap-1.5",lg:"h-10 px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...l},o)=>{const c=a?_M:"button";return u.jsx(c,{className:Te(kD({variant:t,size:n,className:e})),ref:o,...l})});me.displayName="Button";const At=x.forwardRef(({className:e,type:t,...n},a)=>u.jsx("input",{type:t,className:Te("flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...n}));At.displayName="Input";function jD({action:e,onClose:t}){const n=e!==null;return u.jsx(sn,{open:n,onOpenChange:a=>!a&&t(),children:u.jsxs(en,{children:[u.jsxs(fn,{children:[u.jsx(on,{children:e==="join"?"Join a team":"Create a new team"}),u.jsx(Ty,{children:e==="join"?"Paste the invite token shared with you.":"You'll be the admin. You can rename or invite teammates afterward."})]}),e==="create"&&u.jsx(ED,{onDone:t}),e==="join"&&u.jsx(ND,{onDone:t})]})})}function CD(e){return e.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"team"}function ED({onDone:e}){const{adoptTokens:t}=Rt(),n=Un(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{y.preventDefault();const g=a.trim();if(g){m(!0),c(null);try{const b=await ke.post("/me/organizations",{name:CD(g),displayName:g});await t(b.tokens),e(),n("/",{replace:!0})}catch(b){c(b instanceof Error?b.message:"Failed to create team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(At,{id:"team-display-name","aria-label":"Team name",value:a,onChange:y=>l(y.target.value),placeholder:"Acme Robotics",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Creating…":"Create team"})]})}function ND({onDone:e}){const{adoptTokens:t}=Rt(),n=Un(),[a,l]=x.useState(""),[o,c]=x.useState(null),[f,m]=x.useState(!1);x.useEffect(()=>{l(""),c(null),m(!1)},[]);const h=async y=>{if(y.preventDefault(),!!a.trim()){m(!0),c(null);try{const g=a.trim(),b=/\/invite\/([^/?#]+)/.exec(g),w=(b==null?void 0:b[1])??g,k=await ke.post("/me/organizations/join",{token:w});await t(k.tokens),e(),n("/",{replace:!0})}catch(g){c(g instanceof Error?g.message:"Failed to join team")}finally{m(!1)}}};return u.jsxs("form",{className:"space-y-3",onSubmit:h,children:[o&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:o}),u.jsx(At,{id:"join-token","aria-label":"Invite token or full URL",value:a,onChange:y=>l(y.target.value),placeholder:"abc123… or https://hub/invite/abc123",autoFocus:!0}),u.jsx(me,{type:"submit",className:"w-full",disabled:f||!a.trim(),children:f?"Joining…":"Join team"})]})}function _D(){var B,z;const{organizationId:e,role:t,user:n,selectOrganization:a,logout:l}=Rt(),o=Un(),[c,f]=x.useState([]),[m,h]=x.useState(!1),[y,g]=x.useState(null),b=x.useRef(null);x.useEffect(()=>{(async()=>{try{const $=await ke.get("/me/organizations");f($)}catch{}})()},[]),x.useEffect(()=>{const $=Q=>{m&&b.current&&!b.current.contains(Q.target)&&h(!1)},U=Q=>{m&&Q.key==="Escape"&&h(!1)};return window.addEventListener("mousedown",$),window.addEventListener("keydown",U),()=>{window.removeEventListener("mousedown",$),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,E=c.find($=>$.id===e)??null,C=(E==null?void 0:E.role)??(t==="admin"||t==="member"?t:null),R=async $=>{if($===e){h(!1);return}try{await a($),h(!1),o("/",{replace:!0})}catch{}},O=()=>{h(!1),g("create")},M=()=>{h(!1),g("join")};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:b,className:"relative","data-testid":"user-menu",children:[u.jsx("button",{type:"button","aria-label":`User menu, ${w}`,"aria-haspopup":"menu","aria-expanded":m,onClick:()=>h($=>!$),className:"inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-ring transition-shadow",style:{background:"transparent",border:m?"var(--hairline) solid var(--border)":"var(--hairline) solid transparent",padding:1,cursor:"pointer"},children:u.jsx(mw,{src:j,name:w,size:28})}),m&&u.jsxs("div",{role:"menu",className:"absolute right-0 z-30 mt-2 rounded-md border bg-popover shadow-md",style:{width:280},children:[u.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",style:{borderColor:"var(--border)"},children:[u.jsx(mw,{src:j,name:w,size:32}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("div",{className:"text-subtitle font-medium truncate",style:{color:"var(--fg)"},children:w}),k&&k!==w&&u.jsxs("div",{className:"text-label text-muted-foreground truncate",children:["@",k]})]})]}),c.length>0&&u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsx("div",{className:"px-4 py-1 text-eyebrow text-muted-foreground",children:"Current team"}),c.length===1?u.jsxs("div",{className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:u.jsx(fr,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:(B=c[0])==null?void 0:B.displayName}),u.jsx(yw,{role:((z=c[0])==null?void 0:z.role)??C})]}):u.jsx("div",{children:c.map($=>u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>void R($.id),className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx("span",{style:{width:14,display:"inline-flex"},children:$.id===e?u.jsx(fr,{className:"h-3.5 w-3.5"}):null}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:$.displayName}),u.jsx(yw,{role:$.role})]},$.id))})]}),u.jsxs("div",{className:"border-b py-1",style:{borderColor:"var(--border)"},children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:O,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(qr,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Create new team"})]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:M,className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(nj,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Join with invite link"})]})]}),u.jsx("div",{className:"py-1",children:u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{h(!1),l()},className:"flex w-full items-center gap-2 px-4 py-1.5 text-left text-body hover:bg-accent transition-colors",style:{color:"var(--fg)"},children:[u.jsx(yz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:"Sign out"})]})})]})]}),u.jsx(jD,{action:y,onClose:()=>g(null)})]})}function yw({role:e}){return e!=="admin"&&e!=="member"?null:u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",color:e==="admin"?"var(--accent-dim)":"var(--fg-3)",border:"var(--hairline) solid var(--border)",background:e==="admin"?"var(--accent-bg)":"var(--bg-sunken)"},children:e})}const TD=[{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 AD(){const[e,t]=x.useState(!1),n=Yn(),a=n.pathname==="/"||n.search.includes("a=");return x.useEffect(()=>{const l=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="k"&&(o.preventDefault(),t(c=>!c))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),u.jsxs("div",{className:"flex flex-col overflow-hidden",style:{height:"100vh",background:"var(--bg)"},children:[u.jsxs("header",{className:"relative shrink-0 grid items-center",style:{height:48,gridTemplateColumns:"1fr auto 1fr",gap:"var(--sp-3)",padding:"0 var(--sp-3)",borderBottom:"var(--hairline) solid var(--border)",background:"var(--bg-raised)"},children:[u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3_5)",justifySelf:"start",minWidth:0},children:[u.jsxs("span",{className:"flex items-center",style:{gap:10,flexShrink:0},children:[u.jsx(Xu,{width:16,height:18,style:{color:"var(--fg)"}}),u.jsx("span",{className:"text-title",style:{color:"var(--fg)"},children:"First Tree"})]}),u.jsx(dD,{})]}),u.jsx("nav",{className:"flex",style:{gap:2,pointerEvents:"none",justifySelf:"center"},children:TD.map(l=>u.jsx(vf,{to:l.to,end:l.end,style:{pointerEvents:"auto"},className:({isActive:o})=>Te("inline-flex items-center transition-colors",o?"":"hover:text-[var(--fg)]"),children:({isActive:o})=>u.jsxs("span",{className:"inline-flex items-center text-subtitle font-medium",style:{padding:"var(--sp-1_5) var(--sp-3)",gap:6,borderRadius:5,color:o?"var(--fg)":"var(--fg-3)",background:o?"var(--bg-hover)":"transparent"},children:[l.label,o&&u.jsx("span",{className:"kbd",children:l.kbd})]})},l.to))}),u.jsxs("div",{className:"flex items-center",style:{gap:6,justifySelf:"end"},children:[u.jsxs("button",{type:"button",onClick:()=>t(!0),"aria-label":"Open command palette",className:"inline-flex items-center transition-colors text-body",style:{gap:8,padding:"var(--sp-1) var(--sp-2)",color:"var(--fg-3)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--fg)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--fg-3)"},children:[u.jsx(xy,{className:"h-4 w-4"}),u.jsx("span",{children:"Jump to…"}),u.jsx("span",{className:"kbd",children:"⌘K"})]}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(vD,{}),u.jsx(xD,{}),u.jsx("span",{style:{width:1,height:18,background:"var(--border)",margin:"0 var(--sp-1)"}}),u.jsx(_D,{})]})]}),u.jsx(sD,{open:e,onOpenChange:t}),a?u.jsx(Ps,{}):u.jsx("main",{className:"flex-1 overflow-auto",children:u.jsx("div",{className:"p-6 mx-auto",style:{maxWidth:1280},children:u.jsx(Ps,{})})})]})}function oe(e,t,n){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const h=c.prototype,y=Object.keys(h);for(let g=0;g<y.length;g++){const b=y[g];b in f||(f[b]=h[b].bind(f))}}const l=(n==null?void 0:n.Parent)??Object;class o extends l{}Object.defineProperty(o,"name",{value:e});function c(f){var m;const h=n!=null&&n.Parent?new o:this;a(h,f),(m=h._zod).deferred??(m.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(c,"init",{value:a}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>{var m,h;return n!=null&&n.Parent&&f instanceof n.Parent?!0:(h=(m=f==null?void 0:f._zod)==null?void 0:m.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Ss extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vC extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const bC={};function Ai(e){return bC}function xC(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 Ag(e,t){return typeof t=="bigint"?t.toString():t}function Nf(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ry(e){return e==null}function zy(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function RD(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let l=(a.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m!=null&&m[1]&&(l=Number.parseInt(m[1]))}const o=n>l?n:l,c=Number.parseInt(e.toFixed(o).replace(".","")),f=Number.parseInt(t.toFixed(o).replace(".",""));return c%f/10**o}const vw=Symbol("evaluating");function pt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==vw)return a===void 0&&(a=vw,a=n()),a},set(l){Object.defineProperty(e,t,{value:l})},configurable:!0})}function jl(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Oi(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function bw(e){return JSON.stringify(e)}function zD(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wC="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OD=Nf(()=>{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 Bs(e){if(_u(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(_u(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function SC(e){return Bs(e)?{...e}:Array.isArray(e)?[...e]:e}const MD=new Set(["string","number","symbol"]);function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Mi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(a._zod.parent=e),a}function Re(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function DD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ID={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 LD(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return jl(this,"shape",c),c},checks:[]});return Mi(e,o)}function UD(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Oi(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return jl(this,"shape",c),c},checks:[]});return Mi(e,o)}function PD(e,t){if(!Bs(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(o,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Oi(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return jl(this,"shape",o),o}});return Mi(e,l)}function BD(e,t){if(!Bs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return jl(this,"shape",a),a}});return Mi(e,n)}function $D(e,t){const n=Oi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return jl(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Mi(e,n)}function FD(e,t,n){const l=t._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=Oi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const h in n){if(!(h in f))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(m[h]=e?new e({type:"optional",innerType:f[h]}):f[h])}else for(const h in f)m[h]=e?new e({type:"optional",innerType:f[h]}):f[h];return jl(this,"shape",m),m},checks:[]});return Mi(t,c)}function qD(e,t,n){const a=Oi(t._zod.def,{get shape(){const l=t._zod.def.shape,o={...l};if(n)for(const c in n){if(!(c in o))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(o[c]=new e({type:"nonoptional",innerType:l[c]}))}else for(const c in l)o[c]=new e({type:"nonoptional",innerType:l[c]});return jl(this,"shape",o),o}});return Mi(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 Ad(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ri(e,t,n){var l,o,c,f,m,h;const a={...e,path:e.path??[]};if(!e.message){const y=Ad((c=(o=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:o.error)==null?void 0:c.call(o,e))??Ad((f=t==null?void 0:t.error)==null?void 0:f.call(t,e))??Ad((m=n.customError)==null?void 0:m.call(n,e))??Ad((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 Oy(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tu(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const kC=(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,Ag,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jC=oe("$ZodError",kC),CC=oe("$ZodError",kC,{Parent:Error});function HD(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 ZD(e,t=n=>n.message){const n={_errors:[]},a=l=>{for(const o of l.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>a({issues:c}));else if(o.code==="invalid_key")a({issues:o.issues});else if(o.code==="invalid_element")a({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let c=n,f=0;for(;f<o.path.length;){const m=o.path[f];f===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],f++}}};return a(e),n}const My=e=>(t,n,a,l)=>{const o=a?Object.assign(a,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new Ss;if(c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw wC(f,l==null?void 0:l.callee),f}return c.value},Dy=e=>async(t,n,a,l)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new((l==null?void 0:l.Err)??e)(c.issues.map(m=>Ri(m,o,Ai())));throw wC(f,l==null?void 0:l.callee),f}return c.value},_f=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??jC)(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},VD=_f(CC),Tf=e=>async(t,n,a)=>{const l=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},l);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(c=>Ri(c,l,Ai())))}:{success:!0,data:o.value}},QD=Tf(CC),KD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return My(e)(t,n,l)},GD=e=>(t,n,a)=>My(e)(t,n,a),YD=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Dy(e)(t,n,l)},XD=e=>async(t,n,a)=>Dy(e)(t,n,a),JD=e=>(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return _f(e)(t,n,l)},WD=e=>(t,n,a)=>_f(e)(t,n,a),e4=e=>async(t,n,a)=>{const l=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Tf(e)(t,n,l)},t4=e=>async(t,n,a)=>Tf(e)(t,n,a),n4=/^[cC][^\s-]{8,}$/,r4=/^[0-9a-z]+$/,a4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,i4=/^[0-9a-vA-V]{20}$/,l4=/^[A-Za-z0-9]{27}$/,s4=/^[a-zA-Z0-9_-]{21}$/,o4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,u4=/^([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})$/,xw=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)$/,c4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,d4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function f4(){return new RegExp(d4,"u")}const h4=/^(?:(?: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])$/,m4=/^(([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}|:))$/,p4=/^((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])$/,g4=/^(([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])$/,y4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,EC=/^[A-Za-z0-9_-]*$/,v4=/^\+[1-9]\d{6,14}$/,NC="(?:(?:\\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])))",b4=new RegExp(`^${NC}$`);function _C(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 x4(e){return new RegExp(`^${_C(e)}$`)}function w4(e){const t=_C({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(`^${NC}T(?:${a})$`)}const S4=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}$`)},k4=/^-?\d+$/,TC=/^-?\d+(?:\.\d+)?$/,j4=/^(?:true|false)$/i,C4=/^[^A-Z]*$/,E4=/^[^a-z]*$/,Jn=oe("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),AC={number:"number",bigint:"bigint",object:"date"},RC=oe("$ZodCheckLessThan",(e,t)=>{Jn.init(e,t);const n=AC[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})}}),zC=oe("$ZodCheckGreaterThan",(e,t)=>{Jn.init(e,t);const n=AC[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})}}),N4=oe("$ZodCheckMultipleOf",(e,t)=>{Jn.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):RD(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})}}),_4=oe("$ZodCheckNumberFormat",(e,t)=>{var c;Jn.init(e,t),t.format=t.format||"float64";const n=(c=t.format)==null?void 0:c.includes("int"),a=n?"int":"number",[l,o]=ID[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=k4)}),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=oe("$ZodCheckMaxLength",(e,t)=>{var n;Jn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ry(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const l=a.value;if(l.length<=t.maximum)return;const c=Oy(l);a.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),A4=oe("$ZodCheckMinLength",(e,t)=>{var n;Jn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ry(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const l=a.value;if(l.length>=t.minimum)return;const c=Oy(l);a.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),R4=oe("$ZodCheckLengthEquals",(e,t)=>{var n;Jn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const l=a.value;return!Ry(l)&&l.length!==void 0}),e._zod.onattach.push(a=>{const l=a._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=a=>{const l=a.value,o=l.length;if(o===t.length)return;const c=Oy(l),f=o>t.length;a.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Af=oe("$ZodCheckStringFormat",(e,t)=>{var n,a;Jn.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=()=>{})}),z4=oe("$ZodCheckRegex",(e,t)=>{Af.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})}}),O4=oe("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=C4),Af.init(e,t)}),M4=oe("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=E4),Af.init(e,t)}),D4=oe("$ZodCheckIncludes",(e,t)=>{Jn.init(e,t);const n=$s(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})}}),I4=oe("$ZodCheckStartsWith",(e,t)=>{Jn.init(e,t);const n=new RegExp(`^${$s(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})}}),L4=oe("$ZodCheckEndsWith",(e,t)=>{Jn.init(e,t);const n=new RegExp(`.*${$s(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})}}),U4=oe("$ZodCheckOverwrite",(e,t)=>{Jn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class P4{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
320
|
-
`).filter(c=>c),l=Math.min(...a.map(c=>c.length-c.trimStart().length)),o=a.map(c=>c.slice(l)).map(c=>" ".repeat(this.indent*2)+c);for(const c of o)this.content.push(c)}compile(){const t=Function,n=this==null?void 0:this.args,l=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,l.join(`
|
|
321
|
-
`))}}const B4={major:4,minor:3,patch:6},It=oe("$ZodType",(e,t)=>{var l;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=B4;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),(l=e._zod.deferred)==null||l.push(()=>{e._zod.run=e._zod.parse});else{const o=(f,m,h)=>{let y=vs(f),g;for(const b of m){if(b._zod.def.when){if(!b._zod.def.when(f))continue}else if(y)continue;const w=f.issues.length,k=b._zod.check(f);if(k instanceof Promise&&(h==null?void 0:h.async)===!1)throw new 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},c=(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=>c(g,f,m)):c(y,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new Ss;return h.then(y=>o(y,a,m))}return o(h,a,m)}}pt(e,"~standard",()=>({validate:o=>{var c;try{const f=VD(e,o);return f.success?{value:f.data}:{issues:(c=f.error)==null?void 0:c.issues}}catch{return QD(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}))}),Iy=oe("$ZodString",(e,t)=>{var n;It.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??S4(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}}),Dt=oe("$ZodStringFormat",(e,t)=>{Af.init(e,t),Iy.init(e,t)}),$4=oe("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=u4),Dt.init(e,t)}),F4=oe("$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=xw(a))}else t.pattern??(t.pattern=xw());Dt.init(e,t)}),q4=oe("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=c4),Dt.init(e,t)}),H4=oe("$ZodURL",(e,t)=>{Dt.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})}}}),Z4=oe("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=f4()),Dt.init(e,t)}),V4=oe("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=s4),Dt.init(e,t)}),Q4=oe("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=n4),Dt.init(e,t)}),K4=oe("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=r4),Dt.init(e,t)}),G4=oe("$ZodULID",(e,t)=>{t.pattern??(t.pattern=a4),Dt.init(e,t)}),Y4=oe("$ZodXID",(e,t)=>{t.pattern??(t.pattern=i4),Dt.init(e,t)}),X4=oe("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=l4),Dt.init(e,t)}),J4=oe("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=w4(t)),Dt.init(e,t)}),W4=oe("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=b4),Dt.init(e,t)}),e5=oe("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=x4(t)),Dt.init(e,t)}),t5=oe("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=o4),Dt.init(e,t)}),n5=oe("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=h4),Dt.init(e,t),e._zod.bag.format="ipv4"}),r5=oe("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=m4),Dt.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})}}}),a5=oe("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=p4),Dt.init(e,t)}),i5=oe("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=g4),Dt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[l,o]=a;if(!o)throw new Error;const c=Number(o);if(`${c}`!==o)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${l}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function OC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const l5=oe("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=y4),Dt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{OC(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function s5(e){if(!EC.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return OC(n)}const o5=oe("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=EC),Dt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{s5(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),u5=oe("$ZodE164",(e,t)=>{t.pattern??(t.pattern=v4),Dt.init(e,t)});function c5(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 d5=oe("$ZodJWT",(e,t)=>{Dt.init(e,t),e._zod.check=n=>{c5(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),MC=oe("$ZodNumber",(e,t)=>{It.init(e,t),e._zod.pattern=e._zod.bag.pattern??TC,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}}),f5=oe("$ZodNumberFormat",(e,t)=>{_4.init(e,t),MC.init(e,t)}),h5=oe("$ZodBoolean",(e,t)=>{It.init(e,t),e._zod.pattern=j4,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}}),m5=oe("$ZodUnknown",(e,t)=>{It.init(e,t),e._zod.parse=n=>n}),p5=oe("$ZodNever",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function ww(e,t,n){e.issues.length&&t.issues.push(...bs(n,e.issues)),t.value[n]=e.value}const g5=oe("$ZodArray",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Array.isArray(l))return n.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),n;n.value=Array(l.length);const o=[];for(let c=0;c<l.length;c++){const f=l[c],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?o.push(m.then(h=>ww(h,n,c))):ww(m,n,c)}return o.length?Promise.all(o).then(()=>n):n}});function ef(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 DC(e){var a,l,o,c;const t=Object.keys(e.shape);for(const f of t)if(!((c=(o=(l=(a=e.shape)==null?void 0:a[f])==null?void 0:l._zod)==null?void 0:o.traits)!=null&&c.has("$ZodType")))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);const n=DD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function IC(e,t,n,a,l,o){const c=[],f=l.keySet,m=l.catchall._zod,h=m.def.type,y=m.optout==="optional";for(const g in t){if(f.has(g))continue;if(h==="never"){c.push(g);continue}const b=m.run({value:t[g],issues:[]},a);b instanceof Promise?e.push(b.then(w=>ef(w,n,g,t,y))):ef(b,n,g,t,y)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const y5=oe("$ZodObject",(e,t)=>{It.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=Nf(()=>DC(t));pt(e._zod,"propValues",()=>{const f=t.shape,m={};for(const h in f){const y=f[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const l=_u,o=t.catchall;let c;e._zod.parse=(f,m)=>{c??(c=a.value);const h=f.value;if(!l(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;f.value={};const y=[],g=c.shape;for(const b of c.keys){const w=g[b],k=w._zod.optout==="optional",j=w._zod.run({value:h[b],issues:[]},m);j instanceof Promise?y.push(j.then(E=>ef(E,f,b,h,k))):ef(j,f,b,h,k)}return o?IC(y,h,f,m,a.value,e):y.length?Promise.all(y).then(()=>f):f}}),v5=oe("$ZodObjectJIT",(e,t)=>{y5.init(e,t);const n=e._zod.parse,a=Nf(()=>DC(t)),l=b=>{var O;const w=new P4(["shape","payload","ctx"]),k=a.value,j=M=>{const B=bw(M);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};w.write("const input = payload.value;");const E=Object.create(null);let C=0;for(const M of k.keys)E[M]=`key_${C++}`;w.write("const newResult = {};");for(const M of k.keys){const B=E[M],z=bw(M),$=b[M],U=((O=$==null?void 0:$._zod)==null?void 0:O.optout)==="optional";w.write(`const ${B} = ${j(M)};`),U?w.write(`
|
|
322
|
-
if (${B}.issues.length) {
|
|
323
|
-
if (${z} in input) {
|
|
324
|
-
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
325
|
-
...iss,
|
|
326
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
327
|
-
})));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (${B}.value === undefined) {
|
|
332
|
-
if (${z} in input) {
|
|
333
|
-
newResult[${z}] = undefined;
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
newResult[${z}] = ${B}.value;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
`):w.write(`
|
|
340
|
-
if (${B}.issues.length) {
|
|
341
|
-
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
342
|
-
...iss,
|
|
343
|
-
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
344
|
-
})));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
if (${B}.value === undefined) {
|
|
348
|
-
if (${z} in input) {
|
|
349
|
-
newResult[${z}] = undefined;
|
|
350
|
-
}
|
|
351
|
-
} else {
|
|
352
|
-
newResult[${z}] = ${B}.value;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
`)}w.write("payload.value = newResult;"),w.write("return payload;");const R=w.compile();return(M,B)=>R(b,M,B)};let o;const c=_u,f=!bC.jitless,h=f&&OD.value,y=t.catchall;let g;e._zod.parse=(b,w)=>{g??(g=a.value);const k=b.value;return c(k)?f&&h&&(w==null?void 0:w.async)===!1&&w.jitless!==!0?(o||(o=l(t.shape)),b=o(b,w),y?IC([],k,b,w,g,e):b):n(b,w):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),b)}});function Sw(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(c=>Ri(c,a,Ai())))}),t)}const LC=oe("$ZodUnion",(e,t)=>{It.init(e,t),pt(e._zod,"optin",()=>t.options.some(l=>l._zod.optin==="optional")?"optional":void 0),pt(e._zod,"optout",()=>t.options.some(l=>l._zod.optout==="optional")?"optional":void 0),pt(e._zod,"values",()=>{if(t.options.every(l=>l._zod.values))return new Set(t.options.flatMap(l=>Array.from(l._zod.values)))}),pt(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=>zy(o.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(l,o)=>{if(n)return a(l,o);let c=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:l.value,issues:[]},o);if(h instanceof Promise)f.push(h),c=!0;else{if(h.issues.length===0)return h;f.push(h)}}return c?Promise.all(f).then(m=>Sw(m,l,e,o)):Sw(f,l,e,o)}}),b5=oe("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,LC.init(e,t);const n=e._zod.parse;pt(e._zod,"propValues",()=>{const l={};for(const o of t.options){const c=o._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[f,m]of Object.entries(c)){l[f]||(l[f]=new Set);for(const h of m)l[f].add(h)}}return l});const a=Nf(()=>{var c;const l=t.options,o=new Map;for(const f of l){const m=(c=f._zod.propValues)==null?void 0:c[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(o.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);o.set(h,f)}}return o});e._zod.parse=(l,o)=>{const c=l.value;if(!_u(c))return l.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),l;const f=a.value.get(c==null?void 0:c[t.discriminator]);return f?f._zod.run(l,o):t.unionFallback?n(l,o):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),l)}}),x5=oe("$ZodIntersection",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const l=n.value,o=t.left._zod.run({value:l,issues:[]},a),c=t.right._zod.run({value:l,issues:[]},a);return o instanceof Promise||c instanceof Promise?Promise.all([o,c]).then(([m,h])=>kw(n,m,h)):kw(n,o,c)}});function Rg(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(Bs(e)&&Bs(t)){const n=Object.keys(t),a=Object.keys(e).filter(o=>n.indexOf(o)!==-1),l={...e,...t};for(const o of a){const c=Rg(e[o],t[o]);if(!c.valid)return{valid:!1,mergeErrorPath:[o,...c.mergeErrorPath]};l[o]=c.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const l=e[a],o=t[a],c=Rg(l,o);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kw(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 c=Rg(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const w5=oe("$ZodRecord",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{const l=n.value;if(!Bs(l))return n.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),n;const o=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){f.add(typeof h=="number"?h.toString():h);const y=t.valueType._zod.run({value:l[h],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...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"&&TC.test(f)&&m.issues.length){const g=t.keyType._zod.run({value:Number(f),issues:[]},a);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(m=g)}if(m.issues.length){t.mode==="loose"?n.value[f]=l[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(g=>Ri(g,a,Ai())),input:f,path:[f],inst:e});continue}const y=t.valueType._zod.run({value:l[f],issues:[]},a);y instanceof Promise?o.push(y.then(g=>{g.issues.length&&n.issues.push(...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}}),S5=oe("$ZodEnum",(e,t)=>{It.init(e,t);const n=xC(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(l=>MD.has(typeof l)).map(l=>typeof l=="string"?$s(l):l.toString()).join("|")})$`),e._zod.parse=(l,o)=>{const c=l.value;return a.has(c)||l.issues.push({code:"invalid_value",values:n,input:c,inst:e}),l}}),k5=oe("$ZodLiteral",(e,t)=>{if(It.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"?$s(a):a?$s(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}}),j5=oe("$ZodTransform",(e,t)=>{It.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new vC(e.constructor.name);const l=t.transform(n.value,n);if(a.async)return(l instanceof Promise?l:Promise.resolve(l)).then(c=>(n.value=c,n));if(l instanceof Promise)throw new Ss;return n.value=l,n}});function jw(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const UC=oe("$ZodOptional",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${zy(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=>jw(o,n.value)):jw(l,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),C5=oe("$ZodExactOptional",(e,t)=>{UC.init(e,t),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),E5=oe("$ZodNullable",(e,t)=>{It.init(e,t),pt(e._zod,"optin",()=>t.innerType._zod.optin),pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${zy(n.source)}|null)$`):void 0}),pt(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)}),N5=oe("$ZodDefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",pt(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=>Cw(o,t)):Cw(l,t)}});function Cw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _5=oe("$ZodPrefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",pt(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=oe("$ZodNonOptional",(e,t)=>{It.init(e,t),pt(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=>Ew(o,e)):Ew(l,e)}});function Ew(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 A5=oe("$ZodCatch",(e,t)=>{It.init(e,t),pt(e._zod,"optin",()=>t.innerType._zod.optin),pt(e._zod,"optout",()=>t.innerType._zod.optout),pt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const l=t.innerType._zod.run(n,a);return l instanceof Promise?l.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>Ri(c,a,Ai()))},input:n.value}),n.issues=[]),n)):(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(o=>Ri(o,a,Ai()))},input:n.value}),n.issues=[]),n)}}),R5=oe("$ZodPipe",(e,t)=>{It.init(e,t),pt(e._zod,"values",()=>t.in._zod.values),pt(e._zod,"optin",()=>t.in._zod.optin),pt(e._zod,"optout",()=>t.out._zod.optout),pt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const o=t.out._zod.run(n,a);return o instanceof Promise?o.then(c=>Rd(c,t.in,a)):Rd(o,t.in,a)}const l=t.in._zod.run(n,a);return l instanceof Promise?l.then(o=>Rd(o,t.out,a)):Rd(l,t.out,a)}});function Rd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const z5=oe("$ZodReadonly",(e,t)=>{It.init(e,t),pt(e._zod,"propValues",()=>t.innerType._zod.propValues),pt(e._zod,"values",()=>t.innerType._zod.values),pt(e._zod,"optin",()=>{var n,a;return(a=(n=t.innerType)==null?void 0:n._zod)==null?void 0:a.optin}),pt(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(Nw):Nw(l)}});function Nw(e){return e.value=Object.freeze(e.value),e}const O5=oe("$ZodCustom",(e,t)=>{Jn.init(e,t),It.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=>_w(o,n,a,e));_w(l,n,a,e)}});function _w(e,t,n,a){if(!e){const l={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(l.params=a._zod.def.params),t.issues.push(Tu(l))}}var Tw;class M5{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 D5(){return new M5}(Tw=globalThis).__zod_globalRegistry??(Tw.__zod_globalRegistry=D5());const du=globalThis.__zod_globalRegistry;function I5(e,t){return new e({type:"string",...Re(t)})}function L5(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Re(t)})}function Aw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Re(t)})}function U5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Re(t)})}function P5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Re(t)})}function B5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Re(t)})}function $5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Re(t)})}function F5(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Re(t)})}function q5(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Re(t)})}function H5(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Re(t)})}function Z5(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Re(t)})}function V5(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Re(t)})}function Q5(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Re(t)})}function K5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Re(t)})}function G5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Re(t)})}function Y5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Re(t)})}function X5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Re(t)})}function J5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Re(t)})}function W5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Re(t)})}function eI(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Re(t)})}function tI(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Re(t)})}function nI(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Re(t)})}function rI(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Re(t)})}function aI(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Re(t)})}function iI(e,t){return new e({type:"string",format:"date",check:"string_format",...Re(t)})}function lI(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Re(t)})}function sI(e,t){return new e({type:"string",format:"duration",check:"string_format",...Re(t)})}function oI(e,t){return new e({type:"number",checks:[],...Re(t)})}function uI(e,t){return new e({type:"number",coerce:!0,checks:[],...Re(t)})}function cI(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Re(t)})}function dI(e,t){return new e({type:"boolean",...Re(t)})}function fI(e){return new e({type:"unknown"})}function hI(e,t){return new e({type:"never",...Re(t)})}function Rw(e,t){return new RC({check:"less_than",...Re(t),value:e,inclusive:!1})}function xp(e,t){return new RC({check:"less_than",...Re(t),value:e,inclusive:!0})}function zw(e,t){return new zC({check:"greater_than",...Re(t),value:e,inclusive:!1})}function wp(e,t){return new zC({check:"greater_than",...Re(t),value:e,inclusive:!0})}function Ow(e,t){return new N4({check:"multiple_of",...Re(t),value:e})}function PC(e,t){return new T4({check:"max_length",...Re(t),maximum:e})}function tf(e,t){return new A4({check:"min_length",...Re(t),minimum:e})}function BC(e,t){return new R4({check:"length_equals",...Re(t),length:e})}function mI(e,t){return new z4({check:"string_format",format:"regex",...Re(t),pattern:e})}function pI(e){return new O4({check:"string_format",format:"lowercase",...Re(e)})}function gI(e){return new M4({check:"string_format",format:"uppercase",...Re(e)})}function yI(e,t){return new D4({check:"string_format",format:"includes",...Re(t),includes:e})}function vI(e,t){return new I4({check:"string_format",format:"starts_with",...Re(t),prefix:e})}function bI(e,t){return new L4({check:"string_format",format:"ends_with",...Re(t),suffix:e})}function Xs(e){return new U4({check:"overwrite",tx:e})}function xI(e){return Xs(t=>t.normalize(e))}function wI(){return Xs(e=>e.trim())}function SI(){return Xs(e=>e.toLowerCase())}function kI(){return Xs(e=>e.toUpperCase())}function jI(){return Xs(e=>zD(e))}function CI(e,t,n){return new e({type:"array",element:t,...Re(n)})}function EI(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Re(n)})}function NI(e){const t=_I(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(Tu(a,n.value,t._zod.def));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),n.issues.push(Tu(l))}},e(n.value,n)));return t}function _I(e,t){const n=new Jn({check:"custom",...Re(t)});return n._zod.check=e,n}function $C(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)??du,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 Wt(e,t,n={path:[],schemaPath:[]}){var y,g;var a;const l=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=(g=(y=e._zod).toJSONSchema)==null?void 0:g.call(y);if(f)c.schema=f;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,b);else{const k=c.schema,j=t.processors[l.type];if(!j)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);j(e,t,k,b)}const w=e._zod.parent;w&&(c.ref||(c.ref=w),Wt(w,t,b),t.seen.get(w).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(c.schema,m),t.io==="input"&&Mn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((a=c.schema).default??(a.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function FC(e,t){var c,f,m,h;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const y of e.seen.entries()){const g=(c=e.metadataRegistry.get(y[0]))==null?void 0:c.id;if(g){const b=a.get(g);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${g}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(g,y[0])}}const l=y=>{var j;const g=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const E=(j=e.external.registry.get(y[0]))==null?void 0:j.id,C=e.external.uri??(O=>O);if(E)return{ref:C(E)};const R=y[1].defId??y[1].schema.id??`schema${e.counter++}`;return y[1].defId=R,{defId:R,ref:`${C("__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:b,defId:w}=l(y);g.def={...g.schema},w&&(g.defId=w);const k=g.schema;for(const j in k)delete k[j];k.$ref=b};if(e.cycles==="throw")for(const y of e.seen.entries()){const g=y[1];if(g.cycle)throw new Error(`Cycle detected: #/${(f=g.cycle)==null?void 0:f.join("/")}/<root>
|
|
356
|
-
|
|
357
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of e.seen.entries()){const g=y[1];if(t===y[0]){o(y);continue}if(e.external){const w=(m=e.external.registry.get(y[0]))==null?void 0:m.id;if(t!==y[0]&&w){o(y);continue}}if((h=e.metadataRegistry.get(y[0]))==null?void 0:h.id){o(y);continue}if(g.cycle){o(y);continue}if(g.count>1&&e.reused==="ref"){o(y);continue}}}function qC(e,t){var c,f,m;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=h=>{const y=e.seen.get(h);if(y.ref===null)return;const g=y.def??y.schema,b={...g},w=y.ref;if(y.ref=null,w){a(w);const j=e.seen.get(w),E=j.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Object.assign(g,E),Object.assign(g,b),h._zod.parent===w)for(const R in g)R==="$ref"||R==="allOf"||R in b||delete g[R];if(E.$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 E in g)E==="$ref"||E==="allOf"||E in j.def&&JSON.stringify(g[E])===JSON.stringify(j.def[E])&&delete g[E]}e.override({zodSchema:h,jsonSchema:g,path:y.path??[]})};for(const h of[...e.seen.entries()].reverse())a(h[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,(c=e.external)!=null&&c.uri){const h=(f=e.external.registry.get(t))==null?void 0:f.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Object.assign(l,n.def??n.schema);const o=((m=e.external)==null?void 0:m.defs)??{};for(const h of e.seen.entries()){const y=h[1];y.def&&y.defId&&(o[y.defId]=y.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?l.$defs=o:l.definitions=o);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:nf(t,"input",e.processors),output:nf(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Mn(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 Mn(a.element,n);if(a.type==="set")return Mn(a.valueType,n);if(a.type==="lazy")return Mn(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 Mn(a.innerType,n);if(a.type==="intersection")return Mn(a.left,n)||Mn(a.right,n);if(a.type==="record"||a.type==="map")return Mn(a.keyType,n)||Mn(a.valueType,n);if(a.type==="pipe")return Mn(a.in,n)||Mn(a.out,n);if(a.type==="object"){for(const l in a.shape)if(Mn(a.shape[l],n))return!0;return!1}if(a.type==="union"){for(const l of a.options)if(Mn(l,n))return!0;return!1}if(a.type==="tuple"){for(const l of a.items)if(Mn(l,n))return!0;return!!(a.rest&&Mn(a.rest,n))}return!1}const TI=(e,t={})=>n=>{const a=$C({...n,processors:t});return Wt(e,a),FC(a,e),qC(a,e)},nf=(e,t,n={})=>a=>{const{libraryOptions:l,target:o}=a??{},c=$C({...l??{},target:o,io:t,processors:n});return Wt(e,c),FC(c,e),qC(c,e)},AI={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:c,format:f,patterns:m,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(l.minLength=o),typeof c=="number"&&(l.maxLength=c),f&&(l.format=AI[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}))])}},zI=(e,t,n,a)=>{const l=n,{minimum:o,maximum:c,format:f,multipleOf:m,exclusiveMaximum:h,exclusiveMinimum:y}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number",typeof y=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.minimum=y,l.exclusiveMinimum=!0):l.exclusiveMinimum=y),typeof o=="number"&&(l.minimum=o,typeof y=="number"&&t.target!=="draft-04"&&(y>=o?delete l.minimum:delete l.exclusiveMinimum)),typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(l.maximum=h,l.exclusiveMaximum=!0):l.exclusiveMaximum=h),typeof c=="number"&&(l.maximum=c,typeof h=="number"&&t.target!=="draft-04"&&(h<=c?delete l.maximum:delete l.exclusiveMaximum)),typeof m=="number"&&(l.multipleOf=m)},OI=(e,t,n,a)=>{n.type="boolean"},MI=(e,t,n,a)=>{n.not={}},DI=(e,t,n,a)=>{},II=(e,t,n,a)=>{const l=e._zod.def,o=xC(l.entries);o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),n.enum=o},LI=(e,t,n,a)=>{const l=e._zod.def,o=[];for(const c of l.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(c))}else o.push(c);if(o.length!==0)if(o.length===1){const c=o[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else o.every(c=>typeof c=="number")&&(n.type="number"),o.every(c=>typeof c=="string")&&(n.type="string"),o.every(c=>typeof c=="boolean")&&(n.type="boolean"),o.every(c=>c===null)&&(n.type="null"),n.enum=o},UI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},PI=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},BI=(e,t,n,a)=>{const l=n,o=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(l.minItems=c),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=Wt(o.element,t,{...a,path:[...a.path,"items"]})},$I=(e,t,n,a)=>{var h;const l=n,o=e._zod.def;l.type="object",l.properties={};const c=o.shape;for(const y in c)l.properties[y]=Wt(c[y],t,{...a,path:[...a.path,"properties",y]});const f=new Set(Object.keys(c)),m=new Set([...f].filter(y=>{const g=o.shape[y]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));m.size>0&&(l.required=Array.from(m)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?l.additionalProperties=!1:o.catchall?o.catchall&&(l.additionalProperties=Wt(o.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(l.additionalProperties=!1)},FI=(e,t,n,a)=>{const l=e._zod.def,o=l.inclusive===!1,c=l.options.map((f,m)=>Wt(f,t,{...a,path:[...a.path,o?"oneOf":"anyOf",m]}));o?n.oneOf=c:n.anyOf=c},qI=(e,t,n,a)=>{const l=e._zod.def,o=Wt(l.left,t,{...a,path:[...a.path,"allOf",0]}),c=Wt(l.right,t,{...a,path:[...a.path,"allOf",1]}),f=h=>"allOf"in h&&Object.keys(h).length===1,m=[...f(o)?o.allOf:[o],...f(c)?c.allOf:[c]];n.allOf=m},HI=(e,t,n,a)=>{const l=n,o=e._zod.def;l.type="object";const c=o.keyType,f=c._zod.bag,m=f==null?void 0:f.patterns;if(o.mode==="loose"&&m&&m.size>0){const y=Wt(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=Wt(o.keyType,t,{...a,path:[...a.path,"propertyNames"]})),l.additionalProperties=Wt(o.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const h=c._zod.values;if(h){const y=[...h].filter(g=>typeof g=="string"||typeof g=="number");y.length>0&&(l.required=y)}},ZI=(e,t,n,a)=>{const l=e._zod.def,o=Wt(l.innerType,t,a),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=l.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},VI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},QI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.default=JSON.parse(JSON.stringify(l.defaultValue))},KI=(e,t,n,a)=>{const l=e._zod.def;Wt(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)))},GI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType;let c;try{c=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},YI=(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;Wt(o,t,a);const c=t.seen.get(e);c.ref=o},XI=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType,n.readOnly=!0},HC=(e,t,n,a)=>{const l=e._zod.def;Wt(l.innerType,t,a);const o=t.seen.get(e);o.ref=l.innerType},JI=oe("ZodISODateTime",(e,t)=>{J4.init(e,t),Ut.init(e,t)});function WI(e){return aI(JI,e)}const eL=oe("ZodISODate",(e,t)=>{W4.init(e,t),Ut.init(e,t)});function tL(e){return iI(eL,e)}const nL=oe("ZodISOTime",(e,t)=>{e5.init(e,t),Ut.init(e,t)});function rL(e){return lI(nL,e)}const aL=oe("ZodISODuration",(e,t)=>{t5.init(e,t),Ut.init(e,t)});function iL(e){return sI(aL,e)}const lL=(e,t)=>{jC.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ZD(e,n)},flatten:{value:n=>HD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ag,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ag,2)}},isEmpty:{get(){return e.issues.length===0}}})},zr=oe("ZodError",lL,{Parent:Error}),sL=My(zr),oL=Dy(zr),uL=_f(zr),cL=Tf(zr),dL=KD(zr),fL=GD(zr),hL=YD(zr),mL=XD(zr),pL=JD(zr),gL=WD(zr),yL=e4(zr),vL=t4(zr),Lt=oe("ZodType",(e,t)=>(It.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nf(e,"input"),output:nf(e,"output")}}),e.toJSONSchema=TI(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Oi(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Mi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>sL(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>uL(e,n,a),e.parseAsync=async(n,a)=>oL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>cL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>dL(e,n,a),e.decode=(n,a)=>fL(e,n,a),e.encodeAsync=async(n,a)=>hL(e,n,a),e.decodeAsync=async(n,a)=>mL(e,n,a),e.safeEncode=(n,a)=>pL(e,n,a),e.safeDecode=(n,a)=>gL(e,n,a),e.safeEncodeAsync=async(n,a)=>yL(e,n,a),e.safeDecodeAsync=async(n,a)=>vL(e,n,a),e.refine=(n,a)=>e.check(c6(n,a)),e.superRefine=n=>e.check(d6(n)),e.overwrite=n=>e.check(Xs(n)),e.optional=()=>Iw(e),e.exactOptional=()=>XL(e),e.nullable=()=>Lw(e),e.nullish=()=>Iw(Lw(e)),e.nonoptional=n=>r6(e,n),e.array=()=>Et(e),e.or=n=>QC([e,n]),e.and=n=>VL(e,n),e.transform=n=>Og(e,KC(n)),e.default=n=>e6(e,n),e.prefault=n=>n6(e,n),e.catch=n=>i6(e,n),e.pipe=n=>Og(e,n),e.readonly=()=>o6(e),e.describe=n=>{const a=e.clone();return du.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){var n;return(n=du.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return du.get(e);const a=e.clone();return du.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ZC=oe("_ZodString",(e,t)=>{Iy.init(e,t),Lt.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(mI(...a)),e.includes=(...a)=>e.check(yI(...a)),e.startsWith=(...a)=>e.check(vI(...a)),e.endsWith=(...a)=>e.check(bI(...a)),e.min=(...a)=>e.check(tf(...a)),e.max=(...a)=>e.check(PC(...a)),e.length=(...a)=>e.check(BC(...a)),e.nonempty=(...a)=>e.check(tf(1,...a)),e.lowercase=a=>e.check(pI(a)),e.uppercase=a=>e.check(gI(a)),e.trim=()=>e.check(wI()),e.normalize=(...a)=>e.check(xI(...a)),e.toLowerCase=()=>e.check(SI()),e.toUpperCase=()=>e.check(kI()),e.slugify=()=>e.check(jI())}),bL=oe("ZodString",(e,t)=>{Iy.init(e,t),ZC.init(e,t),e.email=n=>e.check(L5(xL,n)),e.url=n=>e.check(F5(wL,n)),e.jwt=n=>e.check(rI(IL,n)),e.emoji=n=>e.check(q5(SL,n)),e.guid=n=>e.check(Aw(Mw,n)),e.uuid=n=>e.check(U5(zd,n)),e.uuidv4=n=>e.check(P5(zd,n)),e.uuidv6=n=>e.check(B5(zd,n)),e.uuidv7=n=>e.check($5(zd,n)),e.nanoid=n=>e.check(H5(kL,n)),e.guid=n=>e.check(Aw(Mw,n)),e.cuid=n=>e.check(Z5(jL,n)),e.cuid2=n=>e.check(V5(CL,n)),e.ulid=n=>e.check(Q5(EL,n)),e.base64=n=>e.check(eI(OL,n)),e.base64url=n=>e.check(tI(ML,n)),e.xid=n=>e.check(K5(NL,n)),e.ksuid=n=>e.check(G5(_L,n)),e.ipv4=n=>e.check(Y5(TL,n)),e.ipv6=n=>e.check(X5(AL,n)),e.cidrv4=n=>e.check(J5(RL,n)),e.cidrv6=n=>e.check(W5(zL,n)),e.e164=n=>e.check(nI(DL,n)),e.datetime=n=>e.check(WI(n)),e.date=n=>e.check(tL(n)),e.time=n=>e.check(rL(n)),e.duration=n=>e.check(iL(n))});function N(e){return I5(bL,e)}const Ut=oe("ZodStringFormat",(e,t)=>{Dt.init(e,t),ZC.init(e,t)}),xL=oe("ZodEmail",(e,t)=>{q4.init(e,t),Ut.init(e,t)}),Mw=oe("ZodGUID",(e,t)=>{$4.init(e,t),Ut.init(e,t)}),zd=oe("ZodUUID",(e,t)=>{F4.init(e,t),Ut.init(e,t)}),wL=oe("ZodURL",(e,t)=>{H4.init(e,t),Ut.init(e,t)}),SL=oe("ZodEmoji",(e,t)=>{Z4.init(e,t),Ut.init(e,t)}),kL=oe("ZodNanoID",(e,t)=>{V4.init(e,t),Ut.init(e,t)}),jL=oe("ZodCUID",(e,t)=>{Q4.init(e,t),Ut.init(e,t)}),CL=oe("ZodCUID2",(e,t)=>{K4.init(e,t),Ut.init(e,t)}),EL=oe("ZodULID",(e,t)=>{G4.init(e,t),Ut.init(e,t)}),NL=oe("ZodXID",(e,t)=>{Y4.init(e,t),Ut.init(e,t)}),_L=oe("ZodKSUID",(e,t)=>{X4.init(e,t),Ut.init(e,t)}),TL=oe("ZodIPv4",(e,t)=>{n5.init(e,t),Ut.init(e,t)}),AL=oe("ZodIPv6",(e,t)=>{r5.init(e,t),Ut.init(e,t)}),RL=oe("ZodCIDRv4",(e,t)=>{a5.init(e,t),Ut.init(e,t)}),zL=oe("ZodCIDRv6",(e,t)=>{i5.init(e,t),Ut.init(e,t)}),OL=oe("ZodBase64",(e,t)=>{l5.init(e,t),Ut.init(e,t)}),ML=oe("ZodBase64URL",(e,t)=>{o5.init(e,t),Ut.init(e,t)}),DL=oe("ZodE164",(e,t)=>{u5.init(e,t),Ut.init(e,t)}),IL=oe("ZodJWT",(e,t)=>{d5.init(e,t),Ut.init(e,t)}),Ly=oe("ZodNumber",(e,t)=>{MC.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>zI(e,a,l),e.gt=(a,l)=>e.check(zw(a,l)),e.gte=(a,l)=>e.check(wp(a,l)),e.min=(a,l)=>e.check(wp(a,l)),e.lt=(a,l)=>e.check(Rw(a,l)),e.lte=(a,l)=>e.check(xp(a,l)),e.max=(a,l)=>e.check(xp(a,l)),e.int=a=>e.check(Dw(a)),e.safe=a=>e.check(Dw(a)),e.positive=a=>e.check(zw(0,a)),e.nonnegative=a=>e.check(wp(0,a)),e.negative=a=>e.check(Rw(0,a)),e.nonpositive=a=>e.check(xp(0,a)),e.multipleOf=(a,l)=>e.check(Ow(a,l)),e.step=(a,l)=>e.check(Ow(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 Be(e){return oI(Ly,e)}const LL=oe("ZodNumberFormat",(e,t)=>{f5.init(e,t),Ly.init(e,t)});function Dw(e){return cI(LL,e)}const UL=oe("ZodBoolean",(e,t)=>{h5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>OI(e,n,a)});function Ar(e){return dI(UL,e)}const PL=oe("ZodUnknown",(e,t)=>{m5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>DI()});function Nt(){return fI(PL)}const BL=oe("ZodNever",(e,t)=>{p5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>MI(e,n,a)});function $L(e){return hI(BL,e)}const FL=oe("ZodArray",(e,t)=>{g5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>BI(e,n,a,l),e.element=t.element,e.min=(n,a)=>e.check(tf(n,a)),e.nonempty=n=>e.check(tf(1,n)),e.max=(n,a)=>e.check(PC(n,a)),e.length=(n,a)=>e.check(BC(n,a)),e.unwrap=()=>e.element});function Et(e,t){return CI(FL,e,t)}const qL=oe("ZodObject",(e,t)=>{v5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>$I(e,n,a,l),pt(e,"shape",()=>t.shape),e.keyof=()=>Ie(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nt()}),e.strict=()=>e.clone({...e._zod.def,catchall:$L()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>PD(e,n),e.safeExtend=n=>BD(e,n),e.merge=n=>$D(e,n),e.pick=n=>LD(e,n),e.omit=n=>UD(e,n),e.partial=(...n)=>FD(GC,e,n[0]),e.required=(...n)=>qD(YC,e,n[0])});function re(e,t){const n={type:"object",shape:e??{},...Re(t)};return new qL(n)}const VC=oe("ZodUnion",(e,t)=>{LC.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>FI(e,n,a,l),e.options=t.options});function QC(e,t){return new VC({type:"union",options:e,...Re(t)})}const HL=oe("ZodDiscriminatedUnion",(e,t)=>{VC.init(e,t),b5.init(e,t)});function Uy(e,t,n){return new HL({type:"union",options:t,discriminator:e,...Re(n)})}const ZL=oe("ZodIntersection",(e,t)=>{x5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>qI(e,n,a,l)});function VL(e,t){return new ZL({type:"intersection",left:e,right:t})}const QL=oe("ZodRecord",(e,t)=>{w5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>HI(e,n,a,l),e.keyType=t.keyType,e.valueType=t.valueType});function Vt(e,t,n){return new QL({type:"record",keyType:e,valueType:t,...Re(n)})}const zg=oe("ZodEnum",(e,t)=>{S5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,l,o)=>II(e,a,l),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,l)=>{const o={};for(const c of a)if(n.has(c))o[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new zg({...t,checks:[],...Re(l),entries:o})},e.exclude=(a,l)=>{const o={...t.entries};for(const c of a)if(n.has(c))delete o[c];else throw new Error(`Key ${c} not found in enum`);return new zg({...t,checks:[],...Re(l),entries:o})}});function Ie(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new zg({type:"enum",entries:n,...Re(t)})}const KL=oe("ZodLiteral",(e,t)=>{k5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>LI(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 Jt(e,t){return new KL({type:"literal",values:Array.isArray(e)?e:[e],...Re(t)})}const GL=oe("ZodTransform",(e,t)=>{j5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>PI(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new vC(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(Tu(o,n.value,t));else{const c=o;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(Tu(c))}};const l=t.transform(n.value,n);return l instanceof Promise?l.then(o=>(n.value=o,n)):(n.value=l,n)}});function KC(e){return new GL({type:"transform",transform:e})}const GC=oe("ZodOptional",(e,t)=>{UC.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>HC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function Iw(e){return new GC({type:"optional",innerType:e})}const YL=oe("ZodExactOptional",(e,t)=>{C5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>HC(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function XL(e){return new YL({type:"optional",innerType:e})}const JL=oe("ZodNullable",(e,t)=>{E5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>ZI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function Lw(e){return new JL({type:"nullable",innerType:e})}const WL=oe("ZodDefault",(e,t)=>{N5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>QI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function e6(e,t){return new WL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():SC(t)}})}const t6=oe("ZodPrefault",(e,t)=>{_5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>KI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function n6(e,t){return new t6({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():SC(t)}})}const YC=oe("ZodNonOptional",(e,t)=>{T5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>VI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function r6(e,t){return new YC({type:"nonoptional",innerType:e,...Re(t)})}const a6=oe("ZodCatch",(e,t)=>{A5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>GI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function i6(e,t){return new a6({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const l6=oe("ZodPipe",(e,t)=>{R5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>YI(e,n,a,l),e.in=t.in,e.out=t.out});function Og(e,t){return new l6({type:"pipe",in:e,out:t})}const s6=oe("ZodReadonly",(e,t)=>{z5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>XI(e,n,a,l),e.unwrap=()=>e._zod.def.innerType});function o6(e){return new s6({type:"readonly",innerType:e})}const u6=oe("ZodCustom",(e,t)=>{O5.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,l)=>UI(e,n)});function c6(e,t={}){return EI(u6,e,t)}function d6(e){return NI(e)}function f6(e,t){return Og(KC(e),t)}const Sp={custom:"custom"};function Ju(e){return uI(Ly,e)}const h6=new RegExp("(?<![A-Za-z0-9_.@-])@([A-Za-z0-9][A-Za-z0-9_-]{0,63})\\b","g");function m6(e){return e.replace(/```[\s\S]*?```/g,"").replace(/~~~[\s\S]*?~~~/g,"").replace(/`[^`\n]+`/g,"")}function XC(e,t){const n=m6(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(h6)){const c=o[1];if(!c)continue;const f=a.get(c.toLowerCase());f&&l.add(f)}return[...l]}const p6=/^\/(?![/\\])[A-Za-z0-9_\-./?=&%#]*$/,Uw="/";function JC(e){return!e||typeof e!="string"||e.length>256||!p6.test(e)?"/":e}const g6={FEISHU:"feishu",SLACK:"slack",KAEL:"kael"},WC=Ie(["feishu","slack","kael"]),eE=Ie(["active","inactive"]);re({platform:WC,agentId:N().min(1),credentials:Vt(N(),Nt()),status:eE.default("active")});re({agentId:N().min(1).optional(),credentials:Vt(N(),Nt()).optional(),status:eE.optional()});re({id:Be(),platform:N(),agentId:N(),hasCredentials:Ar(),status:N(),createdAt:N(),updatedAt:N()});const y6=Ie(["code","reverse_token","oauth","manual"]);re({appId:N().min(1),appSecret:N().min(1)});re({platform:WC,externalUserId:N().min(1),agentId:N().min(1),boundVia:y6.default("manual"),displayName:N().max(200).optional()});re({id:Be(),platform:N(),externalUserId:N(),agentId:N(),boundVia:N().nullable(),displayName:N().nullable(),createdAt:N()});re({feishuUserId:N().min(1),displayName:N().max(200).optional()});re({configId:Be(),platform:N(),agentId:N(),appId:N(),connected:Ar(),lastActiveAt:N().nullable()});const tE=Ie(["online","offline"]),nE=Ie(["idle","working","blocked","error"]);Ie(["active","suspended","evicted"]);const v6=Ie(["active","suspended"]);re({chatId:N().min(1),state:v6});re({runtimeState:nE});re({agentId:N().min(1),runtimeType:N().max(50),runtimeVersion:N().max(50).optional()});Ie(["wrong_client","not_owned","agent_suspended","wrong_org","unknown_agent","runtime_provider_mismatch"]);re({agentId:N(),status:tE,connectedAt:N().nullable(),lastSeenAt:N(),clientId:N().nullable().optional(),runtimeType:N().nullable().optional(),runtimeVersion:N().nullable().optional(),runtimeState:nE.nullable().optional(),activeSessions:Be().int().nullable().optional(),totalSessions:Be().int().nullable().optional(),runtimeUpdatedAt:N().nullable().optional()});re({total:Be().int(),running:Be().int(),byState:re({idle:Be().int(),working:Be().int(),blocked:Be().int(),error:Be().int()}),clients:Be().int()});const rf={CLAUDE_CODE:"claude-code",CODEX:"codex"},Rf=Ie(["claude-code","codex"]),zf=Ie(["human","personal_assistant","autonomous_agent"]),Pw={PRIVATE:"private",ORGANIZATION:"organization"},Py=Ie(["private","organization"]),b6=Ie(["admin-api","portal"]);Ie(["active","suspended"]);const Mg=/^[a-z0-9][a-z0-9_-]{0,63}$/,xs=64,x6=["admin","agent","first-tree","hub","me","null","system","undefined"],w6=new Set(x6);function Dg(e){return w6.has(e)}re({name:N().min(1).max(64).regex(Mg,"Must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_). Max 64 chars.").refine(e=>!Dg(e),{message:"That agent name is reserved — pick a different one."}).optional(),type:zf,displayName:N().min(1).max(200).optional(),delegateMention:N().max(100).optional(),organizationId:N().min(1).max(100).optional(),source:b6.optional(),visibility:Py.optional(),metadata:Vt(N(),Nt()).optional(),managerId:N().optional(),clientId:N().min(1).max(100).optional(),runtimeProvider:Rf.optional()});re({type:zf.optional(),displayName:N().min(1).max(200).optional(),delegateMention:N().max(100).nullable().optional(),visibility:Py.optional(),metadata:Vt(N(),Nt()).optional(),managerId:N().nullable().optional(),clientId:N().min(1).max(100).nullable().optional()});re({clientId:N().min(1).max(100),runtimeProvider:Rf,force:Ar().optional()});re({uuid:N(),name:N().nullable(),organizationId:N(),type:zf,displayName:N(),delegateMention:N().nullable(),inboxId:N(),status:N(),source:N().nullable().optional(),visibility:Py,metadata:Vt(N(),Nt()),managerId:N().nullable(),clientId:N().nullable(),runtimeProvider:Rf,presenceStatus:tE.optional(),createdAt:N(),updatedAt:N()});re({repo:N().nullable(),branch:N().nullable()});re({type:Jt("agent:pinned"),agentId:N(),name:N().nullable(),displayName:N(),agentType:zf,runtimeProvider:Rf});const S6=32e3,By=/^[a-z0-9][a-z0-9_-]{0,63}$/i,k6=/^[A-Z][A-Z0-9_]*$/,j6=re({append:N().max(S6).default("")}),C6=re({name:N().regex(By,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Jt("stdio"),command:N().min(1),args:Et(N()).optional()}),E6=re({name:N().regex(By,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Jt("http"),url:N().url(),headers:Vt(N(),N()).optional()}),N6=re({name:N().regex(By,"MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),transport:Jt("sse"),url:N().url(),headers:Vt(N(),N()).optional()}),_6=Uy("transport",[C6,E6,N6]),T6=re({key:N().regex(k6,"Env key must match /^[A-Z][A-Z0-9_]*$/"),value:N(),sensitive:Ar().default(!1)}),A6=re({url:N().min(1),ref:N().min(1).optional(),localPath:N().min(1).optional()}),Of=re({prompt:j6.default({append:""}),model:N().default("opus"),mcpServers:Et(_6).default([]),env:Et(T6).default([]),gitRepos:Et(A6).default([])}),R6=Of.extend({kind:Jt("claude-code")}),z6=Of.extend({kind:Jt("codex")}),O6=Uy("kind",[R6,z6]),M6=(e,t)=>{const n=new Set;e.mcpServers.forEach((o,c)=>{const f=o.name.toLowerCase();n.has(f)&&t.addIssue({code:Sp.custom,path:["mcpServers",c,"name"],message:`Duplicate MCP server name "${o.name}"`}),n.add(f)});const a=new Set;e.env.forEach((o,c)=>{a.has(o.key)&&t.addIssue({code:Sp.custom,path:["env",c,"key"],message:`Duplicate env key "${o.key}"`}),a.add(o.key)});const l=new Set;e.gitRepos.forEach((o,c)=>{const f=o.localPath??lf(o.url);f&&(l.has(f)&&t.addIssue({code:Sp.custom,path:["gitRepos",c,"localPath"],message:`Duplicate git repo local path "${f}"`}),l.add(f))})},rE=f6(e=>e&&typeof e=="object"&&!Array.isArray(e)&&!("kind"in e)?{...e,kind:"claude-code"}:e,O6).superRefine((e,t)=>{M6(e,t)}),D6=re({agentId:N(),version:Be().int().positive(),payload:rE,updatedAt:N(),updatedBy:N()});re({expectedVersion:Be().int().positive(),payload:Of.partial()});re({payload:Of.partial()});re({current:D6,next:rE,diff:Et(re({path:N(),op:Ie(["add","remove","replace"]),before:Nt().optional(),after:Nt().optional()}))});const af="***";function lf(e){const t=e.trim();return t?((t.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,""):""}re({username:N().min(1),password:N().min(1)});re({accessToken:N(),refreshToken:N()});re({refreshToken:N().min(1)});re({token:N().min(1)});re({token:N(),expiresIn:Be(),command:N()});const I6=Ie(["direct","group","thread"]);re({type:I6,topic:N().max(500).optional(),participantIds:Et(N()).min(1),metadata:Vt(N(),Nt()).optional()});const aE=re({agentId:N(),role:N(),mode:N(),joinedAt:N()});aE.extend({name:N().nullable(),displayName:N(),type:N()});const L6=re({id:N(),organizationId:N(),type:N(),topic:N().nullable(),lifecyclePolicy:N().nullable().optional(),metadata:Vt(N(),Nt()),createdAt:N(),updatedAt:N()});L6.extend({participants:Et(aE),title:N(),firstMessagePreview:N().nullable()});re({topic:N().trim().max(500).nullable()});re({agentId:N().min(1),mode:Ie(["full","mention_only"]).default("full")});re({agentId:N().min(1)});const U6=Ie(["connected","disconnected"]),P6=Ie(["ok","expired"]);re({id:N(),userId:N().nullable(),status:U6,authState:P6,sdkVersion:N().max(50).nullable(),hostname:N().max(100).nullable(),os:N().max(50).nullable(),agentCount:Be().int().min(0),connectedAt:N().nullable(),lastSeenAt:N(),metadata:Vt(N(),Nt()).nullable()});const B6=re({wsInboxDeliver:Ar().default(!1)}).partial();re({clientId:N().min(1).max(100),hostname:N().max(100).optional(),os:N().max(50).optional(),sdkVersion:N().max(50).optional(),wireCapabilities:B6.optional()});re({clientId:N(),previousUserId:N().nullable(),unpinnedAgentCount:Be().int().nonnegative()});const $6=Ie(["ok","missing","unauthenticated","error"]),F6=Ie(["api_key","oauth","auth_json","none"]),q6=re({state:$6,available:Ar(),authenticated:Ar(),sdkVersion:N().nullable().optional(),authMethod:F6,error:N().nullable().optional(),detectedAt:N()}),H6=Vt(N(),q6);re({capabilities:H6});re({limit:Ju().int().min(1).max(100).default(20),cursor:N().optional()});const Z6=Ie(["active","stale","unavailable"]),V6=Ie(["ok","warning","error"]),Q6=re({label:N(),detail:N().nullable(),severity:V6}),K6=Ie(["root","domain","subdomain","leaf"]),$y=Ie(["added","edited","removed"]),G6=Ie(["parent","soft_link","markdown_link"]),Y6=Ie(["low","medium","high"]),X6=re({id:N(),path:N(),sourcePath:N().nullable(),title:N(),kind:K6,owners:Et(N()),parentId:N().nullable(),preview:N().nullable(),relatedNodeIds:Et(N()),affectedContextArea:N(),changeType:$y.nullable(),changedAtCommit:N().nullable()}),J6=re({source:N(),target:N(),kind:G6}),W6=re({path:N(),nodeId:N().nullable(),type:$y,commit:N().nullable(),changedAt:N().nullable(),changedBy:N().nullable(),summary:N().nullable()}),eU=re({id:N(),nodeId:N().nullable(),path:N(),title:N(),changeType:$y,affectedContextArea:N(),reason:N(),summary:N(),changedBy:N().nullable(),owners:Et(N()),relatedNodeIds:Et(N()),sourceCommit:N().nullable(),riskLevel:Y6}),tU=re({addedCount:Be().int().nonnegative(),editedCount:Be().int().nonnegative(),removedCount:Be().int().nonnegative(),changedNodeCount:Be().int().nonnegative()});re({repo:N().nullable(),branch:N().nullable(),headCommit:N().nullable(),syncedAt:N().nullable(),snapshotStatus:Z6,contextStatus:Q6,summary:tU,updates:Et(eU),nodes:Et(X6),edges:Et(J6),changes:Et(W6)});const nU=["image/png","image/jpeg","image/gif","image/webp"],Fy=Ie(nU);re({data:N().min(1),mimeType:Fy,filename:N().min(1),size:Be().int().nonnegative().optional(),imageId:N().uuid().optional()});re({imageId:N().uuid(),mimeType:Fy,filename:N().min(1),size:Be().int().nonnegative().optional()});re({type:Jt("image_payload"),imageId:N().uuid(),chatId:N(),base64:N().min(1),mimeType:Fy,filename:N().min(1),size:Be().int().nonnegative().optional()});const qy=Ie(["hub_ui","cli","feishu","github","api"]),iE=Ie(["text","markdown","card","reference","file","task"]);re({format:iE.default("text"),content:Nt(),metadata:Vt(N(),Nt()).optional(),inReplyTo:N().optional(),replyToInbox:N().optional(),replyToChat:N().optional(),source:qy.optional()});re({format:iE.default("text"),content:Nt(),metadata:Vt(N(),Nt()).optional(),replyToInbox:N().optional(),replyToChat:N().optional(),source:qy.optional()});const rU=re({id:N(),chatId:N(),senderId:N(),format:N(),content:Nt(),metadata:Vt(N(),Nt()),replyToInbox:N().nullable(),replyToChat:N().nullable(),inReplyTo:N().nullable(),source:qy.nullable(),createdAt:N()}),aU=re({senderId:N(),chatId:N(),replyToChat:N().nullable()}).nullable(),iU=Ie(["full","mention_only"]),lU=re({id:N(),senderId:N(),format:N(),content:Nt(),metadata:Vt(N(),Nt()).default({}),createdAt:N()}),lE=rU.extend({configVersion:Be().int().positive(),recipientMode:iU.default("full"),inReplyToSnapshot:aU.default(null),precedingMessages:Et(lU).default([])});Ie(["pending","delivered","acked","failed"]);const sU=re({id:Be(),inboxId:N(),messageId:N(),chatId:N().nullable(),status:N(),retryCount:Be(),createdAt:N(),deliveredAt:N().nullable(),ackedAt:N().nullable()});sU.extend({message:lE});re({limit:Ju().int().min(1).max(50).default(10)});re({type:Jt("inbox:deliver"),entryId:Be().int().nonnegative(),inboxId:N().min(1),chatId:N().nullable(),message:lE}).passthrough();re({type:Jt("inbox:ack"),entryId:Be().int().nonnegative()});const oU=7;re({organizationId:N(),organizationName:N(),organizationDisplayName:N(),role:N(),expiresAt:N().nullable()});re({id:N(),organizationId:N(),token:N(),inviteUrl:N(),role:N(),createdAt:N(),expiresAt:N().nullable()});re({token:N().min(1)});re({}).optional();const uU=["all","unread","watching"],cU=Ie(uU),sE=Ie(["participant","watching"]);re({cursor:N().optional(),limit:Ju().int().min(1).max(200).default(50),filter:cU.default("all")});const dU=re({agentId:N(),displayName:N(),type:N()}),fU=re({chatId:N(),type:N(),membershipKind:sE,title:N(),topic:N().nullable(),participants:Et(dU),participantCount:Be().int(),lastMessageAt:N().nullable(),lastMessagePreview:N().nullable(),unreadMentionCount:Be().int(),canReply:Ar(),taskId:N().nullable(),taskStatus:N().nullable()});re({rows:Et(fU),nextCursor:N().nullable()});re({participantIds:Et(N().min(1)).min(1),topic:N().trim().max(500).optional().nullable()});re({participantIds:Et(N().min(1)).min(1)});re({chatId:N(),lastReadAt:N(),unreadMentionCount:Be().int()});re({chatId:N(),membershipKind:sE.nullable()});re({type:Jt("chat:message"),chatId:N()});Ie(["connect","create_agent","completed"]);re({id:N(),name:N(),displayName:N(),role:Ie(["admin","member"])});re({name:N().min(2).max(50).regex(/^[a-z0-9][a-z0-9-]*$/),displayName:N().min(1).max(200)});re({id:N(),organizationId:N(),organizationName:N(),role:Ie(["admin","member"]),agentId:N()});const hU={ADMIN:"admin",MEMBER:"member"},Hy=Ie(["admin","member"]),mU=re({id:N(),userId:N(),organizationId:N(),agentId:N(),role:Hy,createdAt:N()});re({username:N().min(1).max(100),displayName:N().min(1).max(200),role:Hy.default("member")});re({role:Hy.optional(),displayName:N().min(1).max(200).optional()});mU.extend({username:N(),displayName:N(),password:N()});const pU=Ie(["agent_error","session_error","agent_needs_decision","agent_blocked","agent_stale","agent_disconnected","agent_connected","session_completed"]),oE=Ie(["high","medium","low"]);re({id:N(),organizationId:N(),type:pU,severity:oE,agentId:N().nullable(),chatId:N().nullable(),message:N(),read:Ar(),createdAt:N()});re({limit:Ju().int().min(1).max(100).default(20),cursor:N().optional(),severity:oE.optional(),read:Ie(["true","false"]).transform(e=>e==="true").optional(),agentId:N().optional()});re({next:N().max(256).optional()});re({code:N().min(1),state:N().min(1)});re({githubId:N().min(1),login:N().min(1),email:N().email().optional(),displayName:N().optional(),next:N().max(256).optional()});const gU=re({repo:N().url().optional(),branch:N().default("main")}),yU=re({repo:N().url().min(1).nullish(),branch:N().min(1).nullish()}),vU=re({repo:N().optional(),branch:N().optional()}),bU=re({webhookSecretCipher:N().optional()}),xU=re({webhookSecret:N().min(1).nullish()}),wU=re({webhookSecretConfigured:Ar(),webhookUrl:N()}),SU={context_tree:{storage:gU,input:yU,output:vU},github_integration:{storage:bU,input:xU,output:wU}},kU=Object.keys(SU);Ie(kU);const uE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;re({name:N().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=>!uE.test(e),"Name must not be a UUID format"),displayName:N().min(1).max(200),maxAgents:Be().int().min(0).default(0),maxMessagesPerMinute:Be().int().min(0).default(0),features:Vt(N(),Nt()).default({})});re({name:N().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=>!uE.test(e),"Name must not be a UUID format").optional(),displayName:N().min(1).max(200).optional(),maxAgents:Be().int().min(0).optional(),maxMessagesPerMinute:Be().int().min(0).optional(),features:Vt(N(),Nt()).optional()});re({id:N(),name:N(),displayName:N(),maxAgents:Be(),maxMessagesPerMinute:Be(),features:Vt(N(),Nt()),createdAt:N(),updatedAt:N()});const jU=re({workingCount:Be().int().nonnegative(),errorMask:Ar()}),CU=re({type:Jt("pulse:tick"),organizationId:N(),agents:Vt(N(),Et(jU).length(32))}),EU=Ie(["tool_call","error","assistant_text","thinking","turn_end"]),cE=re({toolUseId:N(),name:N(),args:Nt(),status:Ie(["pending","ok","error"]),durationMs:Be().int().nonnegative().optional(),resultPreview:N().max(400).optional()}),dE=re({source:Ie(["sdk","runtime","tool"]),message:N().max(2e3)}),fE=re({text:N().max(8e3)}),hE=re({}),mE=re({status:Ie(["success","error"])}),NU=Uy("kind",[re({kind:Jt("tool_call"),payload:cE}),re({kind:Jt("error"),payload:dE}),re({kind:Jt("assistant_text"),payload:fE}),re({kind:Jt("thinking"),payload:hE}),re({kind:Jt("turn_end"),payload:mE})]);re({id:N(),agentId:N(),chatId:N(),seq:Be().int().positive(),kind:EU,payload:QC([cE,dE,fE,hE,mE]),createdAt:N()});re({agentId:N(),chatId:N(),event:NU});re({agentId:N(),chatId:N()});re({type:Jt("session:reconcile"),agentId:N().min(1),chatIds:Et(N().min(1)).max(500)});re({type:Jt("session:reconcile:result"),agentId:N().min(1),staleChatIds:Et(N().min(1))});const _U=re({organizationId:N(),agentCount:Be(),chatCount:Be(),messageCount:Be()});re({totalAgents:Be(),totalChats:Be(),totalMessages:Be(),byOrganization:Et(_U)});const Au=Ie(["pending","assigned","working","completed","failed","cancelled"]),Bw=Ie(["agent","admin"]),TU=Ie(["assigned","status_changed","cancelled"]);re({taskId:N(),event:TU,title:N(),body:N().default(""),status:Au,fromStatus:Au.optional(),originRef:N().nullable().optional()});const AU=re({title:N().min(1).max(500),body:N().optional(),assigneeAgentId:N().optional(),originRef:N().max(500).optional(),metadata:Vt(N(),Nt()).optional()});AU.extend({organizationId:N().optional()});re({status:Ie(["working","completed","failed"]),result:N().optional()});re({assigneeAgentId:N().nullable().optional(),status:Au.optional(),result:N().optional()});re({chatId:N().min(1)});const RU=re({id:N(),organizationId:N(),title:N(),body:N(),status:Au,assigneeAgentId:N().nullable(),createdByType:Bw,createdById:N(),originRef:N().nullable(),result:N().nullable(),metadata:Vt(N(),Nt()),createdAt:N(),updatedAt:N(),cancelledAt:N().nullable(),cancelledByType:Bw.nullable(),cancelledById:N().nullable()}),zU=re({taskId:N(),chatId:N(),linkedByAgentId:N().nullable(),linkedAt:N()});RU.extend({chats:Et(zU)});re({status:Au.optional(),assigneeAgentId:N().optional(),originRef:N().optional(),limit:Ju().int().min(1).max(100).default(20),cursor:N().optional()});const OU=Ie(["normal","idle_island","awaiting_reply","no_chat","not_applicable"]);re({taskId:N(),signal:OU,reason:N()});const MU=Ie(["active","suspended"]);re({id:N(),username:N(),displayName:N(),avatarUrl:N().nullable(),status:MU,createdAt:N(),updatedAt:N()});re({username:N().min(1).max(100),displayName:N().min(1).max(200),password:N().min(8).max(200)});re({displayName:N().min(1).max(200).optional(),password:N().min(8).max(200).optional()});re({type:Jt("auth"),token:N().min(1)});const DU=re({wsInboxDeliver:Ar().default(!1)}).partial();re({type:Jt("server:welcome"),serverCommandVersion:N().min(1),serverTimeMs:Be().int().nonnegative(),capabilities:DU.optional()}).passthrough();const pE=Array.from({length:32},()=>({workingCount:0,errorMask:!1}));function IU(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 LU=2e3,UU=3e4;let mi=null,Ru=!1,sf=0,hu=null;const Ig=new Set;let hi=null,ll=0;function PU(e){for(const t of Ig)try{t(e)}catch{}if(hi){if(e.type==="notification")hi.invalidateQueries({queryKey:["notifications"]});else if(e.type==="session:state")hi.invalidateQueries({queryKey:["activity"]}),hi.invalidateQueries({queryKey:["sessions"]});else if(e.type==="chat:message"){const t=typeof e.chatId=="string"?e.chatId:null;hi.invalidateQueries({queryKey:["me","chats"]}),t&&(hi.invalidateQueries({queryKey:["chat-messages",t]}),hi.invalidateQueries({queryKey:["chat-detail",t]}))}}}function Zy(){const e=bf();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);mi=l,l.onmessage=o=>{if(l===mi)try{const c=JSON.parse(o.data);PU(c)}catch{}},l.onopen=()=>{l===mi&&(sf=0)},l.onclose=o=>{if(l===mi&&(mi=null,!(Ru||ll===0))){if(o.code===4001){xR().then(c=>{Ru||ll===0||(c?(sf=0,Zy()):$w())});return}$w()}}}function $w(){sf++;const e=Math.min(LU*2**(sf-1),UU);hu=setTimeout(()=>{hu=null,!Ru&&ll>0&&Zy()},e)}function BU(){Ru=!0,hu&&(clearTimeout(hu),hu=null),mi&&(mi.close(1e3,"unmount"),mi=null)}function gE(e){const{onMessage:t,enabled:n=!0}=e??{},a=nn(),l=x.useRef(t);l.current=t,x.useEffect(()=>{hi=a},[a]),x.useEffect(()=>{if(!n)return;const o=c=>{var f;return(f=l.current)==null?void 0:f.call(l,c)};return Ig.add(o),ll++,ll===1&&(Ru=!1,Zy()),()=>{Ig.delete(o),ll--,ll===0&&BU()}},[n])}const $U=x.createContext({aggregated:pE,agents:{},receivedAtMs:null,stale:!0});function FU({children:e}){const[t,n]=x.useState({aggregated:pE,agents:{},receivedAtMs:null}),[a,l]=x.useState(()=>Date.now());gE({onMessage:c=>{const f=CU.safeParse(c);f.success&&n({aggregated:IU(f.data.agents),agents:f.data.agents,receivedAtMs:Date.now()})}}),x.useEffect(()=>{const c=setInterval(()=>l(Date.now()),1e4);return()=>clearInterval(c)},[]);const o=x.useMemo(()=>({...t,stale:t.receivedAtMs===null||a-t.receivedAtMs>3e4}),[t,a]);return u.jsx($U.Provider,{value:o,children:e})}function qU(e){return ke.get(`/agents/${e}/config`)}function HU(e,t){return ke.patch(`/agents/${e}/config`,t)}function ZU(e,t){return ke.post(`/agents/${e}/config/dry-run`,{payload:t})}function VU(e){return ke.get(`/agents/${e}/client-status`)}function QU({className:e,style:t,...n}){return u.jsx("div",{className:Te("flex items-center text-body",e),style:{gap:6,color:"var(--fg-3)",...t},...n})}function KU({onClick:e,children:t}){return u.jsx("button",{type:"button",onClick:e,className:"bg-transparent border-0 p-0 cursor-pointer",style:{color:"var(--fg-3)",textDecoration:"none",font:"inherit"},onMouseEnter:n=>{n.currentTarget.style.color="var(--fg)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--fg-3)"},children:t})}function GU(){return u.jsx("span",{style:{color:"var(--fg-4)"},children:"/"})}function YU({children:e,mono:t}){return u.jsx("span",{className:Te("font-medium",t&&"mono"),style:{color:"var(--fg)"},children:e})}const XU={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 Br({tone:e="neutral",className:t,style:n,...a}){const l=XU[e],o={background:l.bg,color:l.fg,border:`var(--hairline) solid ${l.bd}`,...n};return u.jsx("span",{className:Te("mono inline-flex items-center uppercase text-caption leading-[1.6]",t),style:{padding:"var(--hairline) var(--sp-1_75)",borderRadius:"var(--radius-chip)",...o},...a})}function Lg({children:e,right:t,className:n,style:a,...l}){return u.jsxs("div",{className:Te("mono flex items-center justify-between uppercase text-eyebrow",n),style:{padding:"var(--sp-1_75) var(--sp-3_5)",color:"var(--fg-4)",background:"var(--bg-raised)",borderBottom:"var(--hairline) solid var(--border-faint)",...a},...l,children:[u.jsx("span",{children:e}),t]})}function Vy({className:e,style:t,...n}){return u.jsx("span",{className:Te("mono uppercase text-caption",e),style:{color:"var(--fg-3)",...t},...n})}function mu({state:e,size:t=8,className:n}){const a={width:t,height:t,display:"inline-block",position:"relative",flexShrink:0};return e==="working"?u.jsxs("span",{className:Te("shrink-0",n),style:a,role:"img","aria-label":"working",children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--state-working)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--state-working)",animation:"ring-pulse 1.8s infinite",opacity:.6}})]}):e==="blocked"?u.jsx("span",{className:Te("shrink-0",n),style:{...a,border:"var(--hairline-bold) dashed var(--state-blocked)",borderRadius:"50%",animation:"dash-spin 4s linear infinite"},role:"img","aria-label":"blocked",children:u.jsx("span",{style:{position:"absolute",inset:2,borderRadius:"50%",background:"var(--state-blocked)"}})}):e==="error"?u.jsx("span",{className:Te("shrink-0",n),style:{...a,background:"var(--state-error)",clipPath:"polygon(50% 0%, 100% 100%, 0% 100%)",borderRadius:1},role:"img","aria-label":"error"}):e==="idle"?u.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",background:"var(--state-idle)"},role:"img","aria-label":"idle"}):u.jsx("span",{className:Te("shrink-0",n),style:{...a,borderRadius:"50%",border:"var(--hairline) solid var(--state-offline)",background:"transparent"},role:"img","aria-label":"offline"})}function JU(e){return e==="idle"||e==="working"||e==="blocked"||e==="error"||e==="offline"}function zu({state:e,className:t}){const n=e!==null&&JU(e)?e:"offline",a=n==="offline"?"var(--fg-3)":`var(--state-${n})`;return u.jsxs("span",{className:Te("mono inline-flex items-center gap-1.5 uppercase text-caption",t),style:{color:a},children:[u.jsx(mu,{state:n,size:7}),n]})}function Od({label:e,value:t,accent:n}){return u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-2_5)",background:"var(--bg-sunken)",borderRadius:"var(--radius-input)",cursor:"default"},children:[u.jsx("div",{className:"mono uppercase text-eyebrow",style:{color:"var(--fg-4)"},children:e}),u.jsx("div",{className:"mono text-subtitle font-semibold",style:{color:n??"var(--fg)",marginTop:"var(--sp-px)"},children:t})]})}function WU({runtimeLabel:e,computerLabel:t,visible:n=!0}){return n?u.jsx("div",{className:"sticky z-20 flex items-center justify-between gap-3 backdrop-blur",style:{top:0,padding:"var(--sp-1_75) var(--sp-5)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("div",{className:"mono text-caption flex items-center gap-2",style:{color:"var(--fg-3)"},children:[u.jsxs("span",{children:["Runs on ",u.jsx("span",{style:{color:"var(--fg-2)"},children:e})]}),t&&u.jsxs(u.Fragment,{children:[u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"@"}),u.jsx("span",{style:{color:"var(--fg-2)"},children:t})]})]})}):null}function eP(e){const{agent:t}=e,[n,a]=x.useState(!1),[l,o]=x.useState(!1),c=t.displayName||t.name||t.uuid;return u.jsxs("section",{id:"ad-danger",style:{background:"color-mix(in oklch, var(--state-error) 6%, var(--bg-raised))",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-panel)"},children:[u.jsxs("header",{className:"flex items-center gap-2",style:{padding:"var(--sp-2_5) var(--sp-3_5)"},children:[u.jsx(wl,{className:"h-3.5 w-3.5",style:{color:"var(--state-error)"}}),u.jsx("h3",{className:"text-body font-semibold",style:{color:"var(--state-error)"},children:"Danger zone"})]}),u.jsxs("div",{children:[t.status==="active"?u.jsx(kp,{title:"Suspend agent",body:"Pause all active sessions. You can reactivate later; tokens stay revoked until then.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:()=>o(!0),disabled:e.suspendPending,children:e.suspendPending?"Suspending…":"Suspend"})}):u.jsx(kp,{title:"Reactivate agent",body:"Resume sessions. Tokens must be recreated — they are not restored.",action:u.jsx(me,{variant:"outline",size:"xs",onClick:e.onReactivate,disabled:e.reactivatePending,children:e.reactivatePending?"Reactivating…":"Reactivate"})}),u.jsx(kp,{title:"Delete agent",body:"Permanent. Configuration, bindings, tokens, and session history are all dropped.",action:u.jsxs(me,{variant:"destructive",size:"xs",onClick:()=>a(!0),disabled:e.deletePending,children:[u.jsx(ku,{className:"h-3 w-3"}),"Delete"]})})]}),u.jsx(tP,{open:l,onOpenChange:o,label:c,onConfirm:()=>{o(!1),e.onSuspend()},pending:e.suspendPending}),u.jsx(nP,{open:n,onOpenChange:a,expected:c,onDelete:()=>{a(!1),e.onDelete()},deleting:e.deletePending})]})}function kp(e){return u.jsxs("div",{className:"flex items-start justify-between gap-4 text-body",style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderTop:"var(--hairline) solid color-mix(in oklch, var(--state-error) 14%, transparent)"},children:[u.jsxs("div",{children:[u.jsx("p",{className:"font-medium",style:{color:"var(--fg)"},children:e.title}),u.jsx("p",{className:"text-label font-normal",style:{color:"var(--fg-3)"},children:e.body})]}),u.jsx("div",{children:e.action})]})}function tP({open:e,onOpenChange:t,label:n,onConfirm:a,pending:l}){return u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsxs(on,{children:['Suspend "',n,'"?']})}),u.jsx("div",{className:"space-y-3",children:u.jsx("p",{className:"text-body",style:{color:"var(--fg-2)"},children:"Runtime binds and HTTP calls will be refused while the agent is suspended. Active sessions end on their next message. You can reactivate later from this same page."})}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:a,disabled:l,children:l?"Suspending…":"Suspend"})]})]})})}function nP({open:e,onOpenChange:t,expected:n,onDelete:a,deleting:l}){const[o,c]=x.useState("");function f(m){m.preventDefault(),o===n&&a()}return u.jsx(sn,{open:e,onOpenChange:m=>{t(m),m||c("")},children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsxs(on,{children:['Delete "',n,'"?']})}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["This action cannot be undone. Type ",u.jsx("span",{className:"font-mono font-medium text-foreground",children:n})," ","to confirm."]}),u.jsx(At,{value:o,onChange:m=>c(m.target.value),autoFocus:!0,placeholder:n,className:"font-mono"}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"}),u.jsx(me,{type:"submit",variant:"destructive",disabled:o!==n||l,children:l?"Deleting…":"Delete"})]})]})]})})}var rP="Label",yE=x.forwardRef((e,t)=>u.jsx(Oa.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())}}));yE.displayName=rP;var aP=yE;const ft=x.forwardRef(({className:e,...t},n)=>u.jsx(aP,{ref:n,className:Te("text-label leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));ft.displayName="Label";const tn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("overflow-hidden",e),style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",...t},...n}));tn.displayName="Panel";const Or=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("flex items-center justify-between gap-3",e),style:{padding:"var(--sp-2_5) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));Or.displayName="PanelHeader";const Mr=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te("inline-flex items-center gap-2 text-body font-semibold",e),style:{color:"var(--fg)",...t},...n}));Mr.displayName="PanelTitle";const Tn=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("div",{ref:a,className:Te(e),style:{padding:"var(--sp-3) var(--sp-3_5)",...t},...n}));Tn.displayName="PanelBody";const iP={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 Qy({status:e,onEdit:t,onDelete:n,onUndo:a,children:l,disabled:o}){const c=iP[e],f=e==="deleted";return u.jsxs("div",{className:Te("flex items-center gap-2 rounded border px-3 py-2 text-body",f?"bg-error-soft border-error text-error line-through decoration-error":"bg-card"),children:[u.jsx("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:l}),c.label&&u.jsx("span",{className:Te("text-caption rounded px-1.5 py-0.5 whitespace-nowrap",c.tone),children:c.label}),!o&&(f?u.jsxs(me,{size:"sm",variant:"ghost",onClick:a,children:[u.jsx(Mz,{className:"h-3.5 w-3.5 mr-1"}),"Undo"]}):u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:t,title:"Edit",children:[u.jsx(wf,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Edit"})]}),u.jsxs(me,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:n,title:"Delete",children:[u.jsx(ku,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"sr-only",children:"Delete"})]})]}))]})}function lP(e){const[t,n]=x.useState(null),[a,l]=x.useState(()=>new Set),o=f=>l(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h}),c=e.items.filter(f=>f.status!=="deleted").length;return u.jsxs(tn,{children:[u.jsxs(Or,{children:[u.jsxs(Mr,{children:["Environment variables (",c,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(qr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Tn,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No environment variables."}):e.items.map(f=>{const m=f.value.sensitive,h=f.value.value===af,y=m&&!h&&!!f.value.value,g=a.has(f.key);let b;return m?y&&g?b=f.value.value:b="••••••":b=f.value.value||u.jsx("em",{children:"(empty)"}),u.jsxs(Qy,{status:f.status,onEdit:()=>n({mode:"edit",key:f.key,initial:f.value}),onDelete:()=>e.onDelete(f.key),onUndo:()=>e.onUndoDelete(f.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono font-medium",children:f.value.key}),u.jsx("span",{className:"font-mono text-caption text-muted-foreground truncate max-w-xs",children:b}),m&&u.jsx(ej,{className:"h-3 w-3 text-muted-foreground","aria-hidden":!0}),m&&u.jsx("button",{type:"button",onClick:()=>y&&o(f.key),className:"bg-transparent border-0 cursor-pointer inline-flex items-center text-muted-foreground",title:y?g?"Hide value":"Reveal value":"Saved sensitive values can't be revealed. Edit to set a new value.","aria-label":g?"Hide value":"Reveal value",disabled:!y,style:{padding:0,opacity:y?1:.4},children:g?u.jsx(iz,{className:"h-3.5 w-3.5"}):u.jsx(Jk,{className:"h-3.5 w-3.5"})})]},f.key)})}),t&&u.jsx(sP,{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 sP({open:e,onOpenChange:t,initial:n,forbiddenKeys:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.key)??""),[f,m]=x.useState(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),[h,y]=x.useState((n==null?void 0:n.sensitive)??!1),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.key)??""),m(n!=null&&n.sensitive?"":(n==null?void 0:n.value)??""),y((n==null?void 0:n.sensitive)??!1),b(null))},[e,n]);function w(k){if(k.preventDefault(),!o.match(/^[A-Z][A-Z0-9_]*$/)){b("Key must match /^[A-Z][A-Z0-9_]*$/.");return}if(a.has(o)){b(`Another entry already uses key "${o}".`);return}let j=f;if(h&&(n!=null&&n.sensitive)&&!f&&(j=af),!h&&!n&&!f){b("Value is required for non-sensitive entries.");return}l({key:o,value:j,sensitive:h})}return u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:n?"Edit environment variable":"Add environment variable"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"env-key",children:"Key"}),u.jsx(At,{id:"env-key",value:o,onChange:k=>c(k.target.value.toUpperCase()),placeholder:"OPENAI_API_KEY",className:"font-mono",disabled:!!n}),n&&u.jsx("p",{className:"text-caption text-muted-foreground",children:"Key can't be renamed — delete and re-add."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"env-value",children:"Value"}),u.jsx(At,{id:"env-value",type:h?"password":"text",autoComplete:"new-password",value:f,onChange:k=>m(k.target.value),placeholder:n!=null&&n.sensitive?"Leave empty to keep existing value":h?"new secret":"value",className:"font-mono"})]}),u.jsxs("label",{className:"flex items-center gap-2 text-body",children:[u.jsx("input",{type:"checkbox",checked:h,onChange:k=>y(k.target.checked),className:"h-4 w-4",disabled:!!n&&n.sensitive}),"Mark as sensitive (encrypted at rest, never displayed again)"]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Sensitive values cannot be viewed after saving. If you need to verify, save a new value."}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function oP(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(tn,{children:[u.jsxs(Or,{children:[u.jsxs(Mr,{children:["Git repositories (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(qr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Tn,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No Git repositories."}):e.items.map(l=>{const o=l.value.localPath??lf(l.value.url);return u.jsxs(Qy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"font-mono text-caption",children:l.value.url}),l.value.ref&&u.jsxs("span",{className:"text-caption text-muted-foreground",children:["@ ",l.value.ref]}),u.jsxs("span",{className:"text-caption text-muted-foreground",children:["→ ",o||"./"]})]},l.key)})}),t&&u.jsx(uP,{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 uP({open:e,onOpenChange:t,initial:n,forbiddenPaths:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.url)??""),[f,m]=x.useState((n==null?void 0:n.ref)??""),[h,y]=x.useState((n==null?void 0:n.localPath)??""),[g,b]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.url)??""),m((n==null?void 0:n.ref)??""),y((n==null?void 0:n.localPath)??""),b(null))},[e,n]);function w(k){k.preventDefault();const j=o.trim();if(!j){b("URL is required.");return}const E=h.trim()||lf(j);if(E&&a.has(E)){b(`Another repo already occupies local path "${E}".`);return}const C={url:j,...f.trim()?{ref:f.trim()}:{},...h.trim()?{localPath:h.trim()}:{}};l(C)}return u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:n?"Edit Git repository":"Add Git repository"})}),u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"git-url",children:"URL"}),u.jsx(At,{id:"git-url",value:o,onChange:k=>c(k.target.value),placeholder:"git@github.com:org/repo.git",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"git-ref",children:"Ref (branch / tag / sha, optional)"}),u.jsx(At,{id:"git-ref",value:f,onChange:k=>m(k.target.value),placeholder:"main",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"git-path",children:"Local path (optional)"}),u.jsx(At,{id:"git-path",value:h,onChange:k=>y(k.target.value),placeholder:lf(o)||"repo-name",className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Relative to the session working directory. Leave empty to derive from the URL."})]}),g&&u.jsx("p",{className:"text-body text-destructive",children:g}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}function cP({name:e,displayName:t,variant:n="inline",tone:a="neutral",emptyLabel:l="—",className:o,style:c,title:f}){const m=typeof e=="string"&&e.length>0,h=typeof t=="string"&&t.length>0;if(!m&&!h)return u.jsx("span",{className:Te("mono text-label",o),style:{color:"var(--fg-4)",...c},title:f,children:l});const y=f??(m&&h?`${t} (@${e})`:h?t:`@${e}`),g=a==="accent"?"var(--accent-dim)":void 0,b=a==="accent"?"var(--accent-dim)":"var(--fg-3)";return n==="stacked"?u.jsxs("span",{className:Te("inline-flex flex-col leading-tight",o),style:{gap:1,...c},title:y??void 0,children:[h&&u.jsx("span",{className:"text-body",style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]}):u.jsxs("span",{className:Te("inline-flex items-baseline gap-1.5",o),style:c,title:y??void 0,children:[h&&u.jsx("span",{style:{color:g},children:t}),m&&u.jsxs("span",{className:"mono text-caption",style:{color:b},children:["@",e]})]})}function Ky(){return ke.get(hn("/members"))}function dP(e,t){return ke.patch(hn(`/members/${encodeURIComponent(e)}`),t)}function fP(e){return ke.delete(hn(`/members/${encodeURIComponent(e)}`))}function vE(){const{data:e}=He({queryKey:["members","name-map"],queryFn:Ky,staleTime:3e4});return x.useMemo(()=>{const t=new Map;if(e)for(const n of e)t.set(n.id,n.displayName||n.username);return n=>n?t.get(n)??n:"—"},[e])}function hP({agent:e,onSave:t}){const[n,a]=x.useState(!1),l=Ay(),o=vE(),c=e.metadata,f=c==null?void 0:c.tree,m=typeof(f==null?void 0:f.role)=="string"?f.role:null,h=Array.isArray(f==null?void 0:f.domains)?(f==null?void 0:f.domains).filter(b=>typeof b=="string"):[],y=e.managerId?o(e.managerId):null,g=e.delegateMention?l(e.delegateMention):null;return u.jsxs(tn,{children:[u.jsxs(Or,{children:[u.jsx(Mr,{children:"Profile"}),e.status==="active"&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>a(!0),children:[u.jsx(wf,{className:"h-3 w-3"})," Edit"]})]}),u.jsxs(Tn,{className:"text-body space-y-1",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-semibold",children:e.displayName}),e.name&&u.jsxs("span",{className:"ml-2 font-mono text-caption text-muted-foreground",children:["@",e.name]}),g&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"mx-2 text-muted-foreground",children:"·"}),u.jsxs("span",{className:"text-muted-foreground",children:["delegate ",u.jsx(cP,{name:g.name,displayName:g.displayName})]})]})]}),u.jsxs("div",{className:"text-caption text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1",children:[u.jsxs("span",{children:["owner ",u.jsx("span",{className:"text-foreground",children:y??"—"})]}),m&&u.jsxs("span",{children:["role ",u.jsx("span",{className:"text-foreground",children:m})]}),u.jsxs("span",{children:["type ",u.jsx(Br,{tone:e.type==="autonomous_agent"?"accent":"neutral",children:e.type})]}),u.jsxs("span",{children:["visibility"," ",u.jsx(Br,{tone:e.visibility==="organization"?"accent":"outline",children:e.visibility})]}),h.length>0&&u.jsxs("span",{children:["domains"," ",u.jsx("span",{className:"inline-flex flex-wrap gap-1 align-middle",children:h.map(b=>u.jsx(Br,{tone:"outline",children:b},b))})]})]})]}),u.jsx(mP,{agent:e,open:n,onOpenChange:a,onSave:t})]})}function mP({agent:e,open:t,onOpenChange:n,onSave:a}){var M;const{memberId:l,role:o}=Rt(),[c,f]=x.useState(e.displayName),[m,h]=x.useState(e.delegateMention??""),[y,g]=x.useState(e.visibility),[b,w]=x.useState(!1),[k,j]=x.useState(null);x.useEffect(()=>{t&&(f(e.displayName),h(e.delegateMention??""),g(e.visibility),j(null))},[t,e]);const E=e.type==="human",C=o==="admin"||e.managerId===l,R=He({queryKey:["agents-for-delegate"],queryFn:async()=>(await Yu({limit:100})).items.filter(z=>z.type==="personal_assistant"&&z.status==="active"),enabled:t&&E});async function O(B){B.preventDefault(),j(null);const z=c.trim();if(!z){j("Display name is required.");return}w(!0);try{const $={displayName:z,delegateMention:m||null};y!==e.visibility&&($.visibility=y),await a($),n(!1)}catch($){j($ instanceof Error?$.message:String($))}finally{w(!1)}}return u.jsx(sn,{open:t,onOpenChange:n,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:"Edit Identity"})}),u.jsxs("form",{onSubmit:O,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Agent name"}),u.jsx(At,{value:e.name?`@${e.name}`:"",disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Agent name is permanent after creation — used in @mentions and CLI commands."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"id-display",children:"Display Name"}),u.jsx(At,{id:"id-display",value:c,onChange:B=>f(B.target.value),placeholder:"How teammates see this agent",maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"id-visibility",children:"Visibility"}),u.jsxs("select",{id:"id-visibility",value:y,onChange:B=>g(B.target.value),disabled:!C,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",children:[u.jsx("option",{value:Pw.PRIVATE,children:"Private — only the manager"}),u.jsx("option",{value:Pw.ORGANIZATION,children:"Organization — all members"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:C?"Private agents are only visible to their manager; organization agents appear in every member's list.":"Only the manager or an admin can change this agent's visibility."})]}),E&&u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"id-delegate",children:"Delegate Mention"}),u.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:[u.jsx("option",{value:"",children:"None"}),(M=R.data)==null?void 0:M.map(B=>u.jsx("option",{value:B.uuid,children:B.displayName?`${B.displayName} (@${B.name??B.uuid})`:B.name?`@${B.name}`:B.uuid},B.uuid))]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"Assistant that acts on behalf of this agent."})]}),k&&u.jsx("p",{className:"text-body text-destructive",children:k}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>n(!1),disabled:b,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:b,children:b?"Saving…":"Save"})]})]})]})})}function pP(e){return e==="working"?"accent":e==="error"?"error":"outline"}function gP(e){const[t,n]=x.useState(null),a=e.items.filter(l=>l.status!=="deleted").length;return u.jsxs(tn,{children:[u.jsxs(Or,{children:[u.jsxs(Mr,{children:["MCP servers (",a,")"]}),!e.disabled&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>n({mode:"add"}),children:[u.jsx(qr,{className:"h-3 w-3"})," Add"]})]}),u.jsx(Tn,{className:"space-y-2",children:e.items.length===0?u.jsx("p",{className:"text-body text-muted-foreground",children:"No MCP servers. Add one to extend the agent's tools."}):e.items.map(l=>{const o=l.status==="deleted"||!e.toolHealth?"unknown":e.toolHealth(l.value.name);return u.jsxs(Qy,{status:l.status,onEdit:()=>n({mode:"edit",key:l.key,initial:l.value}),onDelete:()=>e.onDelete(l.key),onUndo:()=>e.onUndoDelete(l.key),disabled:e.disabled,children:[u.jsx("span",{className:"text-caption rounded bg-muted px-1.5 py-0.5 font-mono",children:l.value.transport}),u.jsx("span",{className:"font-medium font-mono",children:l.value.name}),u.jsx(Br,{tone:pP(o),children:o}),u.jsx("span",{className:"text-caption text-muted-foreground truncate",children:yP(l.value)})]},l.key)})}),t&&u.jsx(vP,{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 yP(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 vP({open:e,onOpenChange:t,initial:n,forbiddenNames:a,onSubmit:l}){const[o,c]=x.useState((n==null?void 0:n.transport)??"stdio"),[f,m]=x.useState((n==null?void 0:n.name)??""),[h,y]=x.useState((n==null?void 0:n.transport)==="stdio"?n.command:""),[g,b]=x.useState((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),[w,k]=x.useState(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),[j,E]=x.useState(null);x.useEffect(()=>{e&&(c((n==null?void 0:n.transport)??"stdio"),m((n==null?void 0:n.name)??""),y((n==null?void 0:n.transport)==="stdio"?n.command:""),b((n==null?void 0:n.transport)==="stdio"&&n.args?n.args.join(" "):""),k(n&&(n.transport==="http"||n.transport==="sse")?n.url:""),E(null))},[e,n]);function C(R){if(R.preventDefault(),!f.match(/^[a-z0-9][a-z0-9_-]{0,63}$/i)){E("Name must start alphanumeric and contain only a-z0-9_-.");return}if(a.has(f.toLowerCase())){E(`Another MCP server is already named "${f}".`);return}let O;if(o==="stdio"){if(!h.trim()){E("stdio transport requires a command.");return}const M=g.trim().split(/\s+/).filter(B=>B.length>0);O={name:f,transport:"stdio",command:h.trim(),...M.length?{args:M}:{}}}else{const M=w.trim();try{new URL(M)}catch{E("URL is not valid.");return}O={name:f,transport:o,url:M}}l(O)}return u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:n?"Edit MCP server":"Add MCP server"})}),u.jsxs("form",{onSubmit:C,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-transport",children:"Transport"}),u.jsxs("select",{id:"mcp-transport",value:o,onChange:R=>c(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:[u.jsx("option",{value:"stdio",children:"stdio (local subprocess)"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-name",children:"Name"}),u.jsx(At,{id:"mcp-name",value:f,onChange:R=>m(R.target.value),placeholder:"playwright",className:"font-mono"})]}),o==="stdio"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-command",children:"Command"}),u.jsx(At,{id:"mcp-command",value:h,onChange:R=>y(R.target.value),placeholder:"/usr/local/bin/playwright-mcp",className:"font-mono"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-args",children:"Args (space-separated, optional)"}),u.jsx(At,{id:"mcp-args",value:g,onChange:R=>b(R.target.value),placeholder:"--port 3000",className:"font-mono"})]})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"mcp-url",children:"URL"}),u.jsx(At,{id:"mcp-url",value:w,onChange:R=>k(R.target.value),placeholder:"https://internal.api/mcp",className:"font-mono"})]}),j&&u.jsx("p",{className:"text-body text-destructive",children:j}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),u.jsx(me,{type:"submit",children:n?"Done":"Add"})]})]})]})})}const bP=[{value:"opus",label:"opus",hint:"most capable"},{value:"sonnet",label:"sonnet",hint:"balanced"},{value:"haiku",label:"haiku",hint:"fastest"}],xP=[{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"}],wP={"claude-code":bP,codex:xP},SP={"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."},kP={value:"",label:"(unset — inherits local)"};function jP({value:e,baseline:t,onChange:n,onRevert:a,disabled:l,provider:o="claude-code"}){const c=e!==t,f=wP[o],m=x.useMemo(()=>{const h=[kP,...f];return e!==""&&!f.some(y=>y.value===e)&&h.push({value:e,label:e,hint:"custom"}),h},[f,e]);return u.jsxs(tn,{style:{borderColor:c?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Or,{children:[u.jsxs(Mr,{children:["Model",c&&u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})]}),c&&u.jsx(me,{size:"xs",variant:"ghost",onClick:a,disabled:l,children:"Revert"})]}),u.jsxs(Tn,{className:"space-y-2",children:[u.jsx(CP,{items:m,value:e,onChange:n,disabled:l}),u.jsx("p",{className:"text-caption text-muted-foreground",children:SP[o]})]})]})}function CP({items:e,value:t,onChange:n,disabled:a}){const[l,o]=x.useState(!1),[c,f]=x.useState(null),m=x.useRef(null),h=x.useRef(null),y=e.find(b=>b.value===t)??e[0],g=x.useCallback(()=>{const b=m.current;if(!b)return;const w=b.getBoundingClientRect();f({top:w.bottom+4,left:w.left,width:w.width})},[]);return x.useLayoutEffect(()=>{l&&g()},[l,g]),x.useEffect(()=>{if(!l)return;const b=j=>{var C,R;const E=j.target;(C=m.current)!=null&&C.contains(E)||(R=h.current)!=null&&R.contains(E)||o(!1)},w=j=>{var E;j.key==="Escape"&&(o(!1),(E=m.current)==null||E.focus())},k=()=>g();return document.addEventListener("pointerdown",b),document.addEventListener("keydown",w),window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{document.removeEventListener("pointerdown",b),document.removeEventListener("keydown",w),window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[l,g]),u.jsxs("div",{className:"max-w-md",children:[u.jsxs("button",{ref:m,type:"button",disabled:a,onClick:()=>o(b=>!b),className:"mono flex h-9 w-full items-center justify-between rounded-[var(--radius-input)] border border-input bg-transparent pl-3 pr-2 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 hover:border-ring transition-colors cursor-pointer","aria-haspopup":"listbox","aria-expanded":l,children:[u.jsx("span",{className:"truncate",style:{color:(y==null?void 0:y.value)===""?"var(--fg-3)":void 0},children:(y==null?void 0:y.label)??t}),u.jsx(Xk,{className:"ml-2 h-3.5 w-3.5 transition-transform",style:{color:"var(--fg-3)",transform:l?"rotate(180deg)":void 0}})]}),l&&c&&jy.createPortal(u.jsx("div",{ref:h,className:"fixed z-50 overflow-hidden rounded-[var(--radius-input)] py-1",style:{top:c.top,left:c.left,width:c.width,background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",boxShadow:"var(--shadow-md)",maxHeight:280,overflowY:"auto"},children:e.map(b=>{const w=b.value===t;return u.jsxs("button",{type:"button",onClick:()=>{n(b.value),o(!1)},className:"mono flex w-full items-center gap-2 cursor-pointer px-3 py-1.5 text-body text-left hover:bg-accent/40 transition-colors focus-visible:outline-none focus-visible:bg-accent/40",style:{background:w?"var(--bg-hover)":void 0,color:b.value===""?"var(--fg-3)":void 0},children:[u.jsx(fr,{className:"h-3.5 w-3.5 flex-shrink-0",style:{visibility:w?"visible":"hidden",color:"var(--state-idle)"}}),u.jsx("span",{className:"flex-1 truncate",children:b.label}),b.hint&&u.jsx("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:b.hint})]},b.value||"__unset")})}),document.body)]})}function EP(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const NP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_P=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TP={};function Fw(e,t){return(TP.jsx?_P:NP).test(e)}const AP=/[ \t\n\f\r]/g;function RP(e){return typeof e=="object"?e.type==="text"?qw(e.value):!1:qw(e)}function qw(e){return e.replace(AP,"")===""}class Wu{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Wu.prototype.normal={};Wu.prototype.property={};Wu.prototype.space=void 0;function bE(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Wu(n,a,t)}function Ug(e){return e.toLowerCase()}class Wn{constructor(t,n){this.attribute=n,this.property=t}}Wn.prototype.attribute="";Wn.prototype.booleanish=!1;Wn.prototype.boolean=!1;Wn.prototype.commaOrSpaceSeparated=!1;Wn.prototype.commaSeparated=!1;Wn.prototype.defined=!1;Wn.prototype.mustUseProperty=!1;Wn.prototype.number=!1;Wn.prototype.overloadedBoolean=!1;Wn.prototype.property="";Wn.prototype.spaceSeparated=!1;Wn.prototype.space=void 0;let zP=0;const Ve=Cl(),Xt=Cl(),Pg=Cl(),he=Cl(),Ct=Cl(),ks=Cl(),sr=Cl();function Cl(){return 2**++zP}const Bg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Xt,commaOrSpaceSeparated:sr,commaSeparated:ks,number:he,overloadedBoolean:Pg,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),jp=Object.keys(Bg);class Gy extends Wn{constructor(t,n,a,l){let o=-1;if(super(t,n),Hw(this,"space",l),typeof a=="number")for(;++o<jp.length;){const c=jp[o];Hw(this,jp[o],(a&Bg[c])===Bg[c])}}}Gy.prototype.defined=!0;function Hw(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 Gy(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Ug(a)]=a,n[Ug(o.attribute)]=a}return new Wu(t,n,e.space)}const xE=Js({properties:{ariaActiveDescendant:null,ariaAtomic:Xt,ariaAutoComplete:null,ariaBusy:Xt,ariaChecked:Xt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Xt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Xt,ariaFlowTo:Ct,ariaGrabbed:Xt,ariaHasPopup:null,ariaHidden:Xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:he,ariaLive:null,ariaModal:Xt,ariaMultiLine:Xt,ariaMultiSelectable:Xt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Xt,ariaReadOnly:Xt,ariaRelevant:null,ariaRequired:Xt,ariaRoleDescription:Ct,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Xt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wE(e,t){return t in e?e[t]:t}function SE(e,t){return wE(e,t.toLowerCase())}const OP=Js({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ks,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:Ct,autoFocus:Ve,autoPlay:Ve,blocking:Ct,capture:null,charSet:null,checked:Ve,cite:null,className:Ct,cols:he,colSpan:null,content:null,contentEditable:Xt,controls:Ve,controlsList:Ct,coords:he|ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Pg,draggable:Xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:Ct,height:he,hidden:Pg,high:he,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ve,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:he,pattern:null,ping:Ct,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:Ct,required:Ve,reversed:Ve,rows:he,rowSpan:he,sandbox:Ct,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Xt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Xt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:SE}),MP=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:sr,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1: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:sr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:he,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:sr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:sr,rev:sr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:sr,requiredFeatures:sr,requiredFonts:sr,requiredFormats:sr,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:sr,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:sr,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:sr,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:wE}),kE=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()}}),jE=Js({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:SE}),CE=Js({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),DP={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"},IP=/[A-Z]/g,Zw=/-[a-z]/g,LP=/^data[-\w.:]+$/i;function UP(e,t){const n=Ug(t);let a=t,l=Wn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Zw,BP);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Zw.test(o)){let c=o.replace(IP,PP);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=Gy}return new l(a,t)}function PP(e){return"-"+e.toLowerCase()}function BP(e){return e.charAt(1).toUpperCase()}const $P=bE([xE,OP,kE,jE,CE],"html"),Yy=bE([xE,MP,kE,jE,CE],"svg");function FP(e){return e.join(" ").trim()}var hs={},Cp,Vw;function qP(){if(Vw)return Cp;Vw=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
|
|
358
|
-
`,h="/",y="*",g="",b="comment",w="declaration";function k(E,C){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];C=C||{};var R=1,O=1;function M(Y){var J=Y.match(t);J&&(R+=J.length);var H=Y.lastIndexOf(m);O=~H?Y.length-H:O+Y.length}function B(){var Y={line:R,column:O};return function(J){return J.position=new z(Y),Q(),J}}function z(Y){this.start=Y,this.end={line:R,column:O},this.source=C.source}z.prototype.content=E;function $(Y){var J=new Error(C.source+":"+R+":"+O+": "+Y);if(J.reason=Y,J.filename=C.source,J.line=R,J.column=O,J.source=E,!C.silent)throw J}function U(Y){var J=Y.exec(E);if(J){var H=J[0];return M(H),E=E.slice(H.length),J}}function Q(){U(n)}function I(Y){var J;for(Y=Y||[];J=ne();)J!==!1&&Y.push(J);return Y}function ne(){var Y=B();if(!(h!=E.charAt(0)||y!=E.charAt(1))){for(var J=2;g!=E.charAt(J)&&(y!=E.charAt(J)||h!=E.charAt(J+1));)++J;if(J+=2,g===E.charAt(J-1))return $("End of comment missing");var H=E.slice(2,J-2);return O+=2,M(H),E=E.slice(J),O+=2,Y({type:b,comment:H})}}function le(){var Y=B(),J=U(a);if(J){if(ne(),!U(l))return $("property missing ':'");var H=U(o),ee=Y({type:w,property:j(J[0].replace(e,g)),value:H?j(H[0].replace(e,g)):g});return U(c),ee}}function we(){var Y=[];I(Y);for(var J;J=le();)J!==!1&&(Y.push(J),I(Y));return Y}return Q(),we()}function j(E){return E?E.replace(f,g):g}return Cp=k,Cp}var Qw;function HP(){if(Qw)return hs;Qw=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(qP());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:y}=m;f?l(h,y,m):y&&(o=o||{},o[h]=y)}),o}return hs}var iu={},Kw;function ZP(){if(Kw)return iu;Kw=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,y){return y.toUpperCase()},f=function(h,y){return"".concat(y,"-")},m=function(h,y){return y===void 0&&(y={}),o(h)?h:(h=h.toLowerCase(),y.reactCompat?h=h.replace(l,f):h=h.replace(a,f),h.replace(t,c))};return iu.camelCase=m,iu}var lu,Gw;function VP(){if(Gw)return lu;Gw=1;var e=lu&&lu.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(HP()),n=ZP();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(c[(0,n.camelCase)(f,o)]=m)}),c}return a.default=a,lu=a,lu}var QP=VP();const KP=mf(QP),EE=NE("end"),Xy=NE("start");function NE(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 GP(e){const t=Xy(e),n=EE(e);if(t&&n)return{start:t,end:n}}function pu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yw(e.position):"start"in e||"end"in e?Yw(e):"line"in e||"column"in e?$g(e):""}function $g(e){return Xw(e&&e.line)+":"+Xw(e&&e.column)}function Yw(e){return $g(e&&e.start)+"-"+$g(e&&e.end)}function Xw(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=pu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const Jy={}.hasOwnProperty,YP=new Map,XP=/[A-Z]/g,JP=new Set(["table","tbody","thead","tfoot","tr"]),WP=new Set(["td","th"]),_E="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e9(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=o9(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=s9(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"?Yy:$P,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=TE(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function TE(e,t,n){if(t.type==="element")return t9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return n9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return a9(e,t,n);if(t.type==="mdxjsEsm")return r9(e,t);if(t.type==="root")return i9(e,t,n);if(t.type==="text")return l9(e,t)}function t9(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=Yy,e.schema=l),e.ancestors.push(t);const o=RE(e,t.tagName,!1),c=u9(e,t);let f=ev(e,t);return JP.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!RP(m):!0})),AE(e,c,o,t),Wy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function n9(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)}Ou(e,t.position)}function r9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ou(e,t.position)}function a9(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=Yy,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:RE(e,t.name,!0),c=c9(e,t),f=ev(e,t);return AE(e,c,o,t),Wy(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function i9(e,t,n){const a={};return Wy(a,ev(e,t)),e.create(t,e.Fragment,a,n)}function l9(e,t){return t.value}function AE(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Wy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function s9(e,t,n){return a;function a(l,o,c,f){const h=Array.isArray(c.children)?n:t;return f?h(o,c,f):h(o,c)}}function o9(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),m=Xy(a);return t(l,o,c,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function u9(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&Jy.call(t.properties,l)){const o=d9(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&WP.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function c9(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Ou(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 Ou(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function ev(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:YP;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;c=m+"-"+h,l.set(m,h+1)}}const f=TE(e,o,c);f!==void 0&&n.push(f)}return n}function d9(e,t,n){const a=UP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?EP(n):FP(n)),a.property==="style"){let l=typeof n=="object"?n:f9(e,String(n));return e.stylePropertyNameCase==="css"&&(l=h9(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?DP[a.property]||a.property:a.attribute,n]}}function f9(e,t){try{return KP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new An("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=_E+"#cannot-parse-style-attribute",l}}function RE(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=Fw(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=Fw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return Jy.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Ou(e)}function Ou(e,t){const n=new An("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=_E+"#cannot-handle-mdx-estrees-without-createevaluater",n}function h9(e){const t={};let n;for(n in e)Jy.call(e,n)&&(t[m9(n)]=e[n]);return t}function m9(e){let t=e.replace(XP,p9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function p9(e){return"-"+e.toLowerCase()}const Ep={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"]},g9={};function tv(e,t){const n=g9,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return zE(e,a,l)}function zE(e,t,n){if(y9(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 Jw(e.children,t,n)}return Array.isArray(e)?Jw(e,t,n):""}function Jw(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=zE(e[l],t,n);return a.join("")}function y9(e){return!!(e&&typeof e=="object")}const Ww=document.createElement("i");function nv(e){const t="&"+e+";";Ww.innerHTML=t;const n=Ww.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function dr(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function _r(e,t){return e.length>0?(dr(e,e.length,0,t),e):t}const eS={}.hasOwnProperty;function OE(e){const t={};let n=-1;for(;++n<e.length;)v9(t,e[n]);return t}function v9(e,t){let n;for(n in t){const l=(eS.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){eS.call(l,c)||(l[c]=[]);const f=o[c];b9(l[c],Array.isArray(f)?f:f?[f]:[])}}}function b9(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);dr(e,0,0,a)}function ME(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=Di(/[A-Za-z]/),_n=Di(/[\dA-Za-z]/),x9=Di(/[#-'*+\--9=?A-Z^-~]/);function of(e){return e!==null&&(e<32||e===127)}const Fg=Di(/\d/),w9=Di(/[\dA-Fa-f]/),S9=Di(/[!-/:-@[-`{-~]/);function De(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const Mf=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 c="";if(o===37&&_n(e.charCodeAt(n+1))&&_n(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function ot(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return et(m)?(e.enter(n),f(m)):t(m)}function f(m){return et(m)&&o++<l?(e.consume(m),f):(e.exit(n),t(m))}}const k9={tokenize:j9};function j9(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ot(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return De(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const C9={tokenize:E9},tS={tokenize:N9};function E9(e){const t=this,n=[];let a=0,l,o,c;return f;function f(O){if(a<n.length){const M=n[a];return t.containerState=M[1],e.attempt(M[0].continuation,m,h)(O)}return h(O)}function m(O){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&R();const M=t.events.length;let B=M,z;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){z=t.events[B][1].end;break}C(a);let $=M;for(;$<t.events.length;)t.events[$][1].end={...z},$++;return dr(t.events,B+1,0,t.events.slice(M)),t.events.length=$,h(O)}return f(O)}function h(O){if(a===n.length){if(!l)return b(O);if(l.currentConstruct&&l.currentConstruct.concrete)return k(O);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(tS,y,g)(O)}function y(O){return l&&R(),C(a),b(O)}function g(O){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,k(O)}function b(O){return t.containerState={},e.attempt(tS,w,k)(O)}function w(O){return a++,n.push([t.currentConstruct,t.containerState]),b(O)}function k(O){if(O===null){l&&R(),C(0),e.consume(O);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),j(O)}function j(O){if(O===null){E(e.exit("chunkFlow"),!0),C(0),e.consume(O);return}return De(O)?(e.consume(O),E(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(O),j)}function E(O,M){const B=t.sliceStream(O);if(M&&B.push(null),O.previous=o,o&&(o.next=O),o=O,l.defineSkip(O.start),l.write(B),t.parser.lazy[O.start.line]){let z=l.events.length;for(;z--;)if(l.events[z][1].start.offset<c&&(!l.events[z][1].end||l.events[z][1].end.offset>c))return;const $=t.events.length;let U=$,Q,I;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(Q){I=t.events[U][1].end;break}Q=!0}for(C(a),z=$;z<t.events.length;)t.events[z][1].end={...I},z++;dr(t.events,U+1,0,t.events.slice($)),t.events.length=z}}function C(O){let M=n.length;for(;M-- >O;){const B=n[M];t.containerState=B[1],B[0].exit.call(t,e)}n.length=O}function R(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function N9(e,t,n){return ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fs(e){if(e===null||jt(e)||bl(e))return 1;if(Mf(e))return 2}function Df(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 qg={name:"attention",resolveAll:_9,tokenize:T9};function _9(e,t){let n=-1,a,l,o,c,f,m,h,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;m=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},b={...e[n][1].start};nS(g,-m),nS(b,m),c={type:m>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:m>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=_r(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=_r(h,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=_r(h,Df(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=_r(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=_r(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,dr(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 T9(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Fs(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),y=Fs(m),g=!y||y===2&&l||n.includes(m),b=!l||l===2&&y||n.includes(a);return h._open=!!(o===42?g:g&&(l||!b)),h._close=!!(o===42?b:b&&(y||!g)),t(m)}}function nS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const A9={name:"autolink",tokenize:R9};function R9(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 In(w)?(e.consume(w),c):w===64?n(w):h(w)}function c(w){return w===43||w===45||w===46||_n(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||_n(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||of(w)?n(w):(e.consume(w),m)}function h(w){return w===64?(e.consume(w),y):x9(w)?(e.consume(w),h):n(w)}function y(w){return _n(w)?g(w):n(w)}function g(w){return w===46?(e.consume(w),a=0,y):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):b(w)}function b(w){if((w===45||_n(w))&&a++<63){const k=w===45?b:g;return e.consume(w),k}return n(w)}}const ec={partial:!0,tokenize:z9};function z9(e,t,n){return a;function a(o){return et(o)?ot(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||De(o)?t(o):n(o)}}const DE={continuation:{tokenize:M9},exit:D9,name:"blockQuote",tokenize:O9};function O9(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return et(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function M9(e,t,n){const a=this;return l;function l(c){return et(c)?ot(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(DE,t,n)(c)}}function D9(e){e.exit("blockQuote")}const IE={name:"characterEscape",tokenize:I9};function I9(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 S9(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const LE={name:"characterReference",tokenize:L9};function L9(e,t,n){const a=this;let l=0,o,c;return f;function f(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),m}function m(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=_n,y(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=w9,y):(e.enter("characterReferenceValue"),o=7,c=Fg,y(g))}function y(g){if(g===59&&l){const b=e.exit("characterReferenceValue");return c===_n&&!nv(a.sliceSerialize(b))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(g)&&l++<o?(e.consume(g),y):n(g)}}const rS={partial:!0,tokenize:P9},aS={concrete:!0,name:"codeFenced",tokenize:U9};function U9(e,t,n){const a=this,l={partial:!0,tokenize:B};let o=0,c=0,f;return m;function m(z){return h(z)}function h(z){const $=a.events[a.events.length-1];return o=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=z,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(z)}function y(z){return z===f?(c++,e.consume(z),y):c<3?n(z):(e.exit("codeFencedFenceSequence"),et(z)?ot(e,g,"whitespace")(z):g(z))}function g(z){return z===null||De(z)?(e.exit("codeFencedFence"),a.interrupt?t(z):e.check(rS,j,M)(z)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===null||De(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(z)):et(z)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ot(e,w,"whitespace")(z)):z===96&&z===f?n(z):(e.consume(z),b)}function w(z){return z===null||De(z)?g(z):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(z))}function k(z){return z===null||De(z)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(z)):z===96&&z===f?n(z):(e.consume(z),k)}function j(z){return e.attempt(l,M,E)(z)}function E(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),C}function C(z){return o>0&&et(z)?ot(e,R,"linePrefix",o+1)(z):R(z)}function R(z){return z===null||De(z)?e.check(rS,j,M)(z):(e.enter("codeFlowValue"),O(z))}function O(z){return z===null||De(z)?(e.exit("codeFlowValue"),R(z)):(e.consume(z),O)}function M(z){return e.exit("codeFenced"),t(z)}function B(z,$,U){let Q=0;return I;function I(J){return z.enter("lineEnding"),z.consume(J),z.exit("lineEnding"),ne}function ne(J){return z.enter("codeFencedFence"),et(J)?ot(z,le,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):le(J)}function le(J){return J===f?(z.enter("codeFencedFenceSequence"),we(J)):U(J)}function we(J){return J===f?(Q++,z.consume(J),we):Q>=c?(z.exit("codeFencedFenceSequence"),et(J)?ot(z,Y,"whitespace")(J):Y(J)):U(J)}function Y(J){return J===null||De(J)?(z.exit("codeFencedFence"),$(J)):U(J)}}}function P9(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Np={name:"codeIndented",tokenize:$9},B9={partial:!0,tokenize:F9};function $9(e,t,n){const a=this;return l;function l(h){return e.enter("codeIndented"),ot(e,o,"linePrefix",5)(h)}function o(h){const y=a.events[a.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):De(h)?e.attempt(B9,c,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||De(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function F9(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):De(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):ot(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):De(c)?l(c):n(c)}}const q9={name:"codeText",previous:Z9,resolve:H9,tokenize:V9};function H9(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 Z9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function V9(e,t,n){let a=0,l,o;return c;function c(g){return e.enter("codeText"),e.enter("codeTextSequence"),f(g)}function f(g){return g===96?(e.consume(g),a++,f):(e.exit("codeTextSequence"),m(g))}function m(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),m):g===96?(o=e.enter("codeTextSequence"),l=0,y(g)):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 Q9{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&&su(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),su(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),su(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);su(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);su(this.left,n.reverse())}}}function su(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 UE(e){const t={};let n=-1,a,l,o,c,f,m,h;const y=new Q9(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,K9(y,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=y.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(y.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...y.get(l)[1].start},f=y.slice(l,n),f.unshift(a),y.splice(l,n-l+1,f))}}return dr(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!h}function K9(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,m=[],h={};let y,g,b=-1,w=n,k=0,j=0;const E=[j];for(;w;){for(;e.get(++l)[1]!==w;);o.push(l),w._tokenizer||(y=a.sliceStream(w),w.next||y.push(null),g&&c.defineSkip(w.start),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(y),w._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,E.push(j),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(c.events=[],w?(w._tokenizer=void 0,w.previous=void 0):E.pop(),b=E.length;b--;){const C=f.slice(E[b],E[b+1]),R=o.pop();m.push([R,R+C.length-1]),e.splice(R,2,C)}for(m.reverse(),b=-1;++b<m.length;)h[k+m[b][0]]=k+m[b][1],k+=m[b][1]-m[b][0]-1;return h}const G9={resolve:X9,tokenize:J9},Y9={partial:!0,tokenize:W9};function X9(e){return UE(e),e}function J9(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(Y9,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function W9(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),ot(e,o,"linePrefix")}function o(c){if(c===null||De(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function PE(e,t,n,a,l,o,c,f,m){const h=m||Number.POSITIVE_INFINITY;let y=0;return g;function g(C){return C===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||of(C)?n(C):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),w(C))}function w(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||De(C)?n(C):(e.consume(C),C===92?k:w)}function k(C){return C===60||C===62||C===92?(e.consume(C),w):w(C)}function j(C){return!y&&(C===null||C===41||jt(C))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(C)):y<h&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||of(C)?n(C):(e.consume(C),C===92?E:j)}function E(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function BE(e,t,n,a,l,o){const c=this;let f=0,m;return h;function h(w){return e.enter(a),e.enter(l),e.consume(w),e.exit(l),e.enter(o),y}function y(w){return f>999||w===null||w===91||w===93&&!m||w===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(w):w===93?(e.exit(o),e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):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=!et(w)),w===92?b:g)}function b(w){return w===91||w===92||w===93?(e.consume(w),f++,g):g(w)}}function $E(e,t,n,a,l,o){let c;return f;function f(b){return b===34||b===39||b===40?(e.enter(a),e.enter(l),e.consume(b),e.exit(l),c=b===40?41:b,m):n(b)}function m(b){return b===c?(e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):(e.enter(o),h(b))}function h(b){return b===c?(e.exit(o),m(c)):b===null?n(b):De(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),ot(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===c||b===null||De(b)?(e.exit("chunkString"),h(b)):(e.consume(b),b===92?g:y)}function g(b){return b===c||b===92?(e.consume(b),y):y(b)}}function gu(e,t){let n;return a;function a(l){return De(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):et(l)?ot(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const e8={name:"definition",tokenize:n8},t8={partial:!0,tokenize:r8};function n8(e,t,n){const a=this;let l;return o;function o(w){return e.enter("definition"),c(w)}function c(w){return BE.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function f(w){return l=Fr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),m):n(w)}function m(w){return jt(w)?gu(e,h)(w):h(w)}function h(w){return PE(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function y(w){return e.attempt(t8,g,g)(w)}function g(w){return et(w)?ot(e,b,"whitespace")(w):b(w)}function b(w){return w===null||De(w)?(e.exit("definition"),a.parser.defined.push(l),t(w)):n(w)}}function r8(e,t,n){return a;function a(f){return jt(f)?gu(e,l)(f):n(f)}function l(f){return $E(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return et(f)?ot(e,c,"whitespace")(f):c(f)}function c(f){return f===null||De(f)?t(f):n(f)}}const a8={name:"hardBreakEscape",tokenize:i8};function i8(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 l8={name:"headingAtx",resolve:s8,tokenize:o8};function s8(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"},dr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function o8(e,t,n){let a=0;return l;function l(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),c(y)}function c(y){return y===35&&a++<6?(e.consume(y),c):y===null||jt(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),m(y)):y===null||De(y)?(e.exit("atxHeading"),t(y)):et(y)?ot(e,f,"whitespace")(y):(e.enter("atxHeadingText"),h(y))}function m(y){return y===35?(e.consume(y),m):(e.exit("atxHeadingSequence"),f(y))}function h(y){return y===null||y===35||jt(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),h)}}const u8=["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"],iS=["pre","script","style","textarea"],c8={concrete:!0,name:"htmlFlow",resolveTo:h8,tokenize:m8},d8={partial:!0,tokenize:g8},f8={partial:!0,tokenize:p8};function h8(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 m8(e,t,n){const a=this;let l,o,c,f,m;return h;function h(T){return y(T)}function y(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),g}function g(T){return T===33?(e.consume(T),b):T===47?(e.consume(T),o=!0,j):T===63?(e.consume(T),l=3,a.interrupt?t:A):In(T)?(e.consume(T),c=String.fromCharCode(T),E):n(T)}function b(T){return T===45?(e.consume(T),l=2,w):T===91?(e.consume(T),l=5,f=0,k):In(T)?(e.consume(T),l=4,a.interrupt?t:A):n(T)}function w(T){return T===45?(e.consume(T),a.interrupt?t:A):n(T)}function k(T){const Z="CDATA[";return T===Z.charCodeAt(f++)?(e.consume(T),f===Z.length?a.interrupt?t:le:k):n(T)}function j(T){return In(T)?(e.consume(T),c=String.fromCharCode(T),E):n(T)}function E(T){if(T===null||T===47||T===62||jt(T)){const Z=T===47,W=c.toLowerCase();return!Z&&!o&&iS.includes(W)?(l=1,a.interrupt?t(T):le(T)):u8.includes(c.toLowerCase())?(l=6,Z?(e.consume(T),C):a.interrupt?t(T):le(T)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):o?R(T):O(T))}return T===45||_n(T)?(e.consume(T),c+=String.fromCharCode(T),E):n(T)}function C(T){return T===62?(e.consume(T),a.interrupt?t:le):n(T)}function R(T){return et(T)?(e.consume(T),R):I(T)}function O(T){return T===47?(e.consume(T),I):T===58||T===95||In(T)?(e.consume(T),M):et(T)?(e.consume(T),O):I(T)}function M(T){return T===45||T===46||T===58||T===95||_n(T)?(e.consume(T),M):B(T)}function B(T){return T===61?(e.consume(T),z):et(T)?(e.consume(T),B):O(T)}function z(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),m=T,$):et(T)?(e.consume(T),z):U(T)}function $(T){return T===m?(e.consume(T),m=null,Q):T===null||De(T)?n(T):(e.consume(T),$)}function U(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||jt(T)?B(T):(e.consume(T),U)}function Q(T){return T===47||T===62||et(T)?O(T):n(T)}function I(T){return T===62?(e.consume(T),ne):n(T)}function ne(T){return T===null||De(T)?le(T):et(T)?(e.consume(T),ne):n(T)}function le(T){return T===45&&l===2?(e.consume(T),H):T===60&&l===1?(e.consume(T),ee):T===62&&l===4?(e.consume(T),L):T===63&&l===3?(e.consume(T),A):T===93&&l===5?(e.consume(T),Ae):De(T)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(d8,P,we)(T)):T===null||De(T)?(e.exit("htmlFlowData"),we(T)):(e.consume(T),le)}function we(T){return e.check(f8,Y,P)(T)}function Y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),J}function J(T){return T===null||De(T)?we(T):(e.enter("htmlFlowData"),le(T))}function H(T){return T===45?(e.consume(T),A):le(T)}function ee(T){return T===47?(e.consume(T),c="",be):le(T)}function be(T){if(T===62){const Z=c.toLowerCase();return iS.includes(Z)?(e.consume(T),L):le(T)}return In(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),be):le(T)}function Ae(T){return T===93?(e.consume(T),A):le(T)}function A(T){return T===62?(e.consume(T),L):T===45&&l===2?(e.consume(T),A):le(T)}function L(T){return T===null||De(T)?(e.exit("htmlFlowData"),P(T)):(e.consume(T),L)}function P(T){return e.exit("htmlFlow"),t(T)}}function p8(e,t,n){const a=this;return l;function l(c){return De(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function g8(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(ec,t,n)}}const y8={name:"htmlText",tokenize:v8};function v8(e,t,n){const a=this;let l,o,c;return f;function f(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),B):A===63?(e.consume(A),O):In(A)?(e.consume(A),U):n(A)}function h(A){return A===45?(e.consume(A),y):A===91?(e.consume(A),o=0,k):In(A)?(e.consume(A),R):n(A)}function y(A){return A===45?(e.consume(A),w):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),b):De(A)?(c=g,ee(A)):(e.consume(A),g)}function b(A){return A===45?(e.consume(A),w):g(A)}function w(A){return A===62?H(A):A===45?b(A):g(A)}function k(A){const L="CDATA[";return A===L.charCodeAt(o++)?(e.consume(A),o===L.length?j:k):n(A)}function j(A){return A===null?n(A):A===93?(e.consume(A),E):De(A)?(c=j,ee(A)):(e.consume(A),j)}function E(A){return A===93?(e.consume(A),C):j(A)}function C(A){return A===62?H(A):A===93?(e.consume(A),C):j(A)}function R(A){return A===null||A===62?H(A):De(A)?(c=R,ee(A)):(e.consume(A),R)}function O(A){return A===null?n(A):A===63?(e.consume(A),M):De(A)?(c=O,ee(A)):(e.consume(A),O)}function M(A){return A===62?H(A):O(A)}function B(A){return In(A)?(e.consume(A),z):n(A)}function z(A){return A===45||_n(A)?(e.consume(A),z):$(A)}function $(A){return De(A)?(c=$,ee(A)):et(A)?(e.consume(A),$):H(A)}function U(A){return A===45||_n(A)?(e.consume(A),U):A===47||A===62||jt(A)?Q(A):n(A)}function Q(A){return A===47?(e.consume(A),H):A===58||A===95||In(A)?(e.consume(A),I):De(A)?(c=Q,ee(A)):et(A)?(e.consume(A),Q):H(A)}function I(A){return A===45||A===46||A===58||A===95||_n(A)?(e.consume(A),I):ne(A)}function ne(A){return A===61?(e.consume(A),le):De(A)?(c=ne,ee(A)):et(A)?(e.consume(A),ne):Q(A)}function le(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,we):De(A)?(c=le,ee(A)):et(A)?(e.consume(A),le):(e.consume(A),Y)}function we(A){return A===l?(e.consume(A),l=void 0,J):A===null?n(A):De(A)?(c=we,ee(A)):(e.consume(A),we)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||jt(A)?Q(A):(e.consume(A),Y)}function J(A){return A===47||A===62||jt(A)?Q(A):n(A)}function H(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function ee(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),be}function be(A){return et(A)?ot(e,Ae,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Ae(A)}function Ae(A){return e.enter("htmlTextData"),c(A)}}const rv={name:"labelEnd",resolveAll:S8,resolveTo:k8,tokenize:j8},b8={tokenize:C8},x8={tokenize:E8},w8={tokenize:N8};function S8(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&&dr(e,0,e.length,n),e}function k8(e,t){let n=e.length,a=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},y={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=_r(f,e.slice(o+1,o+a+3)),f=_r(f,[["enter",y,t]]),f=_r(f,Df(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=_r(f,[["exit",y,t],e[c-2],e[c-1],["exit",h,t]]),f=_r(f,e.slice(c+1)),f=_r(f,[["exit",m,t]]),dr(e,o,e.length,f),e}function j8(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(b){return o?o._inactive?g(b):(c=a.parser.defined.includes(Fr(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),m):n(b)}function m(b){return b===40?e.attempt(b8,y,c?y:g)(b):b===91?e.attempt(x8,y,c?h:g)(b):c?y(b):g(b)}function h(b){return e.attempt(w8,y,g)(b)}function y(b){return t(b)}function g(b){return o._balanced=!0,n(b)}}function C8(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),l}function l(g){return jt(g)?gu(e,o)(g):o(g)}function o(g){return g===41?y(g):PE(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function c(g){return jt(g)?gu(e,m)(g):y(g)}function f(g){return n(g)}function m(g){return g===34||g===39||g===40?$E(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function h(g){return jt(g)?gu(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 E8(e,t,n){const a=this;return l;function l(f){return BE.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Fr(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function N8(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 _8={name:"labelStartImage",resolveAll:rv.resolveAll,tokenize:T8};function T8(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const A8={name:"labelStartLink",resolveAll:rv.resolveAll,tokenize:R8};function R8(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const _p={name:"lineEnding",tokenize:z8};function z8(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ot(e,t,"linePrefix")}}const Qd={name:"thematicBreak",tokenize:O8};function O8(e,t,n){let a=0,l;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||De(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===l?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),et(h)?ot(e,f,"whitespace")(h):f(h))}}const Qn={continuation:{tokenize:L8},exit:P8,name:"list",tokenize:I8},M8={partial:!0,tokenize:B8},D8={partial:!0,tokenize:U8};function I8(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(w){const k=a.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!a.containerState.marker||w===a.containerState.marker:Fg(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 Fg(w)&&++c<10?(e.consume(w),m):(!a.interrupt||c<2)&&(a.containerState.marker?w===a.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),h(w)):n(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||w,e.check(ec,a.interrupt?n:y,e.attempt(M8,b,g))}function y(w){return a.containerState.initialBlankLine=!0,o++,b(w)}function g(w){return et(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),b):n(w)}function b(w){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function L8(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(ec,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ot(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!et(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(D8,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,ot(e,e.attempt(Qn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function U8(e,t,n){const a=this;return ot(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function P8(e){e.exit(this.containerState.type)}function B8(e,t,n){const a=this;return ot(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!et(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const lS={name:"setextUnderline",resolveTo:$8,tokenize:F8};function $8(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function F8(e,t,n){const a=this;let l;return o;function o(h){let y=a.events.length,g;for(;y--;)if(a.events[y][1].type!=="lineEnding"&&a.events[y][1].type!=="linePrefix"&&a.events[y][1].type!=="content"){g=a.events[y][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),l=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),et(h)?ot(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||De(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const q8={tokenize:H8};function H8(e){const t=this,n=e.attempt(ec,a,e.attempt(this.parser.constructs.flowInitial,l,ot(e,e.attempt(this.parser.constructs.flow,l,e.attempt(G9,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 Z8={resolveAll:qE()},V8=FE("string"),Q8=FE("text");function FE(e){return{resolveAll:qE(e==="text"?K8:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(y){return h(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),m}function m(y){return h(y)?(n.exit("data"),o(y)):(n.consume(y),m)}function h(y){if(y===null)return!0;const g=l[y];let b=-1;if(g)for(;++b<g.length;){const w=g[b];if(!w.previous||w.previous.call(a,a.previous))return!0}return!1}}}function qE(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 K8(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const h={type:n===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const G8={42:Qn,43:Qn,45:Qn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,62:DE},Y8={91:e8},X8={[-2]:Np,[-1]:Np,32:Np},J8={35:l8,42:Qd,45:[lS,Qd],60:c8,61:lS,95:Qd,96:aS,126:aS},W8={38:LE,92:IE},eB={[-5]:_p,[-4]:_p,[-3]:_p,33:_8,38:LE,42:qg,60:[A9,y8],91:A8,92:[a8,IE],93:rv,95:qg,96:q9},tB={null:[qg,Z8]},nB={null:[42,95]},rB={null:[]},aB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nB,contentInitial:Y8,disable:rB,document:G8,flow:J8,flowInitial:X8,insideSpan:tB,string:W8,text:eB},Symbol.toStringTag,{value:"Module"}));function iB(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const m={attempt:$(B),check:$(z),consume:R,enter:O,exit:M,interrupt:$(z,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:w,write:g};let y=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function g(ne){return c=_r(c,ne),E(),c[c.length-1]!==null?[]:(U(t,0),h.events=Df(o,h.events,h),h.events)}function b(ne,le){return sB(w(ne),le)}function w(ne){return lB(c,ne)}function k(){const{_bufferIndex:ne,_index:le,line:we,column:Y,offset:J}=a;return{_bufferIndex:ne,_index:le,line:we,column:Y,offset:J}}function j(ne){l[ne.line]=ne.column,I()}function E(){let ne;for(;a._index<c.length;){const le=c[a._index];if(typeof le=="string")for(ne=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ne&&a._bufferIndex<le.length;)C(le.charCodeAt(a._bufferIndex));else C(le)}}function C(ne){y=y(ne)}function R(ne){De(ne)?(a.line++,a.column=1,a.offset+=ne===-3?2:1,I()):ne!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ne}function O(ne,le){const we=le||{};return we.type=ne,we.start=k(),h.events.push(["enter",we,h]),f.push(we),we}function M(ne){const le=f.pop();return le.end=k(),h.events.push(["exit",le,h]),le}function B(ne,le){U(ne,le.from)}function z(ne,le){le.restore()}function $(ne,le){return we;function we(Y,J,H){let ee,be,Ae,A;return Array.isArray(Y)?P(Y):"tokenize"in Y?P([Y]):L(Y);function L(ce){return ve;function ve(ge){const fe=ge!==null&&ce[ge],Qe=ge!==null&&ce.null,Oe=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(Qe)?Qe:Qe?[Qe]:[]];return P(Oe)(ge)}}function P(ce){return ee=ce,be=0,ce.length===0?H:T(ce[be])}function T(ce){return ve;function ve(ge){return A=Q(),Ae=ce,ce.partial||(h.currentConstruct=ce),ce.name&&h.parser.constructs.disable.null.includes(ce.name)?W():ce.tokenize.call(le?Object.assign(Object.create(h),le):h,m,Z,W)(ge)}}function Z(ce){return ne(Ae,A),J}function W(ce){return A.restore(),++be<ee.length?T(ee[be]):H}}}function U(ne,le){ne.resolveAll&&!o.includes(ne)&&o.push(ne),ne.resolve&&dr(h.events,le,h.events.length-le,ne.resolve(h.events.slice(le),h)),ne.resolveTo&&(h.events=ne.resolveTo(h.events,h))}function Q(){const ne=k(),le=h.previous,we=h.currentConstruct,Y=h.events.length,J=Array.from(f);return{from:Y,restore:H};function H(){a=ne,h.previous=le,h.currentConstruct=we,h.events.length=Y,f=J,I()}}function I(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function lB(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function sB(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
359
|
-
`;break}case-3:{c=`\r
|
|
360
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function oB(e){const a={constructs:OE([aB,...(e||{}).extensions||[]]),content:l(k9),defined:[],document:l(C9),flow:l(q8),lazy:{},string:l(V8),text:l(Q8)};return a;function l(o){return c;function c(f){return iB(a,o,f)}}}function uB(e){for(;!UE(e););return e}const sS=/[\0\t\n\r]/g;function cB(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const m=[];let h,y,g,b,w;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(sS.lastIndex=g,h=sS.exec(o),b=h&&h.index!==void 0?h.index:o.length,w=o.charCodeAt(b),!h){t=o.slice(g);break}if(w===10&&g===b&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),g<b&&(m.push(o.slice(g,b)),e+=b-g),w){case 0:{m.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,m.push(-2);e++<y;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}g=b+1}return f&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const dB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fB(e){return e.replace(dB,hB)}function hB(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return ME(n.slice(o?2:1),o?16:10)}return nv(n)||e}const HE={}.hasOwnProperty;function mB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),pB(n)(uB(oB(n).document().write(cB()(e,t,!0))))}function pB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Da),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:o(Me),blockQuote:o(Qe),characterEscape:Q,characterReference:Q,codeFenced:o(Oe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Oe,c),codeText:o(ut,c),codeTextData:Q,data:Q,codeFlowValue:Q,definition:o(ae),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Se),hardBreakEscape:o(Ge),hardBreakTrailing:o(Ge),htmlFlow:o(Rn,c),htmlFlowData:Q,htmlText:o(Rn,c),htmlTextData:Q,image:o(zn),label:c,link:o(Da),listItem:o(ra),listItemValue:b,listOrdered:o(Ia,g),listUnordered:o(Ia),paragraph:o(ro),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Me),strong:o(ao),thematicBreak:o(io)},exit:{atxHeading:m(),atxHeadingSequence:B,autolink:m(),autolinkEmail:fe,autolinkProtocol:ge,blockQuote:m(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:ce,characterReference:ve,codeFenced:m(E),codeFencedFence:j,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:m(C),codeText:m(J),codeTextData:I,data:I,definition:m(),definitionDestinationString:M,definitionLabelString:R,definitionTitleString:O,emphasis:m(),hardBreakEscape:m(le),hardBreakTrailing:m(le),htmlFlow:m(we),htmlFlowData:I,htmlText:m(Y),htmlTextData:I,image:m(ee),label:Ae,labelText:be,lineEnding:ne,link:m(H),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:Z,resourceDestinationString:A,resourceTitleString:L,resource:P,setextHeading:m(U),setextHeadingLineSequence:$,setextHeadingText:z,strong:m(),thematicBreak:m()}};ZE(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(se){let ye={type:"root",children:[]};const Pe={stack:[ye],tokenStack:[],config:t,enter:f,exit:h,buffer:c,resume:y,data:n},$e=[];let rt=-1;for(;++rt<se.length;)if(se[rt][1].type==="listOrdered"||se[rt][1].type==="listUnordered")if(se[rt][0]==="enter")$e.push(rt);else{const pn=$e.pop();rt=l(se,pn,rt)}for(rt=-1;++rt<se.length;){const pn=t[se[rt][0]];HE.call(pn,se[rt][1].type)&&pn[se[rt][1].type].call(Object.assign({sliceSerialize:se[rt][2].sliceSerialize},Pe),se[rt][1])}if(Pe.tokenStack.length>0){const pn=Pe.tokenStack[Pe.tokenStack.length-1];(pn[1]||oS).call(Pe,void 0,pn[0])}for(ye.position={start:ci(se.length>0?se[0][1].start:{line:1,column:1,offset:0}),end:ci(se.length>0?se[se.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)ye=t.transforms[rt](ye)||ye;return ye}function l(se,ye,Pe){let $e=ye-1,rt=-1,pn=!1,mr,rn,qt,gn;for(;++$e<=Pe;){const mt=se[$e];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?rt++:rt--,gn=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(mr&&!gn&&!rt&&!qt&&(qt=$e),gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:gn=void 0}if(!rt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||rt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(mr){let Dr=$e;for(rn=void 0;Dr--;){const Pn=se[Dr];if(Pn[1].type==="lineEnding"||Pn[1].type==="lineEndingBlank"){if(Pn[0]==="exit")continue;rn&&(se[rn][1].type="lineEndingBlank",pn=!0),Pn[1].type="lineEnding",rn=Dr}else if(!(Pn[1].type==="linePrefix"||Pn[1].type==="blockQuotePrefix"||Pn[1].type==="blockQuotePrefixWhitespace"||Pn[1].type==="blockQuoteMarker"||Pn[1].type==="listItemIndent"))break}qt&&(!rn||qt<rn)&&(mr._spread=!0),mr.end=Object.assign({},rn?se[rn][1].start:mt[1].end),se.splice(rn||$e,0,["exit",mr,mt[2]]),$e++,Pe++}if(mt[1].type==="listItemPrefix"){const Dr={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};mr=Dr,se.splice($e,0,["enter",Dr,mt[2]]),$e++,Pe++,qt=void 0,gn=!0}}}return se[ye][1]._spread=pn,Pe}function o(se,ye){return Pe;function Pe($e){f.call(this,se($e),$e),ye&&ye.call(this,$e)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(se,ye,Pe){this.stack[this.stack.length-1].children.push(se),this.stack.push(se),this.tokenStack.push([ye,Pe||void 0]),se.position={start:ci(ye.start),end:void 0}}function m(se){return ye;function ye(Pe){se&&se.call(this,Pe),h.call(this,Pe)}}function h(se,ye){const Pe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==se.type&&(ye?ye.call(this,se,$e[0]):($e[1]||oS).call(this,se,$e[0]));else throw new Error("Cannot close `"+se.type+"` ("+pu({start:se.start,end:se.end})+"): it’s not open");Pe.position.end=ci(se.end)}function y(){return tv(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function b(se){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(se),10),this.data.expectingFirstListItemValue=void 0}}function w(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=se}function k(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=se}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se.replace(/(\r?\n|\r)$/g,"")}function R(se){const ye=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ye,Pe.identifier=Fr(this.sliceSerialize(se)).toLowerCase()}function O(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function M(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function B(se){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Pe=this.sliceSerialize(se).length;ye.depth=Pe}}function z(){this.data.setextHeadingSlurpLineEnding=!0}function $(se){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(se).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(se){const Pe=this.stack[this.stack.length-1].children;let $e=Pe[Pe.length-1];(!$e||$e.type!=="text")&&($e=mn(),$e.position={start:ci(se.start),end:void 0},Pe.push($e)),this.stack.push($e)}function I(se){const ye=this.stack.pop();ye.value+=this.sliceSerialize(se),ye.position.end=ci(se.end)}function ne(se){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=ye.children[ye.children.length-1];Pe.position.end=ci(se.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(Q.call(this,se),I.call(this,se))}function le(){this.data.atHardBreak=!0}function we(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function Y(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function J(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.value=se}function H(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function ee(){const se=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";se.type+="Reference",se.referenceType=ye,delete se.url,delete se.title}else delete se.identifier,delete se.label;this.data.referenceType=void 0}function be(se){const ye=this.sliceSerialize(se),Pe=this.stack[this.stack.length-2];Pe.label=fB(ye),Pe.identifier=Fr(ye).toLowerCase()}function Ae(){const se=this.stack[this.stack.length-1],ye=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const $e=se.children;Pe.children=$e}else Pe.alt=ye}function A(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.url=se}function L(){const se=this.resume(),ye=this.stack[this.stack.length-1];ye.title=se}function P(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function Z(se){const ye=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=ye,Pe.identifier=Fr(this.sliceSerialize(se)).toLowerCase(),this.data.referenceType="full"}function W(se){this.data.characterReferenceType=se.type}function ce(se){const ye=this.sliceSerialize(se),Pe=this.data.characterReferenceType;let $e;Pe?($e=ME(ye,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=nv(ye);const rt=this.stack[this.stack.length-1];rt.value+=$e}function ve(se){const ye=this.stack.pop();ye.position.end=ci(se.end)}function ge(se){I.call(this,se);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(se)}function fe(se){I.call(this,se);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(se)}function Qe(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function ut(){return{type:"inlineCode",value:""}}function ae(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Se(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function Ge(){return{type:"break"}}function Rn(){return{type:"html",value:""}}function zn(){return{type:"image",title:null,url:"",alt:null}}function Da(){return{type:"link",title:null,url:"",children:[]}}function Ia(se){return{type:"list",ordered:se.type==="listOrdered",start:null,spread:se._spread,children:[]}}function ra(se){return{type:"listItem",spread:se._spread,checked:null,children:[]}}function ro(){return{type:"paragraph",children:[]}}function ao(){return{type:"strong",children:[]}}function mn(){return{type:"text",value:""}}function io(){return{type:"thematicBreak"}}}function ci(e){return{line:e.line,column:e.column,offset:e.offset}}function ZE(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?ZE(e,a):gB(e,a)}}function gB(e,t){let n;for(n in t)if(HE.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 oS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pu({start:t.start,end:t.end})+") is still open")}function yB(e){const t=this;t.parser=n;function n(a){return mB(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function vB(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 bB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
361
|
-
`}]}function xB(e,t){const n=t.value?t.value+`
|
|
362
|
-
`:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function wB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function SB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kB(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 c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function jB(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 CB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function VE(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function EB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return VE(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 NB(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 _B(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 TB(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return VE(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 AB(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 RB(e,t,n){const a=e.all(t),l=n?zB(n):QE(t),o={},c=[];if(typeof t.checked=="boolean"){const y=a[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const y=a[f];(l||f!==0||y.type!=="element"||y.tagName!=="p")&&c.push({type:"text",value:`
|
|
363
|
-
`}),y.type==="element"&&y.tagName==="p"&&!l?c.push(...y.children):c.push(y)}const m=a[a.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
364
|
-
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function zB(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=QE(n[a])}return t}function QE(e){const t=e.spread;return t??e.children.length>1}function OB(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function MB(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DB(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function IB(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LB(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Xy(t.children[1]),m=EE(t.children[t.children.length-1]);f&&m&&(c.position={start:f,end:m}),l.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function UB(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const g=t.children[m],b={},w=c?c[m]:void 0;w&&(b.align=w);let k={type:"element",tagName:o,properties:b,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),h.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,y),e.applyData(t,y)}function PB(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const uS=9,cS=32;function BB(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const o=[];for(;a;)o.push(dS(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return o.push(dS(t.slice(l),l>0,!1)),o.join("")}function dS(e,t,n){let a=0,l=e.length;if(t){let o=e.codePointAt(a);for(;o===uS||o===cS;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(l-1);for(;o===uS||o===cS;)l--,o=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function $B(e,t){const n={type:"text",value:BB(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function FB(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const qB={blockquote:vB,break:bB,code:xB,delete:wB,emphasis:SB,footnoteReference:kB,heading:jB,html:CB,imageReference:EB,image:NB,inlineCode:_B,linkReference:TB,link:AB,listItem:RB,list:OB,paragraph:MB,root:DB,strong:IB,table:LB,tableCell:PB,tableRow:UB,text:$B,thematicBreak:FB,toml:Md,yaml:Md,definition:Md,footnoteDefinition:Md};function Md(){}const KE=-1,If=0,yu=1,uf=2,av=3,iv=4,lv=5,sv=6,GE=7,YE=8,fS=typeof self=="object"?self:globalThis,HB=(e,t)=>{const n=(l,o)=>(e.set(o,l),l),a=l=>{if(e.has(l))return e.get(l);const[o,c]=t[l];switch(o){case If:case KE:return n(c,l);case yu:{const f=n([],l);for(const m of c)f.push(a(m));return f}case uf:{const f=n({},l);for(const[m,h]of c)f[a(m)]=a(h);return f}case av:return n(new Date(c),l);case iv:{const{source:f,flags:m}=c;return n(new RegExp(f,m),l)}case lv:{const f=n(new Map,l);for(const[m,h]of c)f.set(a(m),a(h));return f}case sv:{const f=n(new Set,l);for(const m of c)f.add(a(m));return f}case GE:{const{name:f,message:m}=c;return n(new fS[f](m),l)}case YE:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(new fS[o](c),l)};return a},hS=e=>HB(new Map,e)(0),ms="",{toString:ZB}={},{keys:VB}=Object,ou=e=>{const t=typeof e;if(t!=="object"||!e)return[If,t];const n=ZB.call(e).slice(8,-1);switch(n){case"Array":return[yu,ms];case"Object":return[uf,ms];case"Date":return[av,ms];case"RegExp":return[iv,ms];case"Map":return[lv,ms];case"Set":return[sv,ms];case"DataView":return[yu,n]}return n.includes("Array")?[yu,n]:n.includes("Error")?[GE,n]:[uf,n]},Dd=([e,t])=>e===If&&(t==="function"||t==="symbol"),QB=(e,t,n,a)=>{const l=(c,f)=>{const m=a.push(c)-1;return n.set(f,m),m},o=c=>{if(n.has(c))return n.get(c);let[f,m]=ou(c);switch(f){case If:{let y=c;switch(m){case"bigint":f=YE,y=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);y=null;break;case"undefined":return l([KE],c)}return l([f,y],c)}case yu:{if(m){let b=c;return m==="DataView"?b=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(b=new Uint8Array(c)),l([m,[...b]],c)}const y=[],g=l([f,y],c);for(const b of c)y.push(o(b));return g}case uf:{if(m)switch(m){case"BigInt":return l([m,c.toString()],c);case"Boolean":case"Number":case"String":return l([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const y=[],g=l([f,y],c);for(const b of VB(c))(e||!Dd(ou(c[b])))&&y.push([o(b),o(c[b])]);return g}case av:return l([f,c.toISOString()],c);case iv:{const{source:y,flags:g}=c;return l([f,{source:y,flags:g}],c)}case lv:{const y=[],g=l([f,y],c);for(const[b,w]of c)(e||!(Dd(ou(b))||Dd(ou(w))))&&y.push([o(b),o(w)]);return g}case sv:{const y=[],g=l([f,y],c);for(const b of c)(e||!Dd(ou(b)))&&y.push(o(b));return g}}const{message:h}=c;return l([f,{name:m,message:h}],c)};return o},mS=(e,{json:t,lossy:n}={})=>{const a=[];return QB(!(t||n),!!t,new Map,a)(e),a},cf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?hS(mS(e,t)):structuredClone(e):(e,t)=>hS(mS(e,t));function KB(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 GB(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function YB(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KB,a=e.options.footnoteBackLabel||GB,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const y=e.all(h),g=String(h.identifier).toUpperCase(),b=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-"+b+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,w),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const E=y[y.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const R=E.children[E.children.length-1];R&&R.type==="text"?R.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(h,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
|
|
365
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
366
|
-
`}]}}const Lf=(function(e){if(e==null)return e$;if(typeof e=="function")return Uf(e);if(typeof e=="object")return Array.isArray(e)?XB(e):JB(e);if(typeof e=="string")return WB(e);throw new Error("Expected function, string, or object as test")});function XB(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lf(e[n]);return Uf(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function JB(e){const t=e;return Uf(n);function n(a){const l=a;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function WB(e){return Uf(t);function t(n){return n&&n.type===e}}function Uf(e){return t;function t(n,a,l){return!!(t$(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function e$(){return!0}function t$(e){return e!==null&&typeof e=="object"&&"type"in e}const XE=[],n$=!0,Hg=!1,r$="skip";function JE(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const o=Lf(l),c=a?-1:1;f(e,void 0,[])();function f(m,h,y){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(m.type+(w?"<"+w+">":""))+")"})}return b;function b(){let w=XE,k,j,E;if((!t||o(m,h,y[y.length-1]||void 0))&&(w=a$(n(m,y)),w[0]===Hg))return w;if("children"in m&&m.children){const C=m;if(C.children&&w[0]!==r$)for(j=(a?C.children.length:-1)+c,E=y.concat(C);j>-1&&j<C.children.length;){const R=C.children[j];if(k=f(R,j,E)(),k[0]===Hg)return k;j=typeof k[1]=="number"?k[1]:j+c}}return w}}}function a$(e){return Array.isArray(e)?e:typeof e=="number"?[n$,e]:e==null?XE:[e]}function ov(e,t,n,a){let l,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,l=n):(o=t,c=n,l=a),JE(e,o,f,l);function f(m,h){const y=h[h.length-1],g=y?y.children.indexOf(m):void 0;return c(m,g,y)}}const Zg={}.hasOwnProperty,i$={};function l$(e,t){const n=t||i$,a=new Map,l=new Map,o=new Map,c={...qB,...n.handlers},f={all:h,applyData:o$,definitionById:a,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:s$,wrap:c$};return ov(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?a:l,b=String(y.identifier).toUpperCase();g.has(b)||g.set(b,y)}}),f;function m(y,g){const b=y.type,w=f.handlers[b];if(Zg.call(f.handlers,b)&&w)return w(f,y,g);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...E}=y,C=cf(E);return C.children=f.all(y),C}return cf(y)}return(f.options.unknownHandler||u$)(f,y,g)}function h(y){const g=[];if("children"in y){const b=y.children;let w=-1;for(;++w<b.length;){const k=f.one(b[w],y);if(k){if(w&&b[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=pS(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=pS(j.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function s$(e,t){e.position&&(t.position=GP(e))}function o$(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,cf(o)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function u$(e,t){const n=t.data||{},a="value"in t&&!(Zg.call(n,"hProperties")||Zg.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 c$(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
367
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
368
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
369
|
-
`}),n}function pS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function gS(e,t){const n=l$(e,t),a=n.one(e,void 0),l=YB(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
370
|
-
`},l),o}function d$(e,t){return e&&"run"in e?async function(n,a){const l=gS(n,{file:a,...t});await e.run(l,a)}:function(n,a){return gS(n,{file:a,...e||t})}}function yS(e){if(e)throw e}var Tp,vS;function f$(){if(vS)return Tp;vS=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var y=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!y&&!g)return!1;var b;for(b in h);return typeof b>"u"||e.call(h,b)},c=function(h,y){n&&y.name==="__proto__"?n(h,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):h[y.name]=y.newValue},f=function(h,y){if(y==="__proto__")if(e.call(h,y)){if(a)return a(h,y).value}else return;return h[y]};return Tp=function m(){var h,y,g,b,w,k,j=arguments[0],E=1,C=arguments.length,R=!1;for(typeof j=="boolean"&&(R=j,j=arguments[1]||{},E=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});E<C;++E)if(h=arguments[E],h!=null)for(y in h)g=f(j,y),b=f(h,y),j!==b&&(R&&b&&(o(b)||(w=l(b)))?(w?(w=!1,k=g&&l(g)?g:[]):k=g&&o(g)?g:{},c(j,{name:y,newValue:m(R,k,b)})):typeof b<"u"&&c(j,{name:y,newValue:b}));return j},Tp}var h$=f$();const Ap=mf(h$);function Vg(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 m$(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(m,...h){const y=e[++o];let g=-1;if(m){c(m);return}for(;++g<l.length;)(h[g]===null||h[g]===void 0)&&(h[g]=l[g]);l=h,y?p$(y,f)(...h):c(null,...h)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function p$(e,t){let n;return a;function a(...c){const f=e.length>c.length;let m;f&&c.push(l);try{m=e.apply(this,c)}catch(h){const y=h;if(f&&n)throw y;return l(y)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Yr={basename:g$,dirname:y$,extname:v$,join:b$,sep:"/"};function g$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');tc(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function y$(e){if(tc(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 v$(e){tc(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function b$(...e){let t=-1,n;for(;++t<e.length;)tc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":x$(n)}function x$(e){tc(e);const t=e.codePointAt(0)===47;let n=w$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function w$(e,t){let n="",a=0,l=-1,o=0,c=-1,f,m;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function tc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const S$={cwd:k$};function k$(){return"/"}function Qg(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function j$(e){if(typeof e=="string")e=new URL(e);else if(!Qg(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 C$(e)}function C$(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 Rp=["history","path","basename","stem","extname","dirname"];class WE{constructor(t){let n;t?Qg(t)?n={path:t}:typeof t=="string"||E$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":S$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Rp.length;){const o=Rp[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)Rp.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Yr.basename(this.path):void 0}set basename(t){Op(t,"basename"),zp(t,"basename"),this.path=Yr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yr.dirname(this.path):void 0}set dirname(t){bS(this.basename,"dirname"),this.path=Yr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yr.extname(this.path):void 0}set extname(t){if(zp(t,"extname"),bS(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=Yr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Qg(t)&&(t=j$(t)),Op(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yr.basename(this.path,this.extname):void 0}set stem(t){Op(t,"stem"),zp(t,"stem"),this.path=Yr.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 An(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 zp(e,t){if(e&&e.includes(Yr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yr.sep+"`")}function Op(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function E$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const N$=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),_$={}.hasOwnProperty;class uv extends N${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=m$()}copy(){const t=new uv;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Ap(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ip("data",this.frozen),this.namespace[t]=n,this):_$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ip("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=Id(t),a=this.parser||this.Parser;return Mp("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Mp("process",this.parser||this.Parser),Dp("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=Id(t),m=a.parse(f);a.run(m,f,function(y,g,b){if(y||!g||!b)return h(y);const w=g,k=a.stringify(w,b);R$(k)?b.value=k:b.result=k,h(y,b)});function h(y,g){y||!g?c(y):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),Mp("processSync",this.parser||this.Parser),Dp("processSync",this.compiler||this.Compiler),this.process(t,l),wS("processSync","process",n),a;function l(o,c){n=!0,yS(o),a=c}}run(t,n,a){xS(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const m=Id(n);l.run(t,m,h);function h(y,g,b){const w=g||t;y?f(y):c?c(w):a(void 0,w,b)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),wS("runSync","run",a),l;function o(c,f){yS(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Id(n),l=this.compiler||this.Compiler;return Dp("stringify",l),xS(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Ip("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[y,...g]=h;m(y,g)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(h.plugins),h.settings&&(l.settings=Ap(!0,l.settings,h.settings))}function f(h){let y=-1;if(h!=null)if(Array.isArray(h))for(;++y<h.length;){const g=h[y];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,y){let g=-1,b=-1;for(;++g<a.length;)if(a[g][0]===h){b=g;break}if(b===-1)a.push([h,...y]);else if(y.length>0){let[w,...k]=y;const j=a[b][1];Vg(j)&&Vg(w)&&(w=Ap(!0,j,w)),a[b]=[h,w,...k]}}}}const T$=new uv().freeze();function Mp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ip(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 xS(e){if(!Vg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wS(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Id(e){return A$(e)?e:new WE(e)}function A$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function R$(e){return typeof e=="string"||z$(e)}function z$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const O$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",SS=[],kS={allowDangerousHtml:!0},M$=/^(https?|ircs?|mailto|xmpp)$/i,D$=[{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 I$(e){const t=L$(e),n=U$(e);return P$(t.runSync(t.parse(n),n),e)}function L$(e){const t=e.rehypePlugins||SS,n=e.remarkPlugins||SS,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kS}:kS;return T$().use(yB).use(n).use(d$,a).use(t)}function U$(e){const t=e.children||"",n=new WE;return typeof t=="string"&&(n.value=t),n}function P$(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||B$;for(const y of D$)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+O$+y.id,void 0);return ov(e,h),e9(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(y,g,b){if(y.type==="raw"&&b&&typeof g=="number")return c?b.children.splice(g,1):b.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let w;for(w in Ep)if(Object.hasOwn(Ep,w)&&Object.hasOwn(y.properties,w)){const k=y.properties[w],j=Ep[w];(j===null||j.includes(y.tagName))&&(y.properties[w]=m(String(k||""),w,y))}}if(y.type==="element"){let w=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!w&&a&&typeof g=="number"&&(w=!a(y,g,b)),w&&b&&typeof g=="number")return f&&y.children?b.children.splice(g,1,...y.children):b.children.splice(g,1),g}}}function B$(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||M$.test(e.slice(0,t))?e:""}function $$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eN(e,t,n){const l=Lf((n||{}).ignore||[]),o=F$(t);let c=-1;for(;++c<o.length;)JE(e,"text",f);function f(h,y){let g=-1,b;for(;++g<y.length;){const w=y[g],k=b?b.children:void 0;if(l(w,k?k.indexOf(w):void 0,b))return;b=w}if(b)return m(h,y)}function m(h,y){const g=y[y.length-1],b=o[c][0],w=o[c][1];let k=0;const E=g.children.indexOf(h);let C=!1,R=[];b.lastIndex=0;let O=b.exec(h.value);for(;O;){const M=O.index,B={index:O.index,input:O.input,stack:[...y,h]};let z=w(...O,B);if(typeof z=="string"&&(z=z.length>0?{type:"text",value:z}:void 0),z===!1?b.lastIndex=M+1:(k!==M&&R.push({type:"text",value:h.value.slice(k,M)}),Array.isArray(z)?R.push(...z):z&&R.push(z),k=M+O[0].length,C=!0),!b.global)break;O=b.exec(h.value)}return C?(k<h.value.length&&R.push({type:"text",value:h.value.slice(k)}),g.children.splice(E,1,...R)):R=[h],E+R.length}}function F$(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([q$(l[0]),H$(l[1])])}return t}function q$(e){return typeof e=="string"?new RegExp($$(e),"g"):e}function H$(e){return typeof e=="function"?e:function(){return e}}function Z$(e){eN(e,[/\r?\n|\r/g,V$])}function V$(){return{type:"break"}}function Q$(){return function(e){Z$(e)}}function jS(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 Lp="phrasing",Up=["autolink","link","image","label"];function K$(){return{transforms:[tF],enter:{literalAutolink:Y$,literalAutolinkEmail:Pp,literalAutolinkHttp:Pp,literalAutolinkWww:Pp},exit:{literalAutolink:eF,literalAutolinkEmail:W$,literalAutolinkHttp:X$,literalAutolinkWww:J$}}}function G$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Lp,notInConstruct:Up},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Lp,notInConstruct:Up},{character:":",before:"[ps]",after:"\\/",inConstruct:Lp,notInConstruct:Up}]}}function Y$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Pp(e){this.config.enter.autolinkProtocol.call(this,e)}function X$(e){this.config.exit.autolinkProtocol.call(this,e)}function J$(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 W$(e){this.config.exit.autolinkEmail.call(this,e)}function eF(e){this.exit(e)}function tF(e){eN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,nF],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),rF]],{ignore:["link","linkReference"]})}function nF(e,t,n,a,l){let o="";if(!tN(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!aF(n)))return!1;const c=iF(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function rF(e,t,n,a){return!tN(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function aF(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 iF(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=jS(e,"(");let o=jS(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 tN(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bl(n)||Mf(n))&&(!t||n!==47)}nN.peek=mF;function lF(){this.buffer()}function sF(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function oF(){this.buffer()}function uF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function cF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dF(e){this.exit(e)}function fF(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hF(e){this.exit(e)}function mF(){return"["}function nN(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function pF(){return{enter:{gfmFootnoteCallString:lF,gfmFootnoteCall:sF,gfmFootnoteDefinitionLabelString:oF,gfmFootnoteDefinition:uF},exit:{gfmFootnoteCallString:cF,gfmFootnoteCall:dF,gfmFootnoteDefinitionLabelString:fF,gfmFootnoteDefinition:hF}}}function gF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:nN},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let m=f.move("[^");const h=o.enter("footnoteDefinition"),y=o.enter("label");return m+=f.move(o.safe(o.associationId(a),{before:m,after:"]"})),y(),m+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),m+=f.move((t?`
|
|
371
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?rN:yF))),h(),m}}function yF(e,t,n){return t===0?e:rN(e,t,n)}function rN(e,t,n){return(n?"":" ")+e}const vF=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];aN.peek=kF;function bF(){return{canContainEols:["delete"],enter:{strikethrough:wF},exit:{strikethrough:SF}}}function xF(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:vF}],handlers:{delete:aN}}}function wF(e){this.enter({type:"delete",children:[]},e)}function SF(e){this.exit(e)}function aN(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function kF(){return"~"}function jF(e){return e.length}function CF(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||jF,o=[],c=[],f=[],m=[];let h=0,y=-1;for(;++y<e.length;){const j=[],E=[];let C=-1;for(e[y].length>h&&(h=e[y].length);++C<e[y].length;){const R=EF(e[y][C]);if(n.alignDelimiters!==!1){const O=l(R);E[C]=O,(m[C]===void 0||O>m[C])&&(m[C]=O)}j.push(R)}c[y]=j,f[y]=E}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=CS(a[g]);else{const j=CS(a);for(;++g<h;)o[g]=j}g=-1;const b=[],w=[];for(;++g<h;){const j=o[g];let E="",C="";j===99?(E=":",C=":"):j===108?E=":":j===114&&(C=":");let R=n.alignDelimiters===!1?1:Math.max(1,m[g]-E.length-C.length);const O=E+"-".repeat(R)+C;n.alignDelimiters!==!1&&(R=E.length+R+C.length,R>m[g]&&(m[g]=R),w[g]=R),b[g]=O}c.splice(1,0,b),f.splice(1,0,w),y=-1;const k=[];for(;++y<c.length;){const j=c[y],E=f[y];g=-1;const C=[];for(;++g<h;){const R=j[g]||"";let O="",M="";if(n.alignDelimiters!==!1){const B=m[g]-(E[g]||0),z=o[g];z===114?O=" ".repeat(B):z===99?B%2?(O=" ".repeat(B/2+.5),M=" ".repeat(B/2-.5)):(O=" ".repeat(B/2),M=O):M=" ".repeat(B)}n.delimiterStart!==!1&&!g&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||g)&&C.push(" "),n.alignDelimiters!==!1&&C.push(O),C.push(R),n.alignDelimiters!==!1&&C.push(M),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
372
|
-
`)}function EF(e){return e==null?"":String(e)}function CS(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 NF(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),_F);return l(),c}function _F(e,t,n){return">"+(n?"":" ")+e}function TF(e,t){return ES(e,t.inConstruct,!0)&&!ES(e,t.notInConstruct,!1)}function ES(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 NS(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
373
|
-
`&&TF(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
374
|
-
`}function AF(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function RF(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 zF(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 OF(e,t,n,a){const l=zF(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(RF(e,n)){const g=n.enter("codeIndented"),b=n.indentLines(o,MF);return g(),b}const f=n.createTracker(a),m=l.repeat(Math.max(AF(o,l)+1,3)),h=n.enter("codeFenced");let y=f.move(m);if(e.lang){const g=n.enter(`codeFencedLang${c}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${c}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
375
|
-
`,encode:["`"],...f.current()})),g()}return y+=f.move(`
|
|
376
|
-
`),o&&(y+=f.move(o+`
|
|
377
|
-
`)),y+=f.move(m),h(),y}function MF(e,t,n){return(n?"":" ")+e}function cv(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 DF(e,t,n,a){const l=cv(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
378
|
-
`,...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),c(),h}function IF(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 Mu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(e,t,n){const a=Fs(e),l=Fs(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}}iN.peek=LF;function iN(e,t,n,a){const l=IF(n),o=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=df(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Mu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=df(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Mu(g));const w=c.move(l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function LF(e,t,n){return n.options.emphasis||"*"}function UF(e,t){let n=!1;return ov(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Hg}),!!((!e.depth||e.depth<3)&&tv(e)&&(t.options.setext||n))}function PF(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(UF(e,n)){const y=n.enter("headingSetext"),g=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
379
|
-
`,after:`
|
|
380
|
-
`});return g(),y(),b+`
|
|
381
|
-
`+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
382
|
-
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
383
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=Mu(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),f(),h}lN.peek=BF;function lN(e){return e.value||""}function BF(){return"<"}sN.peek=$F;function sN(e,t,n,a){const l=cv(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(n.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),c(),h}function $F(){return"!"}oN.peek=FF;function oN(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("![");const h=n.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function FF(){return"!"}uN.peek=qF;function uN(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let m;if(c.atBreak)for(;m=f.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return l+a+l}function qF(){return"`"}function cN(e,t){const n=tv(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))}dN.peek=HF;function dN(e,t,n,a){const l=cv(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,m;if(cN(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let g=c.move("<");return g+=c.move(n.containerPhrasing(e,{before:g,after:">",...c.current()})),g+=c.move(">"),f(),n.stack=y,g}f=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+l),h+=c.move(n.safe(e.title,{before:h,after:l,...c.current()})),h+=c.move(l),m()),h+=c.move(")"),f(),h}function HF(e,t,n){return cN(e,n)?"<":"["}fN.peek=ZF;function fN(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let m=f.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),c();const y=n.stack;n.stack=[],c=n.enter("reference");const g=n.safe(n.associationId(e),{before:m,after:"]",...f.current()});return c(),n.stack=y,o(),l==="full"||!h||h!==g?m+=f.move(g+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function ZF(){return"["}function dv(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 VF(e){const t=dv(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 QF(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 hN(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 KF(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?QF(n):dv(n);const f=e.ordered?c==="."?")":".":VF(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(m=!0),hN(n)===c&&y){let g=-1;for(;++g<e.children.length;){const b=e.children[g];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=f),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),h}function GF(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 YF(e,t,n,a){const l=GF(n);let o=n.bulletCurrent||dv(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,f.current()),y);return m(),h;function y(g,b,w){return b?(w?"":" ".repeat(c))+g:(w?o:o+" ".repeat(c-o.length))+g}}function XF(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const JF=Lf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function WF(e,t,n,a){return(e.children.some(function(c){return JF(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function eq(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}mN.peek=tq;function mN(e,t,n,a){const l=eq(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let m=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const h=m.charCodeAt(0),y=df(a.before.charCodeAt(a.before.length-1),h,l);y.inside&&(m=Mu(h)+m.slice(1));const g=m.charCodeAt(m.length-1),b=df(a.after.charCodeAt(0),g,l);b.inside&&(m=m.slice(0,-1)+Mu(g));const w=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+m+w}function tq(e,t,n){return n.options.strong||"*"}function nq(e,t,n,a){return n.safe(e.value,a)}function rq(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 aq(e,t,n){const a=(hN(n)+(n.options.ruleSpaces?" ":"")).repeat(rq(n));return n.options.ruleSpaces?a.slice(0,-1):a}const pN={blockquote:NF,break:NS,code:OF,definition:DF,emphasis:iN,hardBreak:NS,heading:PF,html:lN,image:sN,imageReference:oN,inlineCode:uN,link:dN,linkReference:fN,list:KF,listItem:YF,paragraph:XF,root:WF,strong:mN,text:nq,thematicBreak:aq};function iq(){return{enter:{table:lq,tableData:_S,tableHeader:_S,tableRow:oq},exit:{codeText:uq,table:sq,tableData:Bp,tableHeader:Bp,tableRow:Bp}}}function lq(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 sq(e){this.exit(e),this.data.inTable=void 0}function oq(e){this.enter({type:"tableRow",children:[]},e)}function Bp(e){this.exit(e)}function _S(e){this.enter({type:"tableCell",children:[]},e)}function uq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,cq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function cq(e,t){return t==="|"?t:e}function dq(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
384
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:c,tableCell:m,tableRow:f}};function c(w,k,j,E){return h(y(w,j,E),w.align)}function f(w,k,j,E){const C=g(w,j,E),R=h([C]);return R.slice(0,R.indexOf(`
|
|
385
|
-
`))}function m(w,k,j,E){const C=j.enter("tableCell"),R=j.enter("phrasing"),O=j.containerPhrasing(w,{...E,before:o,after:o});return R(),C(),O}function h(w,k){return CF(w,{align:k,alignDelimiters:a,padding:n,stringLength:l})}function y(w,k,j){const E=w.children;let C=-1;const R=[],O=k.enter("table");for(;++C<E.length;)R[C]=g(E[C],k,j);return O(),R}function g(w,k,j){const E=w.children;let C=-1;const R=[],O=k.enter("tableRow");for(;++C<E.length;)R[C]=m(E[C],w,k,j);return O(),R}function b(w,k,j){let E=pN.inlineCode(w,k,j);return j.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function fq(){return{exit:{taskListCheckValueChecked:TS,taskListCheckValueUnchecked:TS,paragraph:mq}}}function hq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:pq}}}function TS(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function mq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function pq(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let m=pN.listItem(e,t,n,{...a,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(y){return y+c}}function gq(){return[K$(),pF(),bF(),iq(),fq()]}function yq(e){return{extensions:[G$(),gF(e),xF(),dq(e),hq()]}}const vq={tokenize:jq,partial:!0},gN={tokenize:Cq,partial:!0},yN={tokenize:Eq,partial:!0},vN={tokenize:Nq,partial:!0},bq={tokenize:_q,partial:!0},bN={name:"wwwAutolink",tokenize:Sq,previous:wN},xN={name:"protocolAutolink",tokenize:kq,previous:SN},Ma={name:"emailAutolink",tokenize:wq,previous:kN},na={};function xq(){return{text:na}}let al=48;for(;al<123;)na[al]=Ma,al++,al===58?al=65:al===91&&(al=97);na[43]=Ma;na[45]=Ma;na[46]=Ma;na[95]=Ma;na[72]=[Ma,xN];na[104]=[Ma,xN];na[87]=[Ma,bN];na[119]=[Ma,bN];function wq(e,t,n){const a=this;let l,o;return c;function c(g){return!Kg(g)||!kN.call(a,a.previous)||fv(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(g))}function f(g){return Kg(g)?(e.consume(g),f):g===64?(e.consume(g),m):n(g)}function m(g){return g===46?e.check(bq,y,h)(g):g===45||g===95||_n(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&&In(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function Sq(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!wN.call(a,a.previous)||fv(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vq,e.attempt(gN,e.attempt(yN,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function kq(e,t,n){const a=this;let l="",o=!1;return c;function c(g){return(g===72||g===104)&&SN.call(a,a.previous)&&!fv(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(g),e.consume(g),f):n(g)}function f(g){if(In(g)&&l.length<5)return l+=String.fromCodePoint(g),e.consume(g),f;if(g===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(g),m}return n(g)}function m(g){return g===47?(e.consume(g),o?h:(o=!0,m)):n(g)}function h(g){return g===null||of(g)||jt(g)||bl(g)||Mf(g)?n(g):e.attempt(gN,e.attempt(yN,y),n)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function jq(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function Cq(e,t,n){let a,l,o;return c;function c(h){return h===46||h===95?e.check(vN,m,f)(h):h===null||jt(h)||bl(h)||h!==45&&Mf(h)?m(h):(o=!0,e.consume(h),c)}function f(h){return h===95?a=!0:(l=a,a=void 0),e.consume(h),c}function m(h){return l||a||!o?n(h):t(h)}}function Eq(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(vN,t,o)(c):c===null||jt(c)||bl(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function Nq(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||jt(f)||bl(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||jt(f)||bl(f)?t(f):a(f)}function o(f){return In(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):In(f)?(e.consume(f),c):n(f)}}function _q(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return _n(o)?n(o):t(o)}}function wN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function SN(e){return!In(e)}function kN(e){return!(e===47||Kg(e))}function Kg(e){return e===43||e===45||e===46||e===95||_n(e)}function fv(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 Tq={tokenize:Lq,partial:!0};function Aq(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Mq,continuation:{tokenize:Dq},exit:Iq}},text:{91:{name:"gfmFootnoteCall",tokenize:Oq},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Rq,resolveTo:zq}}}}function Rq(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const m=a.events[l][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!c||!c._balanced)return n(m);const h=Fr(a.sliceSerialize({start:c.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function zq(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function Oq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),m}function m(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!c||g===null||g===91||jt(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Fr(a.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return jt(g)||(c=!0),o++,e.consume(g),g===92?y:h}function y(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function Mq(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return m;function m(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(c>999||k===93&&!f||k===null||k===91||jt(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Fr(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return jt(k)||(f=!0),c++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),c++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(o)||l.push(o),ot(e,w,"gfmFootnoteDefinitionWhitespace")):n(k)}function w(k){return t(k)}}function Dq(e,t,n){return e.check(ec,t,e.attempt(Tq,t,n))}function Iq(e){e.exit("gfmFootnoteDefinition")}function Lq(e,t,n){const a=this;return ot(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function Uq(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},g={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},b=[["enter",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["enter",g,f]],w=f.parser.constructs.insideSpan.null;w&&dr(b,b.length,0,Df(w,c.slice(h+1,m),f)),dr(b,b.length,0,[["exit",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["exit",y,f]]),dr(c,h-1,m-h+3,b),m=h+b.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,f,m){const h=this.previous,y=this.events;let g=0;return b;function b(k){return h===126&&y[y.length-1][1].type!=="characterEscape"?m(k):(c.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const j=Fs(h);if(k===126)return g>1?m(k):(c.consume(k),g++,w);if(g<2&&!n)return m(k);const E=c.exit("strikethroughSequenceTemporary"),C=Fs(k);return E._open=!C||C===2&&!!j,E._close=!j||j===2&&!!C,f(k)}}}class Pq{constructor(){this.map=[]}add(t,n,a){Bq(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function Bq(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 $q(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 Fq(){return{flow:{null:{name:"table",tokenize:qq,resolveAll:Hq}}}}function qq(e,t,n){const a=this;let l=0,o=0,c;return f;function f(I){let ne=a.events.length-1;for(;ne>-1;){const Y=a.events[ne][1].type;if(Y==="lineEnding"||Y==="linePrefix")ne--;else break}const le=ne>-1?a.events[ne][1].type:null,we=le==="tableHead"||le==="tableRow"?z:m;return we===z&&a.parser.lazy[a.now().line]?n(I):we(I)}function m(I){return e.enter("tableHead"),e.enter("tableRow"),h(I)}function h(I){return I===124||(c=!0,o+=1),y(I)}function y(I){return I===null?n(I):De(I)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):n(I):et(I)?ot(e,y,"whitespace")(I):(o+=1,c&&(c=!1,l+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),c=!0,y):(e.enter("data"),g(I)))}function g(I){return I===null||I===124||jt(I)?(e.exit("data"),y(I)):(e.consume(I),I===92?b:g)}function b(I){return I===92||I===124?(e.consume(I),g):g(I)}function w(I){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(I):(e.enter("tableDelimiterRow"),c=!1,et(I)?ot(e,k,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):k(I))}function k(I){return I===45||I===58?E(I):I===124?(c=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),j):B(I)}function j(I){return et(I)?ot(e,E,"whitespace")(I):E(I)}function E(I){return I===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),C):I===45?(o+=1,C(I)):I===null||De(I)?M(I):B(I)}function C(I){return I===45?(e.enter("tableDelimiterFiller"),R(I)):B(I)}function R(I){return I===45?(e.consume(I),R):I===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),O):(e.exit("tableDelimiterFiller"),O(I))}function O(I){return et(I)?ot(e,M,"whitespace")(I):M(I)}function M(I){return I===124?k(I):I===null||De(I)?!c||l!==o?B(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):B(I)}function B(I){return n(I)}function z(I){return e.enter("tableRow"),$(I)}function $(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),$):I===null||De(I)?(e.exit("tableRow"),t(I)):et(I)?ot(e,$,"whitespace")(I):(e.enter("data"),U(I))}function U(I){return I===null||I===124||jt(I)?(e.exit("data"),$(I)):(e.consume(I),I===92?Q:U)}function Q(I){return I===92||I===124?(e.consume(I),U):U(I)}}function Hq(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,m=0,h,y,g;const b=new Pq;for(;++n<e.length;){const w=e[n],k=w[1];w[0]==="enter"?k.type==="tableHead"?(f=!1,m!==0&&(AS(b,t,m,h,y),y=void 0,m=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),l=k.type==="tableDelimiterRow"?2:y?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],g=Ld(b,t,o,l,void 0,g),o=[0,0,0,0]),c[2]=n)):k.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],g=Ld(b,t,o,l,void 0,g)),o=c,c=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,m=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],g=Ld(b,t,o,l,n,g)):c[1]!==0&&(g=Ld(b,t,c,l,n,g)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&AS(b,t,m,h,y),b.consume(t.events),n=-1;++n<t.events.length;){const w=t.events[n];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=$q(t.events,n))}return e}function Ld(e,t,n,a,l,o){const c=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:c,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 b=t.events[n[2]],w=t.events[n[3]];if(b[1].end=Object.assign({},w[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return l!==void 0&&(o.end=Object.assign({},ys(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function AS(e,t,n,a,l){const o=[],c=ys(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function ys(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const Zq={name:"tasklistCheck",tokenize:Qq};function Vq(){return{text:{91:Zq}}}function Qq(e,t,n){const a=this;return l;function l(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return jt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(m)}function f(m){return De(m)?t(m):et(m)?e.check({tokenize:Kq},t,n)(m):n(m)}}function Kq(e,t,n){return ot(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function Gq(e){return OE([xq(),Aq(),Uq(e),Fq(),Vq()])}const Yq={};function Xq(e){const t=this,n=e||Yq,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(Gq(n)),o.push(gq()),c.push(yq(n))}function hv({children:e,className:t}){return u.jsx("div",{className:Te("prose prose-sm max-w-none leading-[1.55] text-[color:inherit]","prose-headings:text-current prose-p:text-current prose-li:text-current prose-strong:text-current prose-em:text-current prose-blockquote:text-current","prose-p:my-2 prose-headings:mt-3 prose-headings:mb-1.5 prose-ul:my-2 prose-ol:my-2 prose-li:my-0.5 prose-pre:my-2 prose-blockquote:my-2 prose-hr:my-3","prose-a:text-[color:var(--accent)] prose-a:no-underline hover:prose-a:underline","prose-code:text-current prose-code:bg-[color:var(--bg-sunken)] prose-code:rounded prose-code:px-1 prose-code:py-0.5 prose-code:text-[0.9em] prose-code:before:content-none prose-code:after:content-none","prose-pre:bg-[color:var(--bg-sunken)] prose-pre:text-current prose-pre:border prose-pre:border-[color:var(--border)]","prose-hr:border-[color:var(--border)]","prose-blockquote:border-l-[color:var(--border-strong)] prose-blockquote:text-[color:var(--fg-2)]","prose-th:border-[color:var(--border)] prose-td:border-[color:var(--border)]",t),children:u.jsx(I$,{remarkPlugins:[Xq,Q$],children:e})})}function Jq({value:e,baseline:t,onChange:n,onRevert:a,disabled:l}){const[o,c]=x.useState(!1),f=x.useRef(null),m=e!==t;return x.useEffect(()=>{var h;o&&((h=f.current)==null||h.focus())},[o]),u.jsxs(tn,{style:{borderColor:m?"color-mix(in oklch, var(--state-blocked) 70%, transparent)":void 0},children:[u.jsxs(Or,{children:[u.jsxs(Mr,{children:["System prompt append",m&&u.jsx(Wq,{})]}),!o&&!l&&u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>c(!0),children:[u.jsx(wf,{className:"h-3 w-3"})," Edit"]})]}),u.jsx(Tn,{children:o?u.jsxs("div",{className:"space-y-2",children:[u.jsx("textarea",{ref:f,value:e,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),c(!1))},rows:10,className:"w-full rounded border bg-transparent p-2 font-mono text-body shadow-sm focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Appended to Claude Code's default system prompt.",maxLength:32e3,spellCheck:!1}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{size:"xs",variant:"ghost",onClick:()=>{a(),c(!1)},disabled:!m,children:"Revert"}),u.jsx(me,{size:"xs",onClick:()=>c(!1),children:"Done"})]}),u.jsx("p",{className:"text-caption text-muted-foreground",children:"`Done` collapses this editor. The change is saved only when you click Save in the bar at the bottom of the page."})]}):u.jsx("div",{className:"rounded bg-muted p-3 text-body max-h-64 overflow-auto min-h-8",children:e?u.jsx(hv,{children:e}):u.jsx("span",{className:"text-muted-foreground italic",children:"No prompt append."})})})]})}function Wq(){return u.jsx("span",{className:"mono uppercase text-caption",style:{padding:"var(--hairline) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"color-mix(in oklch, var(--state-blocked) 16%, transparent)",color:"color-mix(in oklch, var(--state-blocked) 60%, var(--fg))"},children:"changed"})}const jN={"claude-code":"Claude Code",codex:"Codex"},e7=[rf.CLAUDE_CODE,rf.CODEX];function t7({open:e,onOpenChange:t,agent:n}){const a=nn(),l=n.clientId,o=n.runtimeProvider,[c,f]=x.useState(l),[m,h]=x.useState(o),[y,g]=x.useState(!1),w=He({queryKey:["clients-rebind"],queryFn:Ni,enabled:e}).data??[],k=UT({queries:w.map(U=>({queryKey:["client-capabilities",U.id],queryFn:()=>ky(U.id),enabled:e}))}),j=x.useMemo(()=>{const U=new Map;return k.forEach((Q,I)=>{const ne=w[I];if(!ne)return;const le=Q.data;le!=null&&le.capabilities&&U.set(ne.id,le.capabilities)}),U},[k,w]);x.useEffect(()=>{e||(f(l),h(o),g(!1))},[e,l,o]);const E=c?j.get(c)??null:null,C=(E==null?void 0:E[m])??null,R=!C||C.state==="missing"||C.state==="error",O=!!c&&(c!==l||m!==o)&&(!R||y),M=m!==o,B=c!==l,z=St({mutationFn:()=>{if(!c)throw new Error("clientId required");return tD(n.uuid,{clientId:c,runtimeProvider:m,force:R&&y?!0:void 0})},onSuccess:()=>{a.invalidateQueries({queryKey:["agent",n.uuid]}),a.invalidateQueries({queryKey:["agents"]}),t(!1)}}),$=z.error instanceof Qu||z.error instanceof Error?z.error.message:null;return u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{className:"max-w-lg",children:[u.jsx(fn,{children:u.jsx(on,{children:"Re-bind agent"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:["Currently:"," ",u.jsx("span",{className:"mono",children:r7(l,w,o)})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Computer"}),u.jsx("select",{value:c??"",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=>u.jsx("option",{value:U.id,children:n7(U)},U.id))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Runtime"}),u.jsx("div",{className:"space-y-2",children:e7.map(U=>{const Q=(E==null?void 0:E[U])??null,I=!!Q&&Q.state!=="missing",ne=m===U;return u.jsxs("label",{className:ne?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":I?"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30":"flex items-start gap-3 rounded-md border border-border p-3 opacity-60",children:[u.jsx("input",{type:"radio",name:"rebind-runtime",checked:ne,onChange:()=>h(U),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:jN[U]}),u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:i7(Q,U)})]})]},U)})})]}),(B||M)&&u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-caption space-y-1",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:"Heads up:"})," active sessions on the previous computer are suspended at re-bind. Chat history is preserved."]}),M&&u.jsx("p",{children:"Some configuration fields don't transfer between providers (e.g. claude permission_mode is dropped; codex sandboxMode resets to default)."})]}),R&&u.jsxs("label",{className:"flex items-start gap-2 text-caption",style:{color:"var(--fg-2)"},children:[u.jsx("input",{type:"checkbox",checked:y,onChange:U=>g(U.target.checked),className:"mt-0.5"}),u.jsx("span",{children:"Override capability check — pick this if the destination computer is offline or the SDK was just installed and capabilities haven't refreshed yet."})]}),$&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:$})]}),u.jsxs(Ln,{children:[u.jsx(me,{variant:"outline",onClick:()=>t(!1),disabled:z.isPending,children:"Cancel"}),u.jsx(me,{onClick:()=>z.mutate(),disabled:!O||z.isPending,children:z.isPending?"Re-binding…":"Re-bind"})]})]})})}function n7(e){return`${e.hostname??e.id} · ${e.status}`}function r7(e,t,n){const a=e?t.find(o=>o.id===e):null;return`${(a==null?void 0:a.hostname)??e??"(unbound)"} · ${jN[n]}`}const a7={"claude-code":"Run `claude login` (or set ANTHROPIC_API_KEY) on the computer.",codex:"Run `codex login` (or set CODEX_API_KEY) on the computer."};function i7(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. ${a7[t]}`;case"missing":return"SDK not installed on this computer.";case"error":return e.error?`Probe error: ${e.error}`:"Probe error."}}const l7={prompt:"Prompt",model:"Model",mcp:"MCP",env:"Env",git:"Git"};function s7(e){if(!e.summary.anyDirty&&!e.conflictMessage&&!e.errorMessage&&!e.justSaved)return null;const t=e.summary.dirtySections.length;return u.jsx("div",{className:"sticky bottom-0 z-30 -mx-6 backdrop-blur",style:{padding:"var(--sp-3) var(--sp-6)",background:"color-mix(in oklch, var(--bg-raised) 94%, transparent)",borderTop:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{className:"flex flex-col gap-1 text-body min-w-0",children:[e.summary.anyDirty&&u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(mu,{state:"blocked",size:8}),u.jsxs("span",{className:"font-medium",children:[t," section",t===1?"":"s"," with unsaved changes"]}),u.jsx("span",{style:{color:"var(--fg-4)"},"aria-hidden":!0,children:"·"}),u.jsx("span",{className:"flex flex-wrap gap-1",children:e.summary.dirtySections.map(n=>u.jsx("button",{type:"button",onClick:()=>e.onJumpTo(n),className:"text-caption transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{padding:"var(--sp-0_5) var(--sp-1_5)",borderRadius:"var(--radius-chip)",background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",color:"var(--fg-2)",cursor:"pointer"},children:l7[n]},n))})]}),e.justSaved&&!e.summary.anyDirty&&!e.errorMessage&&!e.conflictMessage&&u.jsxs("div",{className:"inline-flex items-center gap-1.5 text-body font-medium",style:{color:"var(--state-idle)"},children:[u.jsx(fr,{className:"h-3.5 w-3.5"}),"Saved"]}),e.saveHint&&u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:e.saveHint}),e.conflictMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-blocked)"},children:e.conflictMessage}),e.errorMessage&&u.jsx("p",{className:"text-caption font-medium",style:{color:"var(--state-error)"},children:e.errorMessage})]}),u.jsxs("div",{className:"flex gap-2 shrink-0",children:[e.conflictMessage&&u.jsx(me,{variant:"outline",size:"sm",onClick:e.onReloadRemote,children:"Discard mine, load latest"}),u.jsx(me,{variant:"ghost",size:"sm",onClick:e.onDiscard,disabled:e.saving,children:"Discard changes"}),u.jsx(me,{size:"sm",onClick:e.onSave,disabled:e.saving||!e.summary.anyDirty,children:e.saving?u.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[u.jsx(mz,{className:"h-3 w-3 animate-spin","aria-hidden":!0}),"Saving…"]}):"Save"})]})]})})}function vu(e){return`agent-cfg-${e}`}function uu({anchorId:e,title:t,caption:n,right:a,children:l,className:o,sectionProps:c}){return u.jsxs("section",{id:e,className:Te("space-y-3",o),...c,children:[u.jsxs("div",{className:"flex items-end justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-subtitle",style:{color:"var(--fg)"},children:t}),n&&u.jsx("div",{className:"text-caption",style:{color:"var(--fg-3)"},children:n})]}),a]}),u.jsx("div",{className:"space-y-3",children:l})]})}function o7(){return u.jsx("hr",{"aria-hidden":!0,style:{border:0,borderTop:"var(--hairline) solid var(--border)",margin:"var(--sp-2) 0"}})}const u7={"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 c7(e){const t=u7[e.runtimeProvider];return u.jsxs("div",{className:"space-y-3",children:[u.jsx(d7,{name:t.name,caption:t.caption,locked:!0}),u.jsx(f7,{computerLabel:e.computerLabel,canBindComputer:e.canBindComputer,bindPending:e.bindComputerPending??!1,onBindComputer:e.onBindComputer,onRebind:e.onRebind}),e.modelSlot]})}function d7({name:e,caption:t,locked:n}){return u.jsxs(tn,{children:[u.jsx(Or,{children:u.jsxs(Mr,{children:["Where it runs",n&&u.jsxs("span",{className:"mono uppercase text-caption inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(ej,{className:"h-3 w-3","aria-hidden":!0})," locked"]})]})}),u.jsxs(Tn,{className:"space-y-1 text-body",children:[u.jsxs("div",{className:"inline-flex items-center gap-2",children:[u.jsx(tj,{className:"h-3.5 w-3.5","aria-hidden":!0,style:{color:"var(--accent)"}}),u.jsx("span",{className:"font-medium",children:e})]}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:t})]})]})}function f7(e){const t=!!e.computerLabel;return u.jsxs(tn,{children:[u.jsxs(Or,{children:[u.jsx(Mr,{children:"Bound computer"}),e.canBindComputer&&e.onBindComputer&&!t&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onBindComputer,disabled:e.bindPending,children:[u.jsx(kg,{className:"h-3 w-3"}),e.bindPending?"Binding…":"Bind computer"]}),t&&e.onRebind&&u.jsxs(me,{size:"xs",variant:"outline",onClick:e.onRebind,children:[u.jsx(kg,{className:"h-3 w-3"}),"Re-bind"]})]}),u.jsx(Tn,{className:"text-body",children:t?u.jsx("div",{className:"mono",style:{color:"var(--fg-2)"},children:e.computerLabel}):u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"No computer bound. A computer claims this agent on its first WebSocket connect, or you can pick one manually via the button above."})})]})}function h7(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 m7(e,t){let n=t.size+1;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}function p7(e,t){return JSON.stringify(e)===JSON.stringify(t)}function $p(e,t){return e.map((n,a)=>({key:`${t}-${a+1}`,value:n,baseline:n,status:"unchanged"}))}function RS(e){return e.map(t=>t.status==="deleted"?t:t.baseline==null?{...t,status:"added"}:p7(t.value,t.baseline)?{...t,status:"unchanged"}:{...t,status:"modified"})}function Fp(e,t){const n=e;return{add:a=>t(l=>{const o=l[e],c=new Set(o.map(h=>h.key)),f=m7(n,c),m=[...o,{key:f,value:a,baseline:null,status:"added"}];return{...l,[e]:RS(m)}}),update:(a,l)=>t(o=>{const f=o[e].map(m=>m.key===a?{...m,value:l}:m);return{...o,[e]:RS(f)}}),remove:a=>t(l=>{const c=l[e].map(f=>f.key!==a?f:f.baseline==null?null:{...f,status:"deleted"}).filter(f=>f!==null);return{...l,[e]:c}}),undo:a=>t(l=>{const c=l[e].map(f=>f.key!==a||f.baseline==null?f:{...f,value:f.baseline,status:"unchanged"});return{...l,[e]:c}})}}function g7(e){return{promptAppend:e.payload.prompt.append,model:e.payload.model,mcp:$p(e.payload.mcpServers,"mcp"),env:$p(e.payload.env,"env"),git:$p(e.payload.gitRepos,"git")}}function y7(e){const[t,n]=x.useState(null);x.useEffect(()=>{e&&t===null&&n(g7(e))},[e,t]);const a=t??{promptAppend:"",model:"",mcp:[],env:[],git:[]},l=(e==null?void 0:e.payload.prompt.append)??"",o=(e==null?void 0:e.payload.model)??"",c=a.promptAppend!==l,f=a.model!==o,m=x.useMemo(()=>{const O=[],M=U=>U.reduce((Q,I)=>I.status==="unchanged"?Q:Q+1,0),B=M(a.mcp),z=M(a.env),$=M(a.git);return c&&O.push("prompt"),f&&O.push("model"),B>0&&O.push("mcp"),z>0&&O.push("env"),$>0&&O.push("git"),{anyDirty:O.length>0,dirtySections:O,counts:{prompt:c?1:0,model:f?1:0,mcp:B,env:z,git:$}}},[a,c,f]),h=x.useCallback(O=>{n(M=>M&&O(M))},[]),y=x.useCallback(O=>h(M=>({...M,promptAppend:O})),[h]),g=x.useCallback(()=>h(O=>({...O,promptAppend:l})),[h,l]),b=x.useCallback(O=>h(M=>({...M,model:O})),[h]),w=x.useCallback(()=>h(O=>({...O,model:o})),[h,o]),k=x.useMemo(()=>Fp("mcp",h),[h]),j=x.useMemo(()=>Fp("env",h),[h]),E=x.useMemo(()=>Fp("git",h),[h]),C=x.useCallback(()=>{n(null)},[]),R=x.useCallback(()=>{if(!t||!e)return{};const O={};c&&(O.prompt={append:t.promptAppend}),f&&(O.model=t.model);const M=m.counts.mcp>0,B=m.counts.env>0,z=m.counts.git>0;return M&&(O.mcpServers=t.mcp.filter($=>$.status!=="deleted").map($=>$.value)),B&&(O.env=t.env.filter($=>$.status!=="deleted").map($=>{const U=$.value;return U.sensitive&&U.value===af?{key:U.key,value:af,sensitive:!0}:U})),z&&(O.gitRepos=t.git.filter($=>$.status!=="deleted").map($=>$.value)),O},[t,e,c,f,m]);return{draft:a,summary:m,promptDirty:c,modelDirty:f,setPromptAppend:y,revertPrompt:g,setModel:b,revertModel:w,addMcp:k.add,updateMcp:k.update,deleteMcp:k.remove,undoDeleteMcp:k.undo,addEnv:j.add,updateEnv:j.update,deleteEnv:j.remove,undoDeleteEnv:j.undo,addGit:E.add,updateGit:E.update,deleteGit:E.remove,undoDeleteGit:E.undo,resetAll:C,buildPayloadPatch:R}}const En={overview:"ad-overview",setup:"ad-setup",prompt:vu("prompt"),tools:vu("mcp"),advanced:"ad-advanced",danger:"ad-danger"};function v7(e){const t=[{key:"overview",label:"Profile",anchor:En.overview}];return e||t.push({key:"setup",label:"Setup",anchor:En.setup},{key:"prompt",label:"Prompt",anchor:En.prompt},{key:"tools",label:"Tools",anchor:En.tools},{key:"advanced",label:"Advanced",anchor:En.advanced}),t.push({key:"danger",label:"Danger zone",anchor:En.danger,divider:!0,danger:!0}),t}function b7(){var gn,mt,Dr,Pn,ic,Ii,Li,Ui,Zr,Pi,La,lc;const t=Dk().uuid??"",n=Un(),a=nn(),l=He({queryKey:["agent",t],queryFn:()=>JM(t),enabled:!!t}),o=He({queryKey:["agent-config",t],queryFn:()=>qU(t),enabled:!!t&&((gn=l.data)==null?void 0:gn.type)!=="human"}),c=He({queryKey:["agent-client-status",t],queryFn:()=>VU(t),enabled:!!t&&((mt=l.data)==null?void 0:mt.type)!=="human"}),f=He({queryKey:["agent-sessions-active",t],queryFn:()=>xj(t,{state:"active"}),enabled:!!t&&((Dr=l.data)==null?void 0:Dr.type)!=="human"}),m=He({queryKey:["clients"],queryFn:Ni,enabled:!!t&&((Pn=l.data)==null?void 0:Pn.type)!=="human",refetchInterval:3e4}),h=y7(o.data),[y,g]=x.useState(null),[b,w]=x.useState(null),[k,j]=x.useState(!1),E=St({mutationFn:async()=>{if(!o.data)throw new Error("config not loaded");const xe=h.buildPayloadPatch();return HU(t,{expectedVersion:o.data.version,payload:xe})},onSuccess:xe=>{a.setQueryData(["agent-config",t],xe),g(null),w(null),j(!0)},onError:xe=>{if(j(!1),xe instanceof Qu&&xe.status===409){w("Someone else saved a newer version while you were editing."),g(null);return}g(xe instanceof Error?xe.message:String(xe))}});x.useEffect(()=>{if(!k)return;const xe=setTimeout(()=>j(!1),2500);return()=>clearTimeout(xe)},[k]),x.useEffect(()=>{h.summary.anyDirty&&j(!1)},[h.summary.anyDirty]);const C=x.useCallback(()=>{w(null),g(null),a.invalidateQueries({queryKey:["agent-config",t]}),h.resetAll()},[a,t,h]),R=x.useCallback(xe=>{const Ye=document.getElementById(xe);Ye&&Ye.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=St({mutationFn:xe=>fw(t,xe),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agents"]})}}),M=St({mutationFn:()=>rD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),B=St({mutationFn:()=>aD(t),onSuccess:()=>a.invalidateQueries({queryKey:["agent",t]})}),z=St({mutationFn:()=>nD(t),onSuccess:()=>n("/team")}),$=St({mutationFn:()=>iD(t)}),[U,Q]=x.useState(!1),[I,ne]=x.useState(""),[le,we]=x.useState(null),[Y,J]=x.useState(!1),H=He({queryKey:["clients"],queryFn:Ni,enabled:U}),ee=St({mutationFn:xe=>fw(t,{clientId:xe}),onSuccess:()=>{a.invalidateQueries({queryKey:["agent",t]}),a.invalidateQueries({queryKey:["agent-client-status",t]}),a.invalidateQueries({queryKey:["agents"]}),Q(!1),ne(""),we(null)},onError:xe=>we(xe instanceof Error?xe.message:String(xe))}),[be,Ae]=x.useState(!1),[A,L]=x.useState(null),P=St({mutationFn:()=>ZU(t,h.buildPayloadPatch()),onSuccess:xe=>{const Ye=xe.diff.length?xe.diff.map(yn=>`${yn.op} ${yn.path}`).join(`
|
|
386
|
-
`):"(no changes)";L(Ye)},onError:xe=>L(`Dry run failed: ${xe instanceof Error?xe.message:String(xe)}`)});x.useEffect(()=>{if(!h.summary.anyDirty)return;const xe=Ye=>{Ye.preventDefault(),Ye.returnValue=""};return window.addEventListener("beforeunload",xe),()=>window.removeEventListener("beforeunload",xe)},[h.summary.anyDirty]);const T=((ic=l.data)==null?void 0:ic.type)==="human",Z=x.useMemo(()=>v7(T),[T]),W=x.useRef(null),[ce,ve]=x.useState(!1);x.useEffect(()=>{if(T)return;const xe=W.current;if(!xe||typeof IntersectionObserver>"u")return;const Ye=new IntersectionObserver(yn=>{const aa=yn[0];aa&&ve(!aa.isIntersecting&&aa.boundingClientRect.top<0)},{threshold:0});return Ye.observe(xe),()=>Ye.disconnect()},[T]);const[ge,fe]=x.useState(En.overview);x.useEffect(()=>{if(typeof IntersectionObserver>"u")return;const xe=[];for(const Ye of Z){const yn=document.getElementById(Ye.anchor);if(!yn)continue;const aa=new IntersectionObserver(lo=>{for(const sc of lo)sc.isIntersecting&&fe(Ye.anchor)},{rootMargin:"0% 0% -70% 0%",threshold:0});aa.observe(yn),xe.push(aa)}return()=>{for(const Ye of xe)Ye.disconnect()}},[Z]);const Qe=x.useMemo(()=>{const xe=new Set;for(const Ye of h.summary.dirtySections)Ye==="prompt"&&xe.add(En.prompt),Ye==="model"&&xe.add(En.setup),Ye==="mcp"&&xe.add(En.tools),(Ye==="env"||Ye==="git")&&xe.add(En.advanced);return xe},[h.summary.dirtySections]);if(l.isLoading)return u.jsx("div",{className:"-m-6 flex",style:{minHeight:"100%"},children:u.jsx("div",{className:"p-6 text-body",style:{color:"var(--fg-3)"},children:"Loading…"})});if(l.error)return u.jsxs("div",{className:"-m-6 p-6 text-body",style:{color:"var(--state-error)"},children:["Failed to load agent: ",l.error instanceof Error?l.error.message:"Unknown error"]});const Oe=l.data;if(!Oe)return u.jsx("div",{className:"-m-6 p-6 text-body",style:{color:"var(--fg-3)"},children:"Agent not found"});const ut=Oe.type==="human",ae=c.data,Se=((Ii=f.data)==null?void 0:Ii.length)??0,Me=!ut&&!(ae!=null&&ae.clientId),Ge=!ut&&ae?!ae.online&&!!ae.clientId:!1,Rn=Oe,zn=Rn.runtimeState??null,Da=Rn.runtimeType??null,Ia=Rn.totalSessions??null,ra=Oe.uuid.slice(0,8),ro=h7({activeSessions:Se,isUnclaimed:Me,isOffline:Ge}),ao=h.draft.mcp.filter(xe=>xe.status!=="deleted"),mn=h.draft.env.filter(xe=>xe.status!=="deleted"),io=h.draft.git.filter(xe=>xe.status!=="deleted"),se=xe=>new Set(ao.filter(Ye=>Ye.key!==xe).map(Ye=>Ye.value.name.toLowerCase())),ye=xe=>new Set(mn.filter(Ye=>Ye.key!==xe).map(Ye=>Ye.value.key)),Pe=xe=>new Set(io.filter(Ye=>Ye.key!==xe).map(Ye=>{const{value:yn}=Ye;return yn.localPath?yn.localPath:((yn.url.split(/[?#]/)[0]??"").split(/[/:]/).filter(Boolean).pop()??"").replace(/\.git$/i,"")}).filter(Boolean)),$e={sessions:Ia??"—",active:Se,runtime:Da??(ut?"human":"—"),model:((Ui=(Li=o.data)==null?void 0:Li.payload.model)==null?void 0:Ui.trim())||"—"},rt=(ae==null?void 0:ae.clientId)??null,pn=rt?((Zr=m.data)==null?void 0:Zr.find(xe=>xe.id===rt))??null:null,mr=rt?(pn==null?void 0:pn.hostname)??rt:null,rn=Oe.runtimeProvider??"claude-code",qt=rn==="codex"?"Codex":"Claude Code";return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:220,borderRight:"var(--hairline) solid var(--border)",background:"var(--bg-raised)",padding:"var(--sp-3) 0"},children:[u.jsx(Vy,{style:{display:"block",padding:"var(--sp-1) var(--sp-4) var(--sp-2)"},children:"Agent"}),Z.map(xe=>u.jsxs("div",{children:[xe.divider&&u.jsx("div",{"aria-hidden":!0,style:{margin:"var(--sp-2) var(--sp-3_5)",borderTop:"var(--hairline) solid var(--border)"}}),u.jsx(x7,{label:xe.label,active:ge===xe.anchor,danger:xe.danger??!1,dirty:Qe.has(xe.anchor),onClick:()=>R(xe.anchor)})]},xe.key))]}),u.jsxs("div",{className:"flex-1 min-w-0 overflow-auto",style:{background:"var(--bg)"},children:[u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5)",borderBottom:"var(--hairline) solid var(--border-faint)",background:"var(--bg-raised)"},children:[u.jsxs(QU,{style:{marginBottom:"var(--sp-2)"},children:[u.jsx(KU,{onClick:()=>n("/team"),children:"Agents"}),u.jsx(GU,{}),u.jsx(YU,{mono:!0,children:Oe.name??ra})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"inline-flex items-center justify-center",style:{width:36,height:36,borderRadius:"var(--radius-panel)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border-strong)"},children:u.jsx(Xu,{width:18,height:20,style:{color:"var(--accent)"}})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsx("span",{className:"text-title",title:`agt_${ra}`,children:Oe.displayName}),u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:["@",Oe.name??ra]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-caption",style:{color:"var(--fg-4)"},children:[u.jsx(Br,{tone:Oe.type==="autonomous_agent"?"accent":"neutral",children:Oe.type}),Oe.visibility&&u.jsx(Br,{tone:Oe.visibility==="organization"?"accent":"outline",children:Oe.visibility}),(ae==null?void 0:ae.offlineSince)&&u.jsxs("span",{className:"mono",children:["offline since ",Cu(ae.offlineSince)]})]})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(zu,{state:zn}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>n(`/?a=${Oe.uuid}`),children:[u.jsx(by,{className:"h-3 w-3"})," Open chat"]}),!ut&&Oe.status==="active"&&u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>{$.reset(),$.mutate()},disabled:$.isPending,children:[u.jsx(tj,{className:"h-3 w-3"}),$.isPending?"Testing…":"Test"]})]})]}),u.jsxs("div",{className:"grid gap-1.5 mt-3",style:{gridTemplateColumns:"repeat(4, 1fr)"},children:[u.jsx(Od,{label:"sessions",value:$e.sessions}),u.jsx(Od,{label:"active",value:$e.active,accent:typeof $e.active=="number"&&$e.active>0?"var(--accent)":void 0}),u.jsx(Od,{label:"runtime",value:$e.runtime}),u.jsx(Od,{label:"model",value:$e.model})]})]}),u.jsx("div",{ref:W,"aria-hidden":!0,style:{height:0}}),!ut&&u.jsx(WU,{runtimeLabel:qt,computerLabel:mr,visible:ce}),u.jsxs("div",{className:"mx-auto",style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)",maxWidth:960,display:"flex",flexDirection:"column",gap:20},children:[($.data||$.error)&&u.jsx(E7,{result:$.data??{status:"error",message:"Failed to reach server"},onDismiss:()=>$.reset()}),u.jsx(uu,{anchorId:En.overview,title:"Profile",right:u.jsxs(me,{variant:"outline",size:"xs",onClick:()=>n(`/settings/integrations?agent=${Oe.uuid}`),title:"Manage platform bindings in Integrations",children:[u.jsx(kg,{className:"h-3 w-3"}),"Manage bindings"]}),children:u.jsx(hP,{agent:Oe,onSave:async xe=>{await O.mutateAsync(xe)}})}),!ut&&u.jsxs(u.Fragment,{children:[u.jsxs(uu,{anchorId:En.setup,title:"Setup",caption:((Pi=o.data)==null?void 0:Pi.version)!=null?u.jsxs("span",{className:"mono",children:["config v",o.data.version,h.summary.anyDirty&&u.jsxs(u.Fragment,{children:[" · ",u.jsx("span",{style:{color:"var(--state-blocked)"},children:"draft"})]})]}):null,children:[o.isLoading&&u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading configuration…"}),o.error&&u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load configuration: ",String(o.error)]}),o.data&&u.jsx(c7,{runtimeProvider:rn,computerLabel:mr,canBindComputer:Me&&Oe.status==="active",bindComputerPending:ee.isPending,onBindComputer:()=>Q(!0),onRebind:Oe.clientId?()=>J(!0):void 0,modelSlot:u.jsx(jP,{value:h.draft.model,baseline:((La=o.data)==null?void 0:La.payload.model)??"",onChange:h.setModel,onRevert:h.revertModel,disabled:Oe.status!=="active",provider:rn})})]}),u.jsx(uu,{anchorId:En.prompt,title:"Prompt",children:o.data?u.jsx(Jq,{value:h.draft.promptAppend,baseline:((lc=o.data)==null?void 0:lc.payload.prompt.append)??"",onChange:h.setPromptAppend,onRevert:h.revertPrompt,disabled:Oe.status!=="active"}):null}),u.jsx(uu,{anchorId:En.tools,title:"Tools",caption:"MCP servers available to this agent",children:o.data?u.jsx(gP,{items:h.draft.mcp,otherNames:se,onAdd:h.addMcp,onUpdate:h.updateMcp,onDelete:h.deleteMcp,onUndoDelete:h.undoDeleteMcp,disabled:Oe.status!=="active"}):null}),u.jsx(uu,{anchorId:En.advanced,title:"Advanced",caption:"Environment variables and git repositories the runtime clones into each session.",children:o.data&&u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{id:vu("env"),children:u.jsx(lP,{items:h.draft.env,otherKeys:ye,onAdd:h.addEnv,onUpdate:h.updateEnv,onDelete:h.deleteEnv,onUndoDelete:h.undoDeleteEnv,disabled:Oe.status!=="active"})}),u.jsx("div",{id:vu("git"),children:u.jsx(oP,{items:h.draft.git,otherPaths:Pe,onAdd:h.addGit,onUpdate:h.updateGit,onDelete:h.deleteGit,onUndoDelete:h.undoDeleteGit,disabled:Oe.status!=="active"})}),A&&u.jsx("pre",{className:"whitespace-pre-wrap mono text-label",style:{padding:"var(--sp-2)",borderRadius:"var(--radius-input)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",color:"var(--fg-2)"},children:A}),h.summary.anyDirty&&u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)"},children:u.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"})})]})})]}),u.jsx(o7,{}),u.jsx(eP,{agent:Oe,suspendPending:M.isPending,reactivatePending:B.isPending,deletePending:z.isPending,onSuspend:()=>M.mutate(),onReactivate:()=>B.mutate(),onDelete:()=>z.mutate()})]}),!ut&&u.jsx(s7,{summary:h.summary,saveHint:ro,conflictMessage:b,errorMessage:y,saving:E.isPending,justSaved:k,onSave:()=>E.mutate(),onDiscard:()=>{h.summary.anyDirty&&Ae(!0)},onReloadRemote:C,onJumpTo:xe=>R(vu(xe))})]}),u.jsx(w7,{open:be,onOpenChange:Ae,title:"Discard unsaved changes?",description:"Your edits to Prompt / Model / Tools / Advanced will be reverted to the last saved baseline.",confirmLabel:"Discard changes",destructive:!0,onConfirm:()=>{h.resetAll(),g(null),w(null),Ae(!1)}}),u.jsx(sn,{open:U,onOpenChange:xe=>{Q(xe),xe||(ne(""),we(null),ee.reset())},children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:"Bind computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick a computer you own to pin this agent to. The bind is one-shot — once set, moving the agent requires deleting and re-creating it on the target computer."}),H.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading computers…"}):H.error?u.jsxs("div",{className:"text-body",style:{color:"var(--state-error)"},children:["Failed to load computers: ",H.error instanceof Error?H.error.message:"Unknown"]}):u.jsx(S7,{clients:H.data??[],selected:I,onSelect:ne}),le&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:le})]}),u.jsxs(Ln,{children:[u.jsx(me,{variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),u.jsx(me,{disabled:!I||ee.isPending,onClick:()=>{we(null),ee.mutate(I)},children:ee.isPending?"Binding…":"Bind"})]})]})}),u.jsx(t7,{open:Y,onOpenChange:J,agent:Oe})]})}function x7({label:e,active:t,danger:n,dirty:a,onClick:l}){return u.jsx("button",{type:"button",onClick:l,className:Te("block w-full text-left bg-transparent text-body transition-colors cursor-pointer","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",t?"":"hover:bg-accent"),style:{padding:"var(--sp-1_25) var(--sp-4) var(--sp-1_25) var(--sp-3_5)",border:"none",borderLeft:`var(--hairline-bold) solid ${t?"var(--accent)":"transparent"}`,background:t?"var(--bg-active)":"transparent",color:t?"var(--fg)":"var(--fg-3)",fontWeight:t?500:400},children:u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex-1 truncate",children:e}),a&&u.jsx("span",{role:"img","aria-label":"unsaved changes",style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-blocked)",flexShrink:0}}),n&&!a&&u.jsx("span",{"aria-hidden":!0,style:{width:"var(--sp-1_5)",height:"var(--sp-1_5)",borderRadius:"50%",background:"var(--state-error)",flexShrink:0}})]})})}function w7(e){return u.jsx(sn,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:e.destructive?"destructive":"default",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function S7({clients:e,selected:t,onSelect:n}){const a=e.filter(l=>l.status==="connected");return a.length===0?u.jsxs("div",{className:"text-body",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:"var(--sp-2_5) var(--sp-3)",color:"var(--fg-3)"},children:["No connected computers available. Run"," ",u.jsx("code",{className:"mono text-label",children:"first-tree-hub client connect <url>"})," on the computer that should run this agent, then reopen this dialog."]}):u.jsx("ul",{className:"max-h-64 overflow-y-auto",style:{border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",margin:0,padding:0,listStyle:"none"},children:a.map(l=>{const o=l.id===t,c=l.status==="online"||l.status==="active";return u.jsx("li",{style:{borderTop:"var(--hairline) solid var(--border-faint)"},children:u.jsxs("button",{type:"button",onClick:()=>n(l.id),className:Te("w-full text-left flex items-center gap-3"),style:{padding:"var(--sp-2) var(--sp-3)",background:o?"var(--accent-bg)":"transparent",border:"none",cursor:"pointer"},children:[u.jsx("span",{className:Te("inline-block h-2 w-2 rounded-full shrink-0"),style:{background:c?"var(--state-idle)":"var(--fg-4)"},"aria-hidden":!0}),u.jsxs("span",{className:"flex-1 min-w-0",children:[u.jsx("span",{className:"block text-body truncate font-medium",children:l.hostname??l.id}),u.jsxs("span",{className:"block mono truncate text-caption",style:{color:"var(--fg-4)"},children:[l.id,l.os?` · ${l.os}`:"",l.sdkVersion?` · SDK ${l.sdkVersion}`:""]})]}),u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:l.status})]})},l.id)})})}const k7={success:"Connected",timeout:"Timed out",offline:"Offline",stale:"Stale",error:"Error"},j7={success:"var(--state-idle)",timeout:"var(--state-blocked)",offline:"var(--state-offline)",stale:"var(--state-blocked)",error:"var(--state-error)"},C7={success:"accent",timeout:"warn",stale:"warn",error:"error",offline:"neutral"};function E7({result:e,onDismiss:t}){const n=j7[e.status],a=C7[e.status],l=e.connection;return u.jsx("div",{style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderLeft:`var(--sp-0_75) solid ${n}`,borderRadius:"var(--radius-panel)",padding:"var(--sp-3) var(--sp-3_5)"},children:u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Br,{tone:a,children:k7[e.status]}),e.responseTime!=null&&u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:[(e.responseTime/1e3).toFixed(1),"s"]})]}),e.message&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:e.message}),l&&u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:6,marginTop:2},children:[u.jsx("div",{children:l.runtimeState&&u.jsxs("span",{className:"mono",children:["runtime: ",l.runtimeState]})}),l.client?u.jsxs("div",{children:["Computer: ",l.client.hostname??l.client.id,l.client.os&&` (${l.client.os})`,l.client.sdkVersion&&` · SDK ${l.client.sdkVersion}`]}):u.jsx("div",{children:"No computer bound"}),l.lastSeenAt&&u.jsxs("div",{children:["Last seen: ",new Date(l.lastSeenAt).toLocaleString()]})]}),e.responseContent&&u.jsx("p",{className:"mono whitespace-pre-wrap text-label",style:{background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",padding:8,maxHeight:160,overflow:"auto"},children:e.responseContent})]}),u.jsx(me,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})]})})}function N7(e){var t=0,n=e.children,a=n&&n.length;if(!a)t=1;else for(;--a>=0;)t+=n[a].value;e.value=t}function _7(){return this.eachAfter(N7)}function T7(e,t){let n=-1;for(const a of this)e.call(t,a,++n,this);return this}function A7(e,t){for(var n=this,a=[n],l,o,c=-1;n=a.pop();)if(e.call(t,n,++c,this),l=n.children)for(o=l.length-1;o>=0;--o)a.push(l[o]);return this}function R7(e,t){for(var n=this,a=[n],l=[],o,c,f,m=-1;n=a.pop();)if(l.push(n),o=n.children)for(c=0,f=o.length;c<f;++c)a.push(o[c]);for(;n=l.pop();)e.call(t,n,++m,this);return this}function z7(e,t){let n=-1;for(const a of this)if(e.call(t,a,++n,this))return a}function O7(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,a=t.children,l=a&&a.length;--l>=0;)n+=a[l].value;t.value=n})}function M7(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function D7(e){for(var t=this,n=I7(t,e),a=[t];t!==n;)t=t.parent,a.push(t);for(var l=a.length;e!==n;)a.splice(l,0,e),e=e.parent;return a}function I7(e,t){if(e===t)return e;var n=e.ancestors(),a=t.ancestors(),l=null;for(e=n.pop(),t=a.pop();e===t;)l=e,e=n.pop(),t=a.pop();return l}function L7(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function U7(){return Array.from(this)}function P7(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function B7(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*$7(){var e=this,t,n=[e],a,l,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,a=e.children)for(l=0,o=a.length;l<o;++l)n.push(a[l]);while(n.length)}function CN(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=H7)):t===void 0&&(t=q7);for(var n=new qs(e),a,l=[n],o,c,f,m;a=l.pop();)if((c=t(a.data))&&(m=(c=Array.from(c)).length))for(a.children=c,f=m-1;f>=0;--f)l.push(o=c[f]=new qs(c[f])),o.parent=a,o.depth=a.depth+1;return n.eachBefore(EN)}function F7(){return CN(this).eachBefore(Z7)}function q7(e){return e.children}function H7(e){return Array.isArray(e)?e[1]:null}function Z7(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function EN(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function qs(e){this.data=e,this.depth=this.height=0,this.parent=null}qs.prototype=CN.prototype={constructor:qs,count:_7,each:T7,eachAfter:R7,eachBefore:A7,find:z7,sum:O7,sort:M7,path:D7,ancestors:L7,descendants:U7,leaves:P7,links:B7,copy:F7,[Symbol.iterator]:$7};function qp(e){return e==null?null:V7(e)}function V7(e){if(typeof e!="function")throw new Error;return e}var Q7={depth:-1},zS={},Hp={};function K7(e){return e.id}function G7(e){return e.parentId}function Y7(){var e=K7,t=G7,n;function a(l){var o=Array.from(l),c=e,f=t,m,h,y,g,b,w,k,j,E=new Map;if(n!=null){const C=o.map((M,B)=>X7(n(M,B,l))),R=C.map(OS),O=new Set(C).add("");for(const M of R)O.has(M)||(O.add(M),C.push(M),R.push(OS(M)),o.push(Hp));c=(M,B)=>C[B],f=(M,B)=>R[B]}for(y=0,m=o.length;y<m;++y)h=o[y],w=o[y]=new qs(h),(k=c(h,y,l))!=null&&(k+="")&&(j=w.id=k,E.set(j,E.has(j)?zS:w)),(k=f(h,y,l))!=null&&(k+="")&&(w.parent=k);for(y=0;y<m;++y)if(w=o[y],k=w.parent){if(b=E.get(k),!b)throw new Error("missing: "+k);if(b===zS)throw new Error("ambiguous: "+k);b.children?b.children.push(w):b.children=[w],w.parent=b}else{if(g)throw new Error("multiple roots");g=w}if(!g)throw new Error("no root");if(n!=null){for(;g.data===Hp&&g.children.length===1;)g=g.children[0],--m;for(let C=o.length-1;C>=0&&(w=o[C],w.data===Hp);--C)w.data=null}if(g.parent=Q7,g.eachBefore(function(C){C.depth=C.parent.depth+1,--m}).eachBefore(EN),g.parent=null,m>0)throw new Error("cycle");return g}return a.id=function(l){return arguments.length?(e=qp(l),a):e},a.parentId=function(l){return arguments.length?(t=qp(l),a):t},a.path=function(l){return arguments.length?(n=qp(l),a):n},a}function X7(e){e=`${e}`;let t=e.length;return Gg(e,t-1)&&!Gg(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function OS(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Gg(e,t););return e.slice(0,t)}function Gg(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function J7(e,t){return e.parent===t.parent?1:2}function Zp(e){var t=e.children;return t?t[0]:e.t}function Vp(e){var t=e.children;return t?t[t.length-1]:e.t}function W7(e,t,n){var a=n/(t.i-e.i);t.c-=a,t.s+=n,e.c+=a,t.z+=n,t.m+=n}function eH(e){for(var t=0,n=0,a=e.children,l=a.length,o;--l>=0;)o=a[l],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function tH(e,t,n){return e.a.parent===t.parent?e.a:n}function Kd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Kd.prototype=Object.create(qs.prototype);function nH(e){for(var t=new Kd(e,0),n,a=[t],l,o,c,f;n=a.pop();)if(o=n._.children)for(n.children=new Array(f=o.length),c=f-1;c>=0;--c)a.push(l=n.children[c]=new Kd(o[c],c)),l.parent=n;return(t.parent=new Kd(null,0)).children=[t],t}function rH(){var e=J7,t=1,n=1,a=null;function l(h){var y=nH(h);if(y.eachAfter(o),y.parent.m=-y.z,y.eachBefore(c),a)h.eachBefore(m);else{var g=h,b=h,w=h;h.eachBefore(function(R){R.x<g.x&&(g=R),R.x>b.x&&(b=R),R.depth>w.depth&&(w=R)});var k=g===b?1:e(g,b)/2,j=k-g.x,E=t/(b.x+k+j),C=n/(w.depth||1);h.eachBefore(function(R){R.x=(R.x+j)*E,R.y=R.depth*C})}return h}function o(h){var y=h.children,g=h.parent.children,b=h.i?g[h.i-1]:null;if(y){eH(h);var w=(y[0].z+y[y.length-1].z)/2;b?(h.z=b.z+e(h._,b._),h.m=h.z-w):h.z=w}else b&&(h.z=b.z+e(h._,b._));h.parent.A=f(h,b,h.parent.A||g[0])}function c(h){h._.x=h.z+h.parent.m,h.m+=h.parent.m}function f(h,y,g){if(y){for(var b=h,w=h,k=y,j=b.parent.children[0],E=b.m,C=w.m,R=k.m,O=j.m,M;k=Vp(k),b=Zp(b),k&&b;)j=Zp(j),w=Vp(w),w.a=h,M=k.z+R-b.z-E+e(k._,b._),M>0&&(W7(tH(k,h,g),h,M),E+=M,C+=M),R+=k.m,E+=b.m,O+=j.m,C+=w.m;k&&!Vp(w)&&(w.t=k,w.m+=R-C),b&&!Zp(j)&&(j.t=b,j.m+=E-O,g=h)}return g}function m(h){h.x*=t,h.y=h.depth*n}return l.separation=function(h){return arguments.length?(e=h,l):e},l.size=function(h){return arguments.length?(a=!1,t=+h[0],n=+h[1],l):a?null:[t,n]},l.nodeSize=function(h){return arguments.length?(a=!0,t=+h[0],n=+h[1],l):a?[t,n]:null},l}function aH(e){const t=`?window=${encodeURIComponent(e)}`;return ke.get(`/context-tree/snapshot${t}`)}function nc({title:e,subtitle:t,right:n,className:a,style:l,...o}){return u.jsxs("div",{className:Te("flex items-baseline gap-3 shrink-0",a),style:{padding:"var(--sp-4) var(--sp-5) var(--sp-3)",...l},...o,children:[u.jsx("h1",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-3)"},children:t}),u.jsx("div",{style:{flex:1}}),n]})}const NN=[{value:"1d",label:"1 day",summary:"last 1 day"},{value:"7d",label:"7 days",summary:"last 7 days"},{value:"30d",label:"30 days",summary:"last 30 days"}];function iH(){const[e,t]=x.useState("7d"),[n,a]=x.useState(null),[l,o]=x.useState(null),c=He({queryKey:["context-tree-snapshot",e],queryFn:()=>aH(e)}),f=c.data,m=x.useMemo(()=>f?f.updates.find(g=>g.id===n)??f.updates[0]??null:null,[n,f]),h=x.useMemo(()=>f&&m!=null&&m.nodeId?f.nodes.find(g=>g.id===m.nodeId)??null:null,[m,f]),y=l??(m==null?void 0:m.nodeId)??(h==null?void 0:h.id)??null;return x.useEffect(()=>{var g;f&&(n&&f.updates.some(b=>b.id===n)||a(((g=f.updates[0])==null?void 0:g.id)??null))},[n,f]),u.jsxs("div",{className:"-m-6",children:[u.jsx(nc,{title:"Context",subtitle:"Team context available to agents, and how it is changing"}),u.jsxs("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:[c.isLoading?u.jsx(dH,{}):null,c.error?u.jsx(fH,{message:c.error instanceof Error?c.error.message:"Failed to load"}):null,f&&!c.isLoading?u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[u.jsx(lH,{snapshot:f,window:e,onWindowChange:t}),f.snapshotStatus==="unavailable"?u.jsx(TN,{snapshot:f}):u.jsx(sH,{snapshot:f,selectedUpdate:m,selectedUpdateNode:h,selectedOverviewNodeId:y,onSelectUpdate:g=>{a(g.id),o(g.nodeId)},onSelectOverviewNode:o})]}):null]})]})}function lH({snapshot:e,window:t,onWindowChange:n}){const a=e.contextStatus.severity==="ok"?u.jsx(nz,{size:18}):u.jsx(wl,{size:18}),l=pH(t);return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-3)"},children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between",style:{gap:"var(--sp-3)"},children:[u.jsxs("div",{className:"flex items-start",style:{gap:"var(--sp-2)"},children:[u.jsx("span",{style:{color:gH(e.contextStatus.severity),paddingTop:"var(--sp-0_5)"},children:a}),u.jsxs("div",{children:[u.jsx("div",{className:"text-title font-semibold",style:{color:"var(--fg)"},children:e.contextStatus.label}),u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)",marginTop:"var(--sp-1)"},children:[e.contextStatus.detail??"Agents have a synced team context snapshot available.",e.branch||e.headCommit?u.jsxs(u.Fragment,{children:[" ",u.jsx("span",{style:{color:"var(--fg-3)"},children:"·"})," ",u.jsx("span",{className:"font-medium",children:e.branch??"unknown"}),e.headCommit?`@${e.headCommit.slice(0,7)}`:""]}):null]})]})]}),u.jsxs("fieldset",{className:"flex flex-wrap",style:{gap:"var(--sp-1)"},children:[u.jsx("legend",{className:"sr-only",children:"Context update window"}),NN.map(o=>u.jsx(me,{variant:o.value===t?"default":"outline",size:"sm",onClick:()=>n(o.value),children:o.label},o.value))]})]}),u.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[u.jsx(fu,{label:`${e.summary.changedNodeCount} context updates in the ${l}`,strong:!0}),u.jsx(fu,{label:`Added ${e.summary.addedCount}`,tone:"added"}),u.jsx(fu,{label:`Edited ${e.summary.editedCount}`,tone:"edited"}),u.jsx(fu,{label:`Removed ${e.summary.removedCount}`,tone:"removed"})]})]})})})}function sH({snapshot:e,selectedUpdate:t,selectedUpdateNode:n,selectedOverviewNodeId:a,onSelectUpdate:l,onSelectOverviewNode:o}){const c=f=>{o(f);const m=e.updates.find(h=>h.nodeId===f);m&&l(m)};return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[u.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[minmax(22rem,0.78fr)_minmax(0,1.22fr)]",style:{gap:"var(--sp-4)",alignItems:"start"},children:[u.jsxs(tn,{children:[u.jsx(Or,{children:u.jsxs("div",{className:"flex flex-col",children:[u.jsx(Mr,{children:"Context Updates"}),u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:[e.updates.length," team context changes agents may use"]})]})}),u.jsx(Tn,{children:e.updates.length===0?u.jsx(AN,{}):u.jsx("div",{className:"flex flex-col",style:{gap:"var(--sp-2)",maxHeight:"min(64vh, 38rem)",overflow:"auto",paddingRight:"var(--sp-0_5)"},children:e.updates.map(f=>u.jsx(oH,{update:f,selected:f.id===(t==null?void 0:t.id),onClick:()=>l(f)},f.id))})})]}),u.jsx(uH,{update:t,node:n,snapshot:e},(t==null?void 0:t.id)??"empty")]}),u.jsx(cH,{snapshot:e,selectedNodeId:a,onSelectNode:c})]})}function oH({update:e,selected:t,onClick:n}){return u.jsxs("button",{type:"button",onClick:n,className:"w-full text-left transition-colors",style:{border:"var(--hairline) solid var(--border)",borderColor:t?"var(--accent)":"var(--border)",borderRadius:"var(--radius-panel)",background:t?"var(--bg-sunken)":"var(--bg)",padding:"var(--sp-3)"},children:[u.jsx("div",{className:"flex items-start justify-between",style:{gap:"var(--sp-2)"},children:u.jsxs("div",{style:{minWidth:0},children:[u.jsxs("div",{className:"flex flex-wrap items-center",style:{gap:"var(--sp-2)"},children:[u.jsx(_N,{type:e.changeType}),u.jsx("span",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:xH(e)})]}),u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["In ",Yg(e.path)]})]})}),u.jsxs("div",{className:"flex flex-wrap text-label",style:{color:"var(--fg-3)",gap:"var(--sp-2)",marginTop:"var(--sp-2)"},children:[u.jsx("span",{children:CH(e.owners)}),e.relatedNodeIds.length>0?u.jsx("span",{children:EH(e.relatedNodeIds.length)}):null]})]})}function uH({update:e,node:t,snapshot:n}){const[a,l]=x.useState(!1),o=t==null?void 0:t.relatedNodeIds.map(h=>n.nodes.find(y=>y.id===h)).filter(h=>!!h),c=(t==null?void 0:t.sourcePath)??(e==null?void 0:e.path)??null,f=e!=null&&e.sourceCommit?e.sourceCommit.slice(0,7):"no commit",m=e?jH(e.owners):"No owner";return u.jsxs(tn,{children:[u.jsxs(Or,{children:[u.jsxs("div",{children:[u.jsx(Mr,{children:"Selected Change"}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"What changed, and what agents can use from it"})]}),e?u.jsx(_N,{type:e.changeType}):null]}),u.jsx(Tn,{children:e?u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-4)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-title font-semibold",style:{color:"var(--fg)"},children:e.title}),u.jsxs("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:["In ",Yg(e.path)]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2",style:{gap:"var(--sp-3)"},children:[u.jsx(MS,{label:"What changed",value:wH(e)}),u.jsx(MS,{label:"What agents can use",value:bH(e)})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3",style:{gap:"var(--sp-3)"},children:[u.jsx(Qp,{label:"Change",value:vH(e.changeType)}),u.jsx(Qp,{label:"Context area",value:NH(e.path)||Yg(e.path)}),u.jsx(Qp,{label:e.owners.length>1?"Owners":"Owner",value:m})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_minmax(16rem,0.7fr)]",style:{gap:"var(--sp-4)"},children:[u.jsx(DS,{title:"Linked context",items:o&&o.length>0?o.map(h=>h.title||h.path||"root"):["none"]}),u.jsxs("div",{children:[u.jsx(DS,{title:"Source",items:[c??e.path,f]}),c?u.jsxs("div",{className:"flex flex-wrap",style:{gap:"var(--sp-1)",marginTop:"var(--sp-2)"},children:[u.jsx(me,{variant:"outline",size:"xs",onClick:()=>{l(h=>!h)},children:"Preview source"}),u.jsxs(me,{variant:"ghost",size:"xs",onClick:()=>void navigator.clipboard.writeText(c),children:[u.jsx(xf,{size:14}),"Copy path"]})]}):null]})]}),a?u.jsx("div",{style:{borderTop:"var(--hairline) solid var(--border-faint)",paddingTop:"var(--sp-3)"},children:t!=null&&t.preview?u.jsx(hv,{children:t.preview}):u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No source preview available."})}):null]}):u.jsx(AN,{})})]})}function cH({snapshot:e,selectedNodeId:t,onSelectNode:n}){const a=x.useMemo(()=>hH(e.nodes),[e.nodes]),l=x.useMemo(()=>mH(e.nodes),[e.nodes]),o=Math.max(920,...a.map(f=>f.x+300)),c=Math.max(340,a.length*34);return u.jsxs(tn,{children:[u.jsx(Or,{children:u.jsxs("div",{children:[u.jsxs(Mr,{children:[u.jsx(oz,{size:17}),"Context Tree Overview"]}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:"Shows where recent context updates are concentrated across the team tree"})]})}),u.jsx(Tn,{children:a.length===0?u.jsx(TN,{snapshot:e}):u.jsx("div",{style:{overflow:"auto",maxHeight:"min(72vh, 52rem)"},children:u.jsxs("svg",{viewBox:`0 0 ${o} ${c}`,role:"img","aria-label":"Context Tree overview",style:{width:"100%",minWidth:"44rem"},children:[a.map(f=>f.parent?u.jsx("line",{x1:f.parent.x,y1:f.parent.y,x2:f.x,y2:f.y,stroke:"var(--border)",strokeWidth:1},`edge:${f.id}`):null),a.map(f=>{const m=f.id===t,h=l.get(f.id)??0;return u.jsx("foreignObject",{x:f.x-8,y:f.y-12,width:o-f.x+8,height:24,children:u.jsxs("button",{type:"button",onClick:()=>n(f.id),className:"flex w-full items-center text-left text-label",style:{color:"var(--fg)",gap:"var(--sp-2)"},children:[u.jsx("span",{"aria-hidden":"true",style:{width:m?"var(--sp-4)":"var(--sp-3)",height:m?"var(--sp-4)":"var(--sp-3)",borderRadius:"50%",background:TH(f.changeType,m),border:`${m?"var(--hairline-bold)":"var(--hairline)"} solid ${m?"var(--accent)":"var(--border-strong)"}`,flex:"0 0 auto"}}),u.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.title}),h>0?u.jsx("span",{style:{color:"var(--fg-3)",marginLeft:"auto",paddingRight:"var(--sp-2)"},children:h}):null]})},f.id)})]})})})]})}function fu({label:e,tone:t,strong:n}){return u.jsx("span",{className:`text-label ${n?"font-semibold":"font-medium"}`,style:{color:t?_H(t):"var(--fg)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-chip)",padding:"var(--sp-1) var(--sp-2)"},children:e})}function _N({type:e}){return u.jsx(fu,{label:yH(e),tone:e})}function Qp({label:e,value:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:e}),u.jsx("div",{className:"text-body font-semibold",style:{color:"var(--fg)"},children:t})]})}function MS({label:e,value:t}){return u.jsxs("div",{style:{color:"var(--fg-2)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:"var(--sp-3)"},children:[u.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:e}),u.jsx("div",{className:"text-body",children:t})]})}function DS({title:e,items:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-label font-semibold",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:e}),u.jsx("div",{className:"flex flex-wrap",style:{gap:"var(--sp-1)"},children:t.map(n=>u.jsx("span",{className:"text-label",style:{color:"var(--fg-2)",background:"var(--bg-sunken)",borderRadius:"var(--radius-chip)",padding:"var(--sp-1) var(--sp-2)"},children:n},n))})]})}function dH(){return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[u.jsx(Nz,{size:17}),"Loading team context..."]})})})}function fH({message:e}){return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex items-center text-body",style:{color:"var(--danger)",gap:"var(--sp-2)"},children:[u.jsx(wl,{size:17}),e]})})})}function TN({snapshot:e}){return u.jsx(tn,{children:u.jsx(Tn,{children:u.jsxs("div",{className:"flex items-start text-body",style:{color:"var(--fg-2)",gap:"var(--sp-2)"},children:[u.jsx(wl,{size:18,style:{color:"var(--warn)"}}),u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold",style:{color:"var(--fg)"},children:e.contextStatus.label}),u.jsx("div",{style:{marginTop:"var(--sp-1)"},children:e.contextStatus.detail})]})]})})})}function AN(){return u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"No context updates in this time window."})}function hH(e){const t=new Map(e.map(m=>[m.id,m])),n=e.filter(m=>!m.parentId||t.has(m.parentId)).sort((m,h)=>m.path.localeCompare(h.path));if(n.length===0)return[];const a=Y7().id(m=>m.id).parentId(m=>m.parentId)(n).sort((m,h)=>m.data.path.localeCompare(h.data.path)),o=rH().nodeSize([34,96])(a).descendants(),c=Math.min(...o.map(m=>m.x));return o.map(m=>({...m.data,x:24+m.y,y:24+m.x-c,parent:null})).map((m,h,y)=>({...m,parent:m.parentId?y.find(g=>g.id===m.parentId)??null:null}))}function mH(e){const t=new Map(e.map(a=>[a.id,a])),n=new Map;for(const a of e){if(!a.changeType)continue;let l=a;for(;l;)n.set(l.id,(n.get(l.id)??0)+1),l=l.parentId?t.get(l.parentId):void 0}return n}function pH(e){var t;return((t=NN.find(n=>n.value===e))==null?void 0:t.summary)??"last 7 days"}function gH(e){return e==="ok"?"var(--ok)":e==="warning"?"var(--warn)":"var(--danger)"}function yH(e){return e==="added"?"New":e==="removed"?"Removed":"Updated"}function vH(e){return e==="added"?"New knowledge":e==="removed"?"Removed knowledge":"Updated knowledge"}function bH(e){return e.changeType==="added"?`Agents can use new team knowledge when working on ${e.affectedContextArea}.`:e.changeType==="removed"?`Agents should stop using the old team knowledge for ${e.affectedContextArea}.`:`Agents can use updated team knowledge when working on ${e.affectedContextArea}.`}function xH(e){const t=e.changedBy??"Someone",n=e.changeType==="added"?"added":e.changeType==="removed"?"removed":"updated";return`${t} ${n} ${e.title}`}function wH(e){const t=e.changedBy??"Someone",n=e.changeType==="added"?"added":e.changeType==="removed"?"removed":"updated",a=kH(e);return a?`${t} ${n} ${e.title}: ${a}`:`${t} ${n} ${e.title}.`}function SH(e){return e.summary.replace(/^updated:\s*/i,"")}function kH(e){const t=SH(e);return new Set(["updated this team knowledge","added this team knowledge","removed this team knowledge"]).has(t.toLowerCase())||t.length<12||/[,;:]$/.test(t)?null:t}function jH(e){return e.length===0?"No owner":e.length===1?e[0]??"No owner":e.join(", ")}function CH(e){return e.length===0?"Owner not set":e.length===1?`Owner: ${e[0]??"Unknown"}`:`Owners: ${e.join(", ")}`}function EH(e){return`${e} linked context${e===1?"":"s"}`}function NH(e){const t=e.split("/").filter(Boolean);return t.length<=1?null:t.slice(0,-1).map(RN).join(" / ")}function Yg(e){return e.split("/").filter(Boolean).map(RN).join(" / ")||"root"}function RN(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function _H(e){return e==="added"?"var(--ok)":e==="edited"?"var(--warn)":"var(--danger)"}function TH(e,t){return t?"var(--accent)":e==="added"?"var(--ok)":e==="edited"?"var(--warn)":e==="removed"?"var(--danger)":"var(--bg-raised)"}const eo=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("rounded-[var(--radius-panel)] border bg-card text-card-foreground shadow-sm",e),...t}));eo.displayName="Card";const to=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("flex flex-col space-y-1.5 p-6",e),...t}));to.displayName="CardHeader";const rc=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("text-subtitle leading-none",e),...t}));rc.displayName="CardTitle";const zN=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("text-body text-muted-foreground",e),...t}));zN.displayName="CardDescription";const no=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("p-6 pt-0",e),...t}));no.displayName="CardContent";const AH=x.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Te("flex items-center p-6 pt-0",e),...t}));AH.displayName="CardFooter";function RH(){const{token:e}=Dk(),t=Un(),{isAuthenticated:n,adoptTokens:a}=Rt(),[l,o]=x.useState(null),[c,f]=x.useState(null),[m,h]=x.useState(!1),[y,g]=x.useState(null);if(x.useEffect(()=>{e&&(async()=>{try{const E=await fetch(`/api/v1/invitations/${encodeURIComponent(e)}/preview`);if(!E.ok){f("This invitation is no longer valid");return}o(await E.json())}catch{f("Network error while loading invitation")}})()},[e]),x.useEffect(()=>{n&&(async()=>{try{const E=await ke.get("/me/organizations"),C=await ke.get("/me"),R=E.find(O=>O.id===C.member.organizationId);g((R==null?void 0:R.displayName)??null)}catch{}})()},[n]),!e)return u.jsx(IS,{message:"Bad invitation URL"});if(c)return u.jsx(IS,{message:"This invitation is no longer valid"});if(!l)return u.jsx(zH,{});const b=async()=>{h(!0);try{const E=await ke.post("/me/organizations/join",{token:e});await a(E.tokens),Qk("invite"),t("/",{replace:!0})}catch(E){f(E instanceof Error?E.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=OH(l.expiresAt);return u.jsx(mv,{children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsx(to,{className:"text-center",children:u.jsxs(rc,{className:"text-title",children:["You're invited to join",u.jsx("br",{}),l.organizationDisplayName]})}),u.jsxs(no,{className:"space-y-4",children:[k&&u.jsxs("div",{className:"flex items-start gap-2 rounded-md p-3 text-label",style:{background:"var(--bg-sunken)",color:"var(--fg-2)"},children:[u.jsx(wl,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("span",{children:["You'll switch from ",u.jsx("span",{className:"font-medium",children:y})," to"," ",u.jsx("span",{className:"font-medium",children:l.organizationDisplayName}),"."]})]}),n?u.jsx(me,{className:"w-full",disabled:m,onClick:b,children:m?"Joining…":`Join ${l.organizationDisplayName}`}):u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:w,children:[u.jsx(Wk,{className:"h-4 w-4"}),"Continue with GitHub to join"]})}),j&&u.jsx("p",{className:"text-center text-label",style:{color:j.urgent?"var(--destructive)":"var(--fg-3)"},children:j.text}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]})]})]})})}function mv({children:e}){return u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Vu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(vy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:e})]})}function zH(){return u.jsx(mv,{children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsxs(to,{className:"text-center",children:[u.jsx("div",{className:"mx-auto h-5 w-2/3 rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto mt-2 h-5 w-1/2 rounded-md",style:{background:"var(--bg-sunken)"}})]}),u.jsxs(no,{className:"space-y-4",children:[u.jsx("div",{className:"h-9 w-full rounded-md",style:{background:"var(--bg-sunken)"}}),u.jsx("div",{className:"mx-auto h-3 w-1/3 rounded-md",style:{background:"var(--bg-sunken)"}})]})]})})}function IS({message:e}){return u.jsx(mv,{children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsxs(to,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-fg-3",children:u.jsx(wl,{className:"h-6 w-6"})}),u.jsx(rc,{className:"text-title",children:e})]}),u.jsxs(no,{className:"space-y-4",children:[u.jsx("p",{className:"text-center text-body text-muted-foreground",children:"It may have expired or been revoked. Ask the team admin for a fresh link."}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs(Vu,{to:"/",children:[u.jsx(vy,{className:"h-3.5 w-3.5"}),"Back to home"]})})]})]})})}function OH(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 MH(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=JC(l);return o===Uw&&l!==Uw?null:o}function DH(){const{isAuthenticated:e}=Rt(),t=Yn(),n=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),a=MH(t.state)??"/",l=a==="/"?"/api/v1/auth/github/start":`/api/v1/auth/github/start?next=${encodeURIComponent(a)}`,o="/api/v1/auth/github/dev-callback?githubId=1&login=devuser&displayName=Dev+User";return e?u.jsx(ur,{to:a,replace:!0}):u.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[u.jsx("header",{className:"px-4 py-3",children:u.jsxs(Vu,{to:"/",className:"inline-flex items-center gap-1.5 rounded-[var(--radius-input)] px-2 py-1 text-body text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",children:[u.jsx(vy,{className:"h-3.5 w-3.5"}),"Back to home"]})}),u.jsx("div",{className:"flex flex-1 items-center justify-center px-4 pb-16",children:u.jsxs(eo,{className:"w-full max-w-sm",children:[u.jsxs(to,{className:"text-center",children:[u.jsx("div",{className:"mb-2 flex justify-center text-foreground",children:u.jsx(Xu,{width:28,height:32})}),u.jsxs(rc,{className:"text-title",children:["First Tree ",u.jsx("span",{className:"font-normal text-muted-foreground",children:"Hub"})]})]}),u.jsxs(no,{className:"space-y-4",children:[u.jsx(me,{asChild:!0,className:"w-full",children:u.jsxs("a",{href:l,children:[u.jsx(Wk,{className:"h-4 w-4"}),"Continue with GitHub"]})}),u.jsxs("p",{className:"text-center text-label text-muted-foreground",children:["By continuing you agree to our"," ",u.jsx("a",{href:"/terms",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Terms"})," ","·"," ",u.jsx("a",{href:"/privacy",className:"underline underline-offset-2 transition-colors hover:text-foreground",children:"Privacy"})]}),n&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"relative my-2 text-center text-label text-muted-foreground",children:[u.jsx("span",{className:"relative z-10 bg-card px-2",children:"localhost only"}),u.jsx("div",{className:"absolute inset-x-0 top-1/2 h-px bg-border"})]}),u.jsx(me,{asChild:!0,variant:"outline",className:"w-full",children:u.jsxs("a",{href:o,children:[u.jsx(Uz,{className:"h-4 w-4"}),"Dev: skip GitHub"]})})]})]})]})})]})}function IH(){const e=Un(),{adoptTokens:t}=Rt(),[n,a]=x.useState(null);return x.useEffect(()=>{const l=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,o=new URLSearchParams(l),c=o.get("access"),f=o.get("refresh"),m=JC(o.get("next")),h=o.get("joinPath");if(!c||!f){a("Sign-in did not complete. Please try again.");return}(h==="solo"||h==="invite")&&Qk(h),window.history.replaceState(null,"",window.location.pathname),(async()=>(await t({accessToken:c,refreshToken:f}),e(m,{replace:!0})))()},[t,e]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background text-body text-muted-foreground",children:n??"Signing you in…"})}const Hs=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("table",{ref:a,className:Te("w-full",e),style:{borderCollapse:"separate",borderSpacing:0,...t},...n}));Hs.displayName="DenseTable";const Zs=x.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:e,...t}));Zs.displayName="DenseTableHeader";const Vs=x.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:e,...t}));Vs.displayName="DenseTableBody";const $r=x.forwardRef(({className:e,interactive:t,selected:n,style:a,...l},o)=>u.jsx("tr",{ref:o,className:Te("transition-colors",e),"data-interactive":t?"":void 0,"data-selected":n?"":void 0,style:{background:n?"var(--bg-active)":void 0,cursor:t?"pointer":void 0,...a},...l}));$r.displayName="DenseTableRow";const lt=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("th",{ref:a,className:Te("text-left text-label whitespace-nowrap",e),style:{padding:"var(--sp-2) var(--sp-3_5)",color:"var(--fg-3)",fontWeight:500,borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));lt.displayName="DenseTableHead";const We=x.forwardRef(({className:e,style:t,...n},a)=>u.jsx("td",{ref:a,className:Te("align-middle text-body",e),style:{padding:"var(--sp-2_25) var(--sp-3_5)",borderBottom:"var(--hairline) solid var(--border-faint)",...t},...n}));We.displayName="DenseTableCell";const LH=1500;function UH({command:e,expiresInSeconds:t,phase:n,copyLabel:a={idle:"Copy",done:"Copied"},waitingText:l="Waiting for your computer to connect…",successContent:o,errorContent:c,caption:f="Single-use · regenerates the previous one.",copyButtonPlacement:m="right"}){const[h,y]=x.useState(!1),g=async()=>{e&&(await navigator.clipboard.writeText(e),y(!0),setTimeout(()=>y(!1),LH))},b=t!==void 0?Math.max(1,Math.round(t/60)):null,w=u.jsx("pre",{className:"mono text-label",style:{margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border-faint)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"pre-wrap",wordBreak:"break-all",overflowWrap:"anywhere",minWidth:0,flex:m==="right"?1:void 0},title:e??"",children:e?u.jsxs(u.Fragment,{children:[e,b!==null&&u.jsxs("span",{style:{color:"var(--fg-4)"},children:[" # expires in ",b,"m"]})]}):"Generating token…"}),k=u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:g,disabled:!e,style:{alignSelf:"flex-start"},children:[h?u.jsx(fr,{className:"h-3.5 w-3.5"}):u.jsx(xf,{className:"h-3.5 w-3.5"}),h?a.done:a.idle]});return u.jsxs("div",{className:"flex flex-col",style:{gap:"var(--sp-2)"},children:[m==="right"?u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[w,k]}):u.jsxs(u.Fragment,{children:[w,k]}),f&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",margin:0},children:f}),n==="waiting"&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-blocked) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-blocked) 35%, var(--fg))"},children:[u.jsx(PH,{}),l]}),n==="success"&&o&&u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2_5)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-idle) 14%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-idle) 35%, transparent)",borderRadius:"var(--radius-input)",color:"color-mix(in oklch, var(--state-idle) 45%, var(--fg))"},children:[u.jsx(fr,{className:"h-3.5 w-3.5",style:{flexShrink:0}}),u.jsx("span",{style:{minWidth:0},children:o})]}),n==="error"&&c&&u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:c})]})}function PH(){return u.jsx("span",{"aria-hidden":"true",style:{width:12,height:12,flexShrink:0,borderRadius:"50%",border:"var(--hairline-bold) solid color-mix(in oklch, var(--state-blocked) 30%, transparent)",borderTopColor:"var(--state-blocked)",animation:"spin 0.85s linear infinite"}})}const BH=3e3,$H=1200;function FH({open:e,onOpenChange:t}){const n=nn(),{user:a}=Rt(),[l,o]=x.useState("loading"),[c,f]=x.useState(null),[m,h]=x.useState(null),[y,g]=x.useState(null),b=x.useRef(new Set);return x.useEffect(()=>{if(!e){o("loading"),f(null),h(null),g(null),b.current=new Set;return}let w=!1;const k=(n.getQueryData(["clients"])??[]).map(j=>j.id);return b.current=new Set(k),(async()=>{try{const j=await A3();if(w)return;f(j),o("waiting")}catch(j){if(w)return;h(j instanceof Error?j.message:"Failed to generate connect token"),o("error")}})(),()=>{w=!0}},[e,n]),x.useEffect(()=>{if(!e||l!=="waiting"||!a)return;const k=setInterval(async()=>{try{const j=await n.fetchQuery({queryKey:["clients"],queryFn:Ni}),E=b.current,C=j.find(R=>!E.has(R.id)&&R.status==="connected"&&R.userId===a.id);C&&(g(C.hostname??null),o("success"))}catch{}},BH);return()=>clearInterval(k)},[e,l,n,a]),x.useEffect(()=>{if(l!=="success")return;const w=setTimeout(()=>{n.invalidateQueries({queryKey:["clients"]}),t(!1)},$H);return()=>clearTimeout(w)},[l,t,n]),u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{children:[u.jsxs(fn,{children:[u.jsx(on,{children:"Connect computer"}),u.jsx(Ty,{children:"Run this command on the machine you want to pair with this Hub."})]}),u.jsx(UH,{command:(c==null?void 0:c.command)??null,expiresInSeconds:c==null?void 0:c.expiresIn,phase:l,successContent:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold",children:y??"Computer"})," connected. Closing…"]}),errorContent:m}),u.jsx("div",{className:"flex justify-end",style:{gap:"var(--sp-2)"},children:u.jsx(me,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"})})]})})}function qH({embedded:e=!1}={}){const t=nn(),n=Ef(),[a,l]=x.useState(()=>new Set),[o,c]=x.useState(null),[f,m]=x.useState(null),[h,y]=x.useState(null),[g,b]=x.useState(!1),{data:w}=He({queryKey:["clients"],queryFn:Ni,refetchInterval:1e4}),{data:k}=He({queryKey:["activity"],queryFn:Ku,refetchInterval:1e4}),j=St({mutationFn:T3,onSuccess:()=>{c(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})}}),E=St({mutationFn:_3,onSuccess:()=>{m(null),y(null),t.invalidateQueries({queryKey:["clients"]}),t.invalidateQueries({queryKey:["activity"]})},onError:z=>{z instanceof Qu?y(z.message):y(z instanceof Error?z.message:String(z))}}),C=x.useMemo(()=>{const z=new Map;for(const $ of(k==null?void 0:k.agents)??[]){if(!$.clientId)continue;const U=z.get($.clientId)??[];U.push($),z.set($.clientId,U)}return z},[k==null?void 0:k.agents]),R=z=>C.get(z)??[],O=(w??[]).filter(z=>z.status==="connected").length,M=(w??[]).reduce((z,$)=>z+$.agentCount,0),B=(w??[]).filter(z=>z.authState!=="ok").length;return u.jsxs("div",{className:e?"":"-m-6",children:[u.jsx(nc,{title:"Computers",subtitle:w&&w.length>0?u.jsxs(u.Fragment,{children:[w.length," total · ",O," connected · ",M," agents bound",B>0&&u.jsxs(u.Fragment,{children:[" · ",u.jsxs("span",{style:{color:"var(--state-error)"},children:[B," need re-auth"]})]})]}):null,right:u.jsx("div",{className:"flex items-center gap-1.5",children:u.jsxs(me,{size:"xs",onClick:()=>b(!0),children:[u.jsx(qr,{className:"h-3 w-3"}),"Connect computer"]})})}),u.jsxs("div",{style:{padding:"var(--sp-3_5) var(--sp-5) var(--sp-7)"},children:[u.jsx(FH,{open:g,onOpenChange:b}),f&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Retire Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["Permanently remove"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:f.hostname??f.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)."]}),R(f.id).length>0&&u.jsxs("div",{className:"mb-3 p-2 rounded",style:{background:"color-mix(in oklch, var(--state-blocked) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-blocked) 28%, transparent)"},children:[u.jsx("div",{className:"text-label mb-1",children:"Agents currently bound to this computer (delete them first):"}),u.jsx("ul",{className:"text-body space-y-0.5",children:R(f.id).map(z=>u.jsx("li",{className:"font-medium",children:n(z.agentId)},z.agentId))})]}),h&&u.jsx("div",{className:"mb-3 p-2 rounded text-body",style:{background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",color:"var(--state-error)"},children:h}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>{m(null),y(null)},children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>E.mutate(f.id),disabled:E.isPending,children:E.isPending?"Retiring…":"Retire"})]})]})}),o&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-overlay-scrim",children:u.jsxs("div",{className:"max-w-md w-full",style:{background:"var(--bg-raised)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-panel)",padding:24,boxShadow:"var(--shadow-md)"},children:[u.jsx("h3",{className:"text-subtitle mb-2",children:"Disconnect Computer"}),u.jsxs("p",{className:"text-body mb-3",style:{color:"var(--fg-3)"},children:["This will disconnect"," ",u.jsx("span",{className:"font-medium",style:{color:"var(--fg)"},children:o.hostname??o.id.slice(0,8)})," ","and affect all bound agents:"]}),u.jsx("ul",{className:"mb-4 space-y-1",children:R(o.id).length===0?u.jsx("li",{className:"text-body",style:{color:"var(--fg-3)"},children:"No bound agents"}):R(o.id).map(z=>u.jsxs("li",{className:"text-body flex items-center gap-2",children:[u.jsx("span",{className:"font-medium",children:n(z.agentId)}),u.jsx(zu,{state:z.runtimeState})]},z.agentId))}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(me,{variant:"outline",size:"sm",onClick:()=>c(null),children:"Cancel"}),u.jsx(me,{variant:"destructive",size:"sm",onClick:()=>j.mutate(o.id),disabled:j.isPending,children:j.isPending?"Disconnecting…":"Disconnect"})]})]})}),!w||w.length===0?u.jsx(tn,{children:u.jsx("div",{className:"text-center py-10 text-body",style:{color:"var(--fg-3)"},children:"No computers connected. Use the button above to generate a connect command."})}):u.jsxs(tn,{children:[u.jsxs(Lg,{children:["Registered · ",w.length]}),u.jsxs(Hs,{children:[u.jsx(Zs,{children:u.jsxs($r,{children:[u.jsx(lt,{style:{width:16}}),u.jsx(lt,{children:"Hostname"}),u.jsx(lt,{children:"OS"}),u.jsx(lt,{children:"SDK"}),u.jsx(lt,{children:"Agents"}),u.jsx(lt,{children:"Connected"}),u.jsx(lt,{children:"Status"}),u.jsx(lt,{"aria-hidden":!0})]})}),u.jsx(Vs,{children:w.map(z=>{const $=!a.has(z.id),U=R(z.id);return u.jsx(YH,{client:z,boundAgents:U,isExpanded:$,agentName:n,onToggle:()=>l(Q=>{const I=new Set(Q);return I.has(z.id)?I.delete(z.id):I.add(z.id),I}),onDisconnect:()=>c(z),onRetire:()=>{y(null),m(z)},onReconnect:()=>b(!0)},z.id)})})]})]})]})]})}const HH={"claude-code":"Claude Code",codex:"Codex"},ZH=[rf.CLAUDE_CODE,rf.CODEX],LS={"claude-code":"Run `npm install -g @anthropic-ai/claude-code` on this computer.",codex:"Install the OpenAI Codex CLI on this computer."},VH={"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 QH({clientId:e,enabled:t}){const{data:n,isLoading:a}=He({queryKey:["client-capabilities",e],queryFn:()=>ky(e),enabled:t}),l=(n==null?void 0:n.capabilities)??null;return u.jsxs(u.Fragment,{children:[u.jsx(Vy,{style:{display:"block",marginBottom:6},children:"Runtimes"}),a&&!l?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):l&&Object.keys(l).length===0?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)"},children:"Capabilities not yet reported. Reconnect this computer to refresh."}):u.jsx("div",{className:"flex flex-col gap-1",children:ZH.map(o=>u.jsx(KH,{provider:o,entry:l?l[o]??null:null},o))})]})}function KH({provider:e,entry:t}){const n=HH[e];if(!t)return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["not reported · ",LS[e]]})]});switch(t.state){case"ok":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-idle)"},children:["✓ ",t.sdkVersion?`v${t.sdkVersion} · `:"","authenticated (",t.authMethod,")"]})]});case"unauthenticated":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-blocked)"},children:["⚠ installed",t.sdkVersion?` v${t.sdkVersion}`:"",", not authenticated ·"," ",VH[e]]})]});case"missing":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",style:{opacity:.7},children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)"},children:["✗ not installed · ",LS[e]]})]});case"error":return u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:n}),u.jsxs("span",{className:"text-caption",style:{color:"var(--state-error)"},children:["error · ",t.error??"probe failed"]})]})}}function GH(){return u.jsxs("span",{className:"mono inline-flex items-center gap-1.5 uppercase text-caption",style:{color:"var(--state-error)"},children:[u.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"var(--state-error)",display:"inline-block"}}),"AUTH EXPIRED"]})}function YH({client:e,boundAgents:t,isExpanded:n,agentName:a,onToggle:l,onDisconnect:o,onRetire:c,onReconnect:f}){const h=e.status!=="connected",y=e.authState!=="ok",g=e.status==="connected"?"idle":"offline";return u.jsxs(u.Fragment,{children:[u.jsxs($r,{interactive:!0,selected:n,onClick:l,children:[u.jsx(We,{style:{width:16},children:u.jsx("span",{style:{color:"var(--fg-4)",display:"inline-flex"},children:n?u.jsx(Xk,{className:"h-3.5 w-3.5"}):u.jsx(ez,{className:"h-3.5 w-3.5"})})}),u.jsx(We,{className:"font-medium",children:e.hostname??"—"}),u.jsx(We,{style:{color:"var(--fg-3)"},children:e.os??"—"}),u.jsx(We,{className:"mono text-label",style:{color:"var(--fg-3)"},children:e.sdkVersion??"—"}),u.jsx(We,{children:u.jsx("span",{className:"mono tnum text-label",children:e.agentCount})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:e.connectedAt?Cu(e.connectedAt):"—"}),u.jsx(We,{children:y?u.jsx(GH,{}):u.jsx(zu,{state:g})}),u.jsx(We,{style:{width:1,whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex items-center justify-end text-label",style:{gap:"var(--sp-3_5)"},children:[h&&u.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:y?"var(--state-error)":"var(--fg-2)"},onClick:b=>{b.stopPropagation(),f()},children:"Reconnect"}),u.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:"var(--fg-2)"},onClick:b=>{b.stopPropagation(),o()},children:"Disconnect"}),u.jsx("button",{type:"button",className:"rounded-sm hover:underline focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",style:{color:"var(--fg-4)"},onClick:b=>{b.stopPropagation(),c()},children:"Retire"})]})})]}),n&&u.jsxs("tr",{style:{background:"var(--bg-sunken)"},children:[u.jsx(We,{}),u.jsxs(We,{colSpan:7,style:{padding:"var(--sp-2_5) var(--sp-3) var(--sp-3_5)"},children:[u.jsx(QH,{clientId:e.id,enabled:n}),t.length>0&&u.jsxs(u.Fragment,{children:[u.jsxs(Vy,{style:{display:"block",marginTop:"var(--sp-3)",marginBottom:6},children:["Bound agents · ",t.length]}),u.jsx("div",{className:"flex flex-col gap-1",children:t.map(b=>u.jsxs("div",{className:"flex items-center gap-2.5 text-body",children:[u.jsx("span",{className:"font-medium",style:{minWidth:140},children:a(b.agentId)}),u.jsx(zu,{state:b.runtimeState}),b.activeSessions!==null&&u.jsxs("span",{className:"mono tnum text-caption",style:{color:"var(--fg-3)"},children:[b.activeSessions," / ",b.totalSessions??0," sessions"]})]},b.agentId))})]})]})]})]})}function XH(){return u.jsx(qH,{embedded:!0})}function JH(){return ke.get(hn("/adapter-mappings"))}function WH(e){return ke.post(hn("/adapter-mappings"),e)}function eZ(e){return ke.delete(`/adapter-mappings/${e}`)}function tZ(){return ke.get(hn("/adapters/status"))}function nZ(){return ke.get(hn("/adapters"))}function rZ(e){return ke.post(hn("/adapters"),e)}function aZ(e,t){return ke.patch(`/adapters/${e}`,t)}function iZ(e){return ke.delete(`/adapters/${e}`)}const lZ=Object.values(g6),US={platform:"feishu",feishuAppId:"",feishuAppSecret:"",credentialsJson:"{}",status:"active",externalUserId:"",displayName:"",kaelUserId:"",kaelProjectId:""};function PS(e){const[t,n]=x.useState(US),[a,l]=x.useState("");x.useEffect(()=>{e.open&&(n({...US,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=sZ(t);if(!e.editingId&&!m){l("Credentials are required");return}if(e.editingId)e.onSubmit({kind:"bot-update",status:t.status,...m?{credentials:m}:{}});else{if(!m)return;e.onSubmit({kind:"bot-create",draft:{platform:t.platform,status:t.status,credentials:m}})}}const c=e.kind==="user"?`Bind external user → ${e.agentLabel}`:e.editingId?`Edit bot binding · ${e.agentLabel}`:`Bind bot → ${e.agentLabel}`;return u.jsx(sn,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:c})}),u.jsxs("form",{onSubmit:o,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-platform",children:"Platform"}),u.jsx("select",{id:"binding-platform",value:t.platform,onChange:f=>n({...t,platform:f.target.value}),disabled:!!e.editingId,className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",children:lZ.map(f=>u.jsx("option",{value:f,children:f},f))})]}),e.kind==="user"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-ext-id",children:"External user ID"}),u.jsx(At,{id:"binding-ext-id",value:t.externalUserId,onChange:f=>n({...t,externalUserId:f.target.value}),placeholder:"ou_xxxxxxxx...",className:"font-mono",required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-name",children:"Display name (optional)"}),u.jsx(At,{id:"binding-name",value:t.displayName,onChange:f=>n({...t,displayName:f.target.value})})]})]}):u.jsxs(u.Fragment,{children:[t.platform==="feishu"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"feishu-app-id",children:["App ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"feishu-app-id",value:t.feishuAppId,onChange:f=>n({...t,feishuAppId:f.target.value}),placeholder:"cli_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"feishu-app-secret",children:["App Secret",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"feishu-app-secret",type:"password",autoComplete:"new-password",value:t.feishuAppSecret,onChange:f=>n({...t,feishuAppSecret:f.target.value}),placeholder:"••••••••"})]})]}):t.platform==="kael"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"kael-user-id",children:["User ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"kael-user-id",value:t.kaelUserId,onChange:f=>n({...t,kaelUserId:f.target.value}),placeholder:"user_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"kael-project-id",children:["Project ID",e.editingId?" — leave empty to keep existing":""]}),u.jsx(At,{id:"kael-project-id",value:t.kaelProjectId,onChange:f=>n({...t,kaelProjectId:f.target.value}),placeholder:"proj_xxxxxxxx",className:"font-mono",autoComplete:"off"})]}),!e.editingId&&u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Agent Token will be created automatically when you save."})]}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs(ft,{htmlFor:"binding-creds",children:["Credentials (JSON)",e.editingId?" — leave empty to keep existing":""]}),u.jsx("textarea",{id:"binding-creds",value:t.credentialsJson,onChange:f=>n({...t,credentialsJson:f.target.value}),rows:4,className:"flex w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-2 text-body shadow-sm font-mono focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:'{"bot_token": "xoxb-...", "signing_secret": "..."}'})]}),a&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:a}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"binding-status",children:"Status"}),u.jsxs("select",{id:"binding-status",value:t.status,onChange:f=>n({...t,status:f.target.value}),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"active",children:"active"}),u.jsx("option",{value:"inactive",children:"inactive"})]})]})]}),e.errorMessage&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)"},children:e.errorMessage}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:e.pending,children:e.pending?"Saving…":e.editingId?"Update":"Create"})]})]})]})})}function sZ(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 oZ(){var T;const e=Un(),t=nn(),[n,a]=qk(),l=n.get("agent"),o=Ef(),c=He({queryKey:["adapters"],queryFn:nZ}),f=He({queryKey:["adapter-mappings"],queryFn:JH}),m=He({queryKey:["adapter-statuses"],queryFn:tZ,refetchInterval:15e3}),y=((T=He({queryKey:["agents","name-map"],queryFn:()=>Yu({limit:100}),staleTime:3e4}).data)==null?void 0:T.items)??[],g=x.useMemo(()=>{const Z=new Map;for(const W of m.data??[])Z.set(W.configId,W);return Z},[m.data]),b=x.useMemo(()=>{const Z=c.data??[];return l?Z.filter(W=>W.agentId===l):Z},[c.data,l]),w=x.useMemo(()=>{const Z=f.data??[];return l?Z.filter(W=>W.agentId===l):Z},[f.data,l]),k=b.reduce((Z,W)=>{var ce;return Z+((ce=g.get(W.id))!=null&&ce.connected?1:0)},0),j=b.length-k,E=c.isLoading||f.isLoading,[C,R]=x.useState(null),[O,M]=x.useState(""),[B,z]=x.useState(null),[$,U]=x.useState(null),[Q,I]=x.useState(null),[ne,le]=x.useState(null),we=St({mutationFn:Z=>rZ({platform:Z.platform,agentId:Z.agentId,credentials:Z.credentials,status:Z.status}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),Y=St({mutationFn:Z=>{const W={status:Z.status};return Z.credentials&&(W.credentials=Z.credentials),aZ(Z.id,W)},onSuccess:()=>{t.invalidateQueries({queryKey:["adapters"]}),z(null)}}),J=St({mutationFn:iZ,onSuccess:()=>t.invalidateQueries({queryKey:["adapters"]})}),H=St({mutationFn:Z=>WH({platform:Z.platform,externalUserId:Z.externalUserId,agentId:Z.agentId,boundVia:"manual",displayName:Z.displayName??void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["adapter-mappings"]}),U(null)}}),ee=St({mutationFn:eZ,onSuccess:()=>t.invalidateQueries({queryKey:["adapter-mappings"]})});function be(Z){if(l){Z==="bot"?z({agentId:l,editingId:null}):U({agentId:l});return}M(""),R({kind:Z})}function Ae(){!C||!O||(C.kind==="bot"?z({agentId:O,editingId:null}):U({agentId:O}),R(null))}function A(Z){if(B){if(Z.kind==="bot-create")we.mutate({agentId:B.agentId,platform:Z.draft.platform,status:Z.draft.status,credentials:Z.draft.credentials});else if(Z.kind==="bot-update"){if(!B.editingId)return;Y.mutate({id:B.editingId,status:Z.status,credentials:Z.credentials})}}}function L(Z){!$||Z.kind!=="user-create"||H.mutate({agentId:$.agentId,platform:Z.draft.platform,externalUserId:Z.draft.externalUserId,displayName:Z.draft.displayName})}const P=l?y.find(Z=>Z.uuid===l):null;return u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",padding:"0 var(--sp-0_5) var(--sp-3)"},children:"Manage how external platforms (Feishu, Slack, Kael) reach your agents. Bot bindings hold encrypted credentials; user bindings map an external user to a human agent in this organization."}),l&&u.jsxs("div",{className:"flex items-center gap-2",style:{padding:"0 var(--sp-0_5) var(--sp-3)"},children:[u.jsx("span",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Filtered to"}),u.jsxs("span",{className:"inline-flex items-center gap-1.5 mono text-caption",style:{padding:"var(--sp-0_5) var(--sp-2)",borderRadius:"var(--radius-chip)",background:"var(--bg-active)",border:"var(--hairline) solid var(--border)"},children:[(P==null?void 0:P.displayName)??l,u.jsx("button",{type:"button",onClick:()=>{const Z=new URLSearchParams(n);Z.delete("agent"),a(Z,{replace:!0})},"aria-label":"Clear filter",className:"inline-flex items-center justify-center hover:bg-accent rounded-full",style:{width:14,height:14,border:"none",background:"transparent",cursor:"pointer"},children:u.jsx(ju,{className:"h-3 w-3"})})]})]}),u.jsxs(tn,{className:"mb-3.5",children:[u.jsxs(Lg,{right:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[u.jsxs("span",{className:"inline-flex items-center gap-3 text-caption",children:[u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--state-idle)"},children:[u.jsx(mu,{state:"idle",size:6})," ",k," online"]}),u.jsxs("span",{className:"mono inline-flex items-center gap-1",style:{color:"var(--fg-4)"},children:[u.jsx(mu,{state:"offline",size:6})," ",j," offline"]})]}),u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>be("bot"),children:[u.jsx(qr,{className:"h-3 w-3"})," Bot binding"]})]}),children:["Bot bindings · ",b.length]}),E?u.jsx(Ud,{children:"Loading…"}):b.length?u.jsxs(Hs,{children:[u.jsx(Zs,{children:u.jsxs($r,{children:[u.jsx(lt,{children:"Agent"}),u.jsx(lt,{children:"Platform"}),u.jsx(lt,{children:"Status"}),u.jsx(lt,{children:"Connection"}),u.jsx(lt,{children:"Created"}),u.jsx(lt,{style:{width:96,textAlign:"right"}})]})}),u.jsx(Vs,{children:b.map(Z=>{var ce;const W=((ce=g.get(Z.id))==null?void 0:ce.connected)??!1;return u.jsxs($r,{interactive:!0,onClick:()=>e(`/agents/${Z.agentId}`),children:[u.jsx(We,{children:u.jsx("span",{className:"mono font-medium",children:o(Z.agentId)})}),u.jsx(We,{children:u.jsx(Br,{children:Z.platform})}),u.jsx(We,{children:u.jsx(Br,{tone:Z.status==="active"?"accent":"outline",children:Z.status})}),u.jsx(We,{children:u.jsxs("span",{className:"inline-flex items-center gap-1.5 text-label",children:[u.jsx(mu,{state:W?"idle":"offline",size:7}),u.jsx("span",{style:{color:"var(--fg-3)"},children:W?"Online":"Offline"})]})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Cu(Z.createdAt)}),u.jsxs(We,{style:{textAlign:"right",whiteSpace:"nowrap"},onClick:ve=>ve.stopPropagation(),children:[u.jsx(me,{variant:"ghost",size:"xs",className:"text-label",onClick:()=>z({agentId:Z.agentId,editingId:Z.id,initialPlatform:uZ(Z.platform),initialStatus:cZ(Z.status)}),children:"Edit"}),u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>I(Z.id),disabled:J.isPending,title:"Delete",children:u.jsx(ku,{className:"h-3.5 w-3.5"})})]})]},Z.id)})})]}):u.jsx(Ud,{children:l?"No bot bindings for this agent yet.":"No bot bindings"})]}),u.jsxs(tn,{children:[u.jsxs(Lg,{right:u.jsxs(me,{size:"xs",variant:"outline",onClick:()=>be("user"),children:[u.jsx(qr,{className:"h-3 w-3"})," User binding"]}),children:["User bindings · ",w.length]}),E?u.jsx(Ud,{children:"Loading…"}):w.length?u.jsxs(Hs,{children:[u.jsx(Zs,{children:u.jsxs($r,{children:[u.jsx(lt,{children:"Agent"}),u.jsx(lt,{children:"Platform"}),u.jsx(lt,{children:"External user ID"}),u.jsx(lt,{children:"Display name"}),u.jsx(lt,{children:"Bound via"}),u.jsx(lt,{children:"Created"}),u.jsx(lt,{style:{width:32}})]})}),u.jsx(Vs,{children:w.map(Z=>u.jsxs($r,{interactive:!0,onClick:()=>e(`/agents/${Z.agentId}`),children:[u.jsx(We,{children:u.jsx("span",{className:"mono font-medium",style:{color:"var(--accent-dim)"},children:o(Z.agentId)})}),u.jsx(We,{children:u.jsx(Br,{children:Z.platform})}),u.jsx(We,{children:u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-2)"},children:Z.externalUserId})}),u.jsx(We,{style:{color:"var(--fg-2)"},children:Z.displayName??"—"}),u.jsx(We,{children:u.jsx(Br,{tone:"outline",children:Z.boundVia??"—"})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Cu(Z.createdAt)}),u.jsx(We,{onClick:W=>W.stopPropagation(),children:u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>le(Z.id),disabled:ee.isPending,title:"Delete",children:u.jsx(ku,{className:"h-3.5 w-3.5"})})})]},Z.id))})]}):u.jsx(Ud,{children:l?"No user bindings for this agent yet.":"No user bindings"})]}),u.jsx(dZ,{open:C!=null,kind:(C==null?void 0:C.kind)??"bot",agents:y,agentId:O,onAgentChange:M,onCancel:()=>R(null),onConfirm:Ae}),u.jsx(PS,{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:we.isPending||Y.isPending,errorMessage:(we.error??Y.error)instanceof Error?(we.error??Y.error).message:null,onOpenChange:Z=>{Z||(z(null),we.reset(),Y.reset())},onSubmit:A}),u.jsx(PS,{open:$!=null,kind:"user",editingId:null,agentLabel:$?o($.agentId):"",pending:H.isPending,errorMessage:H.error instanceof Error?H.error.message:null,onOpenChange:Z=>{Z||(U(null),H.reset())},onSubmit:L}),u.jsx(BS,{open:Q!=null,onOpenChange:Z=>!Z&&I(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:J.isPending,onConfirm:()=>{Q!=null&&(J.mutate(Q),I(null))}}),u.jsx(BS,{open:ne!=null,onOpenChange:Z=>!Z&&le(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:ee.isPending,onConfirm:()=>{ne!=null&&(ee.mutate(ne),le(null))}})]})}function uZ(e){return e==="feishu"||e==="slack"||e==="kael"?e:"feishu"}function cZ(e){return e==="inactive"?"inactive":"active"}function Ud({children:e}){return u.jsx("div",{className:"text-center py-6 text-body",style:{color:"var(--fg-3)"},children:e})}function dZ(e){const t=e.kind==="user"?e.agents.filter(n=>n.type==="human"&&n.status==="active"):e.agents.filter(n=>n.type!=="human"&&n.status==="active");return u.jsx(sn,{open:e.open,onOpenChange:n=>!n&&e.onCancel(),children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:e.kind==="bot"?"Bind a bot":"Bind an external user"})}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Pick the agent this binding routes to."}),u.jsxs("select",{value:e.agentId,onChange:n=>e.onAgentChange(n.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:[u.jsx("option",{value:"",children:"Select an agent…"}),t.map(n=>u.jsxs("option",{value:n.uuid,children:[n.displayName," ",n.name?`(@${n.name})`:""]},n.uuid))]})]}),u.jsxs(Ln,{children:[u.jsx(me,{variant:"ghost",onClick:e.onCancel,children:"Cancel"}),u.jsx(me,{onClick:e.onConfirm,disabled:!e.agentId,children:"Continue"})]})]})})}function BS(e){return u.jsx(sn,{open:e.open,onOpenChange:e.onOpenChange,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:e.title})}),u.jsx("div",{className:"space-y-3 text-body",style:{color:"var(--fg-2)"},children:e.description}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:()=>e.onOpenChange(!1),disabled:e.pending,children:"Cancel"}),u.jsx(me,{type:"button",variant:"destructive",onClick:e.onConfirm,disabled:e.pending,children:e.pending?"Working…":e.confirmLabel})]})]})})}function fZ({embedded:e=!1}={}){return u.jsxs("div",{className:e?"":"-m-6",children:[u.jsx(nc,{title:"Integrations",subtitle:"External platform bindings"}),u.jsx("div",{style:{padding:"var(--sp-4) var(--sp-5) var(--sp-7)"},children:u.jsx(oZ,{})})]})}function hZ(){return u.jsx(fZ,{embedded:!0})}function mZ(){return u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[u.jsx($S,{to:"/settings/computers",label:"Computers"}),u.jsx($S,{to:"/settings/integrations",label:"Integrations"})]}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:u.jsx(Ps,{})})]})}function $S({to:e,label:t}){return u.jsx(vf,{to:e,className:({isActive:n})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!n&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:n})=>u.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:n?"var(--bg-active)":"transparent",color:n?"var(--fg)":"var(--fg-3)",fontWeight:n?500:400,borderRadius:"var(--radius-input)"},children:u.jsx("span",{className:"flex-1 truncate",children:t})})})}function Xg(e){return e.normalize("NFKD").replace(new RegExp("\\p{M}+","gu"),"").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+|[-_]+$/g,"").slice(0,xs)}const Kp=200;function pZ(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 gZ(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[-_]+/,"").slice(0,xs)}function yZ(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 vZ({open:e,onOpenChange:t,onCreated:n}){const a=nn(),{refreshMe:l,organizationId:o}=Rt(),[c,f]=x.useState(""),[m,h]=x.useState(""),[y,g]=x.useState(!1),[b,w]=x.useState("claude-code"),[k,j]=x.useState("form"),[E,C]=x.useState([]),[R,O]=x.useState(null),[M,B]=x.useState(!1),[z,$]=x.useState({}),[U,Q]=x.useState({status:"idle"});x.useEffect(()=>{e&&(f(""),h(""),g(!1),w("claude-code"),j("form"),C([]),O(null),B(!1),$({}),Q({status:"idle"}))},[e]),x.useEffect(()=>{y||h(Xg(c))},[c,y]);const I=x.useRef(0);x.useEffect(()=>{if(!e||!m){Q({status:"idle"});return}if(!Mg.test(m)){Q({status:"bad",reason:"invalid"});return}if(Dg(m)){Q({status:"bad",reason:"reserved"});return}const A=++I.current;Q({status:"checking"});const L=window.setTimeout(()=>{eD(m).then(P=>{A===I.current&&(P.available?Q({status:"ok"}):Q({status:"bad",reason:P.reason}))}).catch(()=>{A===I.current&&Q({status:"idle"})})},300);return()=>window.clearTimeout(L)},[m,e]);const ne=St({mutationFn:async A=>{const L=c.trim()||m.trim()||"Untitled assistant";return WM({name:m||void 0,type:"personal_assistant",displayName:L,clientId:A.clientId,runtimeProvider:b,...o?{organizationId:o}:{}})},onSuccess:A=>{a.invalidateQueries({queryKey:["agents"]}),a.invalidateQueries({queryKey:["activity"]}),l(),n(A,b)}}),le=x.useMemo(()=>{const A=ne.error;if(!A)return{};if(A instanceof Qu){const L=pZ(A.issues);return Object.keys(L).length>0?L:A.status===409?{name:"That agent name is already in use in this organization. Pick a different one."}:{_root:A.message}}return A instanceof Error?{_root:A.message}:{}},[ne.error]),we=U.status==="bad"?yZ(U.reason):void 0,Y={...we?{name:we}:{},...le,...z};function J(){const A={};return m?m.length>xs?A.name=`Agent name must be at most ${xs} characters (got ${m.length}).`:Mg.test(m)?Dg(m)&&(A.name="That agent name is reserved — pick a different one."):A.name="Agent name must start with a letter or digit and contain only lowercase letters, digits, hyphens (-), and underscores (_).":c.trim().length>0&&(A.name="Agent name must contain at least one letter or digit (e.g. a-z, 0-9)."),c.length>Kp&&(A.displayName=`Display name must be at most ${Kp} characters (got ${c.length}).`),A}async function H(A){var P,T;A.preventDefault();const L=J();if($(L),!(Object.keys(L).length>0)&&U.status!=="bad"){B(!0);try{const W=(await Ni()).filter(ve=>ve.status==="connected");if(W.length===0){ne.mutate({clientId:void 0});return}if(W.length===1){ne.mutate({clientId:(P=W[0])==null?void 0:P.id});return}const ce=[...W].sort((ve,ge)=>ge.lastSeenAt.localeCompare(ve.lastSeenAt));C(ce),O(((T=ce[0])==null?void 0:T.id)??null),j("pick-computer")}catch{ne.mutate({clientId:void 0})}finally{B(!1)}}}function ee(){R&&ne.mutate({clientId:R})}const be=U.status==="bad",Ae=c.trim().length>0&&!be&&!ne.isPending&&!M;return k==="pick-computer"?u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{className:"max-w-lg",children:[u.jsx(fn,{children:u.jsx(on,{children:"Choose a computer"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("p",{className:"text-body text-muted-foreground",children:["Multiple computers are online. Pick where ",u.jsx("span",{className:"font-medium",children:c||m})," ","should run:"]}),u.jsx("div",{className:"space-y-2",children:E.map(A=>{const L=R===A.id;return u.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:[u.jsx("input",{type:"radio",name:"target-computer",checked:L,onChange:()=>O(A.id),className:"mt-1"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body font-medium truncate",children:A.hostname??A.id}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:[A.os??"unknown OS"," · last seen ",new Date(A.lastSeenAt).toLocaleString()]})]})]},A.id)})}),Y.clientId&&u.jsx("p",{className:"text-body text-destructive",children:Y.clientId}),Y._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:Y._root})]}),u.jsxs(Ln,{children:[u.jsx(me,{variant:"outline",onClick:()=>j("form"),disabled:ne.isPending,children:"Back"}),u.jsx(me,{onClick:ee,disabled:!R||ne.isPending,children:ne.isPending?"Creating…":"Create"})]})]})}):u.jsx(sn,{open:e,onOpenChange:t,children:u.jsxs(en,{className:"max-w-lg",children:[u.jsx(fn,{children:u.jsx(on,{children:"New Agent"})}),u.jsxs("form",{onSubmit:H,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"new-agent-display-name",children:"Display name"}),u.jsx(At,{id:"new-agent-display-name",value:c,onChange:A=>{f(A.target.value),z.displayName&&$(L=>({...L,displayName:void 0}))},placeholder:"My Dev Assistant",autoFocus:!0,maxLength:Kp,"aria-invalid":Y.displayName?!0:void 0,"aria-describedby":"new-agent-display-name-help new-agent-display-name-error"}),u.jsx("p",{id:"new-agent-display-name-help",className:"text-caption text-muted-foreground",children:"How teammates see this agent in chats and lists. Can be changed anytime."}),Y.displayName&&u.jsx("p",{id:"new-agent-display-name-error",className:"text-caption text-destructive",children:Y.displayName})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"new-agent-name",children:"Agent name"}),u.jsxs("div",{className:"flex items-stretch",children:[u.jsx("span",{"aria-hidden":!0,className:"inline-flex items-center px-2 font-mono text-body text-muted-foreground border border-r-0 border-input rounded-l-[var(--radius-input)] bg-muted/40",children:"@"}),u.jsx(At,{id:"new-agent-name",value:m,onChange:A=>{const L=gZ(A.target.value);h(L),g(!0),z.name&&$(P=>({...P,name:void 0}))},onBlur:A=>{const L=Xg(A.target.value);L!==m&&h(L)},placeholder:"my-dev-assistant",className:"rounded-l-none font-mono",maxLength:xs,"aria-invalid":Y.name?!0:void 0,"aria-describedby":"new-agent-name-help new-agent-name-error new-agent-name-status"})]}),u.jsxs("p",{id:"new-agent-name-help",className:"text-caption text-muted-foreground",children:["Used in @mentions and CLI commands. Lowercase letters, digits, hyphens (-), and underscores (_). Up to"," ",xs," characters. Permanent after creation."]}),m&&!Y.name&&U.status!=="idle"&&u.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."]}),Y.name&&u.jsx("p",{id:"new-agent-name-error",className:"text-caption text-destructive",children:Y.name})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Where it runs"}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("label",{className:b==="claude-code"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:b==="claude-code",onChange:()=>w("claude-code"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Claude Code"}),u.jsx("div",{className:"text-caption text-muted-foreground",children:"Anthropic's Claude Code on the bound computer. (default)"})]})]}),u.jsxs("label",{className:b==="codex"?"flex items-start gap-3 rounded-md border border-primary bg-primary/5 p-3 cursor-pointer":"flex items-start gap-3 rounded-md border border-border p-3 cursor-pointer hover:bg-accent/30",children:[u.jsx("input",{type:"radio",name:"runtime",checked:b==="codex",onChange:()=>w("codex"),className:"mt-1"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",children:"Codex"}),u.jsxs("div",{className:"text-caption text-muted-foreground",children:["OpenAI Codex CLI on the bound computer. Run ",u.jsx("code",{children:"codex login"})," on the host once."]})]})]})]})]}),Y._root&&u.jsx("div",{className:"rounded-md border border-destructive/50 bg-destructive/5 px-3 py-2 text-body text-destructive",children:Y._root}),u.jsx(Ln,{children:u.jsx(me,{type:"submit",disabled:!Ae,children:M?"Checking computers…":ne.isPending?"Creating…":"Create"})})]})]})})}function ac({children:e,count:t,right:n}){return u.jsxs("div",{className:"flex items-baseline justify-between",style:{padding:"var(--sp-1) var(--sp-1) var(--sp-2)"},children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)"},children:[u.jsx("h2",{className:"m-0 text-subtitle",style:{color:"var(--fg)"},children:e}),t!==void 0&&u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:t})]}),n]})}function bZ(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 xZ(){const{organizationId:e}=Rt(),[t,n]=x.useState(null),[a,l]=x.useState(null),[o,c]=x.useState(!1),[f,m]=x.useState(!1);x.useEffect(()=>{e&&(async()=>{try{const y=await ke.get(P1(e,"/invitations"));n(y)}catch(y){l(y instanceof Error?y.message:"Failed to load invite link")}})()},[e]);const h=async()=>{if(e){c(!0),l(null);try{const y=await ke.post(P1(e,"/invitations/rotate"));n(y)}catch(y){l(y instanceof Error?y.message:"Failed to rotate invite link")}finally{c(!1)}}};return u.jsxs(eo,{children:[u.jsxs(to,{children:[u.jsx(rc,{children:"Invite link"}),u.jsxs(zN,{children:["Anyone with this link can join your team as a member. Links expire after ",oU," days; rotating revokes the old link instantly and resets the timer."]})]}),u.jsxs(no,{className:"space-y-3",children:[a&&u.jsx("div",{className:"rounded-md bg-destructive/10 p-2 text-label text-destructive",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{readOnly:!0,className:"flex-1 rounded-md border bg-muted px-2 py-1 text-label font-mono",value:t.inviteUrl}),u.jsx(me,{size:"sm",variant:"outline",onClick:()=>{navigator.clipboard.writeText(t.inviteUrl),m(!0),setTimeout(()=>m(!1),1500)},children:f?"Copied!":"Copy"}),u.jsx(me,{size:"sm",onClick:h,disabled:o,children:o?"Rotating…":"Rotate"})]}),u.jsxs("p",{className:"text-label text-muted-foreground",children:["Created ",new Date(t.createdAt).toLocaleString(),t.expiresAt?` · ${bZ(t.expiresAt)}`:" · no expiry"]})]}):u.jsx("p",{className:"text-label text-muted-foreground",children:"Loading…"})]})]})}const wZ=Object.values(hU);function SZ(){const e=nn(),{memberId:t,role:n}=Rt(),a=n==="admin",[l,o]=x.useState(null),{data:c,isLoading:f,error:m}=He({queryKey:["members"],queryFn:Ky}),h=St({mutationFn:fP,onSuccess:()=>e.invalidateQueries({queryKey:["members"]})});function y(g){window.confirm("Delete this member? Their human agent will also be deactivated.")&&h.mutate(g)}return u.jsxs(u.Fragment,{children:[u.jsx("section",{children:f?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):m?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load members: ",m instanceof Error?m.message:"Unknown error"]}):(c==null?void 0:c.length)===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:a?"No members yet — share the Invite link to add teammates.":"No members yet."}):u.jsxs(Hs,{className:"table-fixed",children:[u.jsx(Zs,{children:u.jsxs($r,{children:[u.jsx(lt,{style:{width:160},children:"Display name"}),u.jsx(lt,{style:{width:140},children:"Username"}),u.jsx(lt,{style:{width:120},children:"Role"}),u.jsx(lt,{style:{width:150},children:"Created"}),u.jsx(lt,{"aria-hidden":!0}),a&&u.jsx(lt,{style:{width:80,textAlign:"right"}})]})}),u.jsx(Vs,{children:c==null?void 0:c.map(g=>{const b=t===g.id;return u.jsxs($r,{children:[u.jsxs(We,{children:[u.jsx("span",{className:"font-medium",children:g.displayName}),b&&u.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),u.jsx(We,{children:u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",g.username]})}),u.jsx(We,{className:"text-label",style:{color:"var(--fg-3)"},children:g.role==="admin"?"Admin":"Member"}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bj(g.createdAt)}),u.jsx(We,{"aria-hidden":!0}),a&&u.jsx(We,{style:{whiteSpace:"nowrap"},children:u.jsxs("div",{className:"flex gap-0.5 justify-end",children:[u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o({id:g.id,username:g.username,displayName:g.displayName,role:g.role}),title:"Edit",children:u.jsx(wf,{className:"h-3.5 w-3.5"})}),!b&&u.jsx(me,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>y(g.id),disabled:h.isPending,title:"Delete",style:{color:"var(--fg-4)"},children:u.jsx(ku,{className:"h-3.5 w-3.5"})})]})})]},g.id)})})]})}),u.jsx(kZ,{target:l,onClose:()=>o(null),onSaved:()=>{o(null),e.invalidateQueries({queryKey:["members"]})}})]})}function kZ({target:e,onClose:t,onSaved:n}){const[a,l]=x.useState(""),[o,c]=x.useState("member"),[f,m]=x.useState(null);x.useEffect(()=>{e&&(l(e.displayName),c(e.role),m(null))},[e]);const h=St({mutationFn:async()=>{if(!e)throw new Error("No target");const b={};return a.trim()&&a!==e.displayName&&(b.displayName=a.trim()),o!==e.role&&(b.role=o),Object.keys(b).length===0?e:dP(e.id,b)},onSuccess:()=>{m(null),n()},onError:b=>{m(b instanceof Error?b.message:String(b))}});function y(b){b.preventDefault(),h.mutate()}const g=e!==null;return u.jsx(sn,{open:g,onOpenChange:b=>b?void 0:t(),children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:"Edit Member"})}),e&&u.jsxs("form",{onSubmit:y,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{children:"Username"}),u.jsx(At,{value:e.username,disabled:!0,className:"font-mono"}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Username is permanent after creation."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"edit-member-display",children:"Display Name"}),u.jsx(At,{id:"edit-member-display",value:a,onChange:b=>l(b.target.value),required:!0,maxLength:200})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(ft,{htmlFor:"edit-member-role",children:"Role"}),u.jsx("select",{id:"edit-member-role",value:o,onChange:b=>c(b.target.value),className:"flex h-9 w-full rounded-[var(--radius-input)] border border-input bg-transparent px-3 py-1 text-body shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:wZ.map(b=>u.jsx("option",{value:b,children:b},b))}),u.jsx("p",{className:"text-caption",style:{color:"var(--fg-3)"},children:"Demoting the last admin is blocked — every org needs at least one admin to manage members."})]}),f&&u.jsx("p",{className:"text-body",style:{color:"var(--state-error)"},children:f}),u.jsxs(Ln,{children:[u.jsx(me,{type:"button",variant:"ghost",onClick:t,disabled:h.isPending,children:"Cancel"}),u.jsx(me,{type:"submit",disabled:h.isPending,children:h.isPending?"Saving…":"Save"})]})]})]})})}function jZ(){var m;const{role:e}=Rt(),t=e==="admin",[n,a]=x.useState(!1),{data:l}=He({queryKey:["members"],queryFn:Ky}),o=He({queryKey:["agents","team-page"],queryFn:()=>Yu({limit:100})}),c=(l==null?void 0:l.length)??0,f=(((m=o.data)==null?void 0:m.items)??[]).filter(h=>h.type!=="human").length;return u.jsxs(u.Fragment,{children:[u.jsx(nc,{title:"Team",subtitle:`${c} ${c===1?"human":"humans"} and ${f} ${f===1?"agent":"agents"} working together`,right:t&&u.jsxs(me,{size:"xs",variant:"ghost",onClick:()=>a(!0),children:[u.jsx(nj,{className:"h-3 w-3"}),"Invite link"]})}),u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)",display:"flex",flexDirection:"column",gap:"var(--sp-5)"},children:[u.jsx(CZ,{}),u.jsx(EZ,{data:o.data,isLoading:o.isLoading,error:o.error})]}),u.jsx(sn,{open:n,onOpenChange:a,children:u.jsxs(en,{children:[u.jsx(fn,{children:u.jsx(on,{children:"Invite link"})}),u.jsx(xZ,{})]})})]})}function CZ(){return u.jsxs("section",{children:[u.jsx(ac,{children:"Humans"}),u.jsx(SZ,{})]})}function EZ({data:e,isLoading:t,error:n}){const a=Un(),l=nn(),o=vE(),{memberId:c}=Rt(),[f,m]=x.useState(!1),{data:h}=He({queryKey:["activity"],queryFn:Ku,refetchInterval:1e4}),y=x.useMemo(()=>{const w=new Map;for(const k of(h==null?void 0:h.agents)??[])w.set(k.agentId,k);return w},[h==null?void 0:h.agents]),g=x.useMemo(()=>{const w=((e==null?void 0:e.items)??[]).filter(E=>E.type!=="human");if(!c)return w;const k=[],j=[];for(const E of w)(E.managerId===c?k:j).push(E);return[...k,...j]},[e==null?void 0:e.items,c]);function b(w,k){m(!1),l.invalidateQueries({queryKey:["agents"]}),l.invalidateQueries({queryKey:["activity"]})}return u.jsxs(u.Fragment,{children:[u.jsxs("section",{children:[u.jsx(ac,{right:u.jsxs(me,{size:"xs",variant:"ghost",className:"normal-case tracking-normal",onClick:()=>m(!0),children:[u.jsx(qr,{className:"h-3 w-3"}),"New agent"]}),children:"Agents"}),t?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"Loading…"}):n?u.jsxs("div",{className:"text-center py-8 text-body",style:{color:"var(--state-error)"},children:["Failed to load agents: ",n instanceof Error?n.message:"Unknown error"]}):g.length===0?u.jsx("div",{className:"text-center py-8 text-body",style:{color:"var(--fg-3)"},children:"No agents yet — create one with “New agent”."}):u.jsxs(Hs,{className:"table-fixed",children:[u.jsx(Zs,{children:u.jsxs($r,{children:[u.jsx(lt,{style:{width:160},children:"Display name"}),u.jsx(lt,{style:{width:140},children:"Agent name"}),u.jsx(lt,{style:{width:150},children:"Type"}),u.jsx(lt,{style:{width:160},children:"Managed by"}),u.jsx(lt,{style:{width:100},children:"Visibility"}),u.jsx(lt,{style:{width:110},children:"Status"}),u.jsx(lt,{style:{width:150},children:"Created"})]})}),u.jsx(Vs,{children:g.map(w=>{const k=y.get(w.uuid);return u.jsxs($r,{interactive:!0,onClick:()=>a(`/agents/${encodeURIComponent(w.uuid)}`),children:[u.jsx(We,{children:u.jsx("span",{className:"font-medium",children:w.displayName})}),u.jsx(We,{children:w.name?u.jsxs("span",{className:"mono text-label",style:{color:"var(--fg-3)"},children:["@",w.name]}):u.jsx("span",{className:"mono text-label",style:{color:"var(--fg-4)"},children:"—"})}),u.jsx(We,{className:"text-label",style:{color:"var(--fg-3)"},children:NZ(w.type)}),u.jsxs(We,{className:"text-label",style:{color:"var(--fg-2)"},children:[w.managerId?o(w.managerId):"—",w.managerId&&w.managerId===c&&u.jsx("span",{className:"text-label italic",style:{marginLeft:6,color:"var(--fg-3)"},children:"(you)"})]}),u.jsx(We,{className:"text-label",style:{color:"var(--fg-3)"},children:_Z(w.visibility)}),u.jsx(We,{children:u.jsx(zu,{state:(k==null?void 0:k.runtimeState)??null})}),u.jsx(We,{className:"mono text-caption",style:{color:"var(--fg-4)"},children:bj(w.createdAt)})]},w.uuid)})})]})]}),u.jsx(vZ,{open:f,onOpenChange:m,onCreated:b})]})}function NZ(e){return e==="autonomous_agent"?"Autonomous agent":e==="personal_assistant"?"Personal assistant":e}function _Z(e){return e==="organization"?"Shared":e==="private"?"Private":e}function Pf(e,t){return`/orgs/${encodeURIComponent(e)}/settings/${encodeURIComponent(t)}`}function TZ(e){return ke.get(Pf(e,"context_tree"))}function AZ(e,t){return ke.put(Pf(e,"context_tree"),t)}function RZ(e){return ke.get(Pf(e,"github_integration"))}function zZ(e,t){return ke.put(Pf(e,"github_integration"),t)}function OZ(){const{organizationId:e}=Rt(),t=nn(),n=He({queryKey:["org-setting",e,"context_tree"],queryFn:()=>e?TZ(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(""),[f,m]=x.useState(!1);x.useEffect(()=>{n.data&&(l(n.data.repo??""),c(n.data.branch??"main"))},[n.data]);const h=St({mutationFn:()=>{if(!e)throw new Error("organization not loaded");return AZ(e,{repo:a.trim()?a.trim():null,branch:o.trim()?o.trim():null})},onSuccess:g=>{t.setQueryData(["org-setting",e,"context_tree"],g),m(!0),setTimeout(()=>m(!1),2e3)}}),y=g=>{g.preventDefault(),h.mutate()};return u.jsxs("section",{children:[u.jsx(ac,{right:u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(me,{type:"submit",form:"context-tree-form",size:"xs",variant:"outline",disabled:h.isPending||!n.data,children:[u.jsx(fr,{className:"h-3 w-3"}),h.isPending?"Saving…":"Save"]})]}),children:"Context Tree"}),n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load setting"}):u.jsxs("form",{id:"context-tree-form",onSubmit:y,children:[u.jsx(FS,{label:"Repo URL",hint:"HTTPS or SSH URL of the Context Tree git repository for this team.",value:a,onChange:l,mono:!0,placeholder:"https://github.com/your-org/first-tree-context"}),u.jsx(FS,{label:"Branch",hint:"Branch checked out by client agents on startup.",value:o,onChange:c,mono:!0,placeholder:"main"}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",padding:"var(--sp-2) var(--sp-1) 0"},children:"Changes apply to new agent sessions. Members should restart agents to pick up updated tree contents."}),h.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:h.error.message})]})]})}function FS({label:e,hint:t,value:n,onChange:a,mono:l,placeholder:o}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"var(--sp-45) 1fr",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),placeholder: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 MZ(){var E,C;const{organizationId:e}=Rt(),t=nn(),n=He({queryKey:["org-setting",e,"github_integration"],queryFn:()=>e?RZ(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(!1),[f,m]=x.useState(!1),[h,y]=x.useState(!1);x.useEffect(()=>{n.data},[n.data]);const g=((E=n.data)==null?void 0:E.webhookUrl)??"",b=St({mutationFn:()=>{if(!e)throw new Error("organization not loaded");const R=a.trim();return R.length===0&&!o?Promise.resolve(n.data):zZ(e,{webhookSecret:R.length>0?R:null})},onSuccess:R=>{R&&(t.setQueryData(["org-setting",e,"github_integration"],R),l(""),c(!1),m(!0),setTimeout(()=>m(!1),2e3))}}),w=R=>{R.preventDefault(),b.mutate()},k=async()=>{g&&(await navigator.clipboard.writeText(g),y(!0),setTimeout(()=>y(!1),2e3))},j=((C=n.data)==null?void 0:C.webhookSecretConfigured)??!1;return u.jsxs("section",{children:[u.jsx(ac,{right:u.jsxs("div",{className:"flex items-center gap-1.5",children:[f&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(me,{type:"submit",form:"github-integration-form",size:"xs",variant:"outline",disabled:b.isPending||!n.data,children:[u.jsx(fr,{className:"h-3 w-3"}),b.isPending?"Saving…":"Save"]})]}),children:"GitHub integration"}),n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load setting"}):u.jsxs("form",{id:"github-integration-form",onSubmit:w,children:[g?u.jsx(IZ,{label:"Webhook URL",hint:"Configure this URL in GitHub repo / org Settings → Webhooks. Never changes.",value:g,rightSlot:u.jsxs(me,{type:"button",size:"xs",variant:"ghost",onClick:k,children:[u.jsx(xf,{className:"h-3 w-3"}),h?"Copied":"Copy"]})}):u.jsx(LZ,{label:"Webhook URL",message:"The Hub's public URL is not configured. Please contact your site administrator to enable the GitHub webhook."}),j&&!o?u.jsx(UZ,{onReplace:()=>{c(!0),l("")}}):u.jsx(DZ,{label:"Webhook secret",hint:"Paste the value you used when configuring the GitHub webhook. Stored encrypted; never echoed back.",value:a,onChange:l,mono:!0,placeholder:o?"Enter new secret":"(none)",type:"password"}),b.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:b.error.message})]})]})}function DZ({label:e,hint:t,value:n,onChange:a,mono:l,placeholder:o,type:c}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"var(--sp-45) 1fr",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:f=>a(f.target.value),type:c??"text",placeholder: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 IZ({label:e,hint:t,value:n,rightSlot:a}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"var(--sp-45) 1fr",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsxs("div",{className:"mono text-body flex items-center justify-between gap-2",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-3)",overflow:"hidden"},children:[u.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),a]})]})}function LZ({label:e,message:t}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"var(--sp-45) 1fr",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsx("div",{children:u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e})}),u.jsxs("div",{className:"flex items-start gap-2 text-body",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(--state-warning, var(--fg-3))"},children:[u.jsx(wl,{className:"h-4 w-4 shrink-0",style:{marginTop:2}}),u.jsx("span",{children:t})]})]})}function UZ({onReplace:e}){return u.jsxs("div",{className:"grid items-center gap-5",style:{gridTemplateColumns:"var(--sp-45) 1fr",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:"Webhook secret"}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:"Configured. Replace to rotate; webhook signature verification will fail until GitHub is also updated."})]}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"mono text-body",style:{color:"var(--accent-dim)"},children:"••••••••"}),u.jsx(me,{type:"button",size:"xs",variant:"ghost",onClick:e,children:"Replace"})]})]})}function PZ(e){return ke.get(`/orgs/${encodeURIComponent(e)}`)}function BZ(e,t){return ke.patch(`/orgs/${encodeURIComponent(e)}`,t)}function $Z(){const{organizationId:e}=Rt(),t=nn(),n=He({queryKey:["organization",e],queryFn:()=>e?PZ(e):Promise.reject(new Error("no org")),enabled:!!e}),[a,l]=x.useState(""),[o,c]=x.useState(!1);x.useEffect(()=>{n.data&&l(n.data.displayName)},[n.data]);const f=St({mutationFn:()=>{if(!e||!n.data)throw new Error("organization not loaded");const h=a.trim();return!h||h===n.data.displayName?Promise.resolve(n.data):BZ(e,{displayName:h})},onSuccess:h=>{t.setQueryData(["organization",e],h),t.invalidateQueries({queryKey:["me-organizations"]}),c(!0),setTimeout(()=>c(!1),2e3)}}),m=h=>{h.preventDefault(),f.mutate()};return u.jsxs("section",{children:[u.jsx(ac,{right:u.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent-dim)"},children:"saved"}),u.jsxs(me,{type:"submit",form:"team-identity-form",size:"xs",variant:"outline",disabled:f.isPending||!n.data,children:[u.jsx(fr,{className:"h-3 w-3"}),f.isPending?"Saving…":"Save"]})]}),children:"Team identity"}),n.isLoading?u.jsx("div",{className:"text-body",style:{color:"var(--fg-3)",padding:"var(--sp-3) var(--sp-1)"},children:"Loading…"}):n.error?u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",padding:"var(--sp-3) var(--sp-1)"},children:n.error instanceof Error?n.error.message:"Failed to load team"}):u.jsxs("form",{id:"team-identity-form",onSubmit:m,children:[u.jsx(FZ,{label:"Team name",hint:"Shown in the team switcher and dashboard header.",value:a,onChange:l}),f.error instanceof Error&&u.jsx("div",{className:"text-body",style:{color:"var(--state-error)",marginTop:"var(--sp-2)"},children:f.error.message})]})]})}function FZ({label:e,hint:t,value:n,onChange:a,mono:l,pattern:o}){return u.jsxs("div",{className:"grid items-start gap-5",style:{gridTemplateColumns:"var(--sp-45) 1fr",padding:"var(--sp-3_5) var(--sp-1)",borderTop:"var(--hairline) solid var(--border-faint)"},children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-body font-medium",style:{color:"var(--fg)"},children:e}),u.jsx("div",{className:"text-label",style:{color:"var(--fg-3)",marginTop:2},children:t})]}),u.jsx("input",{value:n,onChange:c=>a(c.target.value),pattern:o,className:`w-full outline-none text-body ${l?"mono":""}`,style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:"var(--bg-sunken)",border:"var(--hairline) solid var(--border)",borderRadius:"var(--radius-input)",color:"var(--fg)"}})]})}function qZ(){return u.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[u.jsx($Z,{}),u.jsx(OZ,{}),u.jsx(MZ,{})]})}function HZ(){const{role:e}=Rt();return e===null?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-5)",color:"var(--fg-3)"},children:"Loading..."}):e!=="admin"?u.jsx(ur,{to:"/team",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx(nc,{title:"Team settings",subtitle:"Identity, Context Tree, GitHub integration"}),u.jsx("div",{style:{padding:"var(--sp-2) var(--sp-5) var(--sp-7)"},children:u.jsx(qZ,{})})]})}function ZZ(){const{role:e}=Rt();return e!=="admin"?u.jsx(Ps,{}):u.jsxs("div",{className:"-m-6 flex",style:{minHeight:"calc(100vh - var(--sp-10))"},children:[u.jsxs("aside",{className:"shrink-0 overflow-auto",style:{width:200,padding:"var(--sp-4) var(--sp-2)"},children:[u.jsx(qS,{to:"/team",end:!0,label:"Members"}),u.jsx(qS,{to:"/team/settings",label:"Team settings"})]}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:u.jsx(Ps,{})})]})}function qS({to:e,label:t,end:n}){return u.jsx(vf,{to:e,end:n,className:({isActive:a})=>Te("block w-full text-left bg-transparent text-body transition-colors","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",!a&&"hover:bg-accent"),style:{borderRadius:"var(--radius-input)"},children:({isActive:a})=>u.jsx("span",{className:"flex items-center",style:{padding:"var(--sp-1_25) var(--sp-2_5)",background:a?"var(--bg-active)":"transparent",color:a?"var(--fg)":"var(--fg-3)",fontWeight:a?500:400,borderRadius:"var(--radius-input)"},children:u.jsx("span",{className:"flex-1 truncate",children:t})})})}function ff(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 ke.get(hn(`/chats${n?`?${n}`:""}`))}function VZ(e){return ke.post(hn("/chats"),e)}function QZ(e){return ke.post(`/chats/${encodeURIComponent(e)}/read`)}function ON(e,t){return ke.post(`/chats/${encodeURIComponent(e)}/participants`,t)}function KZ(e){return ke.post(`/chats/${encodeURIComponent(e)}/workspace-join`)}function GZ({active:e,count:t,warn:n,className:a,children:l,style:o,...c}){return u.jsxs("button",{type:"button",className:Te("mono inline-flex items-center gap-1 text-caption leading-[1.6]",a),style:{padding:"var(--sp-0_5) var(--sp-1_75)",borderRadius:3,border:`var(--hairline) solid ${e?"var(--border-strong)":"var(--border)"}`,background:e?"var(--bg-active)":"transparent",color:e?"var(--fg)":"var(--fg-3)",cursor:"pointer",...o},...c,children:[l,t!==void 0&&u.jsx("span",{className:"mono",style:{color:n&&typeof t=="number"&&t>0?"var(--state-error)":"var(--fg-4)"},children:t})]})}const hf="draft";function YZ(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=c=>{var f;return((f=l.find(m=>m.type===c))==null?void 0:f.value)??""};return`${o("month")}/${o("day")} ${o("hour")}:${o("minute")}`}function XZ(e){return e.membershipKind==="watching"?e.lastMessagePreview?`Watching · ${e.lastMessagePreview}`:"Watching":e.lastMessagePreview??""}function JZ({selectedChatId:e,onSelectChat:t,onNewChat:n}){const[a,l]=x.useState("all"),[o,c]=x.useState(""),[f,m]=x.useState([]),[h,y]=x.useState(!1),[g,b]=x.useState(null),{data:w,isLoading:k}=He({queryKey:["me","chats",a],queryFn:()=>ff({filter:a}),refetchInterval:15e3}),j=()=>{f.length>0&&m([]),b(null)},E=(w==null?void 0:w.rows)??[],C=x.useMemo(()=>[...E,...f],[E,f]),R=x.useMemo(()=>{const U=o.trim().toLowerCase();return U?C.filter(Q=>Q.title.toLowerCase().includes(U)||(Q.lastMessagePreview??"").toLowerCase().includes(U)?!0:Q.participants.map(we=>we.displayName.toLowerCase()).join(" ").includes(U)):C},[C,o]),O=async()=>{if(h)return;const U=w==null?void 0:w.nextCursor;if(U){y(!0),b(null);try{const Q=await ff({filter:a,cursor:U});m(I=>[...I,...Q.rows]),B(Q.nextCursor)}catch(Q){b(Q instanceof Error?Q.message:"Failed to load more")}finally{y(!1)}}},[M,B]=x.useState(null),z=(w==null?void 0:w.nextCursor)??null;x.useEffect(()=>{B(z)},[z]);const $=x.useMemo(()=>C.reduce((U,Q)=>U+(Q.unreadMentionCount>0?1:0),0),[C]);return u.jsxs("aside",{className:"shrink-0 flex flex-col overflow-hidden",style:{width:320,background:"var(--bg-raised)",borderRight:"var(--hairline) solid var(--border)"},children:[u.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:[u.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===hf?"var(--bg-active)":"transparent",color:e===hf?"var(--accent)":"var(--fg)",cursor:"pointer",fontWeight:500},title:"New chat",children:[u.jsx(qr,{className:"h-3.5 w-3.5",strokeWidth:2}),"New chat"]}),u.jsxs("div",{className:"flex items-center",style:{gap:8},children:[u.jsx("div",{className:"flex gap-1 shrink-0",children:$>0&&u.jsx(GZ,{active:a==="unread",count:$,onClick:()=>{l(a==="unread"?"all":"unread"),j()},children:"unread"})}),u.jsxs("div",{className:"relative",style:{flex:1,minWidth:0},children:[u.jsx(xy,{className:"h-3 w-3 absolute pointer-events-none",style:{left:4,top:"50%",transform:"translateY(-50%)",color:"var(--fg-4)"}}),u.jsx("input",{value:o,onChange:U=>c(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)"}})]})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto",children:[k&&R.length===0&&u.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&&u.jsx("div",{className:"text-center text-body",style:{padding:"var(--sp-6) var(--sp-3)",color:"var(--fg-3)"},children:o?"No matches":u.jsxs(u.Fragment,{children:[u.jsx("p",{style:{margin:0},children:"No conversations yet."}),u.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 Q=e===U.chatId,I=XZ(U),ne=I&&I!==U.title?I:"",le=U.unreadMentionCount>0;return u.jsx("div",{style:{borderBottom:"var(--hairline) solid var(--border-faint)"},children:u.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:Q?"var(--bg-active)":"transparent",borderLeft:`var(--hairline-bold) solid ${Q?"var(--accent)":"transparent"}`},children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:6},children:[le&&u.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"}}),u.jsx("span",{className:"truncate text-subtitle",style:{color:le?"var(--fg)":"var(--fg-2)",fontWeight:le?700:500,flex:1,minWidth:0},children:U.title}),U.lastMessageAt&&u.jsx("span",{className:"mono text-caption shrink-0",style:{color:"var(--fg-4)"},children:YZ(U.lastMessageAt)})]}),u.jsx("div",{className:"truncate text-body",style:{color:le?"var(--fg-2)":"var(--fg-3)",marginTop:2},children:ne||"—"})]})},U.chatId)}),M&&R.length>0&&u.jsxs("div",{style:{padding:"var(--sp-2) var(--sp-3)"},children:[u.jsx("button",{type:"button",onClick:O,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&&u.jsx("p",{className:"mono text-caption",style:{color:"var(--state-error)",marginTop:4},children:g})]})]})]})}function MN(e){return ke.get(`/chats/${encodeURIComponent(e)}`)}function WZ(e,t){return ke.patch(`/chats/${encodeURIComponent(e)}`,{topic:t})}function Jg(e,t){return ke.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"text",content:t})}function eV(e,t){return ke.post(`/chats/${encodeURIComponent(e)}/messages`,{format:"file",content:t})}function tV(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 nV(e){return ke.post(`/agents/${encodeURIComponent(e)}/chats`,{})}function rV(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 ke.get(`/chats/${encodeURIComponent(e)}/messages${a?`?${a}`:""}`)}function pv(e){const t=new Map;for(const a of e)a.displayName&&t.set(a.displayName,(t.get(a.displayName)??0)+1);const n=new Set;for(const[a,l]of t)l>1&&n.add(a);return n}function aV(e,t){return!e.name||!e.displayName?!1:e.displayName!==e.name?!0:t.has(e.displayName)}function gv({candidate:e,ambiguous:t}){const n=e.name?`@${e.name}`:"—";return u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-medium",children:e.displayName??n}),aV(e,t)&&u.jsxs("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},children:["@",e.name]})]})}function iV(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 lV(e,t){if(!t)return[...e].sort((a,l)=>(a.displayName??a.name??"").localeCompare(l.displayName??l.name??"")).slice(0,8);const n=[];for(const a of e){const l=(a.name??"").toLowerCase(),o=(a.displayName??"").toLowerCase();let c=1/0;l.startsWith(t)?c=0:o.startsWith(t)?c=1:o.includes(t)&&(c=2),c!==1/0&&n.push({c:a,score:c})}return n.sort((a,l)=>a.score-l.score||(a.c.displayName??"").localeCompare(l.c.displayName??"")),n.slice(0,8).map(a=>a.c)}function sV(e,t,n,a){if(!a.name)return null;const l=e.slice(0,t.triggerIndex),o=e.slice(n),c=`@${a.name}`,f=o.length===0||!/\s/.test(o[0]??""),m=f?` ${o}`:o,h=`${l}${c}${m}`,y=l.length+c.length+(f?1:0);return{text:h,cursor:y}}function DN({value:e,cursor:t,candidates:n,onSelect:a,disabled:l}){const[o,c]=x.useState(0),[f,m]=x.useState(null),h=x.useMemo(()=>l?null:iV(e,t),[e,t,l]),y=x.useMemo(()=>h?lV(n,h.query):[],[h,n]),g=h?`${h.triggerIndex}:${h.query}`:"";x.useEffect(()=>{c(0)},[g]),x.useEffect(()=>{h===null&&f!==null&&m(null)},[h,f]);const b=f!==null&&h!==null&&f===h.triggerIndex,w=h!==null&&y.length>0&&!b;function k(){m((h==null?void 0:h.triggerIndex)??null)}function j(C){if(!h)return;const R=sV(e,h,t,C);R&&a(R)}return{trigger:w?h:null,results:w?y:[],highlightIndex:o,handleKey:C=>{if(!w||!h)return!1;if(C.key==="ArrowDown")return C.preventDefault(),c(R=>y.length===0?0:(R+1)%y.length),!0;if(C.key==="ArrowUp")return C.preventDefault(),c(R=>y.length===0?0:(R-1+y.length)%y.length),!0;if(C.key==="Enter"||C.key==="Tab"){const R=y[o]??y[0];return R?(C.preventDefault(),j(R),!0):!1}return C.key==="Escape"?(C.preventDefault(),k(),!0):!1},pick:j,dismiss:k}}function IN({trigger:e,results:t,highlightIndex:n,onPick:a,anchorRef:l}){const o=x.useRef(null);return x.useEffect(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector(`[data-mention-index="${n}"]`);f==null||f.scrollIntoView({block:"nearest"})},[n]),!e||t.length===0||!l.current?null:u.jsx("div",{ref:o,role:"listbox","aria-label":"Mention suggestions",className:Te("absolute z-20 max-h-56 overflow-auto rounded-md border shadow-lg"),style:{bottom:"calc(100% + var(--sp-1))",left:0,minWidth:240,maxWidth:360,background:"var(--bg-raised)",borderColor:"var(--border)"},children:(()=>{const f=pv(t);return t.map((m,h)=>{const y=h===n;return u.jsx("button",{type:"button",role:"option","aria-selected":y,"data-mention-index":h,title:m.name?`@${m.name}`:void 0,onMouseDown:g=>{g.preventDefault(),a(m)},className:"flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-body",style:{background:y?"var(--bg-hover)":"transparent",color:"var(--fg)",border:"none",cursor:"pointer",whiteSpace:"nowrap"},children:u.jsx(gv,{candidate:m,ambiguous:f})},m.agentId)})})()})}function oV({onCreated:e}){const t=nn(),{agentId:n}=Rt(),a=Ay(),[l,o]=x.useState([]),[c,f]=x.useState(""),[m,h]=x.useState(0),[y,g]=x.useState(null),[b,w]=x.useState(!1),[k,j]=x.useState(!1),E=x.useRef(null),C=x.useRef(!1),R=x.useRef(null),{data:O}=He({queryKey:["activity"],queryFn:Ku,refetchInterval:15e3}),M=x.useMemo(()=>{const Y=(O==null?void 0:O.agents)??[],J=[];for(const H of Y){if(n&&H.agentId===n)continue;const ee=a(H.agentId);!ee||!ee.name||J.push({agentId:H.agentId,name:ee.name,displayName:ee.displayName})}return J},[O,a,n]);x.useEffect(()=>{if(C.current||l.length>0||M.length===0)return;const Y=cV(M,(O==null?void 0:O.agents)??[]);Y&&(o([Y]),C.current=!0)},[M,O,l.length]);const B=x.useMemo(()=>{const Y=M.map(J=>({agentId:J.agentId,name:J.name}));return XC(c,Y)},[c,M]),z=DN({value:c,cursor:m,candidates:M,disabled:b,onSelect:Y=>{f(Y.text),h(Y.cursor),requestAnimationFrame(()=>{const J=E.current;J&&(J.focus(),J.setSelectionRange(Y.cursor,Y.cursor))})}});x.useEffect(()=>{B.length!==0&&o(Y=>{const J=new Set(Y);let H=!1;for(const ee of B)J.has(ee)||(J.add(ee),H=!0);return H?[...J]:Y})},[B]),x.useEffect(()=>{if(!k)return;const Y=J=>{R.current&&(R.current.contains(J.target)||j(!1))};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[k]);const $=St({mutationFn:async({participantIds:Y,text:J})=>{const H=await VZ({participantIds:Y}),ee=J.trim();return ee.length>0&&await Jg(H.chatId,ee),H.chatId},onSuccess:Y=>{f(""),o([]),C.current=!1,t.invalidateQueries({queryKey:["me","chats"]}),e(Y)},onError:Y=>{g(Y instanceof Error?Y.message:"Failed to create chat")}}),U=x.useMemo(()=>!(b||$.isPending||l.length===0||c.trim().length===0||l.length>=2&&B.length===0),[b,$.isPending,l.length,c,B.length]),Q=x.useMemo(()=>l.length===0?"Add at least one participant":c.trim().length===0?null:l.length>=2&&B.length===0?"Group chats need an @ to wake at least one participant":null,[l.length,c,B.length]),I=async()=>{if(!U)return;const Y=Array.from(new Set([...l,...B]));g(null),w(!0);try{await $.mutateAsync({participantIds:Y,text:c})}finally{w(!1)}},ne=Y=>{o(J=>J.filter(H=>H!==Y))},le=Y=>{o(J=>J.includes(Y)?J:[...J,Y]),j(!1)},we=x.useMemo(()=>M.filter(Y=>!l.includes(Y.agentId)),[M,l]);return u.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"var(--bg-base)"},children:u.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",style:{padding:"var(--sp-6)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:"clamp(55rem, 75%, 70rem)"},children:[u.jsx("p",{className:"text-title",style:{color:"var(--fg)",textAlign:"center",marginBottom:"var(--sp-5)"},children:"What's the task?"}),u.jsxs("div",{style:{borderRadius:10,background:"var(--bg-raised)",boxShadow:"var(--shadow-md)",overflow:"visible"},children:[u.jsx(uV,{chips:l,candidates:M,chipCandidates:we,pickerOpen:k,setPickerOpen:j,pickerContainerRef:R,onAdd:le,onRemove:ne}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(IN,{trigger:z.trigger,results:z.results,highlightIndex:z.highlightIndex,anchorRef:E,onPick:z.pick}),u.jsx("textarea",{ref:E,value:c,onChange:Y=>{f(Y.target.value),h(Y.target.selectionStart??Y.target.value.length)},onSelect:Y=>{h(Y.currentTarget.selectionStart??c.length)},placeholder:l.length>=2?"Describe the task. Use @ to address one or more.":"Describe the task…",rows:1,onKeyDown:Y=>{z.handleKey(Y)||Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),I())},disabled:b||$.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&&c.trim().length>0&&u.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:[c,u.jsx("span",{style:{color:"var(--fg-4)"},children:" ← @ a group member to send"})]})]}),u.jsx("div",{className:"flex items-center justify-end",style:{padding:"var(--sp-1_5) var(--sp-2_5)"},children:u.jsx("button",{type:"button",onClick:()=>void I(),disabled:!U,title:Q??"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:u.jsx(Yk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})})]}),y&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:8},children:y})]})})})}function uV({chips:e,candidates:t,chipCandidates:n,pickerOpen:a,setPickerOpen:l,pickerContainerRef:o,onAdd:c,onRemove:f}){return u.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 u.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:[u.jsx("span",{children:y}),u.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:u.jsx(ju,{className:"h-3 w-3"})})]},m)}),u.jsxs("div",{ref:o,style:{position:"relative"},children:[u.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:u.jsx(qr,{className:"h-3 w-3"})}),a&&n.length>0&&u.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:(()=>{const m=pv(n);return n.map(h=>u.jsx("button",{type:"button",role:"option","aria-selected":"false",title:h.name?`@${h.name}`:void 0,onClick:()=>c(h.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:u.jsx(gv,{candidate:h,ambiguous:m})},h.agentId))})()})]})]})}function cV(e,t){var o;const n=new Set(e.map(c=>c.agentId)),a=[...t].filter(c=>n.has(c.agentId)&&c.runtimeUpdatedAt).sort((c,f)=>(f.runtimeUpdatedAt??"").localeCompare(c.runtimeUpdatedAt??""))[0];if(a)return a.agentId;const l=t.find(c=>n.has(c.agentId)&&c.type==="personal_assistant");return l?l.agentId:((o=e[0])==null?void 0:o.agentId)??null}const dV="first-tree-hub-images",fV=1,Qs="images";let Pd=null;function LN(){return Pd||(Pd=new Promise(e=>{if(typeof indexedDB>"u"){e(null);return}const t=indexedDB.open(dV,fV);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)}),Pd)}async function hV(e){const t=await LN();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),c={imageId:e.imageId,base64:e.base64,mimeType:e.mimeType,createdAt:Date.now()};o.put(c),l.oncomplete=()=>n(),l.onerror=()=>a(l.error??new Error("Image storage write failed")),l.onabort=()=>a(l.error??new Error("Image storage write aborted"))})}async function mV(e){const t=await LN();return t?new Promise(n=>{const o=t.transaction(Qs,"readonly").objectStore(Qs).get(e);o.onsuccess=()=>{const c=o.result;if(!c){n(null);return}n({base64:c.base64,mimeType:c.mimeType})},o.onerror=()=>n(null)}):null}function pV(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=HS(l.payload);if(!o)continue;const c=a.get(o)??-1;l.seq>c&&a.set(o,l.seq)}return n.filter(l=>{if(l.kind!=="tool_call")return!0;const o=HS(l.payload);return o?a.get(o)===l.seq:!0})}function HS(e){if(typeof e!="object"||e===null)return;const t=e.toolUseId;return typeof t=="string"?t:void 0}function Bf(e){const t=new Date(e),n=new Intl.DateTimeFormat("en-GB",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(t),a=l=>{var o;return((o=n.find(c=>c.type===l))==null?void 0:o.value)??""};return`${a("month")}/${a("day")} ${a("hour")}:${a("minute")}`}function gV(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function ZS(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"…"}}function yV({msg:e,myAgentId:t}){if(!t||e.senderId!==t)return null;const n=e.deliveryStatus??"sent";return n==="acked"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},title:"Agent has started processing",children:"✓✓ read"}):n==="delivered"?u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-3)"},title:"Delivered to agent inbox",children:"✓✓"}):u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},title:"Sent",children:"✓ sent"})}function vV({event:e}){const t=R3(e.payload);if(!t)return null;const n=t.status==="error",a=t.status==="pending",l=n?"var(--state-error)":a?"var(--state-blocked)":"var(--fg-3)",o=n?"failed":a?"using":"used";return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[a?u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:l,animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0,marginTop:5}}):u.jsx("span",{"aria-hidden":!0,style:{color:l,flexShrink:0},children:n?"⚠":"↳"}),u.jsxs("span",{className:"flex items-baseline",style:{color:"var(--fg-3)",minWidth:0,flex:1},title:t.args!==void 0&&t.args!==null?ZS(t.args):void 0,children:[u.jsxs("span",{style:{whiteSpace:"nowrap",flexShrink:0},children:[o," ",u.jsx("span",{style:{color:"var(--fg-2)"},children:t.name})]}),t.args!==void 0&&t.args!==null?u.jsxs("span",{className:"truncate",style:{color:"var(--fg-4)",minWidth:0,flex:1},children:["(",ZS(t.args),")"]}):null,t.durationMs!==void 0&&!a?u.jsxs("span",{className:"text-caption",style:{color:"var(--fg-4)",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:["· ",gV(t.durationMs)]}):null]})]})}function bV({event:e,agentNameFn:t,agentId:n}){const a=O3(e.payload);if(!a||a.text.length===0)return null;const l=t(n);return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1) 0",opacity:.85},children:[u.jsx(UN,{name:l,isSelf:!1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-label font-semibold",style:{color:"var(--accent)"},children:l}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Bf(e.createdAt)}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:"· streaming"})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)",whiteSpace:"pre-wrap",marginTop:2},children:a.text})]})]})}function xV({event:e}){return u.jsxs("div",{className:"mono flex items-center text-label",style:{gap:8,padding:"var(--sp-0_5) var(--sp-2)",color:"var(--fg-3)"},children:[u.jsx("span",{"aria-hidden":!0,style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",flexShrink:0}}),u.jsx("span",{style:{color:"var(--fg-3)"},children:"thinking…"}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Bf(e.createdAt)})]})}function wV({event:e}){const t=z3(e.payload),n=Bf(e.createdAt);return u.jsxs("div",{style:{padding:"var(--sp-1_5) var(--sp-2_5)",borderLeft:"var(--hairline-bold) solid var(--state-error)",background:"color-mix(in oklch, var(--state-error) 6%, transparent)",borderRadius:"0 var(--radius-input) var(--radius-input) 0"},children:[u.jsxs("div",{className:"mono uppercase text-caption",style:{color:"var(--state-error)"},children:["error · ",(t==null?void 0:t.source)??"unknown"," · ",n]}),u.jsx("div",{className:"text-label",style:{marginTop:2,color:"var(--fg-2)",whiteSpace:"pre-wrap"},children:(t==null?void 0:t.message)??"(invalid error payload)"})]})}function UN({name:e,isSelf:t}){const n=e.slice(0,2).toUpperCase();return u.jsx("div",{className:"mono text-eyebrow font-bold",style:{width:20,height:20,borderRadius:"var(--radius-input)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,background:t?"linear-gradient(135deg, var(--accent), oklch(0.58 0.14 170))":"var(--bg-active)",border:t?"none":"var(--hairline) solid var(--border-strong)",color:t?"oklch(0.14 0.01 150)":"var(--fg-2)"},children:t?n:u.jsx(Xu,{width:9,height:10,style:{color:"var(--accent)"}})})}function SV({msg:e,myAgentId:t,agentNameFn:n}){const a=n(e.senderId),l=t===e.senderId;return u.jsxs("div",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:8,padding:"var(--sp-1_5) 0"},children:[u.jsx(UN,{name:a,isSelf:l}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-baseline",style:{gap:8},children:[u.jsx("span",{className:"mono text-body font-semibold",style:{color:l?"var(--fg)":"var(--accent)"},children:a}),u.jsx("span",{className:"mono text-caption",style:{color:"var(--fg-4)"},children:Bf(e.createdAt)}),u.jsx("span",{style:{marginLeft:"auto"},children:u.jsx(yV,{msg:e,myAgentId:t})})]}),u.jsx("div",{className:"text-body",style:{color:"var(--fg)",marginTop:2},children:e.format==="file"&&kV(e.content)?u.jsx("img",{src:`data:${e.content.mimeType};base64,${e.content.data}`,alt:e.content.filename??"image",style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):e.format==="file"&&jV(e.content)?u.jsx(CV,{content:e.content}):e.format==="text"?u.jsx(hv,{children:typeof e.content=="string"?e.content:JSON.stringify(e.content)}):u.jsx("pre",{className:"mono text-label",style:{background:"var(--bg-sunken)",padding:8,borderRadius:"var(--radius-input)",overflow:"auto",maxHeight:160},children:JSON.stringify(e.content,null,2)})})]})]})}function kV(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 jV(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 CV({content:e}){const[t,n]=x.useState({kind:"loading"});return x.useEffect(()=>{let a=!1;return mV(e.imageId).then(l=>{a||n(l?{kind:"hit",src:`data:${l.mimeType};base64,${l.base64}`}:{kind:"miss"})}),()=>{a=!0}},[e.imageId]),t.kind==="hit"?u.jsx("img",{src:t.src,alt:e.filename,style:{maxWidth:320,borderRadius:"var(--radius-panel)",marginTop:4}}):t.kind==="miss"?u.jsxs("span",{className:"text-label",style:{color:"var(--fg-3)",fontStyle:"italic"},children:['[Image "',e.filename,'" not available on this device]']}):u.jsx("span",{className:"text-label",style:{color:"var(--fg-4)"},children:"…"})}function VS({agentId:e,chatId:t,readOnly:n=!1,titleFallback:a,joinAction:l}){var ut;const o=nn(),c=Ef(),f=Ay(),{agentId:m}=Rt(),[h,y]=x.useState(""),[g,b]=x.useState(0),[w,k]=x.useState([]),[j,E]=x.useState(!1),[C,R]=x.useState(null),O=x.useRef(null),M=x.useRef(null),B=x.useRef(null),z=x.useRef(!1),$=x.useRef(new Set);x.useEffect(()=>{z.current=!1},[t]);const{data:U}=He({queryKey:["chat-messages",t],queryFn:()=>rV(t,{limit:50}),refetchInterval:5e3}),{data:Q}=He({queryKey:["session-events",e,t],queryFn:()=>M3(e,t,{limit:200,direction:"desc"}),refetchInterval:5e3}),{data:I}=He({queryKey:["chat-detail",t],queryFn:()=>MN(t),enabled:!!t}),{data:ne}=He({queryKey:["activity"],queryFn:Ku,refetchInterval:15e3}),le=St({mutationFn:ae=>Jg(t,ae),onSuccess:()=>{y(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:G1(e)})}}),we=x.useCallback(ae=>{const Me=ae.filter(zn=>zn.type.startsWith("image/"));if(Me.length===0)return;const Ge=Me.find(zn=>zn.size>5242880);if(Ge){R(`Image too large (${(Ge.size/1024/1024).toFixed(1)}MB). Maximum ${5242880/1024/1024}MB per image.`);return}const Rn=Me.map(zn=>({id:crypto.randomUUID(),file:zn,previewUrl:URL.createObjectURL(zn)}));k(zn=>[...zn,...Rn]),R(null)},[]),Y=x.useCallback(ae=>{k(Se=>{const Me=Se.find(Ge=>Ge.id===ae);return Me&&URL.revokeObjectURL(Me.previewUrl),Se.filter(Ge=>Ge.id!==ae)})},[]),J=async()=>{const ae=h.trim(),Se=w;if(!(!ae&&Se.length===0)&&!j&&!(ge&&fe.length===0)){if(Qe.length>0)try{await ON(t,{participantIds:Qe}),await o.invalidateQueries({queryKey:["chat-detail",t]})}catch(Me){R(Me instanceof Error?Me.message:"Failed to add participants");return}if(Se.length>0){E(!0),R(null);try{for(const Me of Se){const Ge=await tV(Me.file),Rn=crypto.randomUUID();await hV({imageId:Rn,base64:Ge,mimeType:Me.file.type}),await eV(t,{data:Ge,mimeType:Me.file.type,filename:Me.file.name,size:Me.file.size,imageId:Rn}),URL.revokeObjectURL(Me.previewUrl)}k([]),ae&&await Jg(t,ae),y(""),o.invalidateQueries({queryKey:["chat-messages",t]}),o.invalidateQueries({queryKey:G1(e)})}catch(Me){R(Me instanceof Error?Me.message:"Failed to send image")}finally{E(!1)}return}le.mutate(ae)}},[H,ee]=x.useState(!1),[be,Ae]=x.useState(""),A=x.useRef(null);x.useEffect(()=>{var ae;H&&((ae=A.current)==null||ae.focus())},[H]);const L=St({mutationFn:ae=>WZ(t,ae),onSuccess:()=>{ee(!1),o.invalidateQueries({queryKey:["chat-detail",t]}),o.invalidateQueries({queryKey:["agent-sessions",e]}),o.invalidateQueries({queryKey:["session",e,t]})}}),P=()=>{const ae=be.trim();L.mutate(ae.length>0?ae:null)},T=x.useMemo(()=>{const ae=(U==null?void 0:U.items)??[],Se=pV((Q==null?void 0:Q.items)??[]),Me=[...ae.map(Ge=>({kind:"message",at:Ge.createdAt,key:`m-${Ge.id}`,data:Ge})),...Se.map(Ge=>({kind:"event",at:Ge.createdAt,key:`e-${Ge.id}`,data:Ge}))];return Me.sort((Ge,Rn)=>Ge.at.localeCompare(Rn.at)),Me},[U,Q]),Z=T.length;x.useEffect(()=>{var ae;Z>0&&((ae=B.current)==null||ae.scrollIntoView({behavior:"smooth"}))},[Z]);const W=c(e),ce=x.useMemo(()=>{var ae;return new Set(((ae=I==null?void 0:I.participants)==null?void 0:ae.map(Se=>Se.agentId))??[])},[I==null?void 0:I.participants]),ve=x.useMemo(()=>{const ae=new Set;for(const Me of(I==null?void 0:I.participants)??[])ae.add(Me.agentId);for(const Me of(ne==null?void 0:ne.agents)??[])ae.add(Me.agentId);ae.size===0&&ae.add(e);const Se=[];for(const Me of ae){if(Me===m)continue;const Ge=f(Me);!Ge||!Ge.name||Se.push({agentId:Me,name:Ge.name,displayName:Ge.displayName})}return Se},[I==null?void 0:I.participants,ne==null?void 0:ne.agents,e,f,m]),ge=x.useMemo(()=>{if(!I)return!1;if(I.type==="group")return!0;const ae=I.participants.some(Se=>Se.agentId===m);return I.type==="direct"&&!ae&&I.participants.length>=2},[I,m]);x.useEffect(()=>{if(n||$.current.has(t)||!U||!Q||!I||T.length>0||h.length>0||ge||W===e)return;const ae=`Hi ${W}! What can you help with?`;y(ae),b(ae.length),$.current.add(t),requestAnimationFrame(()=>{const Se=M.current;Se&&(Se.focus(),Se.setSelectionRange(ae.length,ae.length))})},[t,e,U,Q,I,T.length,h.length,W,ge,n]);const fe=x.useMemo(()=>{const ae=ve.map(Se=>({agentId:Se.agentId,name:Se.name}));return XC(h,ae)},[h,ve]),Qe=x.useMemo(()=>ce.size===0?[]:fe.filter(ae=>!ce.has(ae)),[fe,ce]),Oe=DN({value:h,cursor:g,candidates:ve,disabled:le.isPending||j,onSelect:ae=>{y(ae.text),b(ae.cursor),requestAnimationFrame(()=>{const Se=M.current;Se&&(Se.focus(),Se.setSelectionRange(ae.cursor,ae.cursor))})}});return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6)",borderBottom:"var(--hairline) solid var(--border)"},children:u.jsxs("div",{className:"flex items-center",style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%",gap:10},children:[u.jsx("div",{className:"flex items-center min-w-0",style:{gap:8,flex:1},children:n?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"truncate text-subtitle min-w-0",style:{color:"var(--fg)"},children:(I==null?void 0:I.title)??a??"…"}),u.jsx("span",{className:"mono uppercase text-eyebrow shrink-0",style:{padding:"var(--hairline) var(--sp-1_25)",borderRadius:2,color:"var(--fg-3)",background:"var(--bg-sunken)"},children:"watching"})]}):H?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:A,value:be,onChange:ae=>Ae(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"?(ae.preventDefault(),P()):ae.key==="Escape"&&(ae.preventDefault(),ee(!1))},disabled:L.isPending,maxLength:500,placeholder:(I==null?void 0:I.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)"}}),u.jsx("button",{type:"button",onClick:P,disabled:L.isPending,title:"Save",className:"inline-flex items-center",style:{color:"var(--accent)",padding:2},children:u.jsx(fr,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>ee(!1),disabled:L.isPending,title:"Cancel",className:"inline-flex items-center",style:{color:"var(--fg-3)",padding:2},children:u.jsx(ju,{className:"h-3.5 w-3.5"})})]}):u.jsx("button",{type:"button",onClick:()=>{Ae((I==null?void 0:I.topic)??""),ee(!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:(I==null?void 0:I.title)??"…"})}),u.jsx(EV,{chatId:t,participantIds:((ut=I==null?void 0:I.participants)==null?void 0:ut.map(ae=>ae.agentId))??[e],candidates:ve,agentIdentity:f,onAdded:()=>o.invalidateQueries({queryKey:["chat-detail",t]}),readOnly:n})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto relative",style:{padding:"var(--sp-2_5) var(--sp-6)"},children:u.jsxs("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:[Z===0&&u.jsxs("div",{className:"flex flex-col items-center text-body",style:{color:"var(--fg-3)",padding:"var(--sp-8) 0",gap:6},children:[u.jsx(by,{className:"h-8 w-8",style:{opacity:.3}}),n?"No messages yet":"Send a message to start the conversation"]}),u.jsx("div",{className:"flex flex-col",style:{gap:4},children:T.map(ae=>{if(ae.kind==="event"){const Se=ae.data;switch(Se.kind){case"tool_call":return u.jsx(vV,{event:Se},ae.key);case"assistant_text":return u.jsx(bV,{event:Se,agentId:e,agentNameFn:c},ae.key);case"thinking":return u.jsx(xV,{event:Se},ae.key);case"error":return u.jsx(wV,{event:Se},ae.key);default:return null}}return u.jsx(SV,{msg:ae.data,myAgentId:m,agentNameFn:c},ae.key)})}),u.jsx("div",{ref:B})]})}),u.jsx("div",{className:"shrink-0",style:{padding:"var(--sp-2_5) var(--sp-6) var(--sp-3)"},children:u.jsx("div",{style:{maxWidth:"clamp(55rem, 75%, 70rem)",margin:"0 auto",width:"100%"},children:n?u.jsxs("div",{className:"flex items-center",style:{gap:"var(--sp-3)",padding:"var(--sp-2) var(--sp-3)",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},children:[u.jsx(Jk,{className:"h-4 w-4 shrink-0",style:{color:"var(--fg-3)"}}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-body",style:{color:"var(--fg-2)"},children:"You're watching this chat — read-only."}),(l==null?void 0:l.error)&&u.jsx("div",{className:"mono text-label",style:{color:"var(--state-error)",marginTop:2},children:l.error})]}),l&&u.jsx(me,{type:"button",variant:"secondary",size:"sm",className:"shrink-0",onClick:l.onJoin,disabled:l.joining,children:l.joining?"Joining…":"Join to reply"})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{position:"relative",border:"var(--hairline) solid var(--border)",borderRadius:6,background:"var(--bg-sunken)"},onDragOver:ae=>ae.preventDefault(),onDrop:ae=>{ae.preventDefault(),we(Array.from(ae.dataTransfer.files))},children:[w.length>0&&u.jsx("div",{className:"flex items-center",style:{gap:6,padding:"var(--sp-1_5) var(--sp-2_5) 0",overflowX:"auto"},children:w.map(ae=>u.jsxs("div",{style:{position:"relative",flexShrink:0,borderRadius:4,border:"var(--hairline) solid var(--border)",overflow:"hidden"},children:[u.jsx("img",{src:ae.previewUrl,alt:ae.file.name,style:{height:32,width:"auto",display:"block",objectFit:"cover"}}),u.jsx("button",{type:"button",onClick:()=>Y(ae.id),style:{position:"absolute",top:1,right:1,width:14,height:14,borderRadius:"50%",background:"var(--color-overlay-scrim)",border:"none",color:"var(--bg-raised)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},children:u.jsx(ju,{className:"h-2 w-2"})})]},ae.id))}),u.jsxs("div",{style:{position:"relative"},children:[u.jsx(IN,{trigger:Oe.trigger,results:Oe.results,highlightIndex:Oe.highlightIndex,anchorRef:M,onPick:Oe.pick}),u.jsx("textarea",{ref:M,value:h,onChange:ae=>{y(ae.target.value),b(ae.target.selectionStart??ae.target.value.length)},onSelect:ae=>{b(ae.currentTarget.selectionStart??h.length)},onFocus:()=>{ge&&(z.current||h.length>0||ve.length===0||(z.current=!0,y("@"),b(1),requestAnimationFrame(()=>{const ae=M.current;ae&&ae.setSelectionRange(1,1)})))},onPaste:ae=>{const Se=Array.from(ae.clipboardData.files);Se.length>0&&(ae.preventDefault(),we(Se))},placeholder:ge?"Type @ to pick a recipient, then your message":`Message @${W} · / for commands · @ to mention`,rows:2,onKeyDown:ae=>{Oe.handleKey(ae)||ae.key==="Enter"&&!ae.shiftKey&&(ae.preventDefault(),J())},disabled:le.isPending||j,className:"w-full outline-none text-subtitle font-normal",style:{padding:"var(--sp-2_25) var(--sp-3) var(--sp-7_5)",background:"transparent",border:"none",resize:"none",color:"var(--fg)"}})]}),u.jsxs("div",{className:"flex items-center justify-between text-caption",style:{position:"absolute",bottom:6,left:10,right:10,color:"var(--fg-4)"},children:[u.jsxs("span",{className:"mono flex items-center",style:{gap:10},children:[u.jsx("button",{type:"button",onClick:()=>{const ae=M.current;if(!ae)return;const Se=ae.selectionStart??h.length,Me=ae.selectionEnd??Se,Ge=`${h.slice(0,Se)}@${h.slice(Me)}`;y(Ge),b(Se+1),requestAnimationFrame(()=>{ae.focus(),ae.setSelectionRange(Se+1,Se+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:u.jsx(VR,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>{var ae;return(ae=O.current)==null?void 0:ae.click()},title:"Attach image",style:{background:"none",border:"none",cursor:"pointer",color:"var(--fg-3)",padding:0,display:"inline-flex",alignItems:"center"},children:u.jsx(Sz,{className:"h-3.5 w-3.5"})}),u.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:ae=>{ae.target.files&&(we(Array.from(ae.target.files)),ae.target.value="")}})]}),u.jsxs("span",{className:"flex items-center",style:{gap:8},children:[j&&u.jsx("span",{className:"mono text-caption",style:{color:"var(--accent)"},children:"uploading…"}),u.jsx("button",{type:"button",onClick:J,disabled:le.isPending||j||!h.trim()&&w.length===0||ge&&fe.length===0,title:ge&&fe.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",(le.isPending||j||!h.trim()&&w.length===0||ge&&fe.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:u.jsx(Yk,{className:"h-3.5 w-3.5",strokeWidth:2.5})})]})]})]}),(le.isError||C)&&u.jsx("p",{className:"mono text-label",style:{color:"var(--state-error)",padding:"var(--sp-1_5) var(--sp-0_5) 0"},children:C??(le.error instanceof Error?le.error.message:"Failed to send")})]})})})]})}function EV({chatId:e,participantIds:t,candidates:n,agentIdentity:a,onAdded:l,readOnly:o=!1}){const[c,f]=x.useState(!1),m=x.useRef(null);x.useEffect(()=>{if(!c)return;const g=b=>{m.current&&(m.current.contains(b.target)||f(!1))};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[c]);const h=St({mutationFn:g=>ON(e,{participantIds:[g]}),onSuccess:()=>{f(!1),l()}}),y=x.useMemo(()=>n.filter(g=>!t.includes(g.agentId)),[n,t]);return u.jsxs("div",{className:"inline-flex items-center flex-wrap",style:{gap:4},children:[t.map(g=>{const b=a(g),w=(b==null?void 0:b.displayName)??(b==null?void 0:b.name)??g.slice(0,8);return u.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:w},g)}),!o&&u.jsxs("div",{ref:m,style:{position:"relative"},children:[u.jsx("button",{type:"button",onClick:()=>f(!c),disabled:y.length===0||h.isPending,title:y.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:y.length===0?"var(--fg-4)":"var(--fg-3)",cursor:y.length===0?"not-allowed":"pointer"},children:u.jsx(qr,{className:"h-3 w-3"})}),c&&y.length>0&&u.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:(()=>{const g=pv(y);return y.map(b=>u.jsx("button",{type:"button",role:"option","aria-selected":"false",title:b.name?`@${b.name}`:void 0,onClick:()=>h.mutate(b.agentId),disabled:h.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:u.jsx(gv,{candidate:b,ambiguous:g})},b.agentId))})()})]})]})}function QS(e,t){return e?e.find(n=>n.chatId===t)??null:null}function NV(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 _V({chatId:e}){const t=nn(),{agentId:n}=Rt(),a=x.useRef(new Map),{data:l}=He({queryKey:["chat-detail",e],queryFn:()=>MN(e),enabled:!!e}),{data:o}=He({queryKey:["me","chats","all"],queryFn:()=>ff({filter:"all"}),refetchInterval:3e4}),{data:c}=He({queryKey:["me","chats","watching"],queryFn:()=>ff({filter:"watching"}),refetchInterval:3e4}),f=x.useMemo(()=>QS(o==null?void 0:o.rows,e)??QS(c==null?void 0:c.rows,e)??null,[o,c,e]),m=x.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=x.useMemo(()=>NV(m,n),[m,n]),g=St({mutationFn:()=>QZ(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]})}}).mutate,b=(f==null?void 0:f.lastMessageAt)??"";x.useEffect(()=>{!f||a.current.get(e)===b||(a.current.set(e,b),g())},[e,f,b,g]);const w=St({mutationFn:()=>KZ(e),onSuccess:()=>{t.invalidateQueries({queryKey:["me","chats"]}),t.invalidateQueries({queryKey:["chat-detail",e]})}}),k=(f==null?void 0:f.membershipKind)==="watching";return h?k?u.jsx(VS,{agentId:h,chatId:e,readOnly:!0,titleFallback:(f==null?void 0:f.title)??null,joinAction:{onJoin:()=>w.mutate(),joining:w.isPending,error:w.isError?w.error instanceof Error?w.error.message:"Failed to join":null}}):u.jsx(VS,{agentId:h,chatId:e}):u.jsx("div",{className:"flex-1 flex items-center justify-center",style:{padding:"var(--sp-8)"},children:u.jsxs("div",{className:"text-center",style:{color:"var(--fg-3)"},children:[u.jsx("div",{className:"text-subtitle",style:{color:"var(--fg-2)",marginBottom:6},children:"Loading chat…"}),u.jsx("div",{className:"text-body",children:"Resolving participants."})]})})}function TV(){return u.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-sm",children:[u.jsx(Xu,{width:36,height:40,className:"mx-auto mb-3 text-primary opacity-60"}),u.jsx("div",{className:"text-subtitle mb-1",children:"Select a chat"}),u.jsx("div",{className:"text-body text-muted-foreground",children:"Pick an agent from the roster to view its sessions, or open a chat to start collaborating."})]})})}const AV=3e4,RV=1e3,zV=3e3;function OV(e){return e==="claude-code"?"Claude Code":e==="codex"?"Codex":e}function MV(){var ve;const{refreshMe:e,organizationId:t,memberId:n}=Rt(),a=Un(),l=jR(t,n),o=ER(l),c=o!=null&&o.connectToken&&o.connectTokenExpiresAt&&o.connectTokenExpiresAt>Date.now()?o.connectToken:null,f=c?(o==null?void 0:o.connectTokenExpiresAt)??null:null,[m,h]=x.useState(()=>(o==null?void 0:o.displayName)??""),[y,g]=x.useState(()=>(o==null?void 0:o.selectedRuntime)??null),[b,w]=x.useState(null),[k,j]=x.useState(null),[E,C]=x.useState(null),[R,O]=x.useState(()=>c),[M,B]=x.useState(()=>f),[z,$]=x.useState([]),[U,Q]=x.useState("form"),[I,ne]=x.useState(null),[le]=x.useState(()=>SR()),we=x.useRef(null),Y=x.useRef(null),J=x.useRef(null),H=x.useRef(0);x.useEffect(()=>()=>{Y.current&&(Y.current.cancelled=!0)},[]),x.useEffect(()=>{NR(l,{displayName:m,selectedRuntime:y,connectToken:R,connectTokenExpiresAt:M})},[l,m,y,R,M]),x.useEffect(()=>{(async()=>{try{const ge=await ke.get("/me/organizations");$(ge)}catch{}})()},[]),x.useEffect(()=>{if(U!=="form")return;let ge=!1;const fe=async()=>{const Oe=++H.current;try{const ut=await Ni();if(ge||Oe!==H.current)return;const Se=ut.filter(Me=>Me.status==="connected").sort((Me,Ge)=>Ge.lastSeenAt.localeCompare(Me.lastSeenAt))[0]??null;if(w(Me=>(Me==null?void 0:Me.id)===(Se==null?void 0:Se.id)?Me:Se),Se){J.current!==Se.id&&(J.current=null,C(null),j(null));try{const Me=await ky(Se.id);if(ge||Oe!==H.current)return;J.current=Se.id,C(Se.id),j(Me.capabilities)}catch{}}else J.current=null,C(null),j(null)}catch{}};fe();const Qe=setInterval(fe,zV);return()=>{ge=!0,clearInterval(Qe)}},[U]),x.useEffect(()=>{if(b)return;if(R&&M&&M>Date.now()){const fe=Math.max(M-Date.now(),0),Qe=window.setTimeout(()=>{O(null),B(null)},fe);return()=>window.clearTimeout(Qe)}R&&(O(null),B(null));let ge=!1;return(async()=>{try{const fe=await ke.post("/me/connect-tokens",{});ge||(O(fe.token),B(Date.now()+fe.expiresIn*1e3))}catch(fe){ge||ne(fe instanceof Error?fe.message:"Failed to generate connect token")}})(),()=>{ge=!0}},[b,R,M]);const ee=b&&E===b.id?k:null;x.useEffect(()=>{g(ge=>{if(!ee)return ge;const fe=Object.entries(ee).filter(([,Qe])=>Qe.state==="ok").map(([Qe])=>Qe);return ge&&fe.includes(ge)?ge:fe[0]??null})},[ee]);const be=ee?Object.entries(ee).filter(([,ge])=>ge.state==="ok").map(([ge])=>ge):[],Ae=((ve=z.find(ge=>ge.id===t))==null?void 0:ve.displayName)??"",A=m.trim(),L=A||"your agent",P=R?`npm install -g @agent-team-foundation/first-tree-hub
|
|
387
|
-
first-tree-hub connect ${R}`:null,T=x.useCallback(async ge=>{Y.current&&(Y.current.cancelled=!0);const fe={cancelled:!1};Y.current=fe;const Qe=Date.now();for(;!fe.cancelled;){let Oe=!1;try{const ut=await ke.get(`/agents/${encodeURIComponent(ge)}/client-status`);if(fe.cancelled)return;Oe=ut.online===!0}catch{if(fe.cancelled)return}if(Oe){try{const ut=await nV(ge);if(fe.cancelled||(_R(l),await e(),fe.cancelled))return;a(`/?a=${encodeURIComponent(ge)}&c=${encodeURIComponent(ut.id)}`,{replace:!0})}catch(ut){if(fe.cancelled)return;ne(ut instanceof Error?ut.message:"Failed to open chat"),Q("timeout")}return}if(Date.now()-Qe>AV){fe.cancelled||Q("timeout");return}await new Promise(ut=>setTimeout(ut,RV))}},[l,e,a]),Z=!!(A&&b&&y&&be.includes(y)&&U==="form"),W=x.useCallback(async()=>{if(!b||!y||!A)return;ne(null),Q("creating");const ge=Xg(A);let fe;try{fe=(await ke.post(hn("/agents"),{type:"personal_assistant",displayName:A,...ge?{name:ge}:{},clientId:b.id,runtimeProvider:y,...t?{organizationId:t}:{}})).uuid,we.current=fe}catch(Qe){ne(Qe instanceof Error?Qe.message:"Failed to create agent"),Q("form");return}await T(fe)},[A,b,y,T,t]),ce=x.useCallback(async()=>{const ge=we.current;ge&&(ne(null),Q("creating"),await T(ge))},[T]);return u.jsx("div",{className:"flex-1 overflow-auto",style:{display:"flex",justifyContent:"center",padding:"clamp(var(--sp-16), 12vh, var(--sp-45)) var(--sp-4) var(--sp-12)"},children:u.jsxs("div",{style:{width:"100%",maxWidth:560},children:[U==="form"&&u.jsx(DV,{joinPath:le,teamName:Ae,displayName:m,setDisplayName:h,trimmedName:A,connectedClient:b,cliCommand:P,okRuntimes:be,selectedRuntime:y,setSelectedRuntime:g,capabilitiesLoaded:ee!==null,error:I,canCreate:Z,onCreate:W}),U==="creating"&&u.jsx(FV,{nameOrFallback:L}),U==="timeout"&&u.jsx(qV,{nameOrFallback:L,hostname:(b==null?void 0:b.hostname)??null,error:I,onRetry:ce})]})})}function DV({joinPath:e,teamName:t,displayName:n,setDisplayName:a,trimmedName:l,connectedClient:o,cliCommand:c,okRuntimes:f,selectedRuntime:m,setSelectedRuntime:h,capabilitiesLoaded:y,error:g,canCreate:b,onCreate:w}){const k=x.useRef(null),E=e==="invite"&&t?`Welcome — you've joined ${t}`:"Welcome to First Tree Hub",C=l?o?m?"Ready to create.":"Next: choose a runtime.":"Next: connect the computer where they'll work.":"Next: name your agent.";return x.useEffect(()=>{var R;l||(R=k.current)==null||R.focus()},[l]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col items-start",style:{gap:"var(--sp-4)",paddingTop:0},children:[u.jsxs("p",{className:"text-label",style:{margin:0,color:"var(--fg-3)",maxWidth:420},children:[u.jsx("span",{style:{color:"var(--fg-2)"},children:E}),u.jsx("span",{style:{color:"var(--fg-4)"},children:" · "}),"Where agents and humans work as one team."]}),u.jsx("h1",{className:"text-title font-semibold",style:{margin:0,color:"var(--fg)"},children:"Let's create your first agent."})]}),u.jsxs("div",{style:{marginTop:"var(--sp-5)",position:"relative"},children:[u.jsx(IV,{}),u.jsx(KS,{number:"01",state:l?"complete":"active",children:u.jsxs("div",{className:"flex items-baseline",style:{gap:"var(--sp-2)",flexWrap:"wrap"},children:[u.jsx("label",{htmlFor:"onboarding-name",className:"text-body font-normal",style:{color:"var(--fg-2)",whiteSpace:"nowrap"},children:"What should we call this agent?"}),u.jsx("input",{ref:k,id:"onboarding-name","aria-label":"Agent display name",value:n,onChange: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)"}})]})}),u.jsx(KS,{number:"02",state:b?"complete":l?"active":"idle",children:u.jsxs("div",{style:{animation:l?"subtle-fade 200ms ease-out":void 0},children:[u.jsxs("h2",{className:"text-subtitle font-semibold",style:{color:l?"var(--fg)":"var(--fg-4)",fontWeight:l?600:500},children:["Where will ",l||"this agent"," run?"]}),l?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)",marginTop:"var(--sp-1)"},children:o?`This computer will run ${l} and keep it connected to Hub.`:"This agent needs a computer to do its work. Connect the one it should use."}),!o&&u.jsx("p",{className:"text-label",style:{color:"var(--fg-4)",marginTop:"var(--sp-2)"},children:"Open Terminal on that computer and run this command."}),o?u.jsx(PV,{hostname:o.hostname??o.id}):u.jsxs(u.Fragment,{children:[u.jsx(LV,{command:c}),u.jsx(UV,{})]}),o&&u.jsx(BV,{runtimes:f,selected:m,onSelect:h,capabilitiesLoaded:y})]}):null]})})]}),g&&u.jsx("div",{className:"text-body",style:{marginTop:"var(--sp-4)",padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 12%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 28%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:g}),l&&u.jsxs("div",{style:{marginTop:b?"var(--sp-4)":"var(--sp-5)",marginLeft:"calc(var(--sp-5) + var(--sp-3))",animation:"subtle-fade 180ms ease-out"},children:[!b&&u.jsx("p",{className:"text-label",style:{margin:0,color:"var(--fg-4)"},children:C}),b&&u.jsxs(me,{type:"button",size:"default",style:{marginTop:0,border:"var(--hairline) solid color-mix(in oklch, var(--accent) 32%, transparent)",background:"var(--accent)",boxShadow:"var(--shadow-md)",color:"var(--primary-foreground, var(--color-primary-foreground))",opacity:1,transform:"translateZ(0)",transition:"box-shadow 160ms ease, transform 160ms ease"},onClick:w,onMouseEnter: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:[u.jsxs("span",{children:["Create ",l]}),u.jsx(qR,{className:"h-4 w-4"})]}),u.jsx("p",{className:"text-caption",style:{margin:b?"var(--sp-2) 0 0":"var(--sp-0_5) 0 0",color:"var(--fg-4)"},children:"You can customize this agent after setup."})]})]})}function IV(){return u.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"var(--sp-5)",bottom:"var(--sp-5)",left:"calc(var(--sp-2_5) - var(--hairline))",width:"var(--hairline)",background:"color-mix(in oklch, var(--border-faint) 56%, transparent)"}})}function KS({number:e,state:t,children:n}){const a=t==="active",l=t==="complete";return u.jsxs("section",{className:"grid",style:{gridTemplateColumns:"var(--sp-5) 1fr",columnGap:"var(--sp-3)",marginTop:e==="01"?0:"var(--sp-5)",position:"relative"},children:[u.jsx("div",{className:"mono text-caption flex items-center justify-center",style:{width:"var(--sp-5)",height:"var(--sp-5)",borderRadius:999,background:a||l?"color-mix(in oklch, var(--accent) 8%, var(--bg))":"var(--bg)",border:a||l?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-faint)",color:a||l?"var(--accent)":"var(--fg-4)",zIndex:1},children:l?u.jsx(fr,{className:"h-3 w-3"}):e}),u.jsx("div",{style:{minHeight:"var(--sp-6)",paddingBottom:"var(--sp-1)"},children:n})]})}function LV({command:e}){const[t,n]=x.useState(!1),l=(e?e.split(`
|
|
388
|
-
`):[]).find(m=>m.startsWith("first-tree-hub"))??"",o="first-tree-hub connect ",c=l.startsWith(o)?`${o}${l.slice(o.length,o.length+22)}…`:l.length>52?`${l.slice(0,52)}…`:l,f=async()=>{e&&(await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500))};return u.jsx("div",{style:{marginTop:"var(--sp-2)"},children:u.jsxs("div",{className:"flex",style:{gap:"var(--sp-2)",alignItems:"stretch"},children:[u.jsx("pre",{className:"mono text-label",title:l,style:{flex:1,minHeight:38,margin:0,padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--bg-sunken) 42%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--border-faint) 58%, transparent)",borderRadius:"var(--radius-input)",color:"var(--fg-2)",whiteSpace:"nowrap",overflow:"hidden",minWidth:0},children:c||"Generating token…"}),u.jsxs(me,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:!e,style:{alignSelf:"stretch",background:"color-mix(in oklch, var(--bg-raised) 48%, transparent)",borderColor:"color-mix(in oklch, var(--border) 58%, transparent)",boxShadow:"none",height:"auto",minHeight:38},children:[t?u.jsx(fr,{className:"h-3.5 w-3.5"}):u.jsx(xf,{className:"h-3.5 w-3.5"}),t?"Copied":"Copy"]})]})})}function UV(){return u.jsxs("div",{className:"flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",color:"color-mix(in oklch, var(--accent) 24%, var(--fg-3))"},children:[u.jsx($V,{}),u.jsx("span",{children:"Waiting for your computer…"})]})}function PV({hostname:e}){return u.jsxs("div",{className:"inline-flex items-center text-body",style:{gap:"var(--sp-2)",marginTop:"var(--sp-2_5)",padding:"var(--sp-1_5) var(--sp-2_5)",borderRadius:999,background:"color-mix(in oklch, var(--accent) 10%, transparent)",color:"color-mix(in oklch, var(--accent) 26%, var(--fg))",animation:"onboarding-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1.15)"},children:[u.jsx(fr,{className:"h-3.5 w-3.5"}),u.jsxs("span",{children:[u.jsx("span",{className:"mono font-semibold",children:e})," connected"]})]})}function BV({runtimes:e,selected:t,onSelect:n,capabilitiesLoaded:a}){return e.length===0?u.jsx("p",{className:"text-label",style:{marginTop:"var(--sp-3)",color:"var(--fg-3)"},children:a?"No runtime ready on this computer. Install Claude Code or Codex, then check back.":"Detecting installed runtimes…"}):u.jsxs("div",{style:{marginTop:"var(--sp-3)"},children:[u.jsx("p",{className:"text-label",style:{color:"var(--fg-3)",marginBottom:"var(--sp-1)"},children:"Powered by"}),u.jsxs("fieldset",{className:"flex",style:{gap:"var(--sp-4)",flexWrap:"wrap",margin:0,padding:0,border:0},children:[u.jsx("legend",{className:"sr-only",children:"Runtime provider"}),e.map((l,o)=>{const c=t===l;return u.jsxs("label",{className:"onboarding-runtime-option inline-flex items-center text-body",style:{gap:"var(--sp-1_5)",padding:"var(--sp-1) 0",cursor:"pointer",color:c?"color-mix(in oklch, var(--accent) 30%, var(--fg))":"var(--fg)",fontWeight:c?600:400,animation:`onboarding-rise 220ms ease-out ${o*80}ms both`,transition:"color 160ms ease, opacity 160ms ease, transform 160ms ease"},children:[u.jsx("input",{type:"radio",name:"onboarding-runtime",value:l,checked:c,onChange:()=>n(l),className:"sr-only"}),u.jsx("span",{"aria-hidden":"true",className:"inline-flex items-center justify-center",style:{width:14,height:14,borderRadius:"50%",border:c?"var(--hairline) solid var(--accent)":"var(--hairline) solid var(--border-strong)",background:c?"color-mix(in oklch, var(--accent) 8%, transparent)":"transparent",boxShadow:c?"0 0 0 var(--sp-0_5) color-mix(in oklch, var(--accent) 10%, transparent)":"none",transition:"border-color 160ms ease, background 160ms ease, box-shadow 160ms ease"},children:c&&u.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)"}})}),OV(l)]},l)})]})]})}function $V(){return u.jsxs("span",{"aria-hidden":"true",style:{position:"relative",display:"inline-block",width:8,height:8,flexShrink:0},children:[u.jsx("span",{style:{position:"absolute",inset:0,borderRadius:"50%",background:"var(--accent)"}}),u.jsx("span",{style:{position:"absolute",inset:-3,borderRadius:"50%",border:"var(--hairline) solid var(--accent)",animation:"ring-pulse 1.8s infinite",opacity:.55}})]})}function FV({nameOrFallback:e}){return u.jsxs("div",{className:"flex flex-col items-center text-center",style:{paddingTop:"var(--sp-12)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:["Creating ",e,"…"]}),u.jsx(HV,{}),u.jsx("p",{className:"text-body",style:{color:"var(--fg-3)"},children:"Usually takes ~10 seconds"})]})}function qV({nameOrFallback:e,hostname:t,error:n,onRetry:a}){const l=t??"your computer";return u.jsxs("div",{className:"flex flex-col",style:{paddingTop:"var(--sp-8)",gap:"var(--sp-4)"},children:[u.jsxs("p",{className:"text-title",style:{color:"var(--fg)"},children:[e," is taking longer than expected."]}),n?u.jsx("div",{className:"text-body",style:{padding:"var(--sp-2_5) var(--sp-3)",background:"color-mix(in oklch, var(--state-error) 10%, transparent)",border:"var(--hairline) solid color-mix(in oklch, var(--state-error) 25%, transparent)",borderRadius:"var(--radius-input)",color:"var(--state-error)"},children:n}):u.jsxs("div",{className:"text-body",style:{color:"var(--fg-2)"},children:[u.jsx("p",{children:"This usually means:"}),u.jsxs("ul",{style:{paddingLeft:"var(--sp-4)",listStyle:"disc",marginTop:"var(--sp-1_5)"},children:[u.jsxs("li",{children:["The runtime can't start on ",l," (missing API key, etc.)"]}),u.jsxs("li",{children:["The connection to ",l," dropped"]})]}),u.jsxs("p",{style:{marginTop:"var(--sp-2)"},children:["Fix it on ",l,", then click ",u.jsx("span",{className:"font-semibold",children:"Try again"}),"."]})]}),u.jsx("div",{className:"flex",style:{gap:"var(--sp-2)"},children:u.jsx(me,{onClick:a,children:"Try again"})})]})}function HV(){return u.jsxs("span",{className:"flex items-center",style:{gap:6},children:[u.jsx(Gp,{delayMs:0}),u.jsx(Gp,{delayMs:160}),u.jsx(Gp,{delayMs:320})]})}function Gp({delayMs:e}){return u.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",background:"var(--accent)",animation:"heartbeat-pulse 1.2s ease-in-out infinite",animationDelay:`${e}ms`,display:"inline-block"}})}function ZV({selectedChatId:e,onSelectChat:t}){const{wizardStep:n}=Rt();return e===hf?u.jsx(oV,{onCreated:t}):e?u.jsx(_V,{chatId:e}):n!==null&&n!=="completed"?u.jsx(MV,{}):u.jsx(TV,{})}function VV(){const[e,t]=qk(),n=e.get("c"),a=e.get("a");gE(),x.useEffect(()=>{if(a&&n){t({c:n},{replace:!0});return}a&&!n&&t({},{replace:!0})},[a,n,t]);const l=x.useCallback(c=>{t({c})},[t]),o=x.useCallback(()=>{t({c:hf})},[t]);return u.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[u.jsx(JZ,{selectedChatId:n,onSelectChat:l,onNewChat:o}),u.jsx("main",{className:"flex-1 flex flex-col overflow-hidden min-w-0",style:{background:"var(--bg)"},children:u.jsx(ZV,{selectedChatId:n,onSelectChat:l})})]})}const QV=new OT({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});function KV(){return u.jsx(MT,{client:QV,children:u.jsx(AR,{children:u.jsx(uR,{children:u.jsxs(UA,{children:[u.jsx(Ot,{path:"/login",element:u.jsx(DH,{})}),u.jsx(Ot,{path:"/signup",element:u.jsx(ur,{to:"/login",replace:!0})}),u.jsx(Ot,{path:"/auth/github/complete",element:u.jsx(IH,{})}),u.jsx(Ot,{path:"/invite/:token",element:u.jsx(RH,{})}),u.jsx(Ot,{element:u.jsx(DR,{}),children:u.jsxs(Ot,{element:u.jsx(FU,{children:u.jsx(AD,{})}),children:[u.jsx(Ot,{index:!0,element:u.jsx(VV,{})}),u.jsx(Ot,{path:"context",element:u.jsx(iH,{})}),u.jsx(Ot,{path:"agents/:uuid",element:u.jsx(b7,{})}),u.jsxs(Ot,{path:"team",element:u.jsx(ZZ,{}),children:[u.jsx(Ot,{index:!0,element:u.jsx(jZ,{})}),u.jsx(Ot,{path:"settings",element:u.jsx(HZ,{})})]}),u.jsxs(Ot,{path:"settings",element:u.jsx(mZ,{}),children:[u.jsx(Ot,{index:!0,element:u.jsx(ur,{to:"computers",replace:!0})}),u.jsx(Ot,{path:"computers",element:u.jsx(XH,{})}),u.jsx(Ot,{path:"integrations",element:u.jsx(hZ,{})})]}),u.jsx(Ot,{path:"agents",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(Ot,{path:"clients",element:u.jsx(ur,{to:"/settings/computers",replace:!0})}),u.jsx(Ot,{path:"integrations",element:u.jsx(ur,{to:"/settings/integrations",replace:!0})}),u.jsx(Ot,{path:"team/members",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(Ot,{path:"team/agents",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(Ot,{path:"team/invite",element:u.jsx(ur,{to:"/team",replace:!0})}),u.jsx(Ot,{path:"admin",element:u.jsx(GV,{})})]})})]})})})})}function GV(){const e=Yn();return e.hash==="#bindings"?u.jsx(ur,{to:`/settings/integrations${e.search}`,replace:!0}):u.jsx(ur,{to:`/team${e.hash}`,replace:!0})}const PN=document.getElementById("root");if(!PN)throw new Error("Root element not found");sT.createRoot(PN).render(u.jsx(x.StrictMode,{children:u.jsx(KV,{})}));export{qR as A,Xu as F,Vu as L,st as c,u as j,x as r};
|