herdr-remote-relay 0.3.2 → 0.3.4
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.
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var ev=Object.defineProperty;var tv=(r,a,i)=>a in r?ev(r,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[a]=i;var fe=(r,a,i)=>tv(r,typeof a!="symbol"?a+"":a,i);import{r as qp,g as Fp,a as Vp}from"./vendor-react-CYSfZuHu.js";import{r as nv,a as lv,b as av}from"./vendor-xterm-Yo7-doCv.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const p of f.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();var Nu={exports:{}},Dr={};/**
|
|
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 qm;function iv(){if(qm)return Dr;qm=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(o,d,f){var p=null;if(f!==void 0&&(p=""+f),d.key!==void 0&&(p=""+d.key),"key"in d){f={};for(var m in d)m!=="key"&&(f[m]=d[m])}else f=d;return d=f.ref,{$$typeof:r,type:o,key:p,ref:d!==void 0?d:null,props:f}}return Dr.Fragment=a,Dr.jsx=i,Dr.jsxs=i,Dr}var Fm;function rv(){return Fm||(Fm=1,Nu.exports=iv()),Nu.exports}var u=rv(),x=qp();const pl=Fp(x);var Eu={exports:{}},Or={},ku={exports:{}},Ru={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* scheduler.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 Vm;function sv(){return Vm||(Vm=1,(function(r){function a(L,V){var $=L.length;L.push(V);e:for(;0<$;){var je=$-1>>>1,Z=L[je];if(0<d(Z,V))L[je]=V,L[$]=Z,$=je;else break e}}function i(L){return L.length===0?null:L[0]}function o(L){if(L.length===0)return null;var V=L[0],$=L.pop();if($!==V){L[0]=$;e:for(var je=0,Z=L.length,at=Z>>>1;je<at;){var Qe=2*(je+1)-1,_e=L[Qe],Ze=Qe+1,ze=L[Ze];if(0>d(_e,$))Ze<Z&&0>d(ze,_e)?(L[je]=ze,L[Ze]=$,je=Ze):(L[je]=_e,L[Qe]=$,je=Qe);else if(Ze<Z&&0>d(ze,$))L[je]=ze,L[Ze]=$,je=Ze;else break e}}return V}function d(L,V){var $=L.sortIndex-V.sortIndex;return $!==0?$:L.id-V.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;r.unstable_now=function(){return f.now()}}else{var p=Date,m=p.now();r.unstable_now=function(){return p.now()-m}}var b=[],v=[],y=1,w=null,T=3,R=!1,k=!1,K=!1,z=!1,X=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function ae(L){for(var V=i(v);V!==null;){if(V.callback===null)o(v);else if(V.startTime<=L)o(v),V.sortIndex=V.expirationTime,a(b,V);else break;V=i(v)}}function be(L){if(K=!1,ae(L),!k)if(i(b)!==null)k=!0,se||(se=!0,we());else{var V=i(v);V!==null&&He(be,V.startTime-L)}}var se=!1,G=-1,U=5,le=-1;function ue(){return z?!0:!(r.unstable_now()-le<U)}function ve(){if(z=!1,se){var L=r.unstable_now();le=L;var V=!0;try{e:{k=!1,K&&(K=!1,I(G),G=-1),R=!0;var $=T;try{t:{for(ae(L),w=i(b);w!==null&&!(w.expirationTime>L&&ue());){var je=w.callback;if(typeof je=="function"){w.callback=null,T=w.priorityLevel;var Z=je(w.expirationTime<=L);if(L=r.unstable_now(),typeof Z=="function"){w.callback=Z,ae(L),V=!0;break t}w===i(b)&&o(b),ae(L)}else o(b);w=i(b)}if(w!==null)V=!0;else{var at=i(v);at!==null&&He(be,at.startTime-L),V=!1}}break e}finally{w=null,T=$,R=!1}V=void 0}}finally{V?we():se=!1}}}var we;if(typeof P=="function")we=function(){P(ve)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,ke=he.port2;he.port1.onmessage=ve,we=function(){ke.postMessage(null)}}else we=function(){X(ve,0)};function He(L,V){G=X(function(){L(r.unstable_now())},V)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(L){L.callback=null},r.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<L?Math.floor(1e3/L):5},r.unstable_getCurrentPriorityLevel=function(){return T},r.unstable_next=function(L){switch(T){case 1:case 2:case 3:var V=3;break;default:V=T}var $=T;T=V;try{return L()}finally{T=$}},r.unstable_requestPaint=function(){z=!0},r.unstable_runWithPriority=function(L,V){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var $=T;T=L;try{return V()}finally{T=$}},r.unstable_scheduleCallback=function(L,V,$){var je=r.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?je+$:je):$=je,L){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=$+Z,L={id:y++,callback:V,priorityLevel:L,startTime:$,expirationTime:Z,sortIndex:-1},$>je?(L.sortIndex=$,a(v,L),i(b)===null&&L===i(v)&&(K?(I(G),G=-1):K=!0,He(be,$-je))):(L.sortIndex=Z,a(b,L),k||R||(k=!0,se||(se=!0,we()))),L},r.unstable_shouldYield=ue,r.unstable_wrapCallback=function(L){var V=T;return function(){var $=T;T=V;try{return L.apply(this,arguments)}finally{T=$}}}})(Ru)),Ru}var Xm;function ov(){return Xm||(Xm=1,ku.exports=sv()),ku.exports}/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react-dom-client.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 Im;function cv(){if(Im)return Or;Im=1;var r=ov(),a=qp(),i=Vp();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function p(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(f(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,l=t;;){var s=n.return;if(s===null)break;var c=s.alternate;if(c===null){if(l=s.return,l!==null){n=l;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===n)return b(s),e;if(c===l)return b(s),t;c=c.sibling}throw Error(o(188))}if(n.return!==l.return)n=s,l=c;else{for(var h=!1,g=s.child;g;){if(g===n){h=!0,n=s,l=c;break}if(g===l){h=!0,l=s,n=c;break}g=g.sibling}if(!h){for(g=c.child;g;){if(g===n){h=!0,n=c,l=s;break}if(g===l){h=!0,l=c,n=s;break}g=g.sibling}if(!h)throw Error(o(189))}}if(n.alternate!==l)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var w=Object.assign,T=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),P=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),be=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),ve=Symbol.iterator;function we(e){return e===null||typeof e!="object"?null:(e=ve&&e[ve]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function ke(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case X:return"Profiler";case z:return"StrictMode";case be:return"Suspense";case se:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case P:return e.displayName||"Context";case I:return(e._context.displayName||"Context")+".Consumer";case ae:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:ke(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return ke(e(t))}catch{}}return null}var He=Array.isArray,L=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},je=[],Z=-1;function at(e){return{current:e}}function Qe(e){0>Z||(e.current=je[Z],je[Z]=null,Z--)}function _e(e,t){Z++,je[Z]=e.current,e.current=t}var Ze=at(null),ze=at(null),Se=at(null),zt=at(null);function ft(e,t){switch(_e(Se,t),_e(ze,e),_e(Ze,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fm(t),e=hm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Qe(Ze),_e(Ze,e)}function B(){Qe(Ze),Qe(ze),Qe(Se)}function Me(e){e.memoizedState!==null&&_e(zt,e);var t=Ze.current,n=hm(t,e.type);t!==n&&(_e(ze,e),_e(Ze,n))}function E(e){ze.current===e&&(Qe(Ze),Qe(ze)),zt.current===e&&(Qe(zt),Mr._currentValue=$)}var te,J;function Ke(e){if(te===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||"",J=-1<n.stack.indexOf(`
|
|
26
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
27
|
+
`+te+e+J}var De=!1;function Je(e,t){if(!e||De)return"";De=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(O){var _=O}Reflect.construct(e,[],F)}else{try{F.call()}catch(O){_=O}e.call(F.prototype)}}else{try{throw Error()}catch(O){_=O}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(O){if(O&&_&&typeof O.stack=="string")return[O.stack,_.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),h=c[0],g=c[1];if(h&&g){var S=h.split(`
|
|
28
|
+
`),M=g.split(`
|
|
29
|
+
`);for(s=l=0;l<S.length&&!S[l].includes("DetermineComponentFrameRoot");)l++;for(;s<M.length&&!M[s].includes("DetermineComponentFrameRoot");)s++;if(l===S.length||s===M.length)for(l=S.length-1,s=M.length-1;1<=l&&0<=s&&S[l]!==M[s];)s--;for(;1<=l&&0<=s;l--,s--)if(S[l]!==M[s]){if(l!==1||s!==1)do if(l--,s--,0>s||S[l]!==M[s]){var Y=`
|
|
30
|
+
`+S[l].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=l&&0<=s);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ke(n):""}function St(e,t){switch(e.tag){case 26:case 27:case 5:return Ke(e.type);case 16:return Ke("Lazy");case 13:return e.child!==t&&t!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return Je(e.type,!1);case 11:return Je(e.type.render,!1);case 1:return Je(e.type,!0);case 31:return Ke("Activity");default:return""}}function Gt(e){try{var t="",n=null;do t+=St(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
|
|
31
|
+
Error generating stack: `+l.message+`
|
|
32
|
+
`+l.stack}}var qt=Object.prototype.hasOwnProperty,Jt=r.unstable_scheduleCallback,lt=r.unstable_cancelCallback,ht=r.unstable_shouldYield,Ft=r.unstable_requestPaint,de=r.unstable_now,Ue=r.unstable_getCurrentPriorityLevel,Ge=r.unstable_ImmediatePriority,it=r.unstable_UserBlockingPriority,hn=r.unstable_NormalPriority,mn=r.unstable_LowPriority,Et=r.unstable_IdlePriority,nl=r.log,pn=r.unstable_setDisableYieldValue,tt=null,Ct=null;function Dt(e){if(typeof nl=="function"&&pn(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(tt,e)}catch{}}var ut=Math.clz32?Math.clz32:Ot,Pl=Math.log,Mn=Math.LN2;function Ot(e){return e>>>=0,e===0?32:31-(Pl(e)/Mn|0)|0}var Nl=256,an=262144,El=4194304;function Sn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function kl(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var s=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~c,l!==0?s=Sn(l):(h&=g,h!==0?s=Sn(h):n||(n=g&~e,n!==0&&(s=Sn(n))))):(g=l&~c,g!==0?s=Sn(g):h!==0?s=Sn(h):n||(n=l&~e,n!==0&&(s=Sn(n)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:s}function ll(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function al(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 _n(){var e=El;return El<<=1,(El&62914560)===0&&(El=4194304),e}function Fn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ln(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Zi(e,t,n,l,s,c){var h=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,S=e.expirationTimes,M=e.hiddenUpdates;for(n=h&~n;0<n;){var Y=31-ut(n),F=1<<Y;g[Y]=0,S[Y]=-1;var _=M[Y];if(_!==null)for(M[Y]=null,Y=0;Y<_.length;Y++){var O=_[Y];O!==null&&(O.lane&=-536870913)}n&=~F}l!==0&&Ma(e,l,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function Ma(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-ut(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function _a(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-ut(n),s=1<<l;s&t|e[l]&t&&(e[l]|=t),n&=~s}}function La(e,t){var n=t&-t;return n=(n&42)!==0?1:Wl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Wl(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function il(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function zn(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Om(e.type))}function ai(e,t){var n=V.p;try{return V.p=e,t()}finally{V.p=n}}var Vn=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Vn,$t="__reactProps$"+Vn,Xn="__reactContainer$"+Vn,za="__reactEvents$"+Vn,ii="__reactListeners$"+Vn,ri="__reactHandles$"+Vn,D="__reactResources$"+Vn,H="__reactMarker$"+Vn;function ie(e){delete e[Ht],delete e[$t],delete e[za],delete e[ii],delete e[ri]}function Ae(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xn]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xm(e);e!==null;){if(n=e[Ht])return n;e=xm(e)}return t}e=n,n=e.parentNode}return null}function Ne(e){if(e=e[Ht]||e[Xn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Le(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ve(e){var t=e[D];return t||(t=e[D]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function rt(e){e[H]=!0}var Lt=new Set,gl={};function dn(e,t){en(e,t),en(e+"Capture",t)}function en(e,t){for(gl[e]=t,e=0;e<t.length;e++)Lt.add(t[e])}var Q=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]*$"),ee={},Ce={};function ye(e){return qt.call(Ce,e)?!0:qt.call(ee,e)?!1:Q.test(e)?Ce[e]=!0:(ee[e]=!0,!1)}function qe(e,t,n){if(ye(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function re(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function kt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function dt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rt(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dn(e){if(!e._valueTracker){var t=Qt(e)?"checked":"value";e._valueTracker=Rt(e,t,""+e[t])}}function rl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Qt(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function bl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Jl=/[\n"\\]/g;function tn(e){return e.replace(Jl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Qi(e,t,n,l,s,c,h,g){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+dt(t)):e.value!==""+dt(t)&&(e.value=""+dt(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Pi(e,h,dt(t)):n!=null?Pi(e,h,dt(n)):l!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+dt(g):e.removeAttribute("name")}function Jr(e,t,n,l,s,c,h,g){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Dn(e);return}n=n!=null?""+dt(n):"",t=t!=null?""+dt(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),Dn(e)}function Pi(e,t,n){t==="number"&&bl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function $l(e,t,n,l){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&l&&(e[n].defaultSelected=!0)}else{for(n=""+dt(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function $r(e,t,n){if(t!=null&&(t=""+dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+dt(n):""}function es(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(o(92));if(He(l)){if(1<l.length)throw Error(o(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=dt(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Dn(e)}function ea(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cn=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 ts(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Cn.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function ns(e,t,n){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var s in t)l=t[s],t.hasOwnProperty(s)&&n[s]!==l&&ts(e,s,l)}else for(var c in t)t.hasOwnProperty(c)&&ts(e,c,t[c])}function Rl(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sl=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"]]),ls=/^[\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 Da(e){return ls.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Tn(){}var ta=null;function na(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var jl=null,Ml=null;function W(e){var t=Ne(e);if(t&&(e=t.stateNode)){var n=e[$t]||null;e:switch(e=t.stateNode,t.type){case"input":if(Qi(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+tn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var s=l[$t]||null;if(!s)throw Error(o(90));Qi(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&rl(l)}break e;case"textarea":$r(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&$l(e,!!n.multiple,t,!1)}}}var ce=!1;function Be(e,t,n){if(ce)return e(t,n);ce=!0;try{var l=e(t);return l}finally{if(ce=!1,(jl!==null||Ml!==null)&&(Ys(),jl&&(t=jl,e=Ml,Ml=jl=null,W(t),e)))for(t=0;t<e.length;t++)W(e[t])}}function vt(e,t){var n=e.stateNode;if(n===null)return null;var l=n[$t]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gn=!1;if(jt)try{var Te={};Object.defineProperty(Te,"passive",{get:function(){gn=!0}}),window.addEventListener("test",Te,Te),window.removeEventListener("test",Te,Te)}catch{gn=!1}var Mt=null,xt=null,nn=null;function On(){if(nn)return nn;var e,t=xt,n=t.length,l,s="value"in Mt?Mt.value:Mt.textContent,c=s.length;for(e=0;e<n&&t[e]===s[e];e++);var h=n-e;for(l=1;l<=h&&t[n-l]===s[c-l];l++);return nn=s.slice(e,1<l?1-l:void 0)}function bn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function la(){return!1}function rn(e){function t(n,l,s,c,h){this._reactName=n,this._targetInst=s,this.type=l,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(c):c[g]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?yn:la,this.isPropagationStopped=la,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oa=rn(yl),aa=w({},yl,{view:0,detail:0}),as=rn(aa),si,oi,Wi,is=w({},aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wi&&(Wi&&e.type==="mousemove"?(si=e.screenX-Wi.screenX,oi=e.screenY-Wi.screenY):oi=si=0,Wi=e),si)},movementY:function(e){return"movementY"in e?e.movementY:oi}}),md=rn(is),$g=w({},is,{dataTransfer:0}),eb=rn($g),tb=w({},aa,{relatedTarget:0}),jo=rn(tb),nb=w({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),lb=rn(nb),ab=w({},yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ib=rn(ab),rb=w({},yl,{data:0}),pd=rn(rb),sb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ob={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"},cb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ub(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cb[e])?!!t[e]:!1}function Mo(){return ub}var db=w({},aa,{key:function(e){if(e.key){var t=sb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=bn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ob[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mo,charCode:function(e){return e.type==="keypress"?bn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?bn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fb=rn(db),hb=w({},is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gd=rn(hb),mb=w({},aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mo}),pb=rn(mb),gb=w({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),bb=rn(gb),yb=w({},is,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),vb=rn(yb),xb=w({},yl,{newState:0,oldState:0}),wb=rn(xb),Sb=[9,13,27,32],_o=jt&&"CompositionEvent"in window,Ji=null;jt&&"documentMode"in document&&(Ji=document.documentMode);var Cb=jt&&"TextEvent"in window&&!Ji,bd=jt&&(!_o||Ji&&8<Ji&&11>=Ji),yd=" ",vd=!1;function xd(e,t){switch(e){case"keyup":return Sb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ci=!1;function Tb(e,t){switch(e){case"compositionend":return wd(t);case"keypress":return t.which!==32?null:(vd=!0,yd);case"textInput":return e=t.data,e===yd&&vd?null:e;default:return null}}function Ab(e,t){if(ci)return e==="compositionend"||!_o&&xd(e,t)?(e=On(),nn=xt=Mt=null,ci=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bd&&t.locale!=="ko"?null:t.data;default:return null}}var Nb={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 Sd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Nb[e.type]:t==="textarea"}function Cd(e,t,n,l){jl?Ml?Ml.push(l):Ml=[l]:jl=l,t=Zs(t,"onChange"),0<t.length&&(n=new Oa("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var $i=null,er=null;function Eb(e){rm(e,0)}function rs(e){var t=Le(e);if(rl(t))return e}function Td(e,t){if(e==="change")return t}var Ad=!1;if(jt){var Lo;if(jt){var zo="oninput"in document;if(!zo){var Nd=document.createElement("div");Nd.setAttribute("oninput","return;"),zo=typeof Nd.oninput=="function"}Lo=zo}else Lo=!1;Ad=Lo&&(!document.documentMode||9<document.documentMode)}function Ed(){$i&&($i.detachEvent("onpropertychange",kd),er=$i=null)}function kd(e){if(e.propertyName==="value"&&rs(er)){var t=[];Cd(t,er,e,na(e)),Be(Eb,t)}}function kb(e,t,n){e==="focusin"?(Ed(),$i=t,er=n,$i.attachEvent("onpropertychange",kd)):e==="focusout"&&Ed()}function Rb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return rs(er)}function jb(e,t){if(e==="click")return rs(t)}function Mb(e,t){if(e==="input"||e==="change")return rs(t)}function _b(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Un=typeof Object.is=="function"?Object.is:_b;function tr(e,t){if(Un(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var s=n[l];if(!qt.call(t,s)||!Un(e[s],t[s]))return!1}return!0}function Rd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jd(e,t){var n=Rd(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Rd(n)}}function Md(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Md(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _d(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=bl(e.document)}return t}function Do(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Lb=jt&&"documentMode"in document&&11>=document.documentMode,ui=null,Oo=null,nr=null,Uo=!1;function Ld(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Uo||ui==null||ui!==bl(l)||(l=ui,"selectionStart"in l&&Do(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),nr&&tr(nr,l)||(nr=l,l=Zs(Oo,"onSelect"),0<l.length&&(t=new Oa("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=ui)))}function Ua(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var di={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionrun:Ua("Transition","TransitionRun"),transitionstart:Ua("Transition","TransitionStart"),transitioncancel:Ua("Transition","TransitionCancel"),transitionend:Ua("Transition","TransitionEnd")},Bo={},zd={};jt&&(zd=document.createElement("div").style,"AnimationEvent"in window||(delete di.animationend.animation,delete di.animationiteration.animation,delete di.animationstart.animation),"TransitionEvent"in window||delete di.transitionend.transition);function Ba(e){if(Bo[e])return Bo[e];if(!di[e])return e;var t=di[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zd)return Bo[e]=t[n];return e}var Dd=Ba("animationend"),Od=Ba("animationiteration"),Ud=Ba("animationstart"),zb=Ba("transitionrun"),Db=Ba("transitionstart"),Ob=Ba("transitioncancel"),Bd=Ba("transitionend"),Hd=new Map,Ho="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(" ");Ho.push("scrollEnd");function ol(e,t){Hd.set(e,t),dn(t,[e])}var ss=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},In=[],fi=0,Ko=0;function os(){for(var e=fi,t=Ko=fi=0;t<e;){var n=In[t];In[t++]=null;var l=In[t];In[t++]=null;var s=In[t];In[t++]=null;var c=In[t];if(In[t++]=null,l!==null&&s!==null){var h=l.pending;h===null?s.next=s:(s.next=h.next,h.next=s),l.pending=s}c!==0&&Kd(n,s,c)}}function cs(e,t,n,l){In[fi++]=e,In[fi++]=t,In[fi++]=n,In[fi++]=l,Ko|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Yo(e,t,n,l){return cs(e,t,n,l),us(e)}function Ha(e,t){return cs(e,null,null,t),us(e)}function Kd(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var s=!1,c=e.return;c!==null;)c.childLanes|=n,l=c.alternate,l!==null&&(l.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-ut(n),e=c.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=n|536870912),c):null}function us(e){if(50<Tr)throw Tr=0,Pc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hi={};function Ub(e,t,n,l){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(e,t,n,l){return new Ub(e,t,n,l)}function Go(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _l(e,t){var n=e.alternate;return n===null?(n=Bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Yd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ds(e,t,n,l,s,c){var h=0;if(l=e,typeof e=="function")Go(e)&&(h=1);else if(typeof e=="string")h=Gy(e,n,Ze.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Bn(31,n,t,s),e.elementType=le,e.lanes=c,e;case K:return Ka(n.children,s,c,t);case z:h=8,s|=24;break;case X:return e=Bn(12,n,t,s|2),e.elementType=X,e.lanes=c,e;case be:return e=Bn(13,n,t,s),e.elementType=be,e.lanes=c,e;case se:return e=Bn(19,n,t,s),e.elementType=se,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:h=10;break e;case I:h=9;break e;case ae:h=11;break e;case G:h=14;break e;case U:h=16,l=null;break e}h=29,n=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=Bn(h,n,t,s),t.elementType=e,t.type=l,t.lanes=c,t}function Ka(e,t,n,l){return e=Bn(7,e,l,t),e.lanes=n,e}function qo(e,t,n){return e=Bn(6,e,null,t),e.lanes=n,e}function Gd(e){var t=Bn(18,null,null,0);return t.stateNode=e,t}function Fo(e,t,n){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var qd=new WeakMap;function Zn(e,t){if(typeof e=="object"&&e!==null){var n=qd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Gt(t)},qd.set(e,t),t)}return{value:e,source:t,stack:Gt(t)}}var mi=[],pi=0,fs=null,lr=0,Qn=[],Pn=0,ia=null,vl=1,xl="";function Ll(e,t){mi[pi++]=lr,mi[pi++]=fs,fs=e,lr=t}function Fd(e,t,n){Qn[Pn++]=vl,Qn[Pn++]=xl,Qn[Pn++]=ia,ia=e;var l=vl;e=xl;var s=32-ut(l)-1;l&=~(1<<s),n+=1;var c=32-ut(t)+s;if(30<c){var h=s-s%5;c=(l&(1<<h)-1).toString(32),l>>=h,s-=h,vl=1<<32-ut(t)+s|n<<s|l,xl=c+e}else vl=1<<c|n<<s|l,xl=e}function Vo(e){e.return!==null&&(Ll(e,1),Fd(e,1,0))}function Xo(e){for(;e===fs;)fs=mi[--pi],mi[pi]=null,lr=mi[--pi],mi[pi]=null;for(;e===ia;)ia=Qn[--Pn],Qn[Pn]=null,xl=Qn[--Pn],Qn[Pn]=null,vl=Qn[--Pn],Qn[Pn]=null}function Vd(e,t){Qn[Pn++]=vl,Qn[Pn++]=xl,Qn[Pn++]=ia,vl=t.id,xl=t.overflow,ia=e}var sn=null,Tt=null,nt=!1,ra=null,Wn=!1,Io=Error(o(519));function sa(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ar(Zn(t,e)),Io}function Xd(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ht]=e,t[$t]=l,n){case"dialog":We("cancel",t),We("close",t);break;case"iframe":case"object":case"embed":We("load",t);break;case"video":case"audio":for(n=0;n<Nr.length;n++)We(Nr[n],t);break;case"source":We("error",t);break;case"img":case"image":case"link":We("error",t),We("load",t);break;case"details":We("toggle",t);break;case"input":We("invalid",t),Jr(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":We("invalid",t);break;case"textarea":We("invalid",t),es(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||um(t.textContent,n)?(l.popover!=null&&(We("beforetoggle",t),We("toggle",t)),l.onScroll!=null&&We("scroll",t),l.onScrollEnd!=null&&We("scrollend",t),l.onClick!=null&&(t.onclick=Tn),t=!0):t=!1,t||sa(e,!0)}function Id(e){for(sn=e.return;sn;)switch(sn.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:sn=sn.return}}function gi(e){if(e!==sn)return!1;if(!nt)return Id(e),nt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||du(e.type,e.memoizedProps)),n=!n),n&&Tt&&sa(e),Id(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Tt=vm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Tt=vm(e)}else t===27?(t=Tt,wa(e.type)?(e=gu,gu=null,Tt=e):Tt=t):Tt=sn?$n(e.stateNode.nextSibling):null;return!0}function Ya(){Tt=sn=null,nt=!1}function Zo(){var e=ra;return e!==null&&(kn===null?kn=e:kn.push.apply(kn,e),ra=null),e}function ar(e){ra===null?ra=[e]:ra.push(e)}var Qo=at(null),Ga=null,zl=null;function oa(e,t,n){_e(Qo,t._currentValue),t._currentValue=n}function Dl(e){e._currentValue=Qo.current,Qe(Qo)}function Po(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function Wo(e,t,n,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var h=s.child;c=c.firstContext;e:for(;c!==null;){var g=c;c=s;for(var S=0;S<t.length;S++)if(g.context===t[S]){c.lanes|=n,g=c.alternate,g!==null&&(g.lanes|=n),Po(c.return,n,e),l||(h=null);break e}c=g.next}}else if(s.tag===18){if(h=s.return,h===null)throw Error(o(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),Po(h,n,e),h=null}else h=s.child;if(h!==null)h.return=s;else for(h=s;h!==null;){if(h===e){h=null;break}if(s=h.sibling,s!==null){s.return=h.return,h=s;break}h=h.return}s=h}}function bi(e,t,n,l){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var h=s.alternate;if(h===null)throw Error(o(387));if(h=h.memoizedProps,h!==null){var g=s.type;Un(s.pendingProps.value,h.value)||(e!==null?e.push(g):e=[g])}}else if(s===zt.current){if(h=s.alternate,h===null)throw Error(o(387));h.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Mr):e=[Mr])}s=s.return}e!==null&&Wo(t,e,n,l),t.flags|=262144}function hs(e){for(e=e.firstContext;e!==null;){if(!Un(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qa(e){Ga=e,zl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function on(e){return Zd(Ga,e)}function ms(e,t){return Ga===null&&qa(e),Zd(e,t)}function Zd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zl===null){if(e===null)throw Error(o(308));zl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zl=zl.next=t;return n}var Bb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Hb=r.unstable_scheduleCallback,Kb=r.unstable_NormalPriority,Vt={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jo(){return{controller:new Bb,data:new Map,refCount:0}}function ir(e){e.refCount--,e.refCount===0&&Hb(Kb,function(){e.controller.abort()})}var rr=null,$o=0,yi=0,vi=null;function Yb(e,t){if(rr===null){var n=rr=[];$o=0,yi=nu(),vi={status:"pending",value:void 0,then:function(l){n.push(l)}}}return $o++,t.then(Qd,Qd),t}function Qd(){if(--$o===0&&rr!==null){vi!==null&&(vi.status="fulfilled");var e=rr;rr=null,yi=0,vi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Gb(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),l}var Pd=L.S;L.S=function(e,t){zh=de(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Yb(e,t),Pd!==null&&Pd(e,t)};var Fa=at(null);function ec(){var e=Fa.current;return e!==null?e:wt.pooledCache}function ps(e,t){t===null?_e(Fa,Fa.current):_e(Fa,t.pool)}function Wd(){var e=ec();return e===null?null:{parent:Vt._currentValue,pool:e}}var xi=Error(o(460)),tc=Error(o(474)),gs=Error(o(542)),bs={then:function(){}};function Jd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $d(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Tn,Tn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tf(e),e;default:if(typeof t.status=="string")t.then(Tn,Tn);else{if(e=wt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tf(e),e}throw Xa=t,xi}}function Va(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Xa=n,xi):n}}var Xa=null;function ef(){if(Xa===null)throw Error(o(459));var e=Xa;return Xa=null,e}function tf(e){if(e===xi||e===gs)throw Error(o(483))}var wi=null,sr=0;function ys(e){var t=sr;return sr+=1,wi===null&&(wi=[]),$d(wi,e,t)}function or(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function vs(e,t){throw t.$$typeof===T?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function nf(e){function t(N,C){if(e){var j=N.deletions;j===null?(N.deletions=[C],N.flags|=16):j.push(C)}}function n(N,C){if(!e)return null;for(;C!==null;)t(N,C),C=C.sibling;return null}function l(N){for(var C=new Map;N!==null;)N.key!==null?C.set(N.key,N):C.set(N.index,N),N=N.sibling;return C}function s(N,C){return N=_l(N,C),N.index=0,N.sibling=null,N}function c(N,C,j){return N.index=j,e?(j=N.alternate,j!==null?(j=j.index,j<C?(N.flags|=67108866,C):j):(N.flags|=67108866,C)):(N.flags|=1048576,C)}function h(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function g(N,C,j,q){return C===null||C.tag!==6?(C=qo(j,N.mode,q),C.return=N,C):(C=s(C,j),C.return=N,C)}function S(N,C,j,q){var Ee=j.type;return Ee===K?Y(N,C,j.props.children,q,j.key):C!==null&&(C.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&Va(Ee)===C.type)?(C=s(C,j.props),or(C,j),C.return=N,C):(C=ds(j.type,j.key,j.props,null,N.mode,q),or(C,j),C.return=N,C)}function M(N,C,j,q){return C===null||C.tag!==4||C.stateNode.containerInfo!==j.containerInfo||C.stateNode.implementation!==j.implementation?(C=Fo(j,N.mode,q),C.return=N,C):(C=s(C,j.children||[]),C.return=N,C)}function Y(N,C,j,q,Ee){return C===null||C.tag!==7?(C=Ka(j,N.mode,q,Ee),C.return=N,C):(C=s(C,j),C.return=N,C)}function F(N,C,j){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=qo(""+C,N.mode,j),C.return=N,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case R:return j=ds(C.type,C.key,C.props,null,N.mode,j),or(j,C),j.return=N,j;case k:return C=Fo(C,N.mode,j),C.return=N,C;case U:return C=Va(C),F(N,C,j)}if(He(C)||we(C))return C=Ka(C,N.mode,j,null),C.return=N,C;if(typeof C.then=="function")return F(N,ys(C),j);if(C.$$typeof===P)return F(N,ms(N,C),j);vs(N,C)}return null}function _(N,C,j,q){var Ee=C!==null?C.key:null;if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return Ee!==null?null:g(N,C,""+j,q);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case R:return j.key===Ee?S(N,C,j,q):null;case k:return j.key===Ee?M(N,C,j,q):null;case U:return j=Va(j),_(N,C,j,q)}if(He(j)||we(j))return Ee!==null?null:Y(N,C,j,q,null);if(typeof j.then=="function")return _(N,C,ys(j),q);if(j.$$typeof===P)return _(N,C,ms(N,j),q);vs(N,j)}return null}function O(N,C,j,q,Ee){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return N=N.get(j)||null,g(C,N,""+q,Ee);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case R:return N=N.get(q.key===null?j:q.key)||null,S(C,N,q,Ee);case k:return N=N.get(q.key===null?j:q.key)||null,M(C,N,q,Ee);case U:return q=Va(q),O(N,C,j,q,Ee)}if(He(q)||we(q))return N=N.get(j)||null,Y(C,N,q,Ee,null);if(typeof q.then=="function")return O(N,C,j,ys(q),Ee);if(q.$$typeof===P)return O(N,C,j,ms(C,q),Ee);vs(C,q)}return null}function ge(N,C,j,q){for(var Ee=null,st=null,xe=C,Fe=C=0,et=null;xe!==null&&Fe<j.length;Fe++){xe.index>Fe?(et=xe,xe=null):et=xe.sibling;var ot=_(N,xe,j[Fe],q);if(ot===null){xe===null&&(xe=et);break}e&&xe&&ot.alternate===null&&t(N,xe),C=c(ot,C,Fe),st===null?Ee=ot:st.sibling=ot,st=ot,xe=et}if(Fe===j.length)return n(N,xe),nt&&Ll(N,Fe),Ee;if(xe===null){for(;Fe<j.length;Fe++)xe=F(N,j[Fe],q),xe!==null&&(C=c(xe,C,Fe),st===null?Ee=xe:st.sibling=xe,st=xe);return nt&&Ll(N,Fe),Ee}for(xe=l(xe);Fe<j.length;Fe++)et=O(xe,N,Fe,j[Fe],q),et!==null&&(e&&et.alternate!==null&&xe.delete(et.key===null?Fe:et.key),C=c(et,C,Fe),st===null?Ee=et:st.sibling=et,st=et);return e&&xe.forEach(function(Na){return t(N,Na)}),nt&&Ll(N,Fe),Ee}function Re(N,C,j,q){if(j==null)throw Error(o(151));for(var Ee=null,st=null,xe=C,Fe=C=0,et=null,ot=j.next();xe!==null&&!ot.done;Fe++,ot=j.next()){xe.index>Fe?(et=xe,xe=null):et=xe.sibling;var Na=_(N,xe,ot.value,q);if(Na===null){xe===null&&(xe=et);break}e&&xe&&Na.alternate===null&&t(N,xe),C=c(Na,C,Fe),st===null?Ee=Na:st.sibling=Na,st=Na,xe=et}if(ot.done)return n(N,xe),nt&&Ll(N,Fe),Ee;if(xe===null){for(;!ot.done;Fe++,ot=j.next())ot=F(N,ot.value,q),ot!==null&&(C=c(ot,C,Fe),st===null?Ee=ot:st.sibling=ot,st=ot);return nt&&Ll(N,Fe),Ee}for(xe=l(xe);!ot.done;Fe++,ot=j.next())ot=O(xe,N,Fe,ot.value,q),ot!==null&&(e&&ot.alternate!==null&&xe.delete(ot.key===null?Fe:ot.key),C=c(ot,C,Fe),st===null?Ee=ot:st.sibling=ot,st=ot);return e&&xe.forEach(function($y){return t(N,$y)}),nt&&Ll(N,Fe),Ee}function yt(N,C,j,q){if(typeof j=="object"&&j!==null&&j.type===K&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case R:e:{for(var Ee=j.key;C!==null;){if(C.key===Ee){if(Ee=j.type,Ee===K){if(C.tag===7){n(N,C.sibling),q=s(C,j.props.children),q.return=N,N=q;break e}}else if(C.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===U&&Va(Ee)===C.type){n(N,C.sibling),q=s(C,j.props),or(q,j),q.return=N,N=q;break e}n(N,C);break}else t(N,C);C=C.sibling}j.type===K?(q=Ka(j.props.children,N.mode,q,j.key),q.return=N,N=q):(q=ds(j.type,j.key,j.props,null,N.mode,q),or(q,j),q.return=N,N=q)}return h(N);case k:e:{for(Ee=j.key;C!==null;){if(C.key===Ee)if(C.tag===4&&C.stateNode.containerInfo===j.containerInfo&&C.stateNode.implementation===j.implementation){n(N,C.sibling),q=s(C,j.children||[]),q.return=N,N=q;break e}else{n(N,C);break}else t(N,C);C=C.sibling}q=Fo(j,N.mode,q),q.return=N,N=q}return h(N);case U:return j=Va(j),yt(N,C,j,q)}if(He(j))return ge(N,C,j,q);if(we(j)){if(Ee=we(j),typeof Ee!="function")throw Error(o(150));return j=Ee.call(j),Re(N,C,j,q)}if(typeof j.then=="function")return yt(N,C,ys(j),q);if(j.$$typeof===P)return yt(N,C,ms(N,j),q);vs(N,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,C!==null&&C.tag===6?(n(N,C.sibling),q=s(C,j),q.return=N,N=q):(n(N,C),q=qo(j,N.mode,q),q.return=N,N=q),h(N)):n(N,C)}return function(N,C,j,q){try{sr=0;var Ee=yt(N,C,j,q);return wi=null,Ee}catch(xe){if(xe===xi||xe===gs)throw xe;var st=Bn(29,xe,null,N.mode);return st.lanes=q,st.return=N,st}finally{}}}var Ia=nf(!0),lf=nf(!1),ca=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function da(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(ct&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=us(e),Kd(e,null,n),t}return cs(e,l,t,n),us(e)}function cr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_a(e,n)}}function ac(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var s=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?s=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?s=c=t:c=c.next=t}else s=c=t;n={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ic=!1;function ur(){if(ic){var e=vi;if(e!==null)throw e}}function dr(e,t,n,l){ic=!1;var s=e.updateQueue;ca=!1;var c=s.firstBaseUpdate,h=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var S=g,M=S.next;S.next=null,h===null?c=M:h.next=M,h=S;var Y=e.alternate;Y!==null&&(Y=Y.updateQueue,g=Y.lastBaseUpdate,g!==h&&(g===null?Y.firstBaseUpdate=M:g.next=M,Y.lastBaseUpdate=S))}if(c!==null){var F=s.baseState;h=0,Y=M=S=null,g=c;do{var _=g.lane&-536870913,O=_!==g.lane;if(O?($e&_)===_:(l&_)===_){_!==0&&_===yi&&(ic=!0),Y!==null&&(Y=Y.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var ge=e,Re=g;_=t;var yt=n;switch(Re.tag){case 1:if(ge=Re.payload,typeof ge=="function"){F=ge.call(yt,F,_);break e}F=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Re.payload,_=typeof ge=="function"?ge.call(yt,F,_):ge,_==null)break e;F=w({},F,_);break e;case 2:ca=!0}}_=g.callback,_!==null&&(e.flags|=64,O&&(e.flags|=8192),O=s.callbacks,O===null?s.callbacks=[_]:O.push(_))}else O={lane:_,tag:g.tag,payload:g.payload,callback:g.callback,next:null},Y===null?(M=Y=O,S=F):Y=Y.next=O,h|=_;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;O=g,g=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);Y===null&&(S=F),s.baseState=S,s.firstBaseUpdate=M,s.lastBaseUpdate=Y,c===null&&(s.shared.lanes=0),ga|=h,e.lanes=h,e.memoizedState=F}}function af(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function rf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)af(n[e],t)}var Si=at(null),xs=at(0);function sf(e,t){e=Fl,_e(xs,e),_e(Si,t),Fl=e|t.baseLanes}function rc(){_e(xs,Fl),_e(Si,Si.current)}function sc(){Fl=xs.current,Qe(Si),Qe(xs)}var Hn=at(null),Jn=null;function fa(e){var t=e.alternate;_e(Kt,Kt.current&1),_e(Hn,e),Jn===null&&(t===null||Si.current!==null||t.memoizedState!==null)&&(Jn=e)}function oc(e){_e(Kt,Kt.current),_e(Hn,e),Jn===null&&(Jn=e)}function of(e){e.tag===22?(_e(Kt,Kt.current),_e(Hn,e),Jn===null&&(Jn=e)):ha()}function ha(){_e(Kt,Kt.current),_e(Hn,Hn.current)}function Kn(e){Qe(Hn),Jn===e&&(Jn=null),Qe(Kt)}var Kt=at(0);function ws(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||mu(n)||pu(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ol=0,Ye=null,gt=null,Xt=null,Ss=!1,Ci=!1,Za=!1,Cs=0,fr=0,Ti=null,qb=0;function Ut(){throw Error(o(321))}function cc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Un(e[n],t[n]))return!1;return!0}function uc(e,t,n,l,s,c){return Ol=c,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?Vf:Ac,Za=!1,c=n(l,s),Za=!1,Ci&&(c=uf(t,n,l,s)),cf(e),c}function cf(e){L.H=pr;var t=gt!==null&>.next!==null;if(Ol=0,Xt=gt=Ye=null,Ss=!1,fr=0,Ti=null,t)throw Error(o(300));e===null||It||(e=e.dependencies,e!==null&&hs(e)&&(It=!0))}function uf(e,t,n,l){Ye=e;var s=0;do{if(Ci&&(Ti=null),fr=0,Ci=!1,25<=s)throw Error(o(301));if(s+=1,Xt=gt=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}L.H=Xf,c=t(n,l)}while(Ci);return c}function Fb(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?hr(t):t,e=e.useState()[0],(gt!==null?gt.memoizedState:null)!==e&&(Ye.flags|=1024),t}function dc(){var e=Cs!==0;return Cs=0,e}function fc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function hc(e){if(Ss){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ss=!1}Ol=0,Xt=gt=Ye=null,Ci=!1,fr=Cs=0,Ti=null}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Ye.memoizedState=Xt=e:Xt=Xt.next=e,Xt}function Yt(){if(gt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=gt.next;var t=Xt===null?Ye.memoizedState:Xt.next;if(t!==null)Xt=t,gt=e;else{if(e===null)throw Ye.alternate===null?Error(o(467)):Error(o(310));gt=e,e={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Xt===null?Ye.memoizedState=Xt=e:Xt=Xt.next=e}return Xt}function Ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hr(e){var t=fr;return fr+=1,Ti===null&&(Ti=[]),e=$d(Ti,e,t),t=Ye,(Xt===null?t.memoizedState:Xt.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?Vf:Ac),e}function As(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hr(e);if(e.$$typeof===P)return on(e)}throw Error(o(438,String(e)))}function mc(e){var t=null,n=Ye.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ye.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ts(),Ye.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ue;return t.index++,n}function Ul(e,t){return typeof t=="function"?t(e):t}function Ns(e){var t=Yt();return pc(t,gt,e)}function pc(e,t,n){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=n;var s=e.baseQueue,c=l.pending;if(c!==null){if(s!==null){var h=s.next;s.next=c.next,c.next=h}t.baseQueue=s=c,l.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var g=h=null,S=null,M=t,Y=!1;do{var F=M.lane&-536870913;if(F!==M.lane?($e&F)===F:(Ol&F)===F){var _=M.revertLane;if(_===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),F===yi&&(Y=!0);else if((Ol&_)===_){M=M.next,_===yi&&(Y=!0);continue}else F={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(g=S=F,h=c):S=S.next=F,Ye.lanes|=_,ga|=_;F=M.action,Za&&n(c,F),c=M.hasEagerState?M.eagerState:n(c,F)}else _={lane:F,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(g=S=_,h=c):S=S.next=_,Ye.lanes|=F,ga|=F;M=M.next}while(M!==null&&M!==t);if(S===null?h=c:S.next=g,!Un(c,e.memoizedState)&&(It=!0,Y&&(n=vi,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=S,l.lastRenderedState=c}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function gc(e){var t=Yt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var l=n.dispatch,s=n.pending,c=t.memoizedState;if(s!==null){n.pending=null;var h=s=s.next;do c=e(c,h.action),h=h.next;while(h!==s);Un(c,t.memoizedState)||(It=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,l]}function df(e,t,n){var l=Ye,s=Yt(),c=nt;if(c){if(n===void 0)throw Error(o(407));n=n()}else n=t();var h=!Un((gt||s).memoizedState,n);if(h&&(s.memoizedState=n,It=!0),s=s.queue,vc(mf.bind(null,l,s,e),[e]),s.getSnapshot!==t||h||Xt!==null&&Xt.memoizedState.tag&1){if(l.flags|=2048,Ai(9,{destroy:void 0},hf.bind(null,l,s,n,t),null),wt===null)throw Error(o(349));c||(Ol&127)!==0||ff(l,t,n)}return n}function ff(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t=Ts(),Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hf(e,t,n,l){t.value=n,t.getSnapshot=l,pf(t)&&gf(e)}function mf(e,t,n){return n(function(){pf(t)&&gf(e)})}function pf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Un(e,n)}catch{return!0}}function gf(e){var t=Ha(e,2);t!==null&&Rn(t,e,2)}function bc(e){var t=vn();if(typeof e=="function"){var n=e;if(e=n(),Za){Dt(!0);try{n()}finally{Dt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:e},t}function bf(e,t,n,l){return e.baseState=n,pc(e,gt,typeof l=="function"?l:Ul)}function Vb(e,t,n,l,s){if(Rs(e))throw Error(o(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};L.T!==null?n(!0):c.isTransition=!1,l(c),n=t.pending,n===null?(c.next=t.pending=c,yf(t,c)):(c.next=n.next,t.pending=n.next=c)}}function yf(e,t){var n=t.action,l=t.payload,s=e.state;if(t.isTransition){var c=L.T,h={};L.T=h;try{var g=n(s,l),S=L.S;S!==null&&S(h,g),vf(e,t,g)}catch(M){yc(e,t,M)}finally{c!==null&&h.types!==null&&(c.types=h.types),L.T=c}}else try{c=n(s,l),vf(e,t,c)}catch(M){yc(e,t,M)}}function vf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){xf(e,t,l)},function(l){return yc(e,t,l)}):xf(e,t,n)}function xf(e,t,n){t.status="fulfilled",t.value=n,wf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,yf(e,n)))}function yc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,wf(t),t=t.next;while(t!==l)}e.action=null}function wf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Sf(e,t){return t}function Cf(e,t){if(nt){var n=wt.formState;if(n!==null){e:{var l=Ye;if(nt){if(Tt){t:{for(var s=Tt,c=Wn;s.nodeType!==8;){if(!c){s=null;break t}if(s=$n(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Tt=$n(s.nextSibling),l=s.data==="F!";break e}}sa(l)}l=!1}l&&(t=n[0])}}return n=vn(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sf,lastRenderedState:t},n.queue=l,n=Gf.bind(null,Ye,l),l.dispatch=n,l=bc(!1),c=Tc.bind(null,Ye,!1,l.queue),l=vn(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,n=Vb.bind(null,Ye,s,c,n),s.dispatch=n,l.memoizedState=e,[t,n,!1]}function Tf(e){var t=Yt();return Af(t,gt,e)}function Af(e,t,n){if(t=pc(e,t,Sf)[0],e=Ns(Ul)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=hr(t)}catch(h){throw h===xi?gs:h}else l=t;t=Yt();var s=t.queue,c=s.dispatch;return n!==t.memoizedState&&(Ye.flags|=2048,Ai(9,{destroy:void 0},Xb.bind(null,s,n),null)),[l,c,e]}function Xb(e,t){e.action=t}function Nf(e){var t=Yt(),n=gt;if(n!==null)return Af(t,n,e);Yt(),t=t.memoizedState,n=Yt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Ai(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ye.updateQueue,t===null&&(t=Ts(),Ye.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Ef(){return Yt().memoizedState}function Es(e,t,n,l){var s=vn();Ye.flags|=e,s.memoizedState=Ai(1|t,{destroy:void 0},n,l===void 0?null:l)}function ks(e,t,n,l){var s=Yt();l=l===void 0?null:l;var c=s.memoizedState.inst;gt!==null&&l!==null&&cc(l,gt.memoizedState.deps)?s.memoizedState=Ai(t,c,n,l):(Ye.flags|=e,s.memoizedState=Ai(1|t,c,n,l))}function kf(e,t){Es(8390656,8,e,t)}function vc(e,t){ks(2048,8,e,t)}function Ib(e){Ye.flags|=4;var t=Ye.updateQueue;if(t===null)t=Ts(),Ye.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Rf(e){var t=Yt().memoizedState;return Ib({ref:t,nextImpl:e}),function(){if((ct&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function jf(e,t){return ks(4,2,e,t)}function Mf(e,t){return ks(4,4,e,t)}function _f(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Lf(e,t,n){n=n!=null?n.concat([e]):null,ks(4,4,_f.bind(null,t,e),n)}function xc(){}function zf(e,t){var n=Yt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&cc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Df(e,t){var n=Yt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&cc(t,l[1]))return l[0];if(l=e(),Za){Dt(!0);try{e()}finally{Dt(!1)}}return n.memoizedState=[l,t],l}function wc(e,t,n){return n===void 0||(Ol&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Oh(),Ye.lanes|=e,ga|=e,n)}function Of(e,t,n,l){return Un(n,t)?n:Si.current!==null?(e=wc(e,n,l),Un(e,t)||(It=!0),e):(Ol&42)===0||(Ol&1073741824)!==0&&($e&261930)===0?(It=!0,e.memoizedState=n):(e=Oh(),Ye.lanes|=e,ga|=e,t)}function Uf(e,t,n,l,s){var c=V.p;V.p=c!==0&&8>c?c:8;var h=L.T,g={};L.T=g,Tc(e,!1,t,n);try{var S=s(),M=L.S;if(M!==null&&M(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var Y=Gb(S,l);mr(e,t,Y,qn(e))}else mr(e,t,l,qn(e))}catch(F){mr(e,t,{then:function(){},status:"rejected",reason:F},qn())}finally{V.p=c,h!==null&&g.types!==null&&(h.types=g.types),L.T=h}}function Zb(){}function Sc(e,t,n,l){if(e.tag!==5)throw Error(o(476));var s=Bf(e).queue;Uf(e,s,t,$,n===null?Zb:function(){return Hf(e),n(l)})}function Bf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:$},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hf(e){var t=Bf(e);t.next===null&&(t=e.alternate.memoizedState),mr(e,t.next.queue,{},qn())}function Cc(){return on(Mr)}function Kf(){return Yt().memoizedState}function Yf(){return Yt().memoizedState}function Qb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=qn();e=ua(n);var l=da(t,e,n);l!==null&&(Rn(l,t,n),cr(l,t,n)),t={cache:Jo()},e.payload=t;return}t=t.return}}function Pb(e,t,n){var l=qn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?qf(t,n):(n=Yo(e,t,n,l),n!==null&&(Rn(n,e,l),Ff(n,t,l)))}function Gf(e,t,n){var l=qn();mr(e,t,n,l)}function mr(e,t,n,l){var s={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))qf(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,g=c(h,n);if(s.hasEagerState=!0,s.eagerState=g,Un(g,h))return cs(e,t,s,0),wt===null&&os(),!1}catch{}finally{}if(n=Yo(e,t,s,l),n!==null)return Rn(n,e,l),Ff(n,t,l),!0}return!1}function Tc(e,t,n,l){if(l={lane:2,revertLane:nu(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(o(479))}else t=Yo(e,n,l,2),t!==null&&Rn(t,e,2)}function Rs(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function qf(e,t){Ci=Ss=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ff(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,_a(e,n)}}var pr={readContext:on,use:As,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};pr.useEffectEvent=Ut;var Vf={readContext:on,use:As,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:on,useEffect:kf,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Es(4194308,4,_f.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Es(4194308,4,e,t)},useInsertionEffect:function(e,t){Es(4,2,e,t)},useMemo:function(e,t){var n=vn();t=t===void 0?null:t;var l=e();if(Za){Dt(!0);try{e()}finally{Dt(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=vn();if(n!==void 0){var s=n(t);if(Za){Dt(!0);try{n(t)}finally{Dt(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=Pb.bind(null,Ye,e),[l.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:function(e){e=bc(e);var t=e.queue,n=Gf.bind(null,Ye,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xc,useDeferredValue:function(e,t){var n=vn();return wc(n,e,t)},useTransition:function(){var e=bc(!1);return e=Uf.bind(null,Ye,e.queue,!0,!1),vn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ye,s=vn();if(nt){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),wt===null)throw Error(o(349));($e&127)!==0||ff(l,t,n)}s.memoizedState=n;var c={value:n,getSnapshot:t};return s.queue=c,kf(mf.bind(null,l,c,e),[e]),l.flags|=2048,Ai(9,{destroy:void 0},hf.bind(null,l,c,n,t),null),n},useId:function(){var e=vn(),t=wt.identifierPrefix;if(nt){var n=xl,l=vl;n=(l&~(1<<32-ut(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Cs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=qb++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Cc,useFormState:Cf,useActionState:Cf,useOptimistic:function(e){var t=vn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Tc.bind(null,Ye,!0,n),n.dispatch=t,[e,t]},useMemoCache:mc,useCacheRefresh:function(){return vn().memoizedState=Qb.bind(null,Ye)},useEffectEvent:function(e){var t=vn(),n={impl:e};return t.memoizedState=n,function(){if((ct&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Ac={readContext:on,use:As,useCallback:zf,useContext:on,useEffect:vc,useImperativeHandle:Lf,useInsertionEffect:jf,useLayoutEffect:Mf,useMemo:Df,useReducer:Ns,useRef:Ef,useState:function(){return Ns(Ul)},useDebugValue:xc,useDeferredValue:function(e,t){var n=Yt();return Of(n,gt.memoizedState,e,t)},useTransition:function(){var e=Ns(Ul)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:hr(e),t]},useSyncExternalStore:df,useId:Kf,useHostTransitionStatus:Cc,useFormState:Tf,useActionState:Tf,useOptimistic:function(e,t){var n=Yt();return bf(n,gt,e,t)},useMemoCache:mc,useCacheRefresh:Yf};Ac.useEffectEvent=Rf;var Xf={readContext:on,use:As,useCallback:zf,useContext:on,useEffect:vc,useImperativeHandle:Lf,useInsertionEffect:jf,useLayoutEffect:Mf,useMemo:Df,useReducer:gc,useRef:Ef,useState:function(){return gc(Ul)},useDebugValue:xc,useDeferredValue:function(e,t){var n=Yt();return gt===null?wc(n,e,t):Of(n,gt.memoizedState,e,t)},useTransition:function(){var e=gc(Ul)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:hr(e),t]},useSyncExternalStore:df,useId:Kf,useHostTransitionStatus:Cc,useFormState:Nf,useActionState:Nf,useOptimistic:function(e,t){var n=Yt();return gt!==null?bf(n,gt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:mc,useCacheRefresh:Yf};Xf.useEffectEvent=Rf;function Nc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ec={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=qn(),s=ua(l);s.payload=t,n!=null&&(s.callback=n),t=da(e,s,l),t!==null&&(Rn(t,e,l),cr(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=qn(),s=ua(l);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=da(e,s,l),t!==null&&(Rn(t,e,l),cr(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qn(),l=ua(n);l.tag=2,t!=null&&(l.callback=t),t=da(e,l,n),t!==null&&(Rn(t,e,n),cr(t,e,n))}};function If(e,t,n,l,s,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,h):t.prototype&&t.prototype.isPureReactComponent?!tr(n,l)||!tr(s,c):!0}function Zf(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Ec.enqueueReplaceState(t,t.state,null)}function Qa(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=w({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function Qf(e){ss(e)}function Pf(e){console.error(e)}function Wf(e){ss(e)}function js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Jf(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function kc(e,t,n){return n=ua(n),n.tag=3,n.payload={element:null},n.callback=function(){js(e,t)},n}function $f(e){return e=ua(e),e.tag=3,e}function eh(e,t,n,l){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var c=l.value;e.payload=function(){return s(c)},e.callback=function(){Jf(t,n,l)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){Jf(t,n,l),typeof s!="function"&&(ba===null?ba=new Set([this]):ba.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function Wb(e,t,n,l,s){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&bi(t,n,s,!0),n=Hn.current,n!==null){switch(n.tag){case 31:case 13:return Jn===null?Gs():n.alternate===null&&Bt===0&&(Bt=3),n.flags&=-257,n.flags|=65536,n.lanes=s,l===bs?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),$c(e,l,s)),!1;case 22:return n.flags|=65536,l===bs?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),$c(e,l,s)),!1}throw Error(o(435,n.tag))}return $c(e,l,s),Gs(),!1}if(nt)return t=Hn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==Io&&(e=Error(o(422),{cause:l}),ar(Zn(e,n)))):(l!==Io&&(t=Error(o(423),{cause:l}),ar(Zn(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=Zn(l,n),s=kc(e.stateNode,l,s),ac(e,s),Bt!==4&&(Bt=2)),!1;var c=Error(o(520),{cause:l});if(c=Zn(c,n),Cr===null?Cr=[c]:Cr.push(c),Bt!==4&&(Bt=2),t===null)return!0;l=Zn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=kc(n.stateNode,l,e),ac(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ba===null||!ba.has(c))))return n.flags|=65536,s&=-s,n.lanes|=s,s=$f(s),eh(s,e,n,l),ac(n,s),!1}n=n.return}while(n!==null);return!1}var Rc=Error(o(461)),It=!1;function cn(e,t,n,l){t.child=e===null?lf(t,null,n,l):Ia(t,e.child,n,l)}function th(e,t,n,l,s){n=n.render;var c=t.ref;if("ref"in l){var h={};for(var g in l)g!=="ref"&&(h[g]=l[g])}else h=l;return qa(t),l=uc(e,t,n,h,c,s),g=dc(),e!==null&&!It?(fc(e,t,s),Bl(e,t,s)):(nt&&g&&Vo(t),t.flags|=1,cn(e,t,l,s),t.child)}function nh(e,t,n,l,s){if(e===null){var c=n.type;return typeof c=="function"&&!Go(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,lh(e,t,c,l,s)):(e=ds(n.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Uc(e,s)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:tr,n(h,l)&&e.ref===t.ref)return Bl(e,t,s)}return t.flags|=1,e=_l(c,l),e.ref=t.ref,e.return=t,t.child=e}function lh(e,t,n,l,s){if(e!==null){var c=e.memoizedProps;if(tr(c,l)&&e.ref===t.ref)if(It=!1,t.pendingProps=l=c,Uc(e,s))(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,Bl(e,t,s)}return jc(e,t,n,l,s)}function ah(e,t,n,l){var s=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~c}else l=0,t.child=null;return ih(e,t,c,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ps(t,c!==null?c.cachePool:null),c!==null?sf(t,c):rc(),of(t);else return l=t.lanes=536870912,ih(e,t,c!==null?c.baseLanes|n:n,n,l)}else c!==null?(ps(t,c.cachePool),sf(t,c),ha(),t.memoizedState=null):(e!==null&&ps(t,null),rc(),ha());return cn(e,t,s,n),t.child}function gr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ih(e,t,n,l,s){var c=ec();return c=c===null?null:{parent:Vt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&ps(t,null),rc(),of(t),e!==null&&bi(e,t,l,!0),t.childLanes=s,null}function Ms(e,t){return t=Ls({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function rh(e,t,n){return Ia(t,e.child,null,n),e=Ms(t,t.pendingProps),e.flags|=2,Kn(t),t.memoizedState=null,e}function Jb(e,t,n){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(l.mode==="hidden")return e=Ms(t,l),t.lanes=536870912,gr(null,e);if(oc(t),(e=Tt)?(e=ym(e,Wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ia!==null?{id:vl,overflow:xl}:null,retryLane:536870912,hydrationErrors:null},n=Gd(e),n.return=t,t.child=n,sn=t,Tt=null)):e=null,e===null)throw sa(t);return t.lanes=536870912,null}return Ms(t,l)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(oc(t),s)if(t.flags&256)t.flags&=-257,t=rh(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(It||bi(e,t,n,!1),s=(n&e.childLanes)!==0,It||s){if(l=wt,l!==null&&(h=La(l,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,Ha(e,h),Rn(l,e,h),Rc;Gs(),t=rh(e,t,n)}else e=c.treeContext,Tt=$n(h.nextSibling),sn=t,nt=!0,ra=null,Wn=!1,e!==null&&Vd(t,e),t=Ms(t,l),t.flags|=4096;return t}return e=_l(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _s(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function jc(e,t,n,l,s){return qa(t),n=uc(e,t,n,l,void 0,s),l=dc(),e!==null&&!It?(fc(e,t,s),Bl(e,t,s)):(nt&&l&&Vo(t),t.flags|=1,cn(e,t,n,s),t.child)}function sh(e,t,n,l,s,c){return qa(t),t.updateQueue=null,n=uf(t,l,n,s),cf(e),l=dc(),e!==null&&!It?(fc(e,t,c),Bl(e,t,c)):(nt&&l&&Vo(t),t.flags|=1,cn(e,t,n,c),t.child)}function oh(e,t,n,l,s){if(qa(t),t.stateNode===null){var c=hi,h=n.contextType;typeof h=="object"&&h!==null&&(c=on(h)),c=new n(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ec,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},nc(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?on(h):hi,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Nc(t,n,h,l),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&Ec.enqueueReplaceState(c,c.state,null),dr(t,l,c,s),ur(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var g=t.memoizedProps,S=Qa(n,g);c.props=S;var M=c.context,Y=n.contextType;h=hi,typeof Y=="object"&&Y!==null&&(h=on(Y));var F=n.getDerivedStateFromProps;Y=typeof F=="function"||typeof c.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,Y||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(g||M!==h)&&Zf(t,c,l,h),ca=!1;var _=t.memoizedState;c.state=_,dr(t,l,c,s),ur(),M=t.memoizedState,g||_!==M||ca?(typeof F=="function"&&(Nc(t,n,F,l),M=t.memoizedState),(S=ca||If(t,n,S,l,_,M,h))?(Y||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=M),c.props=l,c.state=M,c.context=h,l=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,lc(e,t),h=t.memoizedProps,Y=Qa(n,h),c.props=Y,F=t.pendingProps,_=c.context,M=n.contextType,S=hi,typeof M=="object"&&M!==null&&(S=on(M)),g=n.getDerivedStateFromProps,(M=typeof g=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==F||_!==S)&&Zf(t,c,l,S),ca=!1,_=t.memoizedState,c.state=_,dr(t,l,c,s),ur();var O=t.memoizedState;h!==F||_!==O||ca||e!==null&&e.dependencies!==null&&hs(e.dependencies)?(typeof g=="function"&&(Nc(t,n,g,l),O=t.memoizedState),(Y=ca||If(t,n,Y,l,_,O,S)||e!==null&&e.dependencies!==null&&hs(e.dependencies))?(M||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,O,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,O,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=O),c.props=l,c.state=O,c.context=S,l=Y):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,_s(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=Ia(t,e.child,null,s),t.child=Ia(t,null,n,s)):cn(e,t,n,s),t.memoizedState=c.state,e=t.child):e=Bl(e,t,s),e}function ch(e,t,n,l){return Ya(),t.flags|=256,cn(e,t,n,l),t.child}var Mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:Wd()}}function Lc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Gn),e}function uh(e,t,n){var l=t.pendingProps,s=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Kt.current&2)!==0),h&&(s=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(s?fa(t):ha(),(e=Tt)?(e=ym(e,Wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ia!==null?{id:vl,overflow:xl}:null,retryLane:536870912,hydrationErrors:null},n=Gd(e),n.return=t,t.child=n,sn=t,Tt=null)):e=null,e===null)throw sa(t);return pu(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,s?(ha(),s=t.mode,g=Ls({mode:"hidden",children:g},s),l=Ka(l,s,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=_c(n),l.childLanes=Lc(e,h,n),t.memoizedState=Mc,gr(null,l)):(fa(t),zc(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(c)t.flags&256?(fa(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState!==null?(ha(),t.child=e.child,t.flags|=128,t=null):(ha(),g=l.fallback,s=t.mode,l=Ls({mode:"visible",children:l.children},s),g=Ka(g,s,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,Ia(t,e.child,null,n),l=t.child,l.memoizedState=_c(n),l.childLanes=Lc(e,h,n),t.memoizedState=Mc,t=gr(null,l));else if(fa(t),pu(g)){if(h=g.nextSibling&&g.nextSibling.dataset,h)var M=h.dgst;h=M,l=Error(o(419)),l.stack="",l.digest=h,ar({value:l,source:null,stack:null}),t=Dc(e,t,n)}else if(It||bi(e,t,n,!1),h=(n&e.childLanes)!==0,It||h){if(h=wt,h!==null&&(l=La(h,n),l!==0&&l!==S.retryLane))throw S.retryLane=l,Ha(e,l),Rn(h,e,l),Rc;mu(g)||Gs(),t=Dc(e,t,n)}else mu(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Tt=$n(g.nextSibling),sn=t,nt=!0,ra=null,Wn=!1,e!==null&&Vd(t,e),t=zc(t,l.children),t.flags|=4096);return t}return s?(ha(),g=l.fallback,s=t.mode,S=e.child,M=S.sibling,l=_l(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&65011712,M!==null?g=_l(M,g):(g=Ka(g,s,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,gr(null,l),l=t.child,g=e.child.memoizedState,g===null?g=_c(n):(s=g.cachePool,s!==null?(S=Vt._currentValue,s=s.parent!==S?{parent:S,pool:S}:s):s=Wd(),g={baseLanes:g.baseLanes|n,cachePool:s}),l.memoizedState=g,l.childLanes=Lc(e,h,n),t.memoizedState=Mc,gr(e.child,l)):(fa(t),n=e.child,e=n.sibling,n=_l(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function zc(e,t){return t=Ls({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ls(e,t){return e=Bn(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ia(t,e.child,null,n),e=zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dh(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Po(e.return,t,n)}function Oc(e,t,n,l,s,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:s,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=n,h.tailMode=s,h.treeForkCount=c)}function fh(e,t,n){var l=t.pendingProps,s=l.revealOrder,c=l.tail;l=l.children;var h=Kt.current,g=(h&2)!==0;if(g?(h=h&1|2,t.flags|=128):h&=1,_e(Kt,h),cn(e,t,l,n),l=nt?lr:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dh(e,n,t);else if(e.tag===19)dh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ws(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Oc(t,!1,s,n,c,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ws(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Oc(t,!0,n,null,c,l);break;case"together":Oc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Bl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ga|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(bi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=_l(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_l(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&hs(e)))}function $b(e,t,n){switch(t.tag){case 3:ft(t,t.stateNode.containerInfo),oa(t,Vt,e.memoizedState.cache),Ya();break;case 27:case 5:Me(t);break;case 4:ft(t,t.stateNode.containerInfo);break;case 10:oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(fa(t),t.flags|=128,null):(n&t.child.childLanes)!==0?uh(e,t,n):(fa(t),e=Bl(e,t,n),e!==null?e.sibling:null);fa(t);break;case 19:var s=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(bi(e,t,n,!1),l=(n&t.childLanes)!==0),s){if(l)return fh(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),_e(Kt,Kt.current),l)break;return null;case 22:return t.lanes=0,ah(e,t,n,t.pendingProps);case 24:oa(t,Vt,e.memoizedState.cache)}return Bl(e,t,n)}function hh(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)It=!0;else{if(!Uc(e,n)&&(t.flags&128)===0)return It=!1,$b(e,t,n);It=(e.flags&131072)!==0}else It=!1,nt&&(t.flags&1048576)!==0&&Fd(t,lr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Va(t.elementType),t.type=e,typeof e=="function")Go(e)?(l=Qa(e,l),t.tag=1,t=oh(null,t,e,l,n)):(t.tag=0,t=jc(null,t,e,l,n));else{if(e!=null){var s=e.$$typeof;if(s===ae){t.tag=11,t=th(null,t,e,l,n);break e}else if(s===G){t.tag=14,t=nh(null,t,e,l,n);break e}}throw t=ke(e)||e,Error(o(306,t,""))}}return t;case 0:return jc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,s=Qa(l,t.pendingProps),oh(e,t,l,s,n);case 3:e:{if(ft(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var c=t.memoizedState;s=c.element,lc(e,t),dr(t,l,null,n);var h=t.memoizedState;if(l=h.cache,oa(t,Vt,l),l!==c.cache&&Wo(t,[Vt],n,!0),ur(),l=h.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=ch(e,t,l,n);break e}else if(l!==s){s=Zn(Error(o(424)),t),ar(s),t=ch(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Tt=$n(e.firstChild),sn=t,nt=!0,ra=null,Wn=!0,n=lf(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ya(),l===s){t=Bl(e,t,n);break e}cn(e,t,l,n)}t=t.child}return t;case 26:return _s(e,t),e===null?(n=Tm(t.type,null,t.pendingProps,null))?t.memoizedState=n:nt||(n=t.type,e=t.pendingProps,l=Qs(Se.current).createElement(n),l[Ht]=t,l[$t]=e,un(l,n,e),rt(l),t.stateNode=l):t.memoizedState=Tm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Me(t),e===null&&nt&&(l=t.stateNode=wm(t.type,t.pendingProps,Se.current),sn=t,Wn=!0,s=Tt,wa(t.type)?(gu=s,Tt=$n(l.firstChild)):Tt=s),cn(e,t,t.pendingProps.children,n),_s(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((s=l=Tt)&&(l=Ry(l,t.type,t.pendingProps,Wn),l!==null?(t.stateNode=l,sn=t,Tt=$n(l.firstChild),Wn=!1,s=!0):s=!1),s||sa(t)),Me(t),s=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,l=c.children,du(s,c)?l=null:h!==null&&du(s,h)&&(t.flags|=32),t.memoizedState!==null&&(s=uc(e,t,Fb,null,null,n),Mr._currentValue=s),_s(e,t),cn(e,t,l,n),t.child;case 6:return e===null&&nt&&((e=n=Tt)&&(n=jy(n,t.pendingProps,Wn),n!==null?(t.stateNode=n,sn=t,Tt=null,e=!0):e=!1),e||sa(t)),null;case 13:return uh(e,t,n);case 4:return ft(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Ia(t,null,l,n):cn(e,t,l,n),t.child;case 11:return th(e,t,t.type,t.pendingProps,n);case 7:return cn(e,t,t.pendingProps,n),t.child;case 8:return cn(e,t,t.pendingProps.children,n),t.child;case 12:return cn(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,oa(t,t.type,l.value),cn(e,t,l.children,n),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,qa(t),s=on(s),l=l(s),t.flags|=1,cn(e,t,l,n),t.child;case 14:return nh(e,t,t.type,t.pendingProps,n);case 15:return lh(e,t,t.type,t.pendingProps,n);case 19:return fh(e,t,n);case 31:return Jb(e,t,n);case 22:return ah(e,t,n,t.pendingProps);case 24:return qa(t),l=on(Vt),e===null?(s=ec(),s===null&&(s=wt,c=Jo(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=n),s=c),t.memoizedState={parent:l,cache:s},nc(t),oa(t,Vt,s)):((e.lanes&n)!==0&&(lc(e,t),dr(t,null,null,n),ur()),s=e.memoizedState,c=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),oa(t,Vt,l)):(l=c.cache,oa(t,Vt,l),l!==s.cache&&Wo(t,[Vt],n,!0))),cn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Hl(e){e.flags|=4}function Bc(e,t,n,l,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Kh())e.flags|=8192;else throw Xa=bs,tc}else e.flags&=-16777217}function mh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Rm(t))if(Kh())e.flags|=8192;else throw Xa=bs,tc}function zs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_n():536870912,e.lanes|=t,Ri|=t)}function br(e,t){if(!nt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function At(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags&65011712,l|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function ey(e,t,n){var l=t.pendingProps;switch(Xo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(t),null;case 1:return At(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Dl(Vt),B(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(gi(t)?Hl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zo())),At(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(Hl(t),c!==null?(At(t),mh(t,c)):(At(t),Bc(t,s,null,l,n))):c?c!==e.memoizedState?(Hl(t),At(t),mh(t,c)):(At(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Hl(t),At(t),Bc(t,s,e,l,n)),null;case 27:if(E(t),n=Se.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Hl(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return At(t),null}e=Ze.current,gi(t)?Xd(t):(e=wm(s,l,n),t.stateNode=e,Hl(t))}return At(t),null;case 5:if(E(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Hl(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return At(t),null}if(c=Ze.current,gi(t))Xd(t);else{var h=Qs(Se.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?h.createElement(s,{is:l.is}):h.createElement(s)}}c[Ht]=t,c[$t]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(un(c,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Hl(t)}}return At(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Hl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=Se.current,gi(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,s=sn,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[Ht]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||um(e.nodeValue,n)),e||sa(t,!0)}else e=Qs(e).createTextNode(l),e[Ht]=t,t.stateNode=e}return At(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=gi(t),n!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Ht]=t}else Ya(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),e=!1}else n=Zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Kn(t),t):(Kn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return At(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=gi(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[Ht]=t}else Ya(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;At(t),s=!1}else s=Zo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Kn(t),t):(Kn(t),null)}return Kn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==s&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zs(t,t.updateQueue),At(t),null);case 4:return B(),e===null&&ru(t.stateNode.containerInfo),At(t),null;case 10:return Dl(t.type),At(t),null;case 19:if(Qe(Kt),l=t.memoizedState,l===null)return At(t),null;if(s=(t.flags&128)!==0,c=l.rendering,c===null)if(s)br(l,!1);else{if(Bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=ws(e),c!==null){for(t.flags|=128,br(l,!1),e=c.updateQueue,t.updateQueue=e,zs(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Yd(n,e),n=n.sibling;return _e(Kt,Kt.current&1|2),nt&&Ll(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&de()>Hs&&(t.flags|=128,s=!0,br(l,!1),t.lanes=4194304)}else{if(!s)if(e=ws(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,zs(t,e),br(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!nt)return At(t),null}else 2*de()-l.renderingStartTime>Hs&&n!==536870912&&(t.flags|=128,s=!0,br(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=de(),e.sibling=null,n=Kt.current,_e(Kt,s?n&1|2:n&1),nt&&Ll(t,l.treeForkCount),e):(At(t),null);case 22:case 23:return Kn(t),sc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),n=t.updateQueue,n!==null&&zs(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&Qe(Fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Dl(Vt),At(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function ty(e,t){switch(Xo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dl(Vt),B(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return E(t),null;case 31:if(t.memoizedState!==null){if(Kn(t),t.alternate===null)throw Error(o(340));Ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Kn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qe(Kt),null;case 4:return B(),null;case 10:return Dl(t.type),null;case 22:case 23:return Kn(t),sc(),e!==null&&Qe(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dl(Vt),null;case 25:return null;default:return null}}function ph(e,t){switch(Xo(t),t.tag){case 3:Dl(Vt),B();break;case 26:case 27:case 5:E(t);break;case 4:B();break;case 31:t.memoizedState!==null&&Kn(t);break;case 13:Kn(t);break;case 19:Qe(Kt);break;case 10:Dl(t.type);break;case 22:case 23:Kn(t),sc(),e!==null&&Qe(Fa);break;case 24:Dl(Vt)}}function yr(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var s=l.next;n=s;do{if((n.tag&e)===e){l=void 0;var c=n.create,h=n.inst;l=c(),h.destroy=l}n=n.next}while(n!==s)}}catch(g){pt(t,t.return,g)}}function ma(e,t,n){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var c=s.next;l=c;do{if((l.tag&e)===e){var h=l.inst,g=h.destroy;if(g!==void 0){h.destroy=void 0,s=t;var S=n,M=g;try{M()}catch(Y){pt(s,S,Y)}}}l=l.next}while(l!==c)}}catch(Y){pt(t,t.return,Y)}}function gh(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{rf(t,n)}catch(l){pt(e,e.return,l)}}}function bh(e,t,n){n.props=Qa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){pt(e,t,l)}}function vr(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(s){pt(e,t,s)}}function wl(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(s){pt(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){pt(e,t,s)}else n.current=null}function yh(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(s){pt(e,e.return,s)}}function Hc(e,t,n){try{var l=e.stateNode;Cy(l,e.type,n,t),l[$t]=t}catch(s){pt(e,e.return,s)}}function vh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wa(e.type)||e.tag===4}function Kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tn));else if(l!==4&&(l===27&&wa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Ds(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&wa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ds(e,t,n),e=e.sibling;e!==null;)Ds(e,t,n),e=e.sibling}function xh(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);un(t,l,n),t[Ht]=e,t[$t]=n}catch(c){pt(e,e.return,c)}}var Kl=!1,Zt=!1,Gc=!1,wh=typeof WeakSet=="function"?WeakSet:Set,ln=null;function ny(e,t){if(e=e.containerInfo,cu=no,e=_d(e),Do(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var s=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{n.nodeType,c.nodeType}catch{n=null;break e}var h=0,g=-1,S=-1,M=0,Y=0,F=e,_=null;t:for(;;){for(var O;F!==n||s!==0&&F.nodeType!==3||(g=h+s),F!==c||l!==0&&F.nodeType!==3||(S=h+l),F.nodeType===3&&(h+=F.nodeValue.length),(O=F.firstChild)!==null;)_=F,F=O;for(;;){if(F===e)break t;if(_===n&&++M===s&&(g=h),_===c&&++Y===l&&(S=h),(O=F.nextSibling)!==null)break;F=_,_=F.parentNode}F=O}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(uu={focusedElem:e,selectionRange:n},no=!1,ln=t;ln!==null;)if(t=ln,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ln=e;else for(;ln!==null;){switch(t=ln,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,n=t,s=c.memoizedProps,c=c.memoizedState,l=n.stateNode;try{var ge=Qa(n.type,s);e=l.getSnapshotBeforeUpdate(ge,c),l.__reactInternalSnapshotBeforeUpdate=e}catch(Re){pt(n,n.return,Re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)hu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,ln=e;break}ln=t.return}}function Sh(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Gl(e,n),l&4&&yr(5,n);break;case 1:if(Gl(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){pt(n,n.return,h)}else{var s=Qa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){pt(n,n.return,h)}}l&64&&gh(n),l&512&&vr(n,n.return);break;case 3:if(Gl(e,n),l&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{rf(e,t)}catch(h){pt(n,n.return,h)}}break;case 27:t===null&&l&4&&xh(n);case 26:case 5:Gl(e,n),t===null&&l&4&&yh(n),l&512&&vr(n,n.return);break;case 12:Gl(e,n);break;case 31:Gl(e,n),l&4&&Ah(e,n);break;case 13:Gl(e,n),l&4&&Nh(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=dy.bind(null,n),My(e,n))));break;case 22:if(l=n.memoizedState!==null||Kl,!l){t=t!==null&&t.memoizedState!==null||Zt,s=Kl;var c=Zt;Kl=l,(Zt=t)&&!c?ql(e,n,(n.subtreeFlags&8772)!==0):Gl(e,n),Kl=s,Zt=c}break;case 30:break;default:Gl(e,n)}}function Ch(e){var t=e.alternate;t!==null&&(e.alternate=null,Ch(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ie(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _t=null,An=!1;function Yl(e,t,n){for(n=n.child;n!==null;)Th(e,t,n),n=n.sibling}function Th(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(tt,n)}catch{}switch(n.tag){case 26:Zt||wl(n,t),Yl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Zt||wl(n,t);var l=_t,s=An;wa(n.type)&&(_t=n.stateNode,An=!1),Yl(e,t,n),kr(n.stateNode),_t=l,An=s;break;case 5:Zt||wl(n,t);case 6:if(l=_t,s=An,_t=null,Yl(e,t,n),_t=l,An=s,_t!==null)if(An)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(n.stateNode)}catch(c){pt(n,t,c)}else try{_t.removeChild(n.stateNode)}catch(c){pt(n,t,c)}break;case 18:_t!==null&&(An?(e=_t,gm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ui(e)):gm(_t,n.stateNode));break;case 4:l=_t,s=An,_t=n.stateNode.containerInfo,An=!0,Yl(e,t,n),_t=l,An=s;break;case 0:case 11:case 14:case 15:ma(2,n,t),Zt||ma(4,n,t),Yl(e,t,n);break;case 1:Zt||(wl(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&bh(n,t,l)),Yl(e,t,n);break;case 21:Yl(e,t,n);break;case 22:Zt=(l=Zt)||n.memoizedState!==null,Yl(e,t,n),Zt=l;break;default:Yl(e,t,n)}}function Ah(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ui(e)}catch(n){pt(t,t.return,n)}}}function Nh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ui(e)}catch(n){pt(t,t.return,n)}}function ly(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new wh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new wh),t;default:throw Error(o(435,e.tag))}}function Os(e,t){var n=ly(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var s=fy.bind(null,e,l);l.then(s,s)}})}function Nn(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var s=n[l],c=e,h=t,g=h;e:for(;g!==null;){switch(g.tag){case 27:if(wa(g.type)){_t=g.stateNode,An=!1;break e}break;case 5:_t=g.stateNode,An=!1;break e;case 3:case 4:_t=g.stateNode.containerInfo,An=!0;break e}g=g.return}if(_t===null)throw Error(o(160));Th(c,h,s),_t=null,An=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eh(t,e),t=t.sibling}var cl=null;function Eh(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nn(t,e),En(e),l&4&&(ma(3,e,e.return),yr(3,e),ma(5,e,e.return));break;case 1:Nn(t,e),En(e),l&512&&(Zt||n===null||wl(n,n.return)),l&64&&Kl&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var s=cl;if(Nn(t,e),En(e),l&512&&(Zt||n===null||wl(n,n.return)),l&4){var c=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(l){case"title":c=s.getElementsByTagName("title")[0],(!c||c[H]||c[Ht]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(l),s.head.insertBefore(c,s.querySelector("head > title"))),un(c,l,n),c[Ht]=e,rt(c),l=c;break e;case"link":var h=Em("link","href",s).get(l+(n.href||""));if(h){for(var g=0;g<h.length;g++)if(c=h[g],c.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&c.getAttribute("rel")===(n.rel==null?null:n.rel)&&c.getAttribute("title")===(n.title==null?null:n.title)&&c.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){h.splice(g,1);break t}}c=s.createElement(l),un(c,l,n),s.head.appendChild(c);break;case"meta":if(h=Em("meta","content",s).get(l+(n.content||""))){for(g=0;g<h.length;g++)if(c=h[g],c.getAttribute("content")===(n.content==null?null:""+n.content)&&c.getAttribute("name")===(n.name==null?null:n.name)&&c.getAttribute("property")===(n.property==null?null:n.property)&&c.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&c.getAttribute("charset")===(n.charSet==null?null:n.charSet)){h.splice(g,1);break t}}c=s.createElement(l),un(c,l,n),s.head.appendChild(c);break;default:throw Error(o(468,l))}c[Ht]=e,rt(c),l=c}e.stateNode=l}else km(s,e.type,e.stateNode);else e.stateNode=Nm(s,l,e.memoizedProps);else c!==l?(c===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):c.count--,l===null?km(s,e.type,e.stateNode):Nm(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps)}break;case 27:Nn(t,e),En(e),l&512&&(Zt||n===null||wl(n,n.return)),n!==null&&l&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Nn(t,e),En(e),l&512&&(Zt||n===null||wl(n,n.return)),e.flags&32){s=e.stateNode;try{ea(s,"")}catch(ge){pt(e,e.return,ge)}}l&4&&e.stateNode!=null&&(s=e.memoizedProps,Hc(e,s,n!==null?n.memoizedProps:s)),l&1024&&(Gc=!0);break;case 6:if(Nn(t,e),En(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(ge){pt(e,e.return,ge)}}break;case 3:if(Js=null,s=cl,cl=Ps(t.containerInfo),Nn(t,e),cl=s,En(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Ui(t.containerInfo)}catch(ge){pt(e,e.return,ge)}Gc&&(Gc=!1,kh(e));break;case 4:l=cl,cl=Ps(e.stateNode.containerInfo),Nn(t,e),En(e),cl=l;break;case 12:Nn(t,e),En(e);break;case 31:Nn(t,e),En(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Os(e,l)));break;case 13:Nn(t,e),En(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Bs=de()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Os(e,l)));break;case 22:s=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,M=Kl,Y=Zt;if(Kl=M||s,Zt=Y||S,Nn(t,e),Zt=Y,Kl=M,En(e),l&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||S||Kl||Zt||Pa(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(c=S.stateNode,s)h=c.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none";else{g=S.stateNode;var F=S.memoizedProps.style,_=F!=null&&F.hasOwnProperty("display")?F.display:null;g.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(ge){pt(S,S.return,ge)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=s?"":S.memoizedProps}catch(ge){pt(S,S.return,ge)}}}else if(t.tag===18){if(n===null){S=t;try{var O=S.stateNode;s?bm(O,!0):bm(S.stateNode,!1)}catch(ge){pt(S,S.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Os(e,n))));break;case 19:Nn(t,e),En(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Os(e,l)));break;case 30:break;case 21:break;default:Nn(t,e),En(e)}}function En(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(vh(l)){n=l;break}l=l.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var s=n.stateNode,c=Kc(e);Ds(e,c,s);break;case 5:var h=n.stateNode;n.flags&32&&(ea(h,""),n.flags&=-33);var g=Kc(e);Ds(e,g,h);break;case 3:case 4:var S=n.stateNode.containerInfo,M=Kc(e);Yc(e,M,S);break;default:throw Error(o(161))}}catch(Y){pt(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Sh(e,t.alternate,t),t=t.sibling}function Pa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ma(4,t,t.return),Pa(t);break;case 1:wl(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&bh(t,t.return,n),Pa(t);break;case 27:kr(t.stateNode);case 26:case 5:wl(t,t.return),Pa(t);break;case 22:t.memoizedState===null&&Pa(t);break;case 30:Pa(t);break;default:Pa(t)}e=e.sibling}}function ql(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,s=e,c=t,h=c.flags;switch(c.tag){case 0:case 11:case 15:ql(s,c,n),yr(4,c);break;case 1:if(ql(s,c,n),l=c,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(M){pt(l,l.return,M)}if(l=c,s=l.updateQueue,s!==null){var g=l.stateNode;try{var S=s.shared.hiddenCallbacks;if(S!==null)for(s.shared.hiddenCallbacks=null,s=0;s<S.length;s++)af(S[s],g)}catch(M){pt(l,l.return,M)}}n&&h&64&&gh(c),vr(c,c.return);break;case 27:xh(c);case 26:case 5:ql(s,c,n),n&&l===null&&h&4&&yh(c),vr(c,c.return);break;case 12:ql(s,c,n);break;case 31:ql(s,c,n),n&&h&4&&Ah(s,c);break;case 13:ql(s,c,n),n&&h&4&&Nh(s,c);break;case 22:c.memoizedState===null&&ql(s,c,n),vr(c,c.return);break;case 30:break;default:ql(s,c,n)}t=t.sibling}}function qc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ir(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ir(e))}function ul(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Rh(e,t,n,l),t=t.sibling}function Rh(e,t,n,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:ul(e,t,n,l),s&2048&&yr(9,t);break;case 1:ul(e,t,n,l);break;case 3:ul(e,t,n,l),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ir(e)));break;case 12:if(s&2048){ul(e,t,n,l),e=t.stateNode;try{var c=t.memoizedProps,h=c.id,g=c.onPostCommit;typeof g=="function"&&g(h,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){pt(t,t.return,S)}}else ul(e,t,n,l);break;case 31:ul(e,t,n,l);break;case 13:ul(e,t,n,l);break;case 23:break;case 22:c=t.stateNode,h=t.alternate,t.memoizedState!==null?c._visibility&2?ul(e,t,n,l):xr(e,t):c._visibility&2?ul(e,t,n,l):(c._visibility|=2,Ni(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&qc(h,t);break;case 24:ul(e,t,n,l),s&2048&&Fc(t.alternate,t);break;default:ul(e,t,n,l)}}function Ni(e,t,n,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,g=n,S=l,M=h.flags;switch(h.tag){case 0:case 11:case 15:Ni(c,h,g,S,s),yr(8,h);break;case 23:break;case 22:var Y=h.stateNode;h.memoizedState!==null?Y._visibility&2?Ni(c,h,g,S,s):xr(c,h):(Y._visibility|=2,Ni(c,h,g,S,s)),s&&M&2048&&qc(h.alternate,h);break;case 24:Ni(c,h,g,S,s),s&&M&2048&&Fc(h.alternate,h);break;default:Ni(c,h,g,S,s)}t=t.sibling}}function xr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,s=l.flags;switch(l.tag){case 22:xr(n,l),s&2048&&qc(l.alternate,l);break;case 24:xr(n,l),s&2048&&Fc(l.alternate,l);break;default:xr(n,l)}t=t.sibling}}var wr=8192;function Ei(e,t,n){if(e.subtreeFlags&wr)for(e=e.child;e!==null;)jh(e,t,n),e=e.sibling}function jh(e,t,n){switch(e.tag){case 26:Ei(e,t,n),e.flags&wr&&e.memoizedState!==null&&qy(n,cl,e.memoizedState,e.memoizedProps);break;case 5:Ei(e,t,n);break;case 3:case 4:var l=cl;cl=Ps(e.stateNode.containerInfo),Ei(e,t,n),cl=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=wr,wr=16777216,Ei(e,t,n),wr=l):Ei(e,t,n));break;default:Ei(e,t,n)}}function Mh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Sr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];ln=l,Lh(l,e)}Mh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_h(e),e=e.sibling}function _h(e){switch(e.tag){case 0:case 11:case 15:Sr(e),e.flags&2048&&ma(9,e,e.return);break;case 3:Sr(e);break;case 12:Sr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Us(e)):Sr(e);break;default:Sr(e)}}function Us(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];ln=l,Lh(l,e)}Mh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ma(8,t,t.return),Us(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Us(t));break;default:Us(t)}e=e.sibling}}function Lh(e,t){for(;ln!==null;){var n=ln;switch(n.tag){case 0:case 11:case 15:ma(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ir(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,ln=l;else e:for(n=e;ln!==null;){l=ln;var s=l.sibling,c=l.return;if(Ch(l),l===n){ln=null;break e}if(s!==null){s.return=c,ln=s;break e}ln=c}}}var ay={getCacheForType:function(e){var t=on(Vt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return on(Vt).controller.signal}},iy=typeof WeakMap=="function"?WeakMap:Map,ct=0,wt=null,Pe=null,$e=0,mt=0,Yn=null,pa=!1,ki=!1,Vc=!1,Fl=0,Bt=0,ga=0,Wa=0,Xc=0,Gn=0,Ri=0,Cr=null,kn=null,Ic=!1,Bs=0,zh=0,Hs=1/0,Ks=null,ba=null,Pt=0,ya=null,ji=null,Vl=0,Zc=0,Qc=null,Dh=null,Tr=0,Pc=null;function qn(){return(ct&2)!==0&&$e!==0?$e&-$e:L.T!==null?nu():zn()}function Oh(){if(Gn===0)if(($e&536870912)===0||nt){var e=an;an<<=1,(an&3932160)===0&&(an=262144),Gn=e}else Gn=536870912;return e=Hn.current,e!==null&&(e.flags|=32),Gn}function Rn(e,t,n){(e===wt&&(mt===2||mt===9)||e.cancelPendingCommit!==null)&&(Mi(e,0),va(e,$e,Gn,!1)),Ln(e,n),((ct&2)===0||e!==wt)&&(e===wt&&((ct&2)===0&&(Wa|=n),Bt===4&&va(e,$e,Gn,!1)),Sl(e))}function Uh(e,t,n){if((ct&6)!==0)throw Error(o(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ll(e,t),s=l?oy(e,t):Jc(e,t,!0),c=l;do{if(s===0){ki&&!l&&va(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!ry(n)){s=Jc(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var g=e;s=Cr;var S=g.current.memoizedState.isDehydrated;if(S&&(Mi(g,h).flags|=256),h=Jc(g,h,!1),h!==2){if(Vc&&!S){g.errorRecoveryDisabledLanes|=c,Wa|=c,s=4;break e}c=kn,kn=s,c!==null&&(kn===null?kn=c:kn.push.apply(kn,c))}s=h}if(c=!1,s!==2)continue}}if(s===1){Mi(e,0),va(e,t,0,!0);break}e:{switch(l=e,c=s,c){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:va(l,t,Gn,!pa);break e;case 2:kn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=Bs+300-de(),10<s)){if(va(l,t,Gn,!pa),kl(l,0,!0)!==0)break e;Vl=t,l.timeoutHandle=mm(Bh.bind(null,l,n,kn,Ks,Ic,t,Gn,Wa,Ri,pa,c,"Throttled",-0,0),s);break e}Bh(l,n,kn,Ks,Ic,t,Gn,Wa,Ri,pa,c,null,-0,0)}}break}while(!0);Sl(e)}function Bh(e,t,n,l,s,c,h,g,S,M,Y,F,_,O){if(e.timeoutHandle=-1,F=t.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tn},jh(t,c,F);var ge=(c&62914560)===c?Bs-de():(c&4194048)===c?zh-de():0;if(ge=Fy(F,ge),ge!==null){Vl=c,e.cancelPendingCommit=ge(Xh.bind(null,e,t,c,n,l,s,h,g,S,Y,F,null,_,O)),va(e,c,h,!M);return}}Xh(e,t,c,n,l,s,h,g,S)}function ry(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var l=0;l<n.length;l++){var s=n[l],c=s.getSnapshot;s=s.value;try{if(!Un(c(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function va(e,t,n,l){t&=~Xc,t&=~Wa,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var c=31-ut(s),h=1<<c;l[c]=-1,s&=~h}n!==0&&Ma(e,n,t)}function Ys(){return(ct&6)===0?(Ar(0),!1):!0}function Wc(){if(Pe!==null){if(mt===0)var e=Pe.return;else e=Pe,zl=Ga=null,hc(e),wi=null,sr=0,e=Pe;for(;e!==null;)ph(e.alternate,e),e=e.return;Pe=null}}function Mi(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Ny(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Vl=0,Wc(),wt=e,Pe=n=_l(e.current,null),$e=t,mt=0,Yn=null,pa=!1,ki=ll(e,t),Vc=!1,Ri=Gn=Xc=Wa=ga=Bt=0,kn=Cr=null,Ic=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var s=31-ut(l),c=1<<s;t|=e[s],l&=~c}return Fl=t,os(),n}function Hh(e,t){Ye=null,L.H=pr,t===xi||t===gs?(t=ef(),mt=3):t===tc?(t=ef(),mt=4):mt=t===Rc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yn=t,Pe===null&&(Bt=1,js(e,Zn(t,e.current)))}function Kh(){var e=Hn.current;return e===null?!0:($e&4194048)===$e?Jn===null:($e&62914560)===$e||($e&536870912)!==0?e===Jn:!1}function Yh(){var e=L.H;return L.H=pr,e===null?pr:e}function Gh(){var e=L.A;return L.A=ay,e}function Gs(){Bt=4,pa||($e&4194048)!==$e&&Hn.current!==null||(ki=!0),(ga&134217727)===0&&(Wa&134217727)===0||wt===null||va(wt,$e,Gn,!1)}function Jc(e,t,n){var l=ct;ct|=2;var s=Yh(),c=Gh();(wt!==e||$e!==t)&&(Ks=null,Mi(e,t)),t=!1;var h=Bt;e:do try{if(mt!==0&&Pe!==null){var g=Pe,S=Yn;switch(mt){case 8:Wc(),h=6;break e;case 3:case 2:case 9:case 6:Hn.current===null&&(t=!0);var M=mt;if(mt=0,Yn=null,_i(e,g,S,M),n&&ki){h=0;break e}break;default:M=mt,mt=0,Yn=null,_i(e,g,S,M)}}sy(),h=Bt;break}catch(Y){Hh(e,Y)}while(!0);return t&&e.shellSuspendCounter++,zl=Ga=null,ct=l,L.H=s,L.A=c,Pe===null&&(wt=null,$e=0,os()),h}function sy(){for(;Pe!==null;)qh(Pe)}function oy(e,t){var n=ct;ct|=2;var l=Yh(),s=Gh();wt!==e||$e!==t?(Ks=null,Hs=de()+500,Mi(e,t)):ki=ll(e,t);e:do try{if(mt!==0&&Pe!==null){t=Pe;var c=Yn;t:switch(mt){case 1:mt=0,Yn=null,_i(e,t,c,1);break;case 2:case 9:if(Jd(c)){mt=0,Yn=null,Fh(t);break}t=function(){mt!==2&&mt!==9||wt!==e||(mt=7),Sl(e)},c.then(t,t);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:Jd(c)?(mt=0,Yn=null,Fh(t)):(mt=0,Yn=null,_i(e,t,c,7));break;case 5:var h=null;switch(Pe.tag){case 26:h=Pe.memoizedState;case 5:case 27:var g=Pe;if(h?Rm(h):g.stateNode.complete){mt=0,Yn=null;var S=g.sibling;if(S!==null)Pe=S;else{var M=g.return;M!==null?(Pe=M,qs(M)):Pe=null}break t}}mt=0,Yn=null,_i(e,t,c,5);break;case 6:mt=0,Yn=null,_i(e,t,c,6);break;case 8:Wc(),Bt=6;break e;default:throw Error(o(462))}}cy();break}catch(Y){Hh(e,Y)}while(!0);return zl=Ga=null,L.H=l,L.A=s,ct=n,Pe!==null?0:(wt=null,$e=0,os(),Bt)}function cy(){for(;Pe!==null&&!ht();)qh(Pe)}function qh(e){var t=hh(e.alternate,e,Fl);e.memoizedProps=e.pendingProps,t===null?qs(e):Pe=t}function Fh(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=sh(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=sh(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:hc(t);default:ph(n,t),t=Pe=Yd(t,Fl),t=hh(n,t,Fl)}e.memoizedProps=e.pendingProps,t===null?qs(e):Pe=t}function _i(e,t,n,l){zl=Ga=null,hc(t),wi=null,sr=0;var s=t.return;try{if(Wb(e,s,t,n,$e)){Bt=1,js(e,Zn(n,e.current)),Pe=null;return}}catch(c){if(s!==null)throw Pe=s,c;Bt=1,js(e,Zn(n,e.current)),Pe=null;return}t.flags&32768?(nt||l===1?e=!0:ki||($e&536870912)!==0?e=!1:(pa=e=!0,(l===2||l===9||l===3||l===6)&&(l=Hn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Vh(t,e)):qs(t)}function qs(e){var t=e;do{if((t.flags&32768)!==0){Vh(t,pa);return}e=t.return;var n=ey(t.alternate,t,Fl);if(n!==null){Pe=n;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);Bt===0&&(Bt=5)}function Vh(e,t){do{var n=ty(e.alternate,e);if(n!==null){n.flags&=32767,Pe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=n}while(e!==null);Bt=6,Pe=null}function Xh(e,t,n,l,s,c,h,g,S){e.cancelPendingCommit=null;do Fs();while(Pt!==0);if((ct&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(c=t.lanes|t.childLanes,c|=Ko,Zi(e,n,c,h,g,S),e===wt&&(Pe=wt=null,$e=0),ji=t,ya=e,Vl=n,Zc=c,Qc=s,Dh=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,hy(hn,function(){return Wh(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=L.T,L.T=null,s=V.p,V.p=2,h=ct,ct|=4;try{ny(e,t,n)}finally{ct=h,V.p=s,L.T=l}}Pt=1,Ih(),Zh(),Qh()}}function Ih(){if(Pt===1){Pt=0;var e=ya,t=ji,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=L.T,L.T=null;var l=V.p;V.p=2;var s=ct;ct|=4;try{Eh(t,e);var c=uu,h=_d(e.containerInfo),g=c.focusedElem,S=c.selectionRange;if(h!==g&&g&&g.ownerDocument&&Md(g.ownerDocument.documentElement,g)){if(S!==null&&Do(g)){var M=S.start,Y=S.end;if(Y===void 0&&(Y=M),"selectionStart"in g)g.selectionStart=M,g.selectionEnd=Math.min(Y,g.value.length);else{var F=g.ownerDocument||document,_=F&&F.defaultView||window;if(_.getSelection){var O=_.getSelection(),ge=g.textContent.length,Re=Math.min(S.start,ge),yt=S.end===void 0?Re:Math.min(S.end,ge);!O.extend&&Re>yt&&(h=yt,yt=Re,Re=h);var N=jd(g,Re),C=jd(g,yt);if(N&&C&&(O.rangeCount!==1||O.anchorNode!==N.node||O.anchorOffset!==N.offset||O.focusNode!==C.node||O.focusOffset!==C.offset)){var j=F.createRange();j.setStart(N.node,N.offset),O.removeAllRanges(),Re>yt?(O.addRange(j),O.extend(C.node,C.offset)):(j.setEnd(C.node,C.offset),O.addRange(j))}}}}for(F=[],O=g;O=O.parentNode;)O.nodeType===1&&F.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<F.length;g++){var q=F[g];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}no=!!cu,uu=cu=null}finally{ct=s,V.p=l,L.T=n}}e.current=t,Pt=2}}function Zh(){if(Pt===2){Pt=0;var e=ya,t=ji,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=L.T,L.T=null;var l=V.p;V.p=2;var s=ct;ct|=4;try{Sh(e,t.alternate,t)}finally{ct=s,V.p=l,L.T=n}}Pt=3}}function Qh(){if(Pt===4||Pt===3){Pt=0,Ft();var e=ya,t=ji,n=Vl,l=Dh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Pt=5:(Pt=0,ji=ya=null,Ph(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(ba=null),il(n),t=t.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(tt,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=L.T,s=V.p,V.p=2,L.T=null;try{for(var c=e.onRecoverableError,h=0;h<l.length;h++){var g=l[h];c(g.value,{componentStack:g.stack})}}finally{L.T=t,V.p=s}}(Vl&3)!==0&&Fs(),Sl(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===Pc?Tr++:(Tr=0,Pc=e):Tr=0,Ar(0)}}function Ph(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ir(t)))}function Fs(){return Ih(),Zh(),Qh(),Wh()}function Wh(){if(Pt!==5)return!1;var e=ya,t=Zc;Zc=0;var n=il(Vl),l=L.T,s=V.p;try{V.p=32>n?32:n,L.T=null,n=Qc,Qc=null;var c=ya,h=Vl;if(Pt=0,ji=ya=null,Vl=0,(ct&6)!==0)throw Error(o(331));var g=ct;if(ct|=4,_h(c.current),Rh(c,c.current,h,n),ct=g,Ar(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(tt,c)}catch{}return!0}finally{V.p=s,L.T=l,Ph(e,t)}}function Jh(e,t,n){t=Zn(n,t),t=kc(e.stateNode,t,2),e=da(e,t,2),e!==null&&(Ln(e,2),Sl(e))}function pt(e,t,n){if(e.tag===3)Jh(e,e,n);else for(;t!==null;){if(t.tag===3){Jh(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ba===null||!ba.has(l))){e=Zn(n,e),n=$f(2),l=da(t,n,2),l!==null&&(eh(n,l,t,e),Ln(l,2),Sl(l));break}}t=t.return}}function $c(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new iy;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(n)||(Vc=!0,s.add(n),e=uy.bind(null,e,t,n),t.then(e,e))}function uy(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,wt===e&&($e&n)===n&&(Bt===4||Bt===3&&($e&62914560)===$e&&300>de()-Bs?(ct&2)===0&&Mi(e,0):Xc|=n,Ri===$e&&(Ri=0)),Sl(e)}function $h(e,t){t===0&&(t=_n()),e=Ha(e,t),e!==null&&(Ln(e,t),Sl(e))}function dy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$h(e,n)}function fy(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),$h(e,n)}function hy(e,t){return Jt(e,t)}var Vs=null,Li=null,eu=!1,Xs=!1,tu=!1,xa=0;function Sl(e){e!==Li&&e.next===null&&(Li===null?Vs=Li=e:Li=Li.next=e),Xs=!0,eu||(eu=!0,py())}function Ar(e,t){if(!tu&&Xs){tu=!0;do for(var n=!1,l=Vs;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var c=0;else{var h=l.suspendedLanes,g=l.pingedLanes;c=(1<<31-ut(42|e)+1)-1,c&=s&~(h&~g),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,lm(l,c))}else c=$e,c=kl(l,l===wt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||ll(l,c)||(n=!0,lm(l,c));l=l.next}while(n);tu=!1}}function my(){em()}function em(){Xs=eu=!1;var e=0;xa!==0&&Ay()&&(e=xa);for(var t=de(),n=null,l=Vs;l!==null;){var s=l.next,c=tm(l,t);c===0?(l.next=null,n===null?Vs=s:n.next=s,s===null&&(Li=n)):(n=l,(e!==0||(c&3)!==0)&&(Xs=!0)),l=s}Pt!==0&&Pt!==5||Ar(e),xa!==0&&(xa=0)}function tm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-ut(c),g=1<<h,S=s[h];S===-1?((g&n)===0||(g&l)!==0)&&(s[h]=al(g,t)):S<=t&&(e.expiredLanes|=g),c&=~g}if(t=wt,n=$e,n=kl(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(mt===2||mt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&<(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ll(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&<(l),il(n)){case 2:case 8:n=it;break;case 32:n=hn;break;case 268435456:n=Et;break;default:n=hn}return l=nm.bind(null,e),n=Jt(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&<(l),e.callbackPriority=2,e.callbackNode=null,2}function nm(e,t){if(Pt!==0&&Pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fs()&&e.callbackNode!==n)return null;var l=$e;return l=kl(e,e===wt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Uh(e,l,t),tm(e,de()),e.callbackNode!=null&&e.callbackNode===n?nm.bind(null,e):null)}function lm(e,t){if(Fs())return null;Uh(e,t,!0)}function py(){Ey(function(){(ct&6)!==0?Jt(Ge,my):em()})}function nu(){if(xa===0){var e=yi;e===0&&(e=Nl,Nl<<=1,(Nl&261888)===0&&(Nl=256)),xa=e}return xa}function am(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Da(""+e)}function im(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function gy(e,t,n,l,s){if(t==="submit"&&n&&n.stateNode===s){var c=am((s[$t]||null).action),h=l.submitter;h&&(t=(t=h[$t]||null)?am(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var g=new Oa("action","action",null,l,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(xa!==0){var S=h?im(s,h):new FormData(s);Sc(n,{pending:!0,data:S,method:s.method,action:c},null,S)}}else typeof c=="function"&&(g.preventDefault(),S=h?im(s,h):new FormData(s),Sc(n,{pending:!0,data:S,method:s.method,action:c},c,S))},currentTarget:s}]})}}for(var lu=0;lu<Ho.length;lu++){var au=Ho[lu],by=au.toLowerCase(),yy=au[0].toUpperCase()+au.slice(1);ol(by,"on"+yy)}ol(Dd,"onAnimationEnd"),ol(Od,"onAnimationIteration"),ol(Ud,"onAnimationStart"),ol("dblclick","onDoubleClick"),ol("focusin","onFocus"),ol("focusout","onBlur"),ol(zb,"onTransitionRun"),ol(Db,"onTransitionStart"),ol(Ob,"onTransitionCancel"),ol(Bd,"onTransitionEnd"),en("onMouseEnter",["mouseout","mouseover"]),en("onMouseLeave",["mouseout","mouseover"]),en("onPointerEnter",["pointerout","pointerover"]),en("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nr="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(" "),vy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nr));function rm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],s=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var h=l.length-1;0<=h;h--){var g=l[h],S=g.instance,M=g.currentTarget;if(g=g.listener,S!==c&&s.isPropagationStopped())break e;c=g,s.currentTarget=M;try{c(s)}catch(Y){ss(Y)}s.currentTarget=null,c=S}else for(h=0;h<l.length;h++){if(g=l[h],S=g.instance,M=g.currentTarget,g=g.listener,S!==c&&s.isPropagationStopped())break e;c=g,s.currentTarget=M;try{c(s)}catch(Y){ss(Y)}s.currentTarget=null,c=S}}}}function We(e,t){var n=t[za];n===void 0&&(n=t[za]=new Set);var l=e+"__bubble";n.has(l)||(sm(t,e,2,!1),n.add(l))}function iu(e,t,n){var l=0;t&&(l|=4),sm(n,e,l,t)}var Is="_reactListening"+Math.random().toString(36).slice(2);function ru(e){if(!e[Is]){e[Is]=!0,Lt.forEach(function(n){n!=="selectionchange"&&(vy.has(n)||iu(n,!1,e),iu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Is]||(t[Is]=!0,iu("selectionchange",!1,t))}}function sm(e,t,n,l){switch(Om(t)){case 2:var s=Iy;break;case 8:s=Zy;break;default:s=wu}n=s.bind(null,t,n,e),s=void 0,!gn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function su(e,t,n,l,s){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var h=l.tag;if(h===3||h===4){var g=l.stateNode.containerInfo;if(g===s)break;if(h===4)for(h=l.return;h!==null;){var S=h.tag;if((S===3||S===4)&&h.stateNode.containerInfo===s)return;h=h.return}for(;g!==null;){if(h=Ae(g),h===null)return;if(S=h.tag,S===5||S===6||S===26||S===27){l=c=h;continue e}g=g.parentNode}}l=l.return}Be(function(){var M=c,Y=na(n),F=[];e:{var _=Hd.get(e);if(_!==void 0){var O=Oa,ge=e;switch(e){case"keypress":if(bn(n)===0)break e;case"keydown":case"keyup":O=fb;break;case"focusin":ge="focus",O=jo;break;case"focusout":ge="blur",O=jo;break;case"beforeblur":case"afterblur":O=jo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=eb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=pb;break;case Dd:case Od:case Ud:O=lb;break;case Bd:O=bb;break;case"scroll":case"scrollend":O=as;break;case"wheel":O=vb;break;case"copy":case"cut":case"paste":O=ib;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=gd;break;case"toggle":case"beforetoggle":O=wb}var Re=(t&4)!==0,yt=!Re&&(e==="scroll"||e==="scrollend"),N=Re?_!==null?_+"Capture":null:_;Re=[];for(var C=M,j;C!==null;){var q=C;if(j=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||j===null||N===null||(q=vt(C,N),q!=null&&Re.push(Er(C,q,j))),yt)break;C=C.return}0<Re.length&&(_=new O(_,ge,null,n,Y),F.push({event:_,listeners:Re}))}}if((t&7)===0){e:{if(_=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",_&&n!==ta&&(ge=n.relatedTarget||n.fromElement)&&(Ae(ge)||ge[Xn]))break e;if((O||_)&&(_=Y.window===Y?Y:(_=Y.ownerDocument)?_.defaultView||_.parentWindow:window,O?(ge=n.relatedTarget||n.toElement,O=M,ge=ge?Ae(ge):null,ge!==null&&(yt=f(ge),Re=ge.tag,ge!==yt||Re!==5&&Re!==27&&Re!==6)&&(ge=null)):(O=null,ge=M),O!==ge)){if(Re=md,q="onMouseLeave",N="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(Re=gd,q="onPointerLeave",N="onPointerEnter",C="pointer"),yt=O==null?_:Le(O),j=ge==null?_:Le(ge),_=new Re(q,C+"leave",O,n,Y),_.target=yt,_.relatedTarget=j,q=null,Ae(Y)===M&&(Re=new Re(N,C+"enter",ge,n,Y),Re.target=j,Re.relatedTarget=yt,q=Re),yt=q,O&&ge)t:{for(Re=xy,N=O,C=ge,j=0,q=N;q;q=Re(q))j++;q=0;for(var Ee=C;Ee;Ee=Re(Ee))q++;for(;0<j-q;)N=Re(N),j--;for(;0<q-j;)C=Re(C),q--;for(;j--;){if(N===C||C!==null&&N===C.alternate){Re=N;break t}N=Re(N),C=Re(C)}Re=null}else Re=null;O!==null&&om(F,_,O,Re,!1),ge!==null&&yt!==null&&om(F,yt,ge,Re,!0)}}e:{if(_=M?Le(M):window,O=_.nodeName&&_.nodeName.toLowerCase(),O==="select"||O==="input"&&_.type==="file")var st=Td;else if(Sd(_))if(Ad)st=Mb;else{st=Rb;var xe=kb}else O=_.nodeName,!O||O.toLowerCase()!=="input"||_.type!=="checkbox"&&_.type!=="radio"?M&&Rl(M.elementType)&&(st=Td):st=jb;if(st&&(st=st(e,M))){Cd(F,st,n,Y);break e}xe&&xe(e,_,M),e==="focusout"&&M&&_.type==="number"&&M.memoizedProps.value!=null&&Pi(_,"number",_.value)}switch(xe=M?Le(M):window,e){case"focusin":(Sd(xe)||xe.contentEditable==="true")&&(ui=xe,Oo=M,nr=null);break;case"focusout":nr=Oo=ui=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,Ld(F,n,Y);break;case"selectionchange":if(Lb)break;case"keydown":case"keyup":Ld(F,n,Y)}var Fe;if(_o)e:{switch(e){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else ci?xd(e,n)&&(et="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(et="onCompositionStart");et&&(bd&&n.locale!=="ko"&&(ci||et!=="onCompositionStart"?et==="onCompositionEnd"&&ci&&(Fe=On()):(Mt=Y,xt="value"in Mt?Mt.value:Mt.textContent,ci=!0)),xe=Zs(M,et),0<xe.length&&(et=new pd(et,e,null,n,Y),F.push({event:et,listeners:xe}),Fe?et.data=Fe:(Fe=wd(n),Fe!==null&&(et.data=Fe)))),(Fe=Cb?Tb(e,n):Ab(e,n))&&(et=Zs(M,"onBeforeInput"),0<et.length&&(xe=new pd("onBeforeInput","beforeinput",null,n,Y),F.push({event:xe,listeners:et}),xe.data=Fe)),gy(F,e,M,n,Y)}rm(F,t)})}function Er(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zs(e,t){for(var n=t+"Capture",l=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=vt(e,n),s!=null&&l.unshift(Er(e,s,c)),s=vt(e,t),s!=null&&l.push(Er(e,s,c))),e.tag===3)return l;e=e.return}return[]}function xy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function om(e,t,n,l,s){for(var c=t._reactName,h=[];n!==null&&n!==l;){var g=n,S=g.alternate,M=g.stateNode;if(g=g.tag,S!==null&&S===l)break;g!==5&&g!==26&&g!==27||M===null||(S=M,s?(M=vt(n,c),M!=null&&h.unshift(Er(n,M,S))):s||(M=vt(n,c),M!=null&&h.push(Er(n,M,S)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var wy=/\r\n?/g,Sy=/\u0000|\uFFFD/g;function cm(e){return(typeof e=="string"?e:""+e).replace(wy,`
|
|
33
|
+
`).replace(Sy,"")}function um(e,t){return t=cm(t),cm(e)===t}function bt(e,t,n,l,s,c){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ea(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ea(e,""+l);break;case"className":re(e,"class",l);break;case"tabIndex":re(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":re(e,n,l);break;case"style":ns(e,l,c);break;case"data":if(t!=="object"){re(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Da(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"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 c=="function"&&(n==="formAction"?(t!=="input"&&bt(e,t,"name",s.name,s,null),bt(e,t,"formEncType",s.formEncType,s,null),bt(e,t,"formMethod",s.formMethod,s,null),bt(e,t,"formTarget",s.formTarget,s,null)):(bt(e,t,"encType",s.encType,s,null),bt(e,t,"method",s.method,s,null),bt(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Da(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Tn);break;case"onScroll":l!=null&&We("scroll",e);break;case"onScrollEnd":l!=null&&We("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=Da(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":We("beforetoggle",e),We("toggle",e),qe(e,"popover",l);break;case"xlinkActuate":kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":kt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":kt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":kt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":kt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":qe(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=sl.get(n)||n,qe(e,n,l))}}function ou(e,t,n,l,s,c){switch(n){case"style":ns(e,l,c);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(n=l.__html,n!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=n}}break;case"children":typeof l=="string"?ea(e,l):(typeof l=="number"||typeof l=="bigint")&&ea(e,""+l);break;case"onScroll":l!=null&&We("scroll",e);break;case"onScrollEnd":l!=null&&We("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Tn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!gl.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),c=e[$t]||null,c=c!=null?c[n]:null,typeof c=="function"&&e.removeEventListener(t,c,s),typeof l=="function")){typeof c!="function"&&c!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,s);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):qe(e,n,l)}}}function un(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",e),We("load",e);var l=!1,s=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:bt(e,t,c,h,n,null)}}s&&bt(e,t,"srcSet",n.srcSet,n,null),l&&bt(e,t,"src",n.src,n,null);return;case"input":We("invalid",e);var g=c=h=s=null,S=null,M=null;for(l in n)if(n.hasOwnProperty(l)){var Y=n[l];if(Y!=null)switch(l){case"name":s=Y;break;case"type":h=Y;break;case"checked":S=Y;break;case"defaultChecked":M=Y;break;case"value":c=Y;break;case"defaultValue":g=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:bt(e,t,l,Y,n,null)}}Jr(e,c,g,S,M,h,s,!1);return;case"select":We("invalid",e),l=h=c=null;for(s in n)if(n.hasOwnProperty(s)&&(g=n[s],g!=null))switch(s){case"value":c=g;break;case"defaultValue":h=g;break;case"multiple":l=g;default:bt(e,t,s,g,n,null)}t=c,n=h,e.multiple=!!l,t!=null?$l(e,!!l,t,!1):n!=null&&$l(e,!!l,n,!0);return;case"textarea":We("invalid",e),c=s=l=null;for(h in n)if(n.hasOwnProperty(h)&&(g=n[h],g!=null))switch(h){case"value":l=g;break;case"defaultValue":s=g;break;case"children":c=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(o(91));break;default:bt(e,t,h,g,n,null)}es(e,l,s,c);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(l=n[S],l!=null))switch(S){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:bt(e,t,S,l,n,null)}return;case"dialog":We("beforetoggle",e),We("toggle",e),We("cancel",e),We("close",e);break;case"iframe":case"object":We("load",e);break;case"video":case"audio":for(l=0;l<Nr.length;l++)We(Nr[l],e);break;case"image":We("error",e),We("load",e);break;case"details":We("toggle",e);break;case"embed":case"source":case"link":We("error",e),We("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in n)if(n.hasOwnProperty(M)&&(l=n[M],l!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:bt(e,t,M,l,n,null)}return;default:if(Rl(t)){for(Y in n)n.hasOwnProperty(Y)&&(l=n[Y],l!==void 0&&ou(e,t,Y,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&bt(e,t,g,l,n,null))}function Cy(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,h=null,g=null,S=null,M=null,Y=null;for(O in n){var F=n[O];if(n.hasOwnProperty(O)&&F!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":S=F;default:l.hasOwnProperty(O)||bt(e,t,O,null,l,F)}}for(var _ in l){var O=l[_];if(F=n[_],l.hasOwnProperty(_)&&(O!=null||F!=null))switch(_){case"type":c=O;break;case"name":s=O;break;case"checked":M=O;break;case"defaultChecked":Y=O;break;case"value":h=O;break;case"defaultValue":g=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(137,t));break;default:O!==F&&bt(e,t,_,O,l,F)}}Qi(e,h,g,S,M,Y,c,s);return;case"select":O=h=g=_=null;for(c in n)if(S=n[c],n.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":O=S;default:l.hasOwnProperty(c)||bt(e,t,c,null,l,S)}for(s in l)if(c=l[s],S=n[s],l.hasOwnProperty(s)&&(c!=null||S!=null))switch(s){case"value":_=c;break;case"defaultValue":g=c;break;case"multiple":h=c;default:c!==S&&bt(e,t,s,c,l,S)}t=g,n=h,l=O,_!=null?$l(e,!!n,_,!1):!!l!=!!n&&(t!=null?$l(e,!!n,t,!0):$l(e,!!n,n?[]:"",!1));return;case"textarea":O=_=null;for(g in n)if(s=n[g],n.hasOwnProperty(g)&&s!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:bt(e,t,g,null,l,s)}for(h in l)if(s=l[h],c=n[h],l.hasOwnProperty(h)&&(s!=null||c!=null))switch(h){case"value":_=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==c&&bt(e,t,h,s,l,c)}$r(e,_,O);return;case"option":for(var ge in n)if(_=n[ge],n.hasOwnProperty(ge)&&_!=null&&!l.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:bt(e,t,ge,null,l,_)}for(S in l)if(_=l[S],O=n[S],l.hasOwnProperty(S)&&_!==O&&(_!=null||O!=null))switch(S){case"selected":e.selected=_&&typeof _!="function"&&typeof _!="symbol";break;default:bt(e,t,S,_,l,O)}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 Re in n)_=n[Re],n.hasOwnProperty(Re)&&_!=null&&!l.hasOwnProperty(Re)&&bt(e,t,Re,null,l,_);for(M in l)if(_=l[M],O=n[M],l.hasOwnProperty(M)&&_!==O&&(_!=null||O!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(o(137,t));break;default:bt(e,t,M,_,l,O)}return;default:if(Rl(t)){for(var yt in n)_=n[yt],n.hasOwnProperty(yt)&&_!==void 0&&!l.hasOwnProperty(yt)&&ou(e,t,yt,void 0,l,_);for(Y in l)_=l[Y],O=n[Y],!l.hasOwnProperty(Y)||_===O||_===void 0&&O===void 0||ou(e,t,Y,_,l,O);return}}for(var N in n)_=n[N],n.hasOwnProperty(N)&&_!=null&&!l.hasOwnProperty(N)&&bt(e,t,N,null,l,_);for(F in l)_=l[F],O=n[F],!l.hasOwnProperty(F)||_===O||_==null&&O==null||bt(e,t,F,_,l,O)}function dm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ty(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var s=n[l],c=s.transferSize,h=s.initiatorType,g=s.duration;if(c&&g&&dm(h)){for(h=0,g=s.responseEnd,l+=1;l<n.length;l++){var S=n[l],M=S.startTime;if(M>g)break;var Y=S.transferSize,F=S.initiatorType;Y&&dm(F)&&(S=S.responseEnd,h+=Y*(S<g?1:(g-M)/(S-M)))}if(--l,t+=8*(c+h)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var cu=null,uu=null;function Qs(e){return e.nodeType===9?e:e.ownerDocument}function fm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function hm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function du(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fu=null;function Ay(){var e=window.event;return e&&e.type==="popstate"?e===fu?!1:(fu=e,!0):(fu=null,!1)}var mm=typeof setTimeout=="function"?setTimeout:void 0,Ny=typeof clearTimeout=="function"?clearTimeout:void 0,pm=typeof Promise=="function"?Promise:void 0,Ey=typeof queueMicrotask=="function"?queueMicrotask:typeof pm<"u"?function(e){return pm.resolve(null).then(e).catch(ky)}:mm;function ky(e){setTimeout(function(){throw e})}function wa(e){return e==="head"}function gm(e,t){var n=t,l=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(s),Ui(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")kr(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,kr(n);for(var c=n.firstChild;c;){var h=c.nextSibling,g=c.nodeName;c[H]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&kr(e.ownerDocument.body);n=s}while(n);Ui(t)}function bm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function hu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":hu(n),ie(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Ry(e,t,n,l){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[H])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=$n(e.nextSibling),e===null)break}return null}function jy(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=$n(e.nextSibling),e===null))return null;return e}function ym(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=$n(e.nextSibling),e===null))return null;return e}function mu(e){return e.data==="$?"||e.data==="$~"}function pu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function My(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function $n(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var gu=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return $n(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function xm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function wm(e,t,n){switch(t=Qs(n),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function kr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ie(e)}var el=new Map,Sm=new Set;function Ps(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Xl=V.d;V.d={f:_y,r:Ly,D:zy,C:Dy,L:Oy,m:Uy,X:Hy,S:By,M:Ky};function _y(){var e=Xl.f(),t=Ys();return e||t}function Ly(e){var t=Ne(e);t!==null&&t.tag===5&&t.type==="form"?Hf(t):Xl.r(e)}var zi=typeof document>"u"?null:document;function Cm(e,t,n){var l=zi;if(l&&typeof t=="string"&&t){var s=tn(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Sm.has(s)||(Sm.add(s),e={rel:e,crossOrigin:n,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),un(t,"link",e),rt(t),l.head.appendChild(t)))}}function zy(e){Xl.D(e),Cm("dns-prefetch",e,null)}function Dy(e,t){Xl.C(e,t),Cm("preconnect",e,t)}function Oy(e,t,n){Xl.L(e,t,n);var l=zi;if(l&&e&&t){var s='link[rel="preload"][as="'+tn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+tn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+tn(n.imageSizes)+'"]')):s+='[href="'+tn(e)+'"]';var c=s;switch(t){case"style":c=Di(e);break;case"script":c=Oi(e)}el.has(c)||(e=w({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),el.set(c,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(Rr(c))||t==="script"&&l.querySelector(jr(c))||(t=l.createElement("link"),un(t,"link",e),rt(t),l.head.appendChild(t)))}}function Uy(e,t){Xl.m(e,t);var n=zi;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+tn(l)+'"][href="'+tn(e)+'"]',c=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Oi(e)}if(!el.has(c)&&(e=w({rel:"modulepreload",href:e},t),el.set(c,e),n.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(jr(c)))return}l=n.createElement("link"),un(l,"link",e),rt(l),n.head.appendChild(l)}}}function By(e,t,n){Xl.S(e,t,n);var l=zi;if(l&&e){var s=Ve(l).hoistableStyles,c=Di(e);t=t||"default";var h=s.get(c);if(!h){var g={loading:0,preload:null};if(h=l.querySelector(Rr(c)))g.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},n),(n=el.get(c))&&bu(e,n);var S=h=l.createElement("link");rt(S),un(S,"link",e),S._p=new Promise(function(M,Y){S.onload=M,S.onerror=Y}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Ws(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:g},s.set(c,h)}}}function Hy(e,t){Xl.X(e,t);var n=zi;if(n&&e){var l=Ve(n).hoistableScripts,s=Oi(e),c=l.get(s);c||(c=n.querySelector(jr(s)),c||(e=w({src:e,async:!0},t),(t=el.get(s))&&yu(e,t),c=n.createElement("script"),rt(c),un(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function Ky(e,t){Xl.M(e,t);var n=zi;if(n&&e){var l=Ve(n).hoistableScripts,s=Oi(e),c=l.get(s);c||(c=n.querySelector(jr(s)),c||(e=w({src:e,async:!0,type:"module"},t),(t=el.get(s))&&yu(e,t),c=n.createElement("script"),rt(c),un(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(s,c))}}function Tm(e,t,n,l){var s=(s=Se.current)?Ps(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Di(n.href),n=Ve(s).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Di(n.href);var c=Ve(s).hoistableStyles,h=c.get(e);if(h||(s=s.ownerDocument||s,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=s.querySelector(Rr(e)))&&!c._p&&(h.instance=c,h.state.loading=5),el.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},el.set(e,n),c||Yy(s,e,n,h.state))),t&&l===null)throw Error(o(528,""));return h}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Oi(n),n=Ve(s).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Di(e){return'href="'+tn(e)+'"'}function Rr(e){return'link[rel="stylesheet"]['+e+"]"}function Am(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Yy(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),un(t,"link",n),rt(t),e.head.appendChild(t))}function Oi(e){return'[src="'+tn(e)+'"]'}function jr(e){return"script[async]"+e}function Nm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+tn(n.href)+'"]');if(l)return t.instance=l,rt(l),l;var s=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),rt(l),un(l,"style",s),Ws(l,n.precedence,e),t.instance=l;case"stylesheet":s=Di(n.href);var c=e.querySelector(Rr(s));if(c)return t.state.loading|=4,t.instance=c,rt(c),c;l=Am(n),(s=el.get(s))&&bu(l,s),c=(e.ownerDocument||e).createElement("link"),rt(c);var h=c;return h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),un(c,"link",l),t.state.loading|=4,Ws(c,n.precedence,e),t.instance=c;case"script":return c=Oi(n.src),(s=e.querySelector(jr(c)))?(t.instance=s,rt(s),s):(l=n,(s=el.get(c))&&(l=w({},n),yu(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),rt(s),un(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ws(l,n.precedence,e));return t.instance}function Ws(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,c=s,h=0;h<l.length;h++){var g=l[h];if(g.dataset.precedence===t)c=g;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function bu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Js=null;function Em(e,t,n){if(Js===null){var l=new Map,s=Js=new Map;s.set(n,l)}else s=Js,l=s.get(n),l||(l=new Map,s.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var c=n[s];if(!(c[H]||c[Ht]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var g=l.get(h);g?g.push(c):l.set(h,[c])}}return l}function km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Gy(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Rm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function qy(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=Di(l.href),c=t.querySelector(Rr(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=$s.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,rt(c);return}c=t.ownerDocument||t,l=Am(l),(s=el.get(s))&&bu(l,s),c=c.createElement("link"),rt(c);var h=c;h._p=new Promise(function(g,S){h.onload=g,h.onerror=S}),un(c,"link",l),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=$s.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var vu=0;function Fy(e,t){return e.stylesheets&&e.count===0&&to(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&to(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&vu===0&&(vu=62500*Ty());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&to(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>vu?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function $s(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)to(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var eo=null;function to(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,eo=new Map,t.forEach(Vy,e),eo=null,$s.call(e))}function Vy(e,t){if(!(t.state.loading&4)){var n=eo.get(e);if(n)var l=n.get(null);else{n=new Map,eo.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var h=s[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),l=h)}l&&n.set(null,l)}s=t.instance,h=s.getAttribute("data-precedence"),c=n.get(h)||l,c===l&&n.set(null,s),n.set(h,s),this.count++,l=$s.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Mr={$$typeof:P,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function Xy(e,t,n,l,s,c,h,g,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function jm(e,t,n,l,s,c,h,g,S,M,Y,F){return e=new Xy(e,t,n,h,S,M,Y,F,g),t=1,c===!0&&(t|=24),c=Bn(3,null,null,t),e.current=c,c.stateNode=e,t=Jo(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:n,cache:t},nc(c),e}function Mm(e){return e?(e=hi,e):hi}function _m(e,t,n,l,s,c){s=Mm(s),l.context===null?l.context=s:l.pendingContext=s,l=ua(t),l.payload={element:n},c=c===void 0?null:c,c!==null&&(l.callback=c),n=da(e,l,t),n!==null&&(Rn(n,e,t),cr(n,e,t))}function Lm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function xu(e,t){Lm(e,t),(e=e.alternate)&&Lm(e,t)}function zm(e){if(e.tag===13||e.tag===31){var t=Ha(e,67108864);t!==null&&Rn(t,e,67108864),xu(e,67108864)}}function Dm(e){if(e.tag===13||e.tag===31){var t=qn();t=Wl(t);var n=Ha(e,t);n!==null&&Rn(n,e,t),xu(e,t)}}var no=!0;function Iy(e,t,n,l){var s=L.T;L.T=null;var c=V.p;try{V.p=2,wu(e,t,n,l)}finally{V.p=c,L.T=s}}function Zy(e,t,n,l){var s=L.T;L.T=null;var c=V.p;try{V.p=8,wu(e,t,n,l)}finally{V.p=c,L.T=s}}function wu(e,t,n,l){if(no){var s=Su(l);if(s===null)su(e,t,l,lo,n),Um(e,l);else if(Py(s,e,t,n,l))l.stopPropagation();else if(Um(e,l),t&4&&-1<Qy.indexOf(e)){for(;s!==null;){var c=Ne(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=Sn(c.pendingLanes);if(h!==0){var g=c;for(g.pendingLanes|=2,g.entangledLanes|=2;h;){var S=1<<31-ut(h);g.entanglements[1]|=S,h&=~S}Sl(c),(ct&6)===0&&(Hs=de()+500,Ar(0))}}break;case 31:case 13:g=Ha(c,2),g!==null&&Rn(g,c,2),Ys(),xu(c,2)}if(c=Su(l),c===null&&su(e,t,l,lo,n),c===s)break;s=c}s!==null&&l.stopPropagation()}else su(e,t,l,null,n)}}function Su(e){return e=na(e),Cu(e)}var lo=null;function Cu(e){if(lo=null,e=Ae(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=p(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return lo=e,null}function Om(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ue()){case Ge:return 2;case it:return 8;case hn:case mn:return 32;case Et:return 268435456;default:return 32}default:return 32}}var Tu=!1,Sa=null,Ca=null,Ta=null,_r=new Map,Lr=new Map,Aa=[],Qy="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 Um(e,t){switch(e){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ca=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":_r.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lr.delete(t.pointerId)}}function zr(e,t,n,l,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:c,targetContainers:[s]},t!==null&&(t=Ne(t),t!==null&&zm(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Py(e,t,n,l,s){switch(t){case"focusin":return Sa=zr(Sa,e,t,n,l,s),!0;case"dragenter":return Ca=zr(Ca,e,t,n,l,s),!0;case"mouseover":return Ta=zr(Ta,e,t,n,l,s),!0;case"pointerover":var c=s.pointerId;return _r.set(c,zr(_r.get(c)||null,e,t,n,l,s)),!0;case"gotpointercapture":return c=s.pointerId,Lr.set(c,zr(Lr.get(c)||null,e,t,n,l,s)),!0}return!1}function Bm(e){var t=Ae(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=p(n),t!==null){e.blockedOn=t,ai(e.priority,function(){Dm(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,ai(e.priority,function(){Dm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ao(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Su(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);ta=l,n.target.dispatchEvent(l),ta=null}else return t=Ne(n),t!==null&&zm(t),e.blockedOn=n,!1;t.shift()}return!0}function Hm(e,t,n){ao(e)&&n.delete(t)}function Wy(){Tu=!1,Sa!==null&&ao(Sa)&&(Sa=null),Ca!==null&&ao(Ca)&&(Ca=null),Ta!==null&&ao(Ta)&&(Ta=null),_r.forEach(Hm),Lr.forEach(Hm)}function io(e,t){e.blockedOn===t&&(e.blockedOn=null,Tu||(Tu=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Wy)))}var ro=null;function Km(e){ro!==e&&(ro=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){ro===e&&(ro=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Cu(l||n)===null)continue;break}var c=Ne(n);c!==null&&(e.splice(t,3),t-=3,Sc(c,{pending:!0,data:s,method:n.method,action:l},l,s))}}))}function Ui(e){function t(S){return io(S,e)}Sa!==null&&io(Sa,e),Ca!==null&&io(Ca,e),Ta!==null&&io(Ta,e),_r.forEach(t),Lr.forEach(t);for(var n=0;n<Aa.length;n++){var l=Aa[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Aa.length&&(n=Aa[0],n.blockedOn===null);)Bm(n),n.blockedOn===null&&Aa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var s=n[l],c=n[l+1],h=s[$t]||null;if(typeof c=="function")h||Km(n);else if(h){var g=null;if(c&&c.hasAttribute("formAction")){if(s=c,h=c[$t]||null)g=h.formAction;else if(Cu(s)!==null)continue}else g=h.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),Km(n)}}}function Ym(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return s=h})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Au(e){this._internalRoot=e}so.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current,l=qn();_m(n,l,e,t,null,null)},so.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_m(e.current,2,null,e,null,null),Ys(),t[Xn]=null}};function so(e){this._internalRoot=e}so.prototype.unstable_scheduleHydration=function(e){if(e){var t=zn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Aa.length&&t!==0&&t<Aa[n].priority;n++);Aa.splice(n,0,e),n===0&&Bm(e)}};var Gm=a.version;if(Gm!=="19.2.8")throw Error(o(527,Gm,"19.2.8"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Jy={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oo.isDisabled&&oo.supportsFiber)try{tt=oo.inject(Jy),Ct=oo}catch{}}return Or.createRoot=function(e,t){if(!d(e))throw Error(o(299));var n=!1,l="",s=Qf,c=Pf,h=Wf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=jm(e,1,!1,null,null,n,l,null,s,c,h,Ym),e[Xn]=t.current,ru(e),new Au(t)},Or.hydrateRoot=function(e,t,n){if(!d(e))throw Error(o(299));var l=!1,s="",c=Qf,h=Pf,g=Wf,S=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=jm(e,1,!0,t,n??null,l,s,S,c,h,g,Ym),t.context=Mm(null),n=t.current,l=qn(),l=Wl(l),s=ua(l),s.callback=null,da(n,s,l),n=l,t.current.lanes=n,Ln(t,n),Sl(t),e[Xn]=t.current,ru(e),new so(t)},Or.version="19.2.8",Or}var Zm;function uv(){if(Zm)return Eu.exports;Zm=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Eu.exports=cv(),Eu.exports}var dv=uv();const fv=Fp(dv),oe={ESC:"\x1B",TAB:" ",SHIFT_TAB:"\x1B[Z",ENTER:"\r",BACKSPACE:"",UP:"\x1B[A",DOWN:"\x1B[B",RIGHT:"\x1B[C",LEFT:"\x1B[D",HOME:"\x1B[H",END:"\x1B[F",PAGE_UP:"\x1B[5~",PAGE_DOWN:"\x1B[6~",INSERT:"\x1B[2~",DELETE:"\x1B[3~",CTRL_C:"",CTRL_D:"",CTRL_Z:"",CTRL_L:"\f",CTRL_A:"",CTRL_E:"",CTRL_K:"\v",CTRL_R:"",CTRL_W:"",CTRL_U:"",CTRL_X:"",CTRL_N:"",CTRL_P:"",F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"},hv=new TextEncoder;function ed(r){return hv.encode(r)}function Xp(r){if(!r||r.length===0)return"";const i=r.toUpperCase().charCodeAt(0);return i>=65&&i<=90?String.fromCharCode(i-64):r==="@"||r===" "?"\0":r==="["?"\x1B":r==="\\"?"":r==="]"?"":r==="^"?"":r==="_"?"":r==="?"?"":r}function mv(r){return`\x1B${r}`}function Qm({ctrl:r,alt:a,shift:i}){return 1+(i?1:0)+(a?2:0)+(r?4:0)}const Ip=/^\x1b[[O]([ABCDHF])$/,Zp=/^\x1bO([PQRS])$/,Qp=/^\x1b\[(\d+)~$/;function xo(r,a){const{ctrl:i=!1,alt:o=!1,shift:d=!1}=a;if(!i&&!o&&!d)return r;const f=Qm(a),p=o&&!i&&!d,m=Ip.exec(r);if(m)return`\x1B[1;${f}${m[1]}`;const b=Zp.exec(r);if(b)return`\x1B[1;${f}${b[1]}`;const v=Qp.exec(r);if(v)return`\x1B[${v[1]};${f}~`;switch(r){case oe.TAB:return d&&!i&&!o?oe.SHIFT_TAB:p?`\x1B${r}`:`\x1B[9;${f}u`;case oe.SHIFT_TAB:return!i&&!o?r:`\x1B[9;${Qm({...a,shift:!0})}u`;case oe.ENTER:return p?`\x1B${r}`:`\x1B[13;${f}u`;case oe.BACKSPACE:return i&&!o&&!d?"\b":p?`\x1B${r}`:`\x1B[127;${f}u`;case oe.ESC:return p?`\x1B${r}`:`\x1B[27;${f}u`}let y=r;return d&&r.length===1&&!i&&(y=r.toUpperCase()),i&&(y=Xp(y)),o&&(y=mv(y)),y}function pv(r){return[...r].length===1?!0:Ip.test(r)||Zp.test(r)||Qp.test(r)||r===oe.SHIFT_TAB}const Pp=27,Wp=91,gv=60,Pm=59,Jp=77,$p=48,bv=57,yv=64,vv=-30,ju=32,Wm=255;function eg(r){return Number.isInteger(r)&&(r&vv)===yv}function xv(r){return r>=$p&&r<=bv}function Mu(r,a){let i=a,o=0;for(;i<r.length&&xv(r[i]);){if(o=o*10+(r[i]-$p),o>65535)return null;i+=1}return i===a?null:{value:o,next:i}}function wv(r,a){if(r[a]!==Pp||r[a+1]!==Wp||r[a+2]!==gv)return-1;const i=Mu(r,a+3);if(!i||!eg(i.value)||r[i.next]!==Pm)return-1;const o=Mu(r,i.next+1);if(!o||r[o.next]!==Pm)return-1;const d=Mu(r,o.next+1);return!d||r[d.next]!==Jp?-1:d.next+1}function Sv(r,a){if(r[a]!==Pp||r[a+1]!==Wp||r[a+2]!==Jp||a+6>r.length)return-1;const i=r[a+3]-ju,o=r[a+4],d=r[a+5];return!eg(i)||o<ju||o>Wm||d<ju||d>Wm?-1:a+6}function wo(r){if(!r)return!1;const a=r instanceof Uint8Array?r:new Uint8Array(r);if(a.length===0)return!1;let i=0;for(;i<a.length;){const o=wv(a,i);if(o>i){i=o;continue}const d=Sv(a,i);if(d>i){i=d;continue}return!1}return!0}const Cv=3e3,Tv=1e4,Av=1500;class Nv{constructor(a){fe(this,"ws",null);fe(this,"config");fe(this,"state","disconnected");fe(this,"currentRole","viewer");fe(this,"controllerId");fe(this,"hostId");fe(this,"assignedClientId");fe(this,"reconnectAttempts",0);fe(this,"reconnectTimer",null);fe(this,"pingTimer",null);fe(this,"pingTimestamp",null);fe(this,"lastInboundAt",0);fe(this,"pingSentAt",null);fe(this,"connectStartedAt",0);fe(this,"lastWakeConnectAt",0);fe(this,"probeTimer",null);fe(this,"rejectedByRelay",!1);fe(this,"isManuallyClosed",!1);fe(this,"authFailureDetail",null);fe(this,"authFailureCode",null);fe(this,"temporaryFailureCode",null);fe(this,"pendingInputSegments",[]);fe(this,"isFlushScheduled",!1);fe(this,"listeners",{stateChange:new Set,roleChange:new Set,ready:new Set,paired:new Set,controlState:new Set,controlRevoked:new Set,sessionReady:new Set,exit:new Set,controlGranted:new Set,controlDenied:new Set,status:new Set,peerCount:new Set,hostReconnecting:new Set,sessionRestarted:new Set,error:new Set,binaryData:new Set,rttUpdate:new Set,pasteFileReady:new Set,agentStatus:new Set});fe(this,"terminalCols",80);fe(this,"terminalRows",24);this.config={...a}}updateConfig(a){this.config={...this.config,...a}}getConfig(){return{...this.config}}getState(){return this.state}getRole(){return this.currentRole}getControllerId(){return this.controllerId}getHostId(){return this.hostId}getAssignedClientId(){return this.assignedClientId}on(a,i){return this.listeners[a].add(i),()=>{this.listeners[a].delete(i)}}emit(a,...i){this.listeners[a].forEach(d=>{try{d(...i)}catch(f){console.error(`Error in event listener for ${a}:`,f)}})}setState(a,i,o){this.state!==a&&(this.state=a,this.emit("stateChange",a,i,o))}connect(a){if(a&&(this.terminalCols=a.cols,this.terminalRows=a.rows),!(this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING))){this.teardownSocket(1e3,"Replaced by a new connection"),this.isManuallyClosed=!1,this.authFailureDetail=null,this.authFailureCode=null,this.temporaryFailureCode=null,this.rejectedByRelay=!1,this.clearTimers(),this.setState("connecting");try{const i=this.resolveWsUrl(this.config.wsUrl),o=new WebSocket(i);this.ws=o,this.connectStartedAt=Date.now(),o.binaryType="arraybuffer",o.onopen=()=>{this.isStaleSocket(o)||this.handleOpen()},o.onmessage=d=>{this.isStaleSocket(o)||this.handleMessage(d)},o.onerror=d=>{this.isStaleSocket(o)||this.handleError(d)},o.onclose=d=>{this.isStaleSocket(o)||this.handleClose(d)}}catch(i){this.setState("error",i instanceof Error?i.message:"Connection failed","connection_failed"),this.scheduleReconnect()}}}isStaleSocket(a){return this.ws!==a}teardownSocket(a=1e3,i="Client closed the connection"){this.pendingInputSegments=[],this.isFlushScheduled=!1;const o=this.ws;if(o){this.ws=null,o.onopen=null,o.onmessage=null,o.onerror=null,o.onclose=null;try{(o.readyState===WebSocket.OPEN||o.readyState===WebSocket.CONNECTING)&&o.close(a,i)}catch{}}}disconnect(){this.isManuallyClosed=!0,this.clearTimers(),this.pendingInputSegments=[],this.isFlushScheduled=!1,this.teardownSocket(1e3,"User initiated disconnect"),this.setState("disconnected")}reconnectWith(a){this.updateConfig(a),this.clearTimers(),this.teardownSocket(1e3,"Reconnecting with new credentials"),this.isManuallyClosed=!1,this.reconnectAttempts=0,this.authFailureDetail=null,this.authFailureCode=null,this.temporaryFailureCode=null,this.connect()}wake(a){if(this.isManuallyClosed||!this.config.autoReconnect||this.authFailureDetail||this.rejectedByRelay)return;const i=Date.now(),o=this.ws;if(!o){if(i-this.lastWakeConnectAt<Av)return;this.lastWakeConnectAt=i,this.reconnectAttempts=0,this.connect();return}if(o.readyState===WebSocket.CONNECTING){i-this.connectStartedAt>Tv&&this.dropStaleSocket("connection_stalled");return}o.readyState===WebSocket.OPEN&&i-this.lastInboundAt>this.pingIntervalMs()+2e3&&this.probeLiveness()}pingIntervalMs(){return this.config.pingIntervalMs||1e4}probeLiveness(){const a=this.ws;if(!a||a.readyState!==WebSocket.OPEN||this.probeTimer)return;const i=Date.now();this.sendPing(),this.probeTimer=setTimeout(()=>{this.probeTimer=null,this.ws===a&&this.lastInboundAt<i&&this.dropStaleSocket("connection_stale")},Cv)}dropStaleSocket(a){this.clearTimers(),this.teardownSocket(4e3,"Connection went silent"),this.setState("reconnecting","The connection went silent. Reconnecting...",a),this.reconnectAttempts=0,this.lastWakeConnectAt=Date.now(),this.connect()}handleOpen(){this.lastInboundAt=Date.now(),this.sendHello(),this.startHeartbeat()}async handleMessage(a){if(this.lastInboundAt=Date.now(),typeof a.data=="string")try{const i=JSON.parse(a.data);this.processJsonMessage(i)}catch(i){console.warn("Received unparseable text frame from server:",i)}else if(a.data instanceof ArrayBuffer)this.emit("binaryData",new Uint8Array(a.data));else if(typeof Blob<"u"&&a.data instanceof Blob)try{const i=await a.data.arrayBuffer();this.emit("binaryData",new Uint8Array(i))}catch(i){console.error("Failed to convert Blob to ArrayBuffer:",i)}}processJsonMessage(a){switch(a.type){case"ready":{this.reconnectAttempts=0,this.setState("connected"),this.currentRole=a.role,this.controllerId=a.controllerId,this.hostId=a.hostId,this.assignedClientId=a.clientId,this.emit("ready",a),this.emit("roleChange",a.role,a.controllerId,a.hostId,a.clientId),typeof a.clientCount=="number"&&this.emit("peerCount",a.clientCount);break}case"paired":{this.emit("paired",{token:a.token,deviceId:a.deviceId,hostId:a.hostId,expiresAt:a.expiresAt});break}case"control_state":{this.currentRole=a.role,this.controllerId=a.controllerId,this.emit("controlState",a.role,a.controllerId),this.emit("roleChange",a.role,a.controllerId,this.hostId,this.assignedClientId),typeof a.clientCount=="number"&&this.emit("peerCount",a.clientCount);break}case"host_reconnecting":{this.temporaryFailureCode="host_reconnecting",this.setState("reconnecting","Herdr host is reconnecting",a.code||"host_reconnecting"),this.emit("hostReconnecting",a.code);break}case"session_restarted":{this.setState("reconnecting","Herdr session is restarting","session_restarted"),this.emit("sessionRestarted",a.cols,a.rows,a.terminalPalette,a.hostname);break}case"control_revoked":{this.currentRole="viewer",this.emit("controlRevoked",a.reason),this.emit("roleChange","viewer",this.controllerId,this.hostId,this.assignedClientId);break}case"session_ready":{this.setState("connected"),this.emit("sessionReady",a);break}case"exit":{this.emit("exit",a.code,a.reason);break}case"control_granted":{this.currentRole="controller",this.controllerId=this.assignedClientId||this.config.clientId,this.emit("controlGranted"),this.emit("roleChange","controller",this.controllerId,this.hostId,this.assignedClientId);break}case"control_denied":{this.emit("controlDenied",a.message);break}case"status":{this.emit("status",a);break}case"error":{a.code==="host_offline"||a.code==="host_reconnecting"||a.code==="host_reconnect_timeout"||a.code==="rate_limited"?(this.temporaryFailureCode=String(a.code),this.setState("reconnecting",a.message,String(a.code))):(a.code==="auth_required"||a.code==="unauthorized"||a.code==="device_revoked"||a.code==="invalid_handshake"||a.code==="too_many_hosts"||a.code===401||a.code===403)&&(this.authFailureDetail=a.message,this.authFailureCode=String(a.code),this.setState("error",a.message,this.authFailureCode)),this.emit("error",{code:a.code,message:a.message});break}case"pong":{if(this.pingTimestamp){const i=Math.max(0,performance.now()-this.pingTimestamp);this.pingTimestamp=null,this.emit("rttUpdate",Math.round(i))}break}case"paste_file_ready":{this.emit("pasteFileReady",a.path);break}case"agent_status":{this.emit("agentStatus",a);break}}}handleError(a){console.error("WebSocket error:",a),this.emit("error",{code:"WS_ERROR",message:"WebSocket connection error"})}handleClose(a){if(this.clearTimers(),this.ws=null,this.authFailureDetail){this.setState("error",this.authFailureDetail,this.authFailureCode??void 0);return}if(a.code===1008&&this.temporaryFailureCode){this.setState("reconnecting",a.reason||"The relay is temporarily unavailable",this.temporaryFailureCode),this.scheduleReconnect();return}if(a.code===1008){this.rejectedByRelay=!0,this.setState("error",a.reason||"The relay rejected the connection",String(a.code));return}!this.isManuallyClosed&&this.config.autoReconnect?(this.setState("reconnecting",`Connection closed (${a.code}). Retrying...`,"connection_closed"),this.scheduleReconnect()):this.setState("disconnected",`Closed: ${a.reason||a.code}`,"connection_closed")}scheduleReconnect(){if(this.isManuallyClosed||!this.config.autoReconnect)return;if(this.config.maxReconnectAttempts>0&&this.reconnectAttempts>=this.config.maxReconnectAttempts){this.setState("error","Max reconnect attempts reached");return}this.reconnectAttempts++;const a=this.config.reconnectIntervalMs||2e3,o=Math.min(3e4,Math.floor(a*Math.pow(1.5,this.reconnectAttempts-1)+Math.random()*500));this.reconnectTimer=setTimeout(()=>{this.connect()},o)}startHeartbeat(){this.pingTimer&&clearInterval(this.pingTimer);const a=this.pingIntervalMs();this.pingSentAt=null,this.pingTimer=setInterval(()=>{if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN)){if(this.pingSentAt!==null&&this.lastInboundAt<this.pingSentAt&&Date.now()-this.pingSentAt>=a){this.probeLiveness();return}this.sendPing()}},a)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null),this.probeTimer&&(clearTimeout(this.probeTimer),this.probeTimer=null)}sendHello(){const a={type:"hello",protocol:1,clientId:this.config.clientId,cols:this.terminalCols,rows:this.terminalRows,capabilities:["host_handoff"]};this.config.token&&(a.token=this.config.token),this.config.pairCode&&(a.pairCode=this.config.pairCode),this.sendJson(a)}claimControl(a=!1){const i={type:"claim_control",...a?{force:!0}:{}};this.sendJson(i)}releaseControl(){const a={type:"release_control"};this.sendJson(a)}sendResize(a,i){this.terminalCols=a,this.terminalRows=i;const o={type:"resize",cols:a,rows:i};this.sendJson(o)}sendPing(){this.pingTimestamp=performance.now(),this.pingSentAt=Date.now();const a={type:"ping"};this.sendJson(a)}sendPasteFile(a,i){this.sendJson({type:"paste_file",mime:a,dataBase64:i})}sendJson(a){this.flushInput(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(a))}sendInput(a){const i=a instanceof Uint8Array?a:new Uint8Array(a);i.length!==0&&(this.pendingInputSegments.push(i),this.isFlushScheduled||(this.isFlushScheduled=!0,queueMicrotask(()=>this.flushInput())))}flushInput(){if(this.isFlushScheduled=!1,this.pendingInputSegments.length===0)return;let a=this.pendingInputSegments;if(this.pendingInputSegments=[],this.ws&&(this.ws.bufferedAmount??0)>256*1024&&(a=a.filter(o=>!wo(o))),a.length===0)return;let i;if(a.length===1)i=a[0];else{let o=0;for(let f=0;f<a.length;f++)o+=a[f].byteLength;i=new Uint8Array(o);let d=0;for(let f=0;f<a.length;f++)i.set(a[f],d),d+=a[f].byteLength}this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(i)}sendBinary(a){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(a)}sendText(a){const i=ed(a);this.sendInput(i)}resolveWsUrl(a){if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a)){const i=new URL(a);return i.protocol=i.protocol==="https:"?"wss:":"ws:",(!i.pathname||i.pathname==="/")&&(i.pathname="/ws/client"),i.toString()}if(typeof window<"u"&&window.location){const o=window.location.protocol==="https:"?"wss:":"ws:",d=window.location.host,f=a.startsWith("/")?a:`/${a}`;return`${o}//${d}${f}`}return"ws://127.0.0.1:8787/ws/client"}}function Ev(r,a=window,i=document){const o=v=>{var y;((y=a.navigator)==null?void 0:y.onLine)!==!1&&r.wake(v)},d=()=>{i.visibilityState==="visible"&&o("visible")},f=()=>o("pageshow"),p=()=>o("online"),m=()=>o("focus"),b=()=>o("resume");return i.addEventListener("visibilitychange",d),i.addEventListener("resume",b),a.addEventListener("pageshow",f),a.addEventListener("online",p),a.addEventListener("focus",m),()=>{i.removeEventListener("visibilitychange",d),i.removeEventListener("resume",b),a.removeEventListener("pageshow",f),a.removeEventListener("online",p),a.removeEventListener("focus",m)}}const kv=10,Rv=24,Eo=15,td=13,nd=640;function jv(){if(typeof window>"u")return!1;try{if(typeof window.matchMedia=="function"&&(window.matchMedia("(pointer: coarse)").matches||window.matchMedia("(hover: none)").matches))return!0}catch{}return Gi()<nd}function Gi(){return typeof window>"u"?1024:window.visualViewport&&typeof window.visualViewport.width=="number"&&window.visualViewport.width>0?window.visualViewport.width:window.innerWidth||1024}function _u(){return typeof window>"u"?768:window.visualViewport&&typeof window.visualViewport.height=="number"&&window.visualViewport.height>0?window.visualViewport.height:window.innerHeight||768}function So(r,a=Eo){const i=typeof r=="number"?r:Number(r);return!Number.isFinite(i)||i<=0?a:Math.min(Rv,Math.max(kv,Math.round(i)))}function Jm(r,a=Gi()){if(a<nd){const o=So(r,td);return Math.min(15,Math.max(12,o))}return So(r,Eo)}const tg=[{id:"esc",label:"ESC",code:oe.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:oe.TAB,type:"key",enabled:!0,title:"Tab"},{id:"ctrl",label:"CTRL",code:"",type:"modifier",enabled:!0,modifierType:"ctrl",title:"Toggle Ctrl modifier latch"},{id:"alt",label:"ALT",code:"",type:"modifier",enabled:!0,modifierType:"alt",title:"Toggle Alt modifier latch"},{id:"left",label:"←",code:oe.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:oe.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:oe.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:oe.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"drawer_agent",label:"Agent",code:"",type:"drawer",enabled:!0,drawerType:"agent",title:"Agent shortcuts"},{id:"drawer_symbols",label:"~|/",code:"",type:"drawer",enabled:!0,drawerType:"symbols",title:"Special Symbols"},{id:"drawer_fn",label:"Fn",code:"",type:"drawer",enabled:!0,drawerType:"fn",title:"Function Keys (F1-F12)"},{id:"enter",label:"Enter",code:oe.ENTER,type:"key",enabled:!0,title:"Enter / Return"}],Mv=[{id:"ctrl",label:"CTRL",code:"",type:"modifier",enabled:!0,modifierType:"ctrl",title:"Toggle Ctrl modifier latch"},{id:"alt",label:"ALT",code:"",type:"modifier",enabled:!0,modifierType:"alt",title:"Toggle Alt modifier latch"},{id:"shift",label:"SHIFT",code:"",type:"modifier",enabled:!0,modifierType:"shift",title:"Toggle Shift modifier latch"},{id:"meta",label:"META",code:"\x1B",type:"modifier",enabled:!0,modifierType:"meta",title:"Meta / Cmd key"},{id:"esc",label:"ESC",code:oe.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:oe.TAB,type:"key",enabled:!0,title:"Tab"},{id:"shift_tab",label:"⇧TAB",code:oe.SHIFT_TAB,type:"key",enabled:!0,title:"Shift+Tab"},{id:"enter",label:"Enter",code:oe.ENTER,type:"key",enabled:!0,title:"Enter / Return"},{id:"backspace",label:"⌫",code:oe.BACKSPACE,type:"key",enabled:!0,title:"Backspace"},{id:"delete",label:"Del",code:oe.DELETE,type:"key",enabled:!0,title:"Delete"},{id:"left",label:"←",code:oe.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:oe.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:oe.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:oe.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"home",label:"Home",code:oe.HOME,type:"key",enabled:!0,title:"Home"},{id:"end",label:"End",code:oe.END,type:"key",enabled:!0,title:"End"},{id:"page_up",label:"PgUp",code:oe.PAGE_UP,type:"key",enabled:!0,title:"Page Up"},{id:"page_down",label:"PgDn",code:oe.PAGE_DOWN,type:"key",enabled:!0,title:"Page Down"},{id:"insert",label:"Ins",code:oe.INSERT,type:"key",enabled:!0,title:"Insert"},{id:"ctrl_c",label:"^C",code:oe.CTRL_C,type:"chord",enabled:!0,title:"Ctrl+C (SIGINT)"},{id:"ctrl_d",label:"^D",code:oe.CTRL_D,type:"chord",enabled:!0,title:"Ctrl+D (EOF/Exit)"},{id:"ctrl_z",label:"^Z",code:oe.CTRL_Z,type:"chord",enabled:!0,title:"Ctrl+Z (SIGTSTP)"},{id:"ctrl_l",label:"^L",code:oe.CTRL_L,type:"chord",enabled:!0,title:"Ctrl+L (Clear Screen)"},{id:"ctrl_a",label:"^A",code:oe.CTRL_A,type:"chord",enabled:!0,title:"Ctrl+A (Beginning of Line)"},{id:"ctrl_e",label:"^E",code:oe.CTRL_E,type:"chord",enabled:!0,title:"Ctrl+E (End of Line)"},{id:"ctrl_k",label:"^K",code:oe.CTRL_K,type:"chord",enabled:!0,title:"Ctrl+K (Kill to End)"},{id:"ctrl_r",label:"^R",code:oe.CTRL_R,type:"chord",enabled:!0,title:"Ctrl+R (Reverse Search)"},{id:"f1",label:"F1",code:oe.F1,type:"fn",enabled:!0,title:"F1"},{id:"f2",label:"F2",code:oe.F2,type:"fn",enabled:!0,title:"F2"},{id:"f3",label:"F3",code:oe.F3,type:"fn",enabled:!0,title:"F3"},{id:"f4",label:"F4",code:oe.F4,type:"fn",enabled:!0,title:"F4"},{id:"f5",label:"F5",code:oe.F5,type:"fn",enabled:!0,title:"F5"},{id:"f6",label:"F6",code:oe.F6,type:"fn",enabled:!0,title:"F6"},{id:"f7",label:"F7",code:oe.F7,type:"fn",enabled:!0,title:"F7"},{id:"f8",label:"F8",code:oe.F8,type:"fn",enabled:!0,title:"F8"},{id:"f9",label:"F9",code:oe.F9,type:"fn",enabled:!0,title:"F9"},{id:"f10",label:"F10",code:oe.F10,type:"fn",enabled:!0,title:"F10"},{id:"f11",label:"F11",code:oe.F11,type:"fn",enabled:!0,title:"F11"},{id:"f12",label:"F12",code:oe.F12,type:"fn",enabled:!0,title:"F12"},{id:"drawer_agent",label:"Agent",code:"",type:"drawer",enabled:!0,drawerType:"agent",title:"Agent shortcuts"},{id:"drawer_chords",label:"^C",code:"",type:"drawer",enabled:!0,drawerType:"chords",title:"Quick Ctrl Chords"},{id:"drawer_symbols",label:"~|/",code:"",type:"drawer",enabled:!0,drawerType:"symbols",title:"Special Symbols"},{id:"drawer_fn",label:"Fn",code:"",type:"drawer",enabled:!0,drawerType:"fn",title:"Function Keys (F1-F12)"},{id:"sym_pipe",label:"|",code:"|",type:"symbol",enabled:!0,isPlainChar:!0,title:"Pipe (|)"},{id:"sym_tilde",label:"~",code:"~",type:"symbol",enabled:!0,isPlainChar:!0,title:"Tilde (~)"},{id:"sym_slash",label:"/",code:"/",type:"symbol",enabled:!0,isPlainChar:!0,title:"Slash (/)"},{id:"sym_backslash",label:"\\",code:"\\",type:"symbol",enabled:!0,isPlainChar:!0,title:"Backslash (\\)"},{id:"sym_dash",label:"-",code:"-",type:"symbol",enabled:!0,isPlainChar:!0,title:"Dash (-)"},{id:"sym_underscore",label:"_",code:"_",type:"symbol",enabled:!0,isPlainChar:!0,title:"Underscore (_)"},{id:"sym_dollar",label:"$",code:"$",type:"symbol",enabled:!0,isPlainChar:!0,title:"Dollar ($)"},{id:"sym_ampersand",label:"&",code:"&",type:"symbol",enabled:!0,isPlainChar:!0,title:"Ampersand (&)"},{id:"sym_quote",label:'"',code:'"',type:"symbol",enabled:!0,isPlainChar:!0,title:'Double Quote (")'},{id:"sym_backtick",label:"`",code:"`",type:"symbol",enabled:!0,isPlainChar:!0,title:"Backtick (`)"}];function Ir(){return JSON.parse(JSON.stringify(tg))}const _v=[["esc","tab","shift_tab","ctrl","alt","left","up","down","right","drawer_chords","drawer_symbols","drawer_fn","enter"],["esc","tab","ctrl","alt","left","up","down","right","enter","drawer_chords","drawer_symbols","drawer_fn"],["esc","tab","ctrl","alt","left","up","down","right","drawer_chords","drawer_symbols","drawer_fn","enter"]];function Lv(r){return _v.some(a=>r.length===a.length&&r.every((i,o)=>i.id===a[o]&&i.enabled!==!1))}function zv(r){if(!Array.isArray(r)||r.length===0)return Ir();const a=r.filter(i=>typeof i=="object"&&i!==null&&typeof i.id=="string"&&typeof i.label=="string"&&typeof i.code=="string");return Lv(a)?Ir():a}function Vu(r,a){if(a){const i=`keyTitles.${r.id}`,o=a(i);if(o&&o!==i)return o}return r.title||r.label}class Tl extends Error{constructor(i,o={}){super(i);fe(this,"code");fe(this,"params");this.name="KeyComboError",this.code=i,this.params=o}}const Dv={escape:"esc",return:"enter",pgup:"pageup",pgdn:"pagedown",backslash:"\\",plus:"+"},$m={esc:oe.ESC,tab:oe.TAB,enter:oe.ENTER,backspace:oe.BACKSPACE,delete:oe.DELETE,left:oe.LEFT,right:oe.RIGHT,up:oe.UP,down:oe.DOWN,home:oe.HOME,end:oe.END,pageup:oe.PAGE_UP,pagedown:oe.PAGE_DOWN,insert:oe.INSERT,space:" ","+":"+"},Ov={esc:"ESC",tab:"TAB",enter:"⏎",backspace:"⌫",delete:"DEL",left:"←",right:"→",up:"↑",down:"↓",home:"HOME",end:"END",pageup:"PGUP",pagedown:"PGDN",insert:"INS",space:"SPACE","+":"+"},Uv={2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹"};function ng(r,a){const i=r.toLowerCase().split("+");if(i.some(b=>!b))throw new Tl("invalidStepSyntax",{step:a+1});const o={};let d;for(const b of i)if(b==="ctrl"||b==="control"){if(o.ctrl)throw new Tl("duplicateModifier",{step:a+1,modifier:"Ctrl"});o.ctrl=!0}else if(b==="alt"||b==="option"){if(o.alt)throw new Tl("duplicateModifier",{step:a+1,modifier:"Alt"});o.alt=!0}else if(b==="shift"){if(o.shift)throw new Tl("duplicateModifier",{step:a+1,modifier:"Shift"});o.shift=!0}else if(d===void 0)d=b;else throw new Tl("multipleKeys",{step:a+1});if(!d)throw new Tl("missingKey",{step:a+1});const f=Dv[d]||d,p=/^f(?:[1-9]|1[0-2])$/.exec(f);let m;if(p)m=oe[f.toUpperCase()];else if(Object.hasOwn($m,f))m=$m[f];else if([...f].length===1&&/^[\x21-\x7e]$/.test(f))m=f;else throw new Tl("unsupportedKey",{step:a+1,key:f});return{key:m,keyName:f,modifiers:o,sequence:Hv(m,f,o)}}function Bv(r){return 1+(r.shift?1:0)+(r.alt?2:0)+(r.ctrl?4:0)}function ep(r,a){const i=[...r][0].codePointAt(0);return i===void 0?"":`\x1B[${i};${Bv(a)}u`}function Hv(r,a,i){if(!i.ctrl)return xo(r,i);if(a.length===1&&/^[\x20-\x7e]$/.test(a)){const o=a.toLowerCase();if(i.alt||i.shift||o==="m"||o==="i")return ep(o,i);if(o==="-"||o==="/"||o==="_")return"";const d=Xp(o);return d!==o?d:ep(o,i)}return xo(r,i)}function Al(r){if(typeof r!="string"||!r.trim())throw new Tl("empty");const a=r.trim().split(/\s+/);if(a.length>8)throw new Tl("tooManySteps",{count:8});return a.map((i,o)=>ng(i,o).sequence)}function bo(r){const a=r.trim().split(/\s+/);return a.length>1&&a.every(i=>["esc","escape"].includes(i.toLowerCase()))?`ESC${Uv[a.length]||` ×${a.length}`}`:a.map((i,o)=>{const{keyName:d,modifiers:f}=ng(i,o),p=Ov[d]||(/^f\d+$/.test(d),d.toUpperCase());return f.ctrl&&f.alt&&f.shift?`Ctrl+Alt+⇧${p}`:f.ctrl&&f.alt?`Ctrl+Alt+${p}`:f.ctrl&&f.shift?`^⇧${p}`:f.ctrl?`^${p}`:f.alt&&f.shift?`Alt+⇧${p}`:f.alt?`Alt+${p}`:f.shift?`⇧${p}`:p}).join(" ")}const Xu='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Symbols Nerd Font Mono", monospace',Kv='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',tp="JetBrains Mono, Menlo, Monaco, Consolas, monospace",qi="herdr_remote_settings_v1",Vr="herdr_remote_session_view_v1",lg=64,Zr=4096,Iu={local:{},session:{}};function Co(r,a){if(typeof window>"u")return Iu[r][a]||null;try{return(r==="local"?window.localStorage:window.sessionStorage).getItem(a)}catch{return Iu[r][a]||null}}function ei(r,a,i){if(Iu[r][a]=i,!(typeof window>"u"))try{(r==="local"?window.localStorage:window.sessionStorage).setItem(a,i)}catch(o){console.warn(`Failed to write to ${r}Storage:`,o)}}function Yv(){return`client-${Math.random().toString(36).substring(2,8)}`}function ld(){const r=Math.random().toString(36).substring(2,10);return`profile-${Date.now().toString(36)}-${r}`}function Gv(r,a){return(typeof r=="string"?r.trim().slice(0,lg):"")||a}function To(r,a){if(!r||typeof r!="object"||Array.isArray(r))return null;const i=r,o=typeof i.wsUrl=="string"?i.wsUrl.trim().slice(0,2048):"",d=typeof i.token=="string"?i.token.slice(0,Zr):"",f=typeof i.pairCode=="string"?i.pairCode.trim().toUpperCase().slice(0,32):"";if(!o||!o.startsWith("/")&&!/^(?:wss?|https?):\/\//i.test(o)||!d&&!f)return null;const p=Date.now(),m=typeof i.id=="string"&&i.id.length>0?i.id.slice(0,128):ld(),b=typeof i.hostname=="string"&&i.hostname.trim()?i.hostname.trim().slice(0,lg):`Herdr ${a+1}`;return{id:m,displayName:Gv(i.displayName,b),wsUrl:o,token:d,...f?{pairCode:f}:{},...typeof i.hostId=="string"&&i.hostId.trim()?{hostId:i.hostId.trim().slice(0,128)}:{},...typeof i.hostname=="string"&&i.hostname.trim()?{hostname:i.hostname.trim().slice(0,128)}:{},...typeof i.deviceId=="string"&&i.deviceId.trim()?{deviceId:i.deviceId.trim().slice(0,128)}:{},autoReconnect:i.autoReconnect!==!1,createdAt:Number.isFinite(i.createdAt)?Number(i.createdAt):p,lastUsedAt:Number.isFinite(i.lastUsedAt)?Number(i.lastUsedAt):p}}function np(r,a=0){const i=To({...r,id:r.id||ld()},a);if(!i)throw new Error("a connection profile requires a relay URL and token or pairing code");return i}function lp(r){let a=r.wsUrl.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"").toLowerCase();if(typeof window<"u")try{const i=new URL(r.wsUrl,window.location.origin);i.protocol=i.protocol==="wss:"?"https:":"http:",i.pathname=i.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"")||"/",i.search="",i.hash="",a=i.toString().replace(/\/$/,"").toLowerCase()}catch{}return`${a}::${r.hostId||""}`}function ag(){return typeof navigator<"u"&&navigator.language&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function ig(){const r=typeof window<"u"&&window.innerWidth<640;return{wsUrl:"/ws/client",token:"",pairCode:"",clientId:Yv(),autoReconnect:!0,profiles:[],activeProfileId:"",fontSize:r?td:Eo,fontFamily:Xu,toolbarVisible:!0,toolbarPosition:"bottom",vibrateOnKeyPress:!0,predictiveEcho:"auto",agentAlertBadge:!0,agentAlertSound:!1,agentAlertVibrate:!1,agentAlertNotify:!1,language:ag(),virtualKeys:Ir(),agentKeymaps:{},adminToken:"",adminTokens:{}}}const qv=["wsUrl","token","pairCode","clientId","autoReconnect","language","agentKeymaps"],Fv=["wsUrl","token","pairCode","autoReconnect"],ad=["fontSize","fontFamily","toolbarVisible","toolbarPosition","vibrateOnKeyPress","predictiveEcho","virtualKeys","agentAlertBadge","agentAlertSound","agentAlertVibrate","agentAlertNotify","adminToken","adminTokens"],Vv=ad.filter(r=>r!=="adminToken"&&r!=="adminTokens"),ap=["theme","colorMode"];function Zu(r){const a=r;if(!ap.some(d=>a[d]!==void 0))return{data:r,changed:!1};const o={...a};for(const d of ap)delete o[d];return{data:o,changed:!0}}function rg(r){if(!r||typeof r!="object"||Array.isArray(r))return{};const a={};for(const[i,o]of Object.entries(r).slice(0,32))typeof o!="string"||o.length===0||(a[i.slice(0,512)]=o.slice(0,Zr));return a}function sg(r){if(!r||typeof r!="object"||Array.isArray(r))return{};const a=Object.create(null);for(const[i,o]of Object.entries(r).slice(0,32)){if(!/^[a-z][a-z0-9_-]{0,31}$/i.test(i)||["__proto__","constructor","prototype"].includes(i)||!o||typeof o!="object"||Array.isArray(o))continue;const d=o,f={};if(Array.isArray(d.order)&&(f.order=[...new Set(d.order.filter(p=>typeof p=="string"&&/^[a-zA-Z0-9_-]{1,64}$/.test(p)))].slice(0,256)),d.actions&&typeof d.actions=="object"&&!Array.isArray(d.actions)){const p=Object.create(null);for(const[m,b]of Object.entries(d.actions).slice(0,256)){if(!/^[a-zA-Z0-9_-]{1,64}$/.test(m)||!b||typeof b!="object"||Array.isArray(b))continue;const v=b,y={};if(typeof v.keys=="string"&&v.keys.trim()){const w=v.keys.trim().slice(0,80);try{Al(w),y.keys=w}catch{}}typeof v.hidden=="boolean"&&(y.hidden=v.hidden),Object.keys(y).length>0&&(p[m]=y)}f.actions=p}if(Array.isArray(d.custom)){const p=new Set;f.custom=d.custom.slice(0,64).flatMap(m=>{if(!m||typeof m!="object"||Array.isArray(m))return[];const b=m;if(typeof b.id!="string"||!/^[a-zA-Z0-9_-]{1,64}$/.test(b.id)||["__proto__","constructor","prototype"].includes(b.id)||p.has(b.id))return[];if(typeof b.label!="string"||!b.label.trim()||typeof b.keys!="string"||!b.keys.trim())return[];const v=b.keys.trim().slice(0,80);try{Al(v)}catch{return[]}return p.add(b.id),[{id:b.id,label:b.label.trim().slice(0,64),keys:v}]})}a[i]=f}return a}function og(r){var f;const a=[];if((Array.isArray(r.profiles)?r.profiles.slice(0,64):[]).forEach((p,m)=>{const b=To(p,m);b&&!a.some(v=>v.id===b.id)&&a.push(b)}),a.length===0&&(typeof r.token=="string"&&r.token||typeof r.pairCode=="string"&&r.pairCode)){const p=To({id:"profile-migrated",displayName:"Herdr 1",wsUrl:typeof r.wsUrl=="string"&&r.wsUrl.trim()?r.wsUrl:"/ws/client",token:r.token||"",pairCode:r.pairCode||"",autoReconnect:r.autoReconnect!==!1},0);p&&a.push(p)}const o=typeof r.activeProfileId=="string"?r.activeProfileId:"",d=a.some(p=>p.id===o)?o:((f=a[0])==null?void 0:f.id)||"";return{profiles:a,activeProfileId:d}}function cg(){const r=ig();if(typeof window>"u")return r;let a={};const i=Co("local",qi);if(i)try{a=JSON.parse(i)}catch(ue){console.warn("Failed to parse localStorage settings:",ue)}const o=Zu(a);o.changed&&(a=o.data,ei("local",qi,JSON.stringify(a)));let d=null;const f=Co("session",Vr);if(f)try{d=JSON.parse(f)}catch(ue){console.warn("Failed to parse sessionStorage settings:",ue)}if(!d){const ue={};for(const ve of ad)a[ve]!==void 0&&(ue[ve]=a[ve]);d=ue,ei("session",Vr,JSON.stringify(d))}let p=d.fontFamily??a.fontFamily??r.fontFamily;(!p||p===tp||p===Kv)&&(p=Xu);const m=window.innerWidth<640?td:Eo,b=d.fontSize??a.fontSize??r.fontSize,v=So(b,m),y=d.virtualKeys??a.virtualKeys??r.virtualKeys,w=zv(y),T=a.language??r.language,R=T==="zh"||T==="en"?T:ag(),k=og(a),K=k.profiles.find(ue=>ue.id===k.activeProfileId),z=Zu(d);z.changed&&(d=z.data,ei("session",Vr,JSON.stringify(d)));const X=d.toolbarVisible??a.toolbarVisible??r.toolbarVisible,I=d.toolbarPosition??a.toolbarPosition??r.toolbarPosition,P=d.vibrateOnKeyPress??a.vibrateOnKeyPress??r.vibrateOnKeyPress,ae=ue=>{const ve=d[ue]??a[ue];return typeof ve=="boolean"?ve:r[ue]},be=(d==null?void 0:d.predictiveEcho)??(a==null?void 0:a.predictiveEcho)??r.predictiveEcho,se=be==="always"||be==="off"||be==="auto"?be:"auto",G=typeof d.adminToken=="string"?d.adminToken.slice(0,Zr):typeof a.adminToken=="string"?a.adminToken.slice(0,Zr):r.adminToken,U=rg(d.adminTokens),le={...r,...a,...d,wsUrl:(K==null?void 0:K.wsUrl)||(typeof a.wsUrl=="string"?a.wsUrl:r.wsUrl),token:(K==null?void 0:K.token)||"",pairCode:(K==null?void 0:K.pairCode)||"",autoReconnect:(K==null?void 0:K.autoReconnect)??r.autoReconnect,profiles:k.profiles,activeProfileId:k.activeProfileId,clientId:typeof a.clientId=="string"&&a.clientId.trim()?a.clientId.trim().slice(0,128):r.clientId,fontFamily:p,fontSize:v,toolbarVisible:X,toolbarPosition:I,vibrateOnKeyPress:P,predictiveEcho:se,virtualKeys:w,agentKeymaps:sg(a.agentKeymaps),agentAlertBadge:ae("agentAlertBadge"),agentAlertSound:ae("agentAlertSound"),agentAlertVibrate:ae("agentAlertVibrate"),agentAlertNotify:ae("agentAlertNotify"),language:R,adminToken:G,adminTokens:U};return a.fontFamily===tp&&(a.fontFamily=Xu,ei("local",qi,JSON.stringify(a))),le}function Ea(r){var T;const i={...cg(),...r};i.agentKeymaps=sg(i.agentKeymaps),i.adminTokens=rg(i.adminTokens),typeof i.adminToken=="string"&&(i.adminToken=i.adminToken.slice(0,Zr)),r.fontSize!==void 0&&(i.fontSize=So(r.fontSize)),r.predictiveEcho!==void 0&&(r.predictiveEcho==="auto"||r.predictiveEcho==="always"||r.predictiveEcho==="off"?i.predictiveEcho=r.predictiveEcho:i.predictiveEcho="auto");const o=og(i);let d=o.profiles,f=o.activeProfileId;if(Fv.some(R=>r[R]!==void 0)){const R=d.findIndex(z=>z.id===f),k=R>=0?{...d[R]}:{id:ld(),displayName:`Herdr ${d.length+1}`,wsUrl:i.wsUrl,token:"",autoReconnect:!0,createdAt:Date.now(),lastUsedAt:Date.now()};k.wsUrl=i.wsUrl,k.token=i.token,k.pairCode=i.pairCode||void 0,k.autoReconnect=i.autoReconnect,k.lastUsedAt=Date.now();const K=To(k,Math.max(R,0));K?R>=0?d[R]=K:(d.push(K),f=K.id):R>=0&&(d=d.filter(z=>z.id!==f),f=((T=d[0])==null?void 0:T.id)||"")}d.length>0&&!d.some(R=>R.id===f)&&(f=d[0].id);const m=d.find(R=>R.id===f);i.profiles=d,i.activeProfileId=f,i.wsUrl=(m==null?void 0:m.wsUrl)||i.wsUrl||"/ws/client",i.token=(m==null?void 0:m.token)||"",i.pairCode=(m==null?void 0:m.pairCode)||"",i.autoReconnect=(m==null?void 0:m.autoReconnect)??i.autoReconnect;const b=Co("local",qi);let v={};if(b)try{v=JSON.parse(b)}catch{}v=Zu(v).data;for(const R of qv)i[R]!==void 0&&(v[R]=i[R]);v.profiles=d,v.activeProfileId=f,ei("local",qi,JSON.stringify(v));const y=Co("session",Vr);let w={};if(y)try{w=JSON.parse(y)}catch{}for(const R of ad)i[R]!==void 0&&(w[R]=i[R]);ei("session",Vr,JSON.stringify(w));for(const R of Vv)i[R]!==void 0&&(v[R]=i[R]);return ei("local",qi,JSON.stringify(v)),i}const Xv={header:{appName:"Herdr",tagline:"remote terminal client",terminalTab:"Terminal",adminTab:"Admin",rttMs:"{rtt}ms",hostLabel:"Host",clientIdLabel:"ID:",copyClientIdTitle:"Click to copy Client ID",languageToggleTitle:"Switch language (EN / 中文)",pairingTitle:"Connection & pairing",settingsTitle:"Terminal settings",virtualKeyboardTitle:"Quick command helper",latencyTitle:"Round-trip latency (RTT)",mainNavigationAria:"Main Navigation",actionKeyboard:"cmd",actionPairing:"link",actionSettings:"cfg",languageShort:"en"},common:{connecting:"Connecting...",connected:"Connected",reconnecting:"Reconnecting...",disconnected:"Disconnected",error:"Error",save:"Save",cancel:"Cancel",close:"Close",done:"Done",retry:"Retry",connect:"Connect",disconnect:"Disconnect",copy:"Copy",copied:"Copied",loading:"Loading...",offline:"Offline",role:"Role",host:"Host",status:"Status",settings:"Settings",admin:"Admin",terminal:"Terminal",pairing:"Pairing",keyBar:"Key bar",quickInput:"Quick input",dismissNotification:"Dismiss notification",closeDialog:"Close dialog",clickToCopy:"Click to copy",controller:"Controller",viewer:"Viewer",live:"Live"},connection:{live:"Live",connecting:"Connecting",reconnecting:"Reconnecting",reconnectNow:"Reconnect now",error:"Error",offline:"Offline",connect:"Connect",retry:"Retry"},role:{controllerMode:"Controller mode active",viewerMode:"Viewer mode",controlActive:"Full Control",viewerReadOnly:"Viewer",viewerWithController:"Viewer (Active: {controllerId})",sharedControl:"Full control",sharedControlDesc:"Every paired window shares this terminal and may type into it.",sharedWindows:"{count} windows",thisWindow:"Window",claimControl:"Claim Control",claimControlTitle:"Claim terminal control",releaseControl:"Release",releaseControlTitle:"Switch to viewer mode",takeoverControl:"Takeover",takeoverControlTitle:"Take over control from {controllerId}",takeoverModalTitle:"Confirm Control Takeover",takeoverModalDesc:"Another client is controlling this terminal.",takeoverModalWarning:"Input focus will transfer to this window.",confirmTakeover:"Confirm Takeover"},statusBanner:{connecting:"Connecting to relay...",reconnectingDefault:"Connection lost. Reconnecting...",reconnectNow:"Reconnect Now",errorDefault:"Unable to connect to relay",disconnected:"Terminal disconnected"},onboarding:{title:"Pair with Herdr Remote",subtitle:"Connect your mobile or browser to your local terminal session",description:"Control Herdr sessions from any browser or phone.",firstTimeSetup:"First-time Setup",authRequired:"Authorization Required",authRequiredDesc:"Pair your device or provide a valid access token.",step1Title:"Generate Pairing Code on Host",step1Desc:"Run on the host running Herdr:",step1CopyPlugin:"Using Herdr Plugin:",step1CopyCli:"Copy CLI Command",step1TuiNote:"Interactive TUI config:",step2Title:"Enter 6-character Pairing Code",step2Placeholder:"e.g. 7X9K2A",step2Note:"Pairing code expires in 5 minutes; credentials are saved automatically.",connectAndPair:"Connect & Pair",connectingAndPairing:"Pairing with Relay...",advancedTitle:"Advanced Options",manualTokenLabel:"Authentication Token",manualTokenPlaceholder:"Optional token (skips pairing code)",wsEndpointLabel:"Relay WebSocket Endpoint",wsEndpointPlaceholder:"/ws/client or wss://your-relay-host/ws/client",clientIdLabel:"Device Client Identifier"},pairing:{title:"Relay Connection & Pairing",addTitle:"Add Herdr Instance",displayNameLabel:"Host Name",displayNamePlaceholder:"e.g. Workstation",displayNameHelp:"This name is stored only in this browser.",credentialsRequired:"Enter a pairing code or device token.",subtitle:"Manage WebSocket endpoints and credentials",pairCodeLabel:"Pairing Code",pairCodeNote:"(6-char code)",pairCodePlaceholder:"e.g. A1B2C3",pairCodeHelp:'Run "herdr-remote pair" on host.',tokenLabel:"Access Token",tokenNote:"(Device secret)",tokenPlaceholder:"Device token...",wsUrlLabel:"Relay WebSocket Endpoint URL",wsUrlPlaceholder:"/ws/client",wsUrlDefaultNote:"Defaults to same-origin /ws/client",clientIdLabel:"Client Identifier",newIdButton:"New ID",regenerateClientIdTitle:"Regenerate client ID",autoReconnectLabel:"Auto-reconnect",autoReconnectDesc:"Automatically reconnect when disconnected",copyDirectLink:"Copy direct pairing link",saveAndConnect:"Save & Connect"},settings:{title:"Terminal Preferences",subtitle:"Font, size, and touch settings",tabGeneral:"General",tabAppearance:"Appearance & Font",tabVirtualKeys:"Virtual Keys",tabAgentKeymaps:"Agent Keys",fontFamilyLabel:"Monospace Font",fontSizeLabel:"Terminal Text Size ({size}px)",fontSizeCompact:"10px (Compact)",fontSizeDefault:"15px (Default)",fontSizeLarge:"24px (Large)",mobileFontNote:"Terminal font scales automatically on small screens for 80-column layout.",colorPassthroughNote:"Terminal colors and cursor style pass through from the host.",predictiveEchoLabel:"Predictive Echo",predictiveEchoAuto:"Auto",predictiveEchoAlways:"Always On",predictiveEchoOff:"Off",predictiveEchoDesc:"Under high latency, show what you type in a shell prompt or an agent’s input box before the echo comes back. Menus and other screens are never predicted.",touchKeyToolbar:"Touch Key Toolbar",touchKeyToolbarDesc:"Show modifier and navigation keys",touchHaptics:"Haptic Feedback",touchHapticsDesc:"Vibrate on key press",agentAlertsLabel:"Agent alerts",agentAlertBadge:"Title and icon badge",agentAlertBadgeDesc:"Count blocked and finished agents in the tab title, and mark the tab icon",agentAlertVibrate:"Vibrate",agentAlertVibrateDesc:"When an agent stops to ask or finishes, while this page is on screen",agentAlertSound:"Chime",agentAlertSoundDesc:"A short sound while this page is in the background; starts working after your next tap",agentAlertNotify:"System notification",agentAlertNotifyDesc:"While this page is in the background (HTTPS only)",languageLabel:"Language",languageDesc:"Choose English or 简体中文",resetDefaults:"Reset to Defaults",resetDefaultsToast:"Settings reset to defaults",windowZoomSharedNote:"Host view isolation is not active; zoom applies locally.",fontSizeZoomHelp:"Adjusts font size in this window only."},agentKeymaps:{keymapLabel:"Keymap",auto:"Auto",shell:"Shell",agentGroup:"Agent",genericGroup:"General",settingsProfileLabel:"Agent profile",autoProfile:"Auto · {profile}",pinnedProfile:"Pinned · {profile}",showAction:"Show",shortcutLabel:"Shortcut",comboPlaceholder:"e.g. ctrl+e or esc esc",invalidCombo:"Invalid shortcut: {error}",defaultCombo:"Default: {combo}",resetAction:"Reset",moveUp:"Move up",moveDown:"Move down",unverified:"Unverified",addCustom:"Custom key",customLabel:"Function name",customCombo:"Key combo",addAction:"Add custom key",restoreProfile:"Restore this agent defaults",removeCustom:"Remove custom key",configHint:"Agent config: {path}",noAgentActions:"No agent-specific shortcuts.",errors:{empty:"Enter at least one key.",tooManySteps:"A shortcut can have at most {count} steps.",invalidStepSyntax:"Step {step} has invalid syntax. Use ctrl+o or esc esc.",duplicateModifier:"Step {step} repeats {modifier}.",missingKey:"Step {step} needs a key after the modifiers.",multipleKeys:"Step {step} can have only one key.",unsupportedKey:"Step {step} does not support “{key}”."}},agentActions:{mode:"Mode",rewind:"Rewind",details:"Details",model:"Model",thinking:"Thinking",todos:"Tasks",background:"Background",editor:"Editor",history:"History",stash:"Stash",pasteImage:"Paste image",newline:"New line",interrupt:"Interrupt",editPrevious:"Edit previous",queue:"Queue prompt",copy:"Copy",clear:"Clear",yolo:"YOLO mode",expand:"Expand",undo:"Undo",agent:"Next agent",agentBack:"Previous agent",palette:"Command palette",recentModel:"Recent model",variant:"Model variant",newSession:"New session",sessions:"Sessions",thinkingMode:"Thinking mode",nextModel:"Next model",modelPicker:"Model picker",tools:"Tools",thinkingBlocks:"Thinking blocks",followup:"Follow-up",dequeue:"Remove from queue",plan:"Plan mode",temporaryModel:"Temporary model",expandAll:"Expand all",reasoning:"Reasoning effort",review:"Review",specMode:"Spec mode",autonomy:"Autonomy",undoPicker:"Undo picker",steer:"Steer",sidebar:"Sidebar",agents:"Agents",permissionMode:"Permission mode",bypass:"Bypass permissions",tasks:"Tasks",interject:"Interject",multiline:"Multiline input",shortcuts:"Shortcuts",approve:"Approve",eof:"End of input",suspend:"Suspend",startOfLine:"Line start",endOfLine:"Line end",killToEnd:"Delete to line end",agentSwap:"Switch agent",activity:"Activity",planAct:"Plan / Act",autoApprove:"Auto-approve",search:"Search"},virtualKeyboard:{collapseToolbar:"Collapse Toolbar",expandToolbar:"Expand Toolbar",helperTitle:"Quick Commands",closeHelper:"Close Helper",placeholder:"Type command and press Enter...",sendButton:"Send",clearInput:"Clear Input",customizeTitle:"Custom Key Toolbar",customizeDesc:"Reorder, enable, or disable keys for your toolbar.",enabledKeysCount:"{count} keys enabled",resetLayout:"Reset to Default",addKey:"Add Key",availableKeys:"Available Keys",moveUp:"Move Up",moveDown:"Move Down",enableKey:"Enable Key",disableKey:"Disable Key",deleteKeyTitle:"Remove Key",keyTypeModifier:"Modifier",keyTypeNav:"Navigation",keyTypeAction:"Action",keyTypeChord:"Chord",keyTypeFn:"Function",keyTypeSymbol:"Symbol",fnDrawerTitle:"Function Keys (F1-F12)",chordsDrawerTitle:"Control Chords (^C, ^D, ^Z)",symbolsDrawerTitle:"Symbols (~, |, /, \\)",touchKeyboardShortcuts:"Shortcuts Toolbar",ctrlCTitle:"Ctrl+C (SIGINT)",ctrlDTitle:"Ctrl+D (EOF)",ctrlZTitle:"Ctrl+Z (SIGTSTP)",ctrlLTitle:"Ctrl+L (Clear)",ctrlRTitle:"Ctrl+R (Search)",ctrlATitle:"Ctrl+A (Start of line)",ctrlETitle:"Ctrl+E (End of line)",ctrlKTitle:"Ctrl+K (Kill to end)",badgeSigint:"SIGINT",badgeEof:"EOF",badgeTstp:"SIGTSTP",badgeClear:"CLEAR",badgeSearch:"SEARCH",badgeStart:"START",badgeEnd:"END",badgeKill:"KILL",keyEnter:"Enter",uploadImage:"Upload Image",uploadImageTitle:"Select and upload image to terminal",image:"Image",uploadProgressReading:"Reading...",uploadProgressProcessing:"Compressing...",uploadProgressSending:"Uploading...",uploadProgressWaitingHost:"Waiting for host...",uploadProgressCompleted:"Completed",uploadProgressFailed:"Upload failed"},profiles:{title:"Herdr instances",switcherLabel:"Switch Herdr instance",current:"current",empty:"No paired Herdr instances yet.",addHost:"Add Herdr instance",rename:"Rename instance",remove:"Remove locally",removeConfirm:"Remove this saved connection from this browser?"},mobile:{sessionControls:"Session controls",closeSessionControls:"Close session controls",connectionStatusAria:"Connection status",terminalControlAria:"Terminal control",inputControl:"Input control",settingsAria:"Terminal settings",adminAria:"Admin dashboard",pairingAria:"Connection & pairing",keybarAria:"Toggle key toolbar",quickInputAria:"Toggle quick commands",menu:"Menu",statusBarAria:"Session status bar"},terminal:{bannerTitle:"Herdr Remote WebUI",bannerSubtitle:"Connected to Herdr session.",windowAriaLabel:"Terminal Window",bufferAriaLabel:"Terminal Buffer",offlineStatusAria:"Offline Status",releaseControlAria:"Release Control",takeoverControlAria:"Takeover Control",claimControlAria:"Claim Control"},keyTitles:{esc:"Escape (ESC)",tab:"Tab",shift_tab:"Shift+Tab (Claude Code: cycle modes)",ctrl:"Toggle Ctrl Lock",alt:"Toggle Alt Lock",shift:"Toggle Shift Lock",meta:"Meta / Cmd",enter:"Enter",backspace:"Backspace",delete:"Delete",left:"Left (←)",up:"Up (↑)",down:"Down (↓)",right:"Right (→)",home:"Home",end:"End",page_up:"Page Up",page_down:"Page Down",insert:"Insert",drawer_chords:"Ctrl Chords",drawer_agent:"Agent shortcuts",drawer_symbols:"Symbols",drawer_fn:"Function Keys (F1-F12)",ctrl_c:"Ctrl+C (SIGINT)",ctrl_d:"Ctrl+D (EOF)",ctrl_z:"Ctrl+Z (SIGTSTP)",ctrl_l:"Ctrl+L (Clear)",ctrl_a:"Ctrl+A (Start of line)",ctrl_e:"Ctrl+E (End of line)",ctrl_k:"Ctrl+K (Kill to end)",ctrl_r:"Ctrl+R (Search history)",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",sym_pipe:"Pipe (|)",sym_tilde:"Tilde (~)",sym_slash:"Slash (/)",sym_backslash:"Backslash (\\)",sym_dash:"Dash (-)",sym_underscore:"Underscore (_)",sym_dollar:"Dollar ($)",sym_ampersand:"Ampersand (&)",sym_quote:'Quote (")',sym_backtick:"Backtick (`)"},admin:{title:"Admin Dashboard",subtitle:"Connected hosts, paired devices, and relay traffic",returnToTerminal:"Return to Terminal",terminalShells:"Terminal Shells",startedAt:"Started at {time}",accessPanel:"Access",acrossWindows:"across {count} windows",perSecond:"{value}/s",framesPerSecond:"{count} fps",unitDay:"d",unitHour:"h",unitMinute:"m",unitSecond:"s",startedRecently:"Started recently",updatedAt:"Updated at {time}",autoRefresh:"Auto Refresh:",paused:"Paused",refreshNow:"Refresh",connectedHosts:"Connected Hosts",activeUsers:"Active Users",activePtys:"Active PTYs",activeController:"Active Controller",uptime:"Uptime",none:"None",noHost:"No host connected",tabOverview:"Overview",tabClients:"Clients ({count})",tabPtys:"PTY Sessions ({count})",tabDevices:"Paired Devices ({count})",throughput:"Throughput",bytesInTotal:"Total Inbound:",bytesOutTotal:"Total Outbound:",frameRate:"Frame Rate:",hostsTitle:"Hosts ({count})",noHosts:"No hosts connected or paired",hostConnectedDevices:"{count} connected",hostPairedDevices:"{count} paired",hostStatusOnline:"Online",hostStatusBusy:"In use",hostStatusReconnecting:"Reconnecting",hostStatusOffline:"Offline",hostRosterOperatorOnly:"Device list is visible to the relay operator only.",connectedClientsTitle:"Connected Clients ({count})",noClients:"No clients connected",colClientId:"Client ID",colDevice:"Device",colDeviceId:"Device ID",colLastSeen:"Last Seen",colActions:"Actions",unknownDevice:"Unknown Device",pairedDevicesTitle:"Paired Devices ({count})",noDevices:"No paired devices",revokeDevice:"Revoke",revokeConfirm:"Confirm Revocation",revokeFailed:"Revocation failed",colRole:"Role",colIp:"IP Address",colConnectedAt:"Connected At",colTraffic:"Traffic (In/Out)",activePtysTitle:"Active PTY Sessions ({count})",noPtys:"No active PTY sessions",colPtyId:"PTY ID",colPid:"PID",colCommand:"Command",colGrid:"Grid",colCwd:"Working Directory",colViewers:"Windows",copiedJson:"Copied",unauthorizedTitle:"Unauthorized (401/403)",unauthorizedDesc:"GET /api/status requires an authorized device token.",pairingStepsTitle:"Device Pairing:",pairingStepsHelp:"Run pairing command on host to get a code, then enter it here.",enterPairCodeBtn:"Enter Pairing Code",retryFetchBtn:"Retry Status",errorConnecting:"Failed to fetch GET /api/status: {error}",loadingStatus:"Loading status from /api/status...",remoteRelayTitle:"Remote Relay Administration",remoteRelayBadge:"Connected to Remote Relay",remoteRelayNotice:"Connected to remote relay. For server metrics, access the operator dashboard.",remoteRelayEndpoint:"Remote WebSocket Endpoint:",remoteRelayAdminUrl:"Remote Admin URL:",openRemoteAdminBtn:"Open Remote Admin",remoteRelayHelp:"Open remote relay admin dashboard.",relayAdminTitle:"Relay Operator Dashboard",relayAdminTokenLabel:"Relay Admin Token (X-Relay-Admin-Token)",relayAdminTokenPlaceholder:"Enter RELAY_ADMIN_TOKEN...",relayAdminNotConfigured:"RELAY_ADMIN_TOKEN is not configured on this relay.",relayAdminLoginBtn:"Verify & View Metrics",relayAdminAuthError:"Invalid or unauthorized admin token.",remoteRelayClientNotice:"Terminal client connection. For server metrics, use the operator dashboard.",openOperatorPortal:"Open Operator Dashboard",localWorkstationBadge:"Local Relay",modeLocal:"Local Mode",modeRemote:"Remote Mode",hintTabs:"switch tabs",hintRefresh:"refresh status",hintBack:"return to terminal"},toasts:{connected:"Connected to relay",connectionError:"Connection error",controlGranted:"Control granted",controlDenied:"Request denied: another controller is active",controlRevoked:"Control transferred to another device",pairedSuccess:"Paired successfully",sessionEnded:"Session ended",controlReleased:"Control released",viewerModeWarning:'In viewer mode. Click "Claim Control" first.',clientIdCopied:"Client ID copied: {id}",pairingLinkCopied:"Pairing link copied",switchedLanguage:"Language switched to {lang}",settingsReset:"Settings reset to default",fontReset:"Font reset to default",commandCopied:"Command copied",keyLayoutReset:"Key layout reset"},shortcuts:{title:"Shortcuts",help:"Active outside terminal input area:",terminalInputNote:"Terminal shortcuts pass directly to host PTY."},serverErrors:{auth_required:"Pairing required: enter a pairing code, or a device token that is still valid.",unauthorized:"This device is not authorised for that workstation.",host_offline:"The paired workstation is not connected to this relay.",host_disconnected:"The workstation disconnected.",stale_host:"The workstation stopped answering and was dropped.",too_many_clients:"That workstation has reached its window limit.",rate_limited:"Too many pairing attempts. Wait a minute and try again.",invalid_handshake:"The relay rejected the handshake. Reload the page.",device_revoked:"This device was revoked by the relay operator.",connection_closed:"Connection closed. Reconnecting…",connection_stale:"The connection went quiet while the page was away. Reconnecting…",connection_stalled:"Connecting took too long. Trying again…",connection_failed:"Could not open a connection to the relay.",host_reconnecting:"The Herdr host is reconnecting.",host_reconnect_timeout:"The Herdr host did not reconnect in time.",host_replaced:"The Herdr host connection was replaced.",slow_client:"This browser was disconnected because it could not keep up.",client_send_failed:"The relay could not send data to this browser.",too_many_hosts:"This relay has reached its host limit.",paste_file_unsupported:"Unsupported image format for paste.",paste_file_too_large:"Pasted image exceeds 3 MB limit.",paste_file_write_failed:"Failed to save pasted image on host.",paste_file_empty:"Pasted image payload is empty.",paste_file_corrupt:"Pasted image data is corrupt or does not match declared MIME.",viewer_mode:"Viewer mode cannot paste to terminal.",no_session:"Terminal session is not ready."},fontPresets:{system:"System Default",apple:"SF Mono / Menlo",windows:"Consolas",linux:"Liberation Mono",courier:"Courier New",firacode:"Fira Code"},agents:{title:"Agents on this workstation",blocked:"blocked",done:"done",working:"working",allIdle:"agents idle",notifyBlocked:"{count} agent(s) waiting for you",notifyDone:"{count} agent(s) finished"},clipboard:{openLink:"Open Link",openLinkFailed:"This link cannot be opened from the browser",copySelection:"Copy Selection",copyLine:"Copy Line",copyScreen:"Copy Screen",paste:"Paste",cancel:"Cancel",copied:"Copied to clipboard",copyFailed:"Failed to copy",pasteHint:"Long-press here to paste, then tap Send",pasteSend:"Send",pasteUnavailable:"Clipboard is empty or unavailable",pasteTitle:"Paste Content",pasted:"Pasted",chooseImage:"Choose Image",takePhoto:"Take Photo",imageTooLarge:"Image exceeds 3 MB limit and cannot be compressed further.",imageCompressedSize:"Compressed: {size}",fileEmpty:"File is empty.",decodeFailed:"Failed to decode image file.",unsupportedType:"Unsupported format. Only PNG, JPEG, WebP, and GIF are supported.",imageSectionTitle:"Image",textSectionTitle:"Text",imageCompressing:"Processing image...",removeImage:"Remove image"}},Iv={header:{appName:"Herdr",tagline:"远程终端客户端",terminalTab:"终端",adminTab:"管理面板",rttMs:"{rtt}ms",hostLabel:"主机",clientIdLabel:"客户端 ID:",copyClientIdTitle:"点击复制客户端 ID",languageToggleTitle:"切换语言 (EN / 中文)",pairingTitle:"连接与配对",settingsTitle:"终端设置",virtualKeyboardTitle:"快捷命令",latencyTitle:"网络延迟 (RTT)",mainNavigationAria:"主导航菜单",actionKeyboard:"命令",actionPairing:"配对",actionSettings:"设置",languageShort:"中"},common:{connecting:"连接中...",connected:"已连接",reconnecting:"重连中...",disconnected:"已断开",error:"错误",save:"保存",cancel:"取消",close:"关闭",done:"完成",retry:"重试",connect:"连接",disconnect:"断开连接",copy:"复制",copied:"已复制",loading:"加载中...",offline:"离线",role:"角色",host:"主机",status:"连接状态",settings:"设置",admin:"管理面板",terminal:"终端",pairing:"配对",keyBar:"按键条",quickInput:"快捷输入",dismissNotification:"关闭通知",closeDialog:"关闭对话框",clickToCopy:"点击复制",controller:"控制端",viewer:"观察者",live:"运行中"},connection:{live:"在线",connecting:"连接中",reconnecting:"正在重连",reconnectNow:"立即重连",error:"连接错误",offline:"离线",connect:"发起连接",retry:"重试"},role:{controllerMode:"控制模式",viewerMode:"观察者模式",controlActive:"控制端",viewerReadOnly:"观察者",viewerWithController:"观察者(控制者: {controllerId})",sharedControl:"完全控制",sharedControlDesc:"所有已配对窗口共享同一个终端,均可输入。",sharedWindows:"{count} 个窗口",thisWindow:"本窗口",claimControl:"获取控制权",claimControlTitle:"获取终端控制权",releaseControl:"释放控制权",releaseControlTitle:"切回观察者模式",takeoverControl:"强占控制权",takeoverControlTitle:"从 {controllerId} 接管控制权",takeoverModalTitle:"确认接管终端控制权?",takeoverModalDesc:"当前已有其他客户端控制该终端。",takeoverModalWarning:"接管后输入焦点切换至当前窗口。",confirmTakeover:"确认接管"},statusBanner:{connecting:"连接 Relay 服务中...",reconnectingDefault:"连接断开,正在重连...",reconnectNow:"立即重连",errorDefault:"无法连接 Relay 服务",disconnected:"会话已断开"},onboarding:{title:"配对 Herdr Remote",subtitle:"连接手机或浏览器至本地终端会话",description:"在浏览器或移动设备中控制 Herdr 会话。",firstTimeSetup:"首次配对",authRequired:"需要认证",authRequiredDesc:"使用配对码配对设备,或提供有效访问令牌。",step1Title:"在 Herdr 宿主机生成配对码",step1Desc:"在运行 Herdr 的主机终端执行:",step1CopyPlugin:"使用 Herdr 插件:",step1CopyCli:"复制 CLI 命令",step1TuiNote:"交互式 TUI 配置:",step2Title:"输入 6 位配对码",step2Placeholder:"例如:7X9K2A",step2Note:"配对码 5 分钟内有效,连接后自动保存凭据。",connectAndPair:"连接并完成配对",connectingAndPairing:"配对中...",advancedTitle:"高级选项",manualTokenLabel:"认证 Token",manualTokenPlaceholder:"可选 Token(跳过配对码)",wsEndpointLabel:"Relay WebSocket 端点",wsEndpointPlaceholder:"/ws/client 或 wss://relay-host/ws/client",clientIdLabel:"客户端标识 (Client ID)"},pairing:{title:"Relay 连接与配对",addTitle:"添加 Herdr 实例",displayNameLabel:"主机名称",displayNamePlaceholder:"例如:工作电脑",displayNameHelp:"名称仅保存在此浏览器中。",credentialsRequired:"请输入配对码或设备令牌。",subtitle:"管理 WebSocket 服务端点与凭证",pairCodeLabel:"配对码",pairCodeNote:"(6 位代码)",pairCodePlaceholder:"例如:A1B2C3",pairCodeHelp:'在主机运行 "herdr-remote pair" 获取。',tokenLabel:"访问 Token",tokenNote:"(设备凭据)",tokenPlaceholder:"设备 Token...",wsUrlLabel:"Relay WebSocket 端点",wsUrlPlaceholder:"/ws/client",wsUrlDefaultNote:'默认同源端点 "/ws/client"',clientIdLabel:"客户端标识",newIdButton:"生成新 ID",regenerateClientIdTitle:"重新生成客户端 ID",autoReconnectLabel:"掉线自动重连",autoReconnectDesc:"连接断开时自动尝试重连",copyDirectLink:"复制配对链接(含配对码)",saveAndConnect:"保存并连接"},settings:{title:"终端设置",subtitle:"字体、字号与触控管理",tabGeneral:"常规设置",tabAppearance:"终端与字体",tabVirtualKeys:"虚拟按键",tabAgentKeymaps:"智能体按键",fontFamilyLabel:"等宽字体",fontSizeLabel:"终端字号 ({size}px)",fontSizeCompact:"10px (紧凑)",fontSizeDefault:"15px (默认)",fontSizeLarge:"24px (大字号)",mobileFontNote:"小屏设备自动适配字号,保持 80 列完整显示。",colorPassthroughNote:"终端配色与光标样式透传自宿主环境。",predictiveEchoLabel:"预测回显",predictiveEchoAuto:"自动",predictiveEchoAlways:"始终开启",predictiveEchoOff:"关闭",predictiveEchoDesc:"高延迟时,在 shell 提示符或智能体输入框里先行显示输入的字符,回显到达后自动校正。菜单等其他界面不做预测。",touchKeyToolbar:"底部触控按键条",touchKeyToolbarDesc:"显示移动端修饰键与方向键工具栏",touchHaptics:"触控振动反馈",touchHapticsDesc:"移动端按键时轻微震动",agentAlertsLabel:"智能体提醒",agentAlertBadge:"标题与图标角标",agentAlertBadgeDesc:"在标签页标题里显示等待确认和已完成的智能体数量,并在图标上加角标",agentAlertVibrate:"震动",agentAlertVibrateDesc:"智能体停下来等你确认或完成时震动(页面在前台时)",agentAlertSound:"提示音",agentAlertSoundDesc:"页面在后台时播放短提示音;下次点击页面后生效",agentAlertNotify:"系统通知",agentAlertNotifyDesc:"页面在后台时发系统通知(仅 HTTPS)",languageLabel:"显示语言",languageDesc:"选择 English 或 简体中文",resetDefaults:"恢复默认设置",resetDefaultsToast:"设置已恢复默认",windowZoomSharedNote:"当前宿主未启用视图隔离,字号调整仅影响本地窗口。",fontSizeZoomHelp:"仅调节当前窗口字号,不影响其他窗口。"},agentKeymaps:{keymapLabel:"按键方案",auto:"自动",shell:"Shell",agentGroup:"智能体",genericGroup:"通用",settingsProfileLabel:"智能体方案",autoProfile:"自动 · {profile}",pinnedProfile:"固定 · {profile}",showAction:"显示",shortcutLabel:"快捷键",comboPlaceholder:"例如 ctrl+e 或 esc esc",invalidCombo:"快捷键无效:{error}",defaultCombo:"默认:{combo}",resetAction:"重置",moveUp:"上移",moveDown:"下移",unverified:"未验证",addCustom:"自定义按键",customLabel:"功能名称",customCombo:"按键组合",addAction:"添加自定义按键",restoreProfile:"恢复此智能体默认设置",removeCustom:"删除自定义按键",configHint:"智能体配置:{path}",noAgentActions:"此智能体没有专用快捷键。",errors:{empty:"至少输入一个按键。",tooManySteps:"快捷键最多包含 {count} 个步骤。",invalidStepSyntax:"第 {step} 步格式无效。可输入 ctrl+o 或 esc esc。",duplicateModifier:"第 {step} 步重复使用了 {modifier}。",missingKey:"第 {step} 步需要在修饰键后输入一个按键。",multipleKeys:"第 {step} 步只能包含一个按键。",unsupportedKey:"第 {step} 步不支持按键“{key}”。"}},agentActions:{mode:"模式",rewind:"回退",details:"详情",model:"模型",thinking:"思考",todos:"任务",background:"后台运行",editor:"编辑器",history:"历史",stash:"暂存",pasteImage:"粘贴图片",newline:"换行",interrupt:"中断",editPrevious:"编辑上一条",queue:"排队发送",copy:"复制",clear:"清屏",yolo:"YOLO 模式",expand:"展开",undo:"撤销",agent:"下一个智能体",agentBack:"上一个智能体",palette:"命令面板",recentModel:"最近模型",variant:"模型变体",newSession:"新会话",sessions:"会话列表",thinkingMode:"思考模式",nextModel:"下一个模型",modelPicker:"模型选择器",tools:"工具",thinkingBlocks:"思考内容",followup:"后续提问",dequeue:"移出队列",plan:"计划模式",temporaryModel:"临时模型",expandAll:"全部展开",reasoning:"推理强度",review:"代码审查",specMode:"规格模式",autonomy:"自主模式",undoPicker:"撤销菜单",steer:"引导",sidebar:"侧栏",agents:"智能体列表",permissionMode:"权限模式",bypass:"绕过权限",tasks:"任务",interject:"插话",multiline:"多行输入",shortcuts:"快捷键",approve:"批准",eof:"结束输入",suspend:"挂起",startOfLine:"行首",endOfLine:"行尾",killToEnd:"删除至行尾",agentSwap:"切换智能体",activity:"活动面板",planAct:"计划 / 执行",autoApprove:"自动批准",search:"搜索"},virtualKeyboard:{collapseToolbar:"收起按键栏",expandToolbar:"展开按键栏",helperTitle:"快捷命令",closeHelper:"关闭命令助手",placeholder:"输入终端命令并回车...",sendButton:"发送",clearInput:"清除输入内容",customizeTitle:"自定义虚拟按键",customizeDesc:"调整按键顺序与启禁用状态。",enabledKeysCount:"已启用 {count} 个按键",resetLayout:"恢复默认布局",addKey:"添加按键",availableKeys:"可选按键库",moveUp:"前移",moveDown:"后移",enableKey:"启用按键",disableKey:"禁用按键",deleteKeyTitle:"删除按键",keyTypeModifier:"修饰键",keyTypeNav:"导航键",keyTypeAction:"动作键",keyTypeChord:"组合键",keyTypeFn:"功能键",keyTypeSymbol:"符号",fnDrawerTitle:"功能键 (F1-F12)",chordsDrawerTitle:"控制组合键 (^C, ^D, ^Z)",symbolsDrawerTitle:"终端常用符号 (~, |, /, \\)",touchKeyboardShortcuts:"快捷键工具栏",ctrlCTitle:"Ctrl+C (中断)",ctrlDTitle:"Ctrl+D (退出)",ctrlZTitle:"Ctrl+Z (挂起)",ctrlLTitle:"Ctrl+L (清屏)",ctrlRTitle:"Ctrl+R (搜索)",ctrlATitle:"Ctrl+A (行首)",ctrlETitle:"Ctrl+E (行尾)",ctrlKTitle:"Ctrl+K (剪切)",badgeSigint:"中断",badgeEof:"退出",badgeTstp:"挂起",badgeClear:"清屏",badgeSearch:"搜索",badgeStart:"行首",badgeEnd:"行尾",badgeKill:"剪切",keyEnter:"回车",uploadImage:"上传图片",uploadImageTitle:"选择图片并上传至终端",image:"图片",uploadProgressReading:"读取中...",uploadProgressProcessing:"处理压缩中...",uploadProgressSending:"上传中...",uploadProgressWaitingHost:"等待工作站保存...",uploadProgressCompleted:"完成",uploadProgressFailed:"上传失败"},profiles:{title:"Herdr 实例",switcherLabel:"切换 Herdr 实例",current:"当前",empty:"还没有已配对的 Herdr 实例。",addHost:"添加 Herdr 实例",rename:"重命名实例",remove:"仅本地移除",removeConfirm:"确认从此浏览器移除已保存的连接?"},mobile:{sessionControls:"会话控制",closeSessionControls:"关闭会话控制面板",connectionStatusAria:"连接状态",terminalControlAria:"终端控制权",inputControl:"输入控制权",settingsAria:"终端设置",adminAria:"打开管理面板",pairingAria:"连接与配对设置",keybarAria:"切换触控按键条",quickInputAria:"切换快捷命令",menu:"菜单",statusBarAria:"会话状态栏"},terminal:{bannerTitle:"Herdr Remote WebUI",bannerSubtitle:"已连接至 Herdr 会话。",windowAriaLabel:"远程终端窗口",bufferAriaLabel:"xterm 终端缓冲区",offlineStatusAria:"离线状态",releaseControlAria:"释放终端控制权",takeoverControlAria:"强占终端控制权",claimControlAria:"获取终端控制权"},keyTitles:{esc:"Escape (ESC)",tab:"Tab",shift_tab:"Shift+Tab(Claude Code 切换模式)",ctrl:"切换 Ctrl 锁定",alt:"切换 Alt 锁定",shift:"切换 Shift 锁定",meta:"Meta / 命令键",enter:"回车 (Enter)",backspace:"退格 (Backspace)",delete:"删除 (Delete)",left:"左箭头 (←)",up:"上箭头 (↑)",down:"下箭头 (↓)",right:"右箭头 (→)",home:"行首 (Home)",end:"行尾 (End)",page_up:"向上翻页 (Page Up)",page_down:"向下翻页 (Page Down)",insert:"插入 (Insert)",drawer_chords:"常用 Ctrl 组合键",drawer_agent:"智能体快捷键",drawer_symbols:"常用特殊符号",drawer_fn:"功能键 (F1-F12)",ctrl_c:"Ctrl+C (中断)",ctrl_d:"Ctrl+D (退出)",ctrl_z:"Ctrl+Z (挂起)",ctrl_l:"Ctrl+L (清屏)",ctrl_a:"Ctrl+A (行首)",ctrl_e:"Ctrl+E (行尾)",ctrl_k:"Ctrl+K (剪切)",ctrl_r:"Ctrl+R (历史搜索)",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",sym_pipe:"管道符 (|)",sym_tilde:"波浪号 (~)",sym_slash:"正斜杠 (/)",sym_backslash:"反斜杠 (\\)",sym_dash:"连字符 (-)",sym_underscore:"下划线 (_)",sym_dollar:"美元符 ($)",sym_ampersand:"与符号 (&)",sym_quote:'双引号 (")',sym_backtick:"反引号 (`)"},admin:{title:"系统管理面板",subtitle:"接入主机、配对设备与中转流量",returnToTerminal:"返回终端",terminalShells:"个终端 Shell",startedAt:"启动于 {time}",accessPanel:"接入概览",acrossWindows:"共 {count} 个窗口",perSecond:"{value}/秒",framesPerSecond:"{count} 帧/秒",unitDay:" 天",unitHour:" 小时",unitMinute:" 分",unitSecond:" 秒",startedRecently:"最近启动",updatedAt:"更新于 {time}",autoRefresh:"自动刷新:",paused:"暂停刷新",refreshNow:"立即刷新",connectedHosts:"接入主机",activeUsers:"活跃用户",activePtys:"活动 PTY",activeController:"活跃控制者",uptime:"运行时间",none:"无",noHost:"未连接主机",tabOverview:"系统概览",tabClients:"客户端列表 ({count})",tabPtys:"PTY 会话 ({count})",tabDevices:"已配对设备 ({count})",throughput:"网络吞吐流量",bytesInTotal:"入站流量:",bytesOutTotal:"出站流量:",frameRate:"帧率统计:",hostsTitle:"主机 ({count})",noHosts:"暂无接入或配对的主机",hostConnectedDevices:"{count} 台在线",hostPairedDevices:"{count} 台已配对",hostStatusOnline:"在线",hostStatusBusy:"使用中",hostStatusReconnecting:"重连中",hostStatusOffline:"离线",hostRosterOperatorOnly:"设备清单仅 Relay 操作员可见。",connectedClientsTitle:"已连接客户端 ({count})",noClients:"当前暂无客户端连接",colClientId:"客户端 ID",colDevice:"设备",colDeviceId:"设备 ID",colLastSeen:"最近活动",colActions:"操作",unknownDevice:"未知设备",pairedDevicesTitle:"已配对设备 ({count})",noDevices:"尚未配对任何设备",revokeDevice:"撤销",revokeConfirm:"确认撤销",revokeFailed:"撤销失败",colRole:"角色",colIp:"IP 地址",colConnectedAt:"连接时间",colTraffic:"网络流量 (入/出)",activePtysTitle:"活动 PTY 终端会话 ({count})",noPtys:"当前无活跃的 PTY 会话",colPtyId:"PTY 标识",colPid:"进程 PID",colCommand:"运行命令",colGrid:"网格规格",colCwd:"工作目录",colViewers:"窗口数",copiedJson:"已复制",unauthorizedTitle:"管理接口未授权 (401/403)",unauthorizedDesc:"访问 GET /api/status 需要已授权的设备 Token。",pairingStepsTitle:"设备配对指引:",pairingStepsHelp:"在主机运行配对命令获取配对码后输入。",enterPairCodeBtn:"输入配对码",retryFetchBtn:"重新获取状态",errorConnecting:"连接 GET /api/status 失败:{error}",loadingStatus:"正在加载系统状态...",remoteRelayTitle:"远程 Relay 服务管理",remoteRelayBadge:"已连接远程 Relay 服务",remoteRelayNotice:"当前连接至远程独立 Relay 服务。如需查看服务端指标,请使用操作员后台。",remoteRelayEndpoint:"远程端点:",remoteRelayAdminUrl:"远程后台地址:",openRemoteAdminBtn:"前往远程管理后台",remoteRelayHelp:"直接访问远程 Relay 管理后台。",relayAdminTitle:"Relay 操作员管理后台",relayAdminTokenLabel:"Relay 管理员令牌 (X-Relay-Admin-Token)",relayAdminTokenPlaceholder:"请输入 RELAY_ADMIN_TOKEN...",relayAdminNotConfigured:"该 Relay 服务未配置 RELAY_ADMIN_TOKEN。",relayAdminLoginBtn:"验证并查看服务端指标",relayAdminAuthError:"管理员令牌无效或未授权。",remoteRelayClientNotice:"当前为终端客户端连接。如需查看服务端指标,请访问操作员后台。",openOperatorPortal:"打开服务端管理后台",localWorkstationBadge:"本地宿主 Relay",modeLocal:"本地模式",modeRemote:"远程模式",hintTabs:"切换标签页",hintRefresh:"刷新状态",hintBack:"返回终端"},toasts:{connected:"已连接至 Relay 服务",connectionError:"连接发生错误",controlGranted:"已获得控制权",controlDenied:"控制请求被拒绝:已有活跃控制者",controlRevoked:"控制权已转移",pairedSuccess:"设备配对成功,已保存凭证",sessionEnded:"终端会话已结束",controlReleased:"已释放控制权,切回观察者模式",viewerModeWarning:"处于观察者模式,请先获取控制权",clientIdCopied:"客户端 ID 已复制: {id}",pairingLinkCopied:"配对链接已复制",switchedLanguage:"语言已切换为 {lang}",settingsReset:"设置已恢复默认",fontReset:"字体已恢复默认",commandCopied:"命令已复制",keyLayoutReset:"虚拟按键布局已恢复默认"},shortcuts:{title:"WebUI 快捷键",help:"以下快捷键仅在非终端输入区域生效:",terminalInputNote:"终端操作快捷键直接透传至宿主 PTY。"},serverErrors:{auth_required:"需要配对:请输入配对码,或填写仍然有效的设备令牌。",unauthorized:"该设备无权访问此工作站。",host_offline:"已配对的工作站未连接到该 relay。",host_disconnected:"工作站已断开连接。",stale_host:"工作站长时间无响应,已被断开。",too_many_clients:"该工作站的窗口数量已达上限。",rate_limited:"配对尝试过于频繁,请稍后再试。",invalid_handshake:"relay 拒绝了握手,请刷新页面。",device_revoked:"该设备已被 relay 管理员撤销。",connection_closed:"连接已断开,正在重连…",connection_stale:"页面回到前台时连接已无响应,正在重连…",connection_stalled:"连接超时,正在重试…",connection_failed:"无法建立到 relay 的连接。",host_reconnecting:"Herdr 主机正在重连。",host_reconnect_timeout:"Herdr 主机未能及时恢复连接。",host_replaced:"Herdr 主机连接已被替换。",slow_client:"由于浏览器处理速度过慢,连接已关闭。",client_send_failed:"Relay 无法向此浏览器发送数据。",too_many_hosts:"此 relay 已达到主机数量上限。",paste_file_unsupported:"不支持的粘贴图片格式。",paste_file_too_large:"粘贴图片超过 3 MB 上限。",paste_file_write_failed:"工作站保存图片失败。",paste_file_empty:"粘贴图片内容为空。",paste_file_corrupt:"粘贴图片数据损坏或与声明格式不符。",viewer_mode:"观察者模式无法粘贴到终端。",no_session:"终端会话未准备就绪。"},fontPresets:{system:"系统默认",apple:"Apple SF Mono / Menlo",windows:"Windows Consolas",linux:"Linux Liberation Mono",courier:"Courier New",firacode:"Fira Code"},agents:{title:"本工作站的智能体",blocked:"待确认",done:"已完成",working:"运行中",allIdle:"智能体空闲",notifyBlocked:"{count} 个智能体在等你确认",notifyDone:"{count} 个智能体已完成"},clipboard:{openLink:"打开链接",openLinkFailed:"该链接无法在浏览器中打开",copySelection:"复制选中",copyLine:"复制本行",copyScreen:"复制整屏",paste:"粘贴",cancel:"取消",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteHint:"长按此处粘贴,然后按发送",pasteSend:"发送",pasteUnavailable:"剪贴板为空或不可用",pasteTitle:"粘贴内容",pasted:"已粘贴",chooseImage:"选择图片",takePhoto:"拍照",imageTooLarge:"图片超过 3 MB 限制且无法进一步压缩。",imageCompressedSize:"压缩后大小:{size}",fileEmpty:"文件内容为空。",decodeFailed:"无法解析图片文件。",unsupportedType:"不支持的图片格式,仅支持 PNG、JPEG、WebP 和 GIF。",imageSectionTitle:"图片",textSectionTitle:"文本",imageCompressing:"正在处理图片...",removeImage:"移除图片"}},Lu={en:Xv,zh:Iv};function id(r,a,i){const o=Lu[r]||Lu.en,d=a.split(".");let f=o;for(const p of d)if(f&&typeof f=="object"&&p in f)f=f[p];else{let m=Lu.en;for(const b of d)if(m&&typeof m=="object"&&b in m)m=m[b];else return a;f=m;break}if(typeof f!="string")return a;if(i){let p=f;for(const[m,b]of Object.entries(i))p=p.replaceAll(`{${m}}`,String(b));return p}return f}const ip="#11111b",Qu=[{id:"system",name:"System Default (Recommended)",font:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", "Symbols Nerd Font Mono", monospace'},{id:"apple",name:"Apple SF Mono / Menlo",font:'SFMono-Regular, Menlo, Monaco, "Symbols Nerd Font Mono", monospace'},{id:"windows",name:"Windows Consolas",font:'Consolas, "Lucida Console", "Symbols Nerd Font Mono", monospace'},{id:"linux",name:"Linux Liberation Mono",font:'"Liberation Mono", "DejaVu Sans Mono", "Symbols Nerd Font Mono", monospace'},{id:"courier",name:"Courier New",font:'"Courier New", Courier, "Symbols Nerd Font Mono", monospace'},{id:"firacode",name:"Fira Code (Ligatures)",font:'"Fira Code", "Symbols Nerd Font Mono", monospace'}];function rp(r){if(!r||typeof r!="string")return Qu[0].font;const a=r.trim();if(a.includes("Symbols Nerd Font"))return a;if(/^['"]?monospace['"]?$/i.test(a))return'"Symbols Nerd Font Mono", monospace';const i=/,\s*['"]?monospace['"]?\s*$/i;return i.test(a)?a.replace(i,', "Symbols Nerd Font Mono", monospace'):`${a}, "Symbols Nerd Font Mono", monospace`}function Zv(r){if(!r)return null;const a={};return r.background&&(a.background=r.background,a.cursorAccent=r.background),r.foreground&&(a.foreground=r.foreground),r.cursor&&(a.cursor=r.cursor),r.ansi&&Object.assign(a,r.ansi),Object.keys(a).length===0?null:a}function ug(){if(typeof document>"u")return;const r=document.querySelector('meta[name="theme-color"]');document.documentElement.style.colorScheme="dark",r==null||r.setAttribute("content",ip),document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),document.body.classList.add("dark"),document.body.classList.remove("light"),document.body.style.backgroundColor=ip}const A=(r,a,i,o=!0)=>({id:r,labelKey:a,combo:i,verified:o}),dg={claude:{id:"claude",name:"Claude Code",shortName:"Claude",configHint:"~/.claude/keybindings.json",actions:[A("mode","mode","shift+tab"),A("rewind","rewind","esc esc"),A("details","details","ctrl+o"),A("model","model","alt+p"),A("thinking","thinking","alt+t"),A("todos","todos","ctrl+t"),A("background","background","ctrl+b"),A("editor","editor","ctrl+g"),A("history","history","ctrl+r"),A("stash","stash","ctrl+s"),A("pasteImage","pasteImage","ctrl+v"),A("newline","newline","ctrl+j"),A("interrupt","interrupt","esc")]},codex:{id:"codex",name:"Codex",shortName:"Codex",configHint:"~/.codex/config.toml [tui.keymap]",actions:[A("mode","mode","shift+tab"),A("editPrevious","editPrevious","esc esc"),A("details","details","ctrl+t"),A("queue","queue","tab"),A("history","history","ctrl+r"),A("copy","copy","ctrl+o"),A("editor","editor","ctrl+g"),A("newline","newline","ctrl+j"),A("clear","clear","ctrl+l"),A("interrupt","interrupt","esc")]},gemini:{id:"gemini",name:"Gemini CLI",shortName:"Gemini",configHint:"~/.gemini/keybindings.json",actions:[A("mode","mode","shift+tab"),A("yolo","yolo","ctrl+y"),A("rewind","rewind","esc esc"),A("todos","todos","ctrl+t"),A("expand","expand","ctrl+o"),A("background","background","ctrl+b"),A("editor","editor","ctrl+g"),A("history","history","ctrl+r"),A("undo","undo","ctrl+z"),A("newline","newline","ctrl+j"),A("interrupt","interrupt","esc")]},qwen:{id:"qwen",name:"Qwen Code",shortName:"Qwen",actions:[A("mode","mode","shift+tab"),A("interrupt","interrupt","esc"),A("history","history","ctrl+r"),A("newline","newline","ctrl+j"),A("todos","todos","ctrl+t",!1),A("rewind","rewind","esc esc",!1)]},opencode:{id:"opencode",name:"OpenCode",shortName:"OpenCode",configHint:"tui.json keybinds",actions:[A("agent","agent","tab"),A("agentBack","agentBack","shift+tab"),A("interrupt","interrupt","esc"),A("palette","palette","ctrl+p"),A("model","model","ctrl+x m"),A("recentModel","recentModel","f2"),A("variant","variant","ctrl+t"),A("newSession","newSession","ctrl+x n"),A("sessions","sessions","ctrl+x l"),A("undo","undo","ctrl+x u"),A("editor","editor","ctrl+x e"),A("newline","newline","ctrl+j")]},kilo:{id:"kilo",name:"Kilo Code",shortName:"Kilo",configHint:"~/.config/kilo/tui.jsonc",actions:[A("agent","agent","tab",!1),A("agentBack","agentBack","shift+tab",!1),A("interrupt","interrupt","esc"),A("palette","palette","ctrl+p"),A("model","model","ctrl+x m"),A("recentModel","recentModel","f2"),A("variant","variant","ctrl+t"),A("newSession","newSession","ctrl+x n"),A("sessions","sessions","ctrl+x l"),A("undo","undo","ctrl+x u"),A("editor","editor","ctrl+x e"),A("newline","newline","ctrl+j")]},pi:{id:"pi",name:"Pi",shortName:"Pi",configHint:"~/.pi/agent/keybindings.json",actions:[A("thinkingMode","thinkingMode","shift+tab"),A("interrupt","interrupt","esc"),A("nextModel","nextModel","ctrl+p"),A("modelPicker","modelPicker","ctrl+l"),A("tools","tools","ctrl+o"),A("thinkingBlocks","thinkingBlocks","ctrl+t"),A("editor","editor","ctrl+g"),A("followup","followup","alt+enter"),A("dequeue","dequeue","alt+up"),A("newline","newline","shift+enter")]},omp:{id:"omp",name:"Oh My Pi",shortName:"OMP",configHint:"~/.omp/agent/keybindings.yml",actions:[A("thinkingMode","thinkingMode","shift+tab"),A("plan","plan","alt+shift+p"),A("model","model","alt+m"),A("temporaryModel","temporaryModel","alt+p"),A("nextModel","nextModel","ctrl+p"),A("tools","tools","ctrl+o"),A("thinking","thinking","ctrl+t"),A("history","history","ctrl+r"),A("editor","editor","ctrl+g"),A("followup","followup","ctrl+enter"),A("interrupt","interrupt","esc")]},copilot:{id:"copilot",name:"GitHub Copilot",shortName:"Copilot",actions:[A("mode","mode","shift+tab"),A("interrupt","interrupt","esc"),A("expand","expand","ctrl+o"),A("expandAll","expandAll","ctrl+e"),A("reasoning","reasoning","ctrl+t"),A("editor","editor","ctrl+g"),A("clear","clear","ctrl+l")]},cursor:{id:"cursor",name:"Cursor",shortName:"Cursor",actions:[A("mode","mode","shift+tab"),A("review","review","ctrl+r"),A("newline","newline","ctrl+j"),A("interrupt","interrupt","esc",!1)]},droid:{id:"droid",name:"Factory Droid",shortName:"Droid",configHint:"In-app settings",actions:[A("specMode","specMode","shift+tab"),A("autonomy","autonomy","ctrl+l"),A("details","details","ctrl+o",!1),A("queue","queue","ctrl+enter"),A("interrupt","interrupt","esc",!1)]},kimi:{id:"kimi",name:"Kimi Code",shortName:"Kimi",actions:[A("plan","plan","shift+tab"),A("interrupt","interrupt","esc"),A("undoPicker","undoPicker","esc esc"),A("expand","expand","ctrl+o"),A("editor","editor","ctrl+g"),A("steer","steer","ctrl+s"),A("undo","undo","ctrl+-"),A("newline","newline","ctrl+j"),A("pasteImage","pasteImage","ctrl+v")]},amp:{id:"amp",name:"Amp",shortName:"Amp",actions:[A("palette","palette","ctrl+o"),A("reasoning","reasoning","alt+d"),A("mode","mode","ctrl+s",!1),A("editor","editor","ctrl+g"),A("history","history","ctrl+r"),A("sidebar","sidebar","ctrl+backslash"),A("pasteImage","pasteImage","ctrl+v"),A("interrupt","interrupt","esc",!1)]},hermes:{id:"hermes",name:"Hermes",shortName:"Hermes",actions:[A("interrupt","interrupt","ctrl+c"),A("newline","newline","ctrl+j"),A("editor","editor","ctrl+g"),A("agents","agents","ctrl+t"),A("sessions","sessions","ctrl+x")]},qodercli:{id:"qodercli",name:"Qoder CLI",shortName:"Qoder",configHint:"/shortcuts in-app",actions:[A("permissionMode","permissionMode","shift+tab"),A("bypass","bypass","ctrl+y"),A("tasks","tasks","ctrl+t"),A("editor","editor","ctrl+x"),A("history","history","ctrl+r"),A("queue","queue","ctrl+enter"),A("newline","newline","ctrl+j"),A("pasteImage","pasteImage","alt+v"),A("interrupt","interrupt","ctrl+c")]},devin:{id:"devin",name:"Devin",shortName:"Devin",configHint:"~/.config/devin/config.json keymap",actions:[A("mode","mode","shift+tab"),A("interrupt","interrupt","ctrl+c"),A("thinking","thinking","alt+t"),A("newline","newline","ctrl+j"),A("pasteImage","pasteImage","ctrl+v")]},grok:{id:"grok",name:"Grok CLI",shortName:"Grok",actions:[A("mode","mode","shift+tab"),A("interrupt","interrupt","ctrl+c"),A("rewind","rewind","esc esc"),A("interject","interject","ctrl+enter"),A("multiline","multiline","ctrl+m"),A("newline","newline","alt+enter"),A("shortcuts","shortcuts","ctrl+.")]},agy:{id:"agy",name:"Antigravity",shortName:"Antigravity",configHint:"~/.gemini/antigravity-cli/keybindings.json",actions:[A("mode","mode","shift+tab"),A("interrupt","interrupt","ctrl+c"),A("background","background","ctrl+b"),A("approve","approve","ctrl+k"),A("clear","clear","esc esc")]},mastracode:{id:"mastracode",name:"MastraCode",shortName:"MastraCode",actions:[A("interrupt","interrupt","ctrl+c"),A("thinking","thinking","ctrl+t"),A("expand","expand","ctrl+e"),A("followup","followup","ctrl+f")]},letta:{id:"letta",name:"Letta Code",shortName:"Letta",actions:[A("permissionMode","permissionMode","shift+tab"),A("interrupt","interrupt","esc",!1)]},kiro:{id:"kiro",name:"Kiro CLI",shortName:"Kiro",configHint:"kiro-cli settings chat.keybindings.*",actions:[A("agentSwap","agentSwap","shift+tab"),A("interrupt","interrupt","esc"),A("details","details","ctrl+t"),A("steer","steer","ctrl+s"),A("expand","expand","ctrl+o"),A("activity","activity","ctrl+x"),A("newline","newline","ctrl+j")]},cline:{id:"cline",name:"Cline",shortName:"Cline",actions:[A("planAct","planAct","tab"),A("autoApprove","autoApprove","shift+tab"),A("interrupt","interrupt","esc",!1)]},maki:{id:"maki",name:"Maki",shortName:"Maki",actions:[A("rewind","rewind","esc esc"),A("search","search","ctrl+f"),A("interrupt","interrupt","esc",!1)]},muse:{id:"muse",name:"Muse",shortName:"Muse",configHint:"/keymap in-app",actions:[A("interrupt","interrupt","esc"),A("queue","queue","alt+enter"),A("interruptCtrl","interrupt","ctrl+c")]},shell:{id:"shell",name:"Shell",shortName:"Shell",actions:[]}},Zl=dg,fg=Object.keys(dg),sp={pi:"pi",claude:"claude","claude-code":"claude",codex:"codex",gemini:"gemini",cursor:"cursor","cursor-agent":"cursor",devin:"devin","devin-cli":"devin","devin cli":"devin",agy:"agy",antigravity:"agy","antigravity-cli":"agy",cline:"cline",".cline":"cline",omp:"omp",mastracode:"mastracode","mastra-code":"mastracode","mastra code":"mastracode",opencode:"opencode",opencode2:"opencode","open-code":"opencode",copilot:"copilot","github-copilot":"copilot",ghcs:"copilot",kimi:"kimi","kimi-code":"kimi","kimi code":"kimi",kiro:"kiro","kiro-cli":"kiro",droid:"droid",amp:"amp","amp-local":"amp",grok:"grok","grok-build":"grok",hermes:"hermes","hermes-agent":"hermes",kilo:"kilo","kilo-code":"kilo","kilo code":"kilo",qodercli:"qodercli",qoderclicn:"qodercli",qoder:"qodercli",qodercn:"qodercli",qwen:"qwen","qwen-code":"qwen","qwen code":"qwen",letta:"letta","letta-code":"letta","letta code":"letta",maki:"maki",muse:"muse","muse-code":"muse","muse-cli":"muse",shell:"shell"},Qv=[A("genericCtrlC","interrupt","ctrl+c"),A("genericCtrlD","eof","ctrl+d"),A("genericCtrlZ","suspend","ctrl+z"),A("genericCtrlL","clear","ctrl+l"),A("genericCtrlR","history","ctrl+r"),A("genericCtrlA","startOfLine","ctrl+a"),A("genericCtrlE","endOfLine","ctrl+e"),A("genericCtrlK","killToEnd","ctrl+k")];function Pv(r){return r&&r.trim().toLowerCase().replace(/\\/g,"/").split("/").at(-1)||""}function op(r){const a=Pv(r);return sp[a]?sp[a]:/^muse-bin-\d/.test(a)?"muse":null}function Wv(r,a="auto"){return a&&a!=="auto"?op(a)||"shell":op(r)||"shell"}function Jv(r,a){const i=r.map(d=>{var m;const f=(m=a==null?void 0:a.actions)==null?void 0:m[d.id];let p=typeof(f==null?void 0:f.keys)=="string"?f.keys:d.combo;try{Al(p)}catch{p=d.combo}return{...d,defaultCombo:d.combo,combo:p,hidden:(f==null?void 0:f.hidden)===!0,custom:!1}}),o=new Set(i.map(d=>d.id));for(const d of(a==null?void 0:a.custom)||[]){if(!d||typeof d.id!="string"||o.has(d.id))continue;let f=d.keys;try{Al(f)}catch{continue}i.push({id:d.id,labelKey:"custom",defaultCombo:f,combo:f,verified:!0,hidden:!1,custom:!0,customLabel:d.label}),o.add(d.id)}if(Array.isArray(a==null?void 0:a.order)){const d=new Map(a.order.map((f,p)=>[f,p]));i.sort((f,p)=>(d.get(f.id)??Number.MAX_SAFE_INTEGER)-(d.get(p.id)??Number.MAX_SAFE_INTEGER))}return i}function $v(r,a){const i=new Set(r.filter(o=>!o.hidden).map(o=>o.combo.trim().toLowerCase()));return a.filter(o=>!i.has(o.combo.trim().toLowerCase()))}function hg(r,a){return Jv([...Zl[r].actions,...Qv],a)}function ex(r,a){const i=hg(r,a),o=i.filter(f=>!f.id.startsWith("generic")),d=i.filter(f=>f.id.startsWith("generic"));return{agentActions:o.filter(f=>!f.hidden),genericActions:$v(o,d).filter(f=>!f.hidden)}}const mg=1568,tx=3*1024*1024,nx=[.85,.7,.55,.4],dl={active:!1,phase:"idle",ratio:0,percent:0,statusText:""};function lx(r,a,i=mg){if(r<=0||a<=0)return{width:Math.max(1,r),height:Math.max(1,a)};const o=Math.max(r,a);if(o<=i)return{width:r,height:a};const d=i/o;return{width:Math.max(1,Math.round(r*d)),height:Math.max(1,Math.round(a*d))}}function ax(r){if(typeof r!="string"||r.length===0)return 0;const a=r.length;let i=0;r.endsWith("==")?i=2:r.endsWith("=")&&(i=1);const o=Math.floor(a*3/4)-i;return Number.isFinite(o)&&o>0?o:0}function ix(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}async function rx(r){if(typeof createImageBitmap=="function")try{const a=await createImageBitmap(r,{imageOrientation:"from-image"});return{source:a,width:a.width,height:a.height,cleanup:()=>{typeof a.close=="function"&&a.close()}}}catch{try{const a=await createImageBitmap(r);return{source:a,width:a.width,height:a.height,cleanup:()=>{typeof a.close=="function"&&a.close()}}}catch{}}return new Promise((a,i)=>{if(typeof Image>"u")return i(new Error("Image decoding not supported in this environment"));const o=new Image,d=URL.createObjectURL(r);o.onload=()=>{a({source:o,width:o.naturalWidth||o.width,height:o.naturalHeight||o.height,cleanup:()=>{try{URL.revokeObjectURL(d)}catch{}}})},o.onerror=()=>{try{URL.revokeObjectURL(d)}catch{}i(new Error("Failed to decode image source"))},o.src=d})}async function pg(r,a=mg,i=tx){var d;if(!r||r.size===0||r.type&&!r.type.startsWith("image/"))return null;let o;try{o=await rx(r)}catch(f){return console.warn("Failed to decode image for paste:",f),null}try{const{width:f,height:p}=lx(o.width,o.height,a),m=document.createElement("canvas");m.width=f,m.height=p;const b=m.getContext("2d");if(!b)return null;b.drawImage(o.source,0,0,f,p);let v="image/webp";try{m.toDataURL("image/webp",.85).startsWith("data:image/webp")||(v="image/jpeg")}catch{v="image/jpeg"}for(const y of nx){let w;try{w=m.toDataURL(v,y)}catch{continue}if(!w||!w.startsWith("data:"))continue;const T=w.indexOf(","),R=T!==-1?w.slice(T+1):"",k=ax(R);if(k<=i)return{mime:v,dataBase64:R,dataUrl:w,byteLength:k,width:f,height:p}}return null}finally{(d=o.cleanup)==null||d.call(o)}}const sx=4e3,ox=3,gg="herdr_remote_agent_profile_pin_v1";function cx(){if(typeof window>"u")return"auto";try{const r=window.sessionStorage.getItem(gg);if(r==="auto"||r&&Object.hasOwn(Zl,r))return r}catch{}return"auto"}const ux=4096,dx=8*1024*1024,co={ctrl:!1,alt:!1,shift:!1},bg=x.createContext(null);function Bi(r){return{wsUrl:r.wsUrl,token:r.token||void 0,pairCode:r.pairCode||void 0,clientId:r.clientId,autoReconnect:r.autoReconnect,reconnectIntervalMs:2e3,maxReconnectAttempts:0,pingIntervalMs:1e4}}const fx=({children:r})=>{const[a,i]=x.useState(cg),[o,d]=x.useState("disconnected"),[f,p]=x.useState(),[m,b]=x.useState(),[v,y]=x.useState("viewer"),[w,T]=x.useState(),[R,k]=x.useState(),[K,z]=x.useState(),[X,I]=x.useState(null),[P,ae]=x.useState(),[be,se]=x.useState(null),[G,U]=x.useState(1),[le,ue]=x.useState(0),[ve,we]=x.useState(null),[he,ke]=x.useState(null),[He,L]=x.useState(cx),[V,$]=x.useState(null),[je,Z]=x.useState({cols:80,rows:24}),[at,Qe]=x.useState([]),_e=x.useCallback(D=>{L(D);try{window.sessionStorage.setItem(gg,D)}catch{}},[]),Ze=Wv(he==null?void 0:he.focusedAgent,He);x.useEffect(()=>{ug()},[]);const ze=x.useRef(a);ze.current=a;const Se=x.useRef(null),zt=x.useRef(!1),ft=x.useRef(je);ft.current=je;const B=x.useRef(new Set),Me=x.useRef(new Set),[E,te]=x.useState(dl),J=x.useRef(null),Ke=x.useRef(0),De=x.useRef(null),Je=x.useCallback((D,H)=>id(a.language,D,H),[a.language]),St=x.useRef(Je);St.current=Je;const Gt=x.useRef(null),qt=x.useRef([]),Jt=x.useRef(0),lt=x.useCallback(D=>{for(qt.current.push(D),Jt.current+=D.byteLength;qt.current.length>ux||Jt.current>dx;){const H=qt.current.shift();if(!H)break;Jt.current-=H.byteLength}},[]),ht=x.useCallback(D=>{const H=Gt.current;if(H)try{H(D);return}catch(ie){console.debug("Terminal output sink threw, buffering chunk instead:",ie)}lt(D)},[lt]),Ft=x.useRef(ht);Ft.current=ht;const de=x.useCallback(D=>{Gt.current=D;const H=qt.current;qt.current=[],Jt.current=0;for(let ie=0;ie<H.length;ie++)try{D(H[ie])}catch(Ae){console.debug("Terminal sink threw while flushing, re-buffering the tail:",Ae);for(let Ne=ie;Ne<H.length;Ne++)lt(H[Ne]);break}return()=>{Gt.current===D&&(Gt.current=null)}},[lt]),Ue=x.useCallback(()=>qt.current.length,[]),Ge=x.useCallback(()=>{qt.current=[],Jt.current=0},[]),it=x.useCallback((D=!0)=>{y("viewer"),T(void 0),k(void 0),z(void 0),I(null),ae(void 0),se(null),U(1),we(null),Ge(),D&&ue(H=>H+1)},[Ge]),hn=x.useRef([]),mn=x.useRef(new Map),Et=x.useCallback(D=>{hn.current=D,Qe(D)},[]),nl=x.useCallback(D=>{const H=mn.current.get(D);H&&(clearTimeout(H),mn.current.delete(D)),Et(hn.current.filter(ie=>ie.id!==D))},[Et]),pn=x.useRef(nl);pn.current=nl;const tt=x.useCallback((D,H)=>{const ie=Date.now(),Ae=hn.current,Ne=Ae.find(Lt=>Lt.type===D&&Lt.message===H),Le=Ne?Ne.id:`${ie}-${Math.random().toString(36).substring(2,6)}`;let Ve;if(Ne)Ve=Ae.map(Lt=>Lt.id===Le?{...Lt,count:Lt.count+1,timestamp:ie}:Lt);else for(Ve=[...Ae,{id:Le,type:D,message:H,timestamp:ie,count:1}];Ve.length>ox;){const[Lt,...gl]=Ve,dn=mn.current.get(Lt.id);dn&&(clearTimeout(dn),mn.current.delete(Lt.id)),Ve=gl}Et(Ve);const rt=mn.current.get(Le);rt&&clearTimeout(rt),mn.current.set(Le,setTimeout(()=>pn.current(Le),sx))},[Et]),Ct=x.useCallback(D=>{pn.current(D)},[]),Dt=x.useRef(!0);x.useEffect(()=>{v==="controller"&&(Dt.current=!0)},[v]);const ut=x.useCallback(()=>{Dt.current&&(Dt.current=!1,tt("warning",St.current("toasts.viewerModeWarning")))},[tt]);x.useEffect(()=>{const D=mn.current;return()=>{for(const H of D.values())clearTimeout(H);D.clear()}},[]);const Pl=x.useCallback(D=>{const H=Ea(D);ze.current=H,i(H)},[]),Mn=x.useCallback(D=>{Pl({language:D})},[Pl]),Ot=x.useCallback(D=>{ze.current=D,i(D)},[]),Nl=x.useCallback(D=>{var Ne;const H=ze.current,ie=np({...D,wsUrl:D.wsUrl||"/ws/client",token:D.token||"",displayName:D.displayName||`Herdr ${H.profiles.length+1}`,autoReconnect:D.autoReconnect!==!1},H.profiles.length),Ae=Ea({profiles:[...H.profiles,ie],activeProfileId:ie.id,wsUrl:ie.wsUrl,token:ie.token,pairCode:ie.pairCode||"",autoReconnect:ie.autoReconnect});Ot(Ae),it(),(Ne=Se.current)==null||Ne.reconnectWith(Bi(Ae))},[Ot,it]),an=x.useCallback(D=>{var Ne;const H=ze.current,ie=H.profiles.find(Le=>Le.id===D);if(!ie||ie.id===H.activeProfileId)return;const Ae=Ea({activeProfileId:ie.id,wsUrl:ie.wsUrl,token:ie.token,pairCode:ie.pairCode||"",autoReconnect:ie.autoReconnect,profiles:H.profiles.map(Le=>Le.id===ie.id?{...Le,lastUsedAt:Date.now()}:Le)});Ot(Ae),it(),(Ne=Se.current)==null||Ne.reconnectWith(Bi(Ae))},[Ot,it]),El=x.useCallback((D,H)=>{const ie=ze.current;if(!ie.profiles.find(Ve=>Ve.id===D))return;const Ne=H.trim().slice(0,64);if(!Ne)return;const Le=Ea({profiles:ie.profiles.map(Ve=>Ve.id===D?{...Ve,displayName:Ne}:Ve)});Ot(Le)},[Ot]),Sn=x.useCallback(D=>{var Le;const H=ze.current;if(!H.profiles.some(Ve=>Ve.id===D))return;const ie=H.profiles.filter(Ve=>Ve.id!==D),Ae=ie.find(Ve=>Ve.id===H.activeProfileId)||ie[0],Ne=Ea(Ae?{profiles:ie,activeProfileId:Ae.id,wsUrl:Ae.wsUrl,token:Ae.token,pairCode:Ae.pairCode||"",autoReconnect:Ae.autoReconnect}:{profiles:[],activeProfileId:"",wsUrl:"/ws/client",token:"",pairCode:""});Ot(Ne),D===H.activeProfileId&&(it(),(Le=Se.current)==null||Le.reconnectWith(Bi(Ne)))},[Ot,it]),kl=x.useCallback(D=>{const H=ze.current,ie=H.profiles.find(en=>en.id===H.activeProfileId),Ae=D.hostId?lp({wsUrl:H.wsUrl,hostId:D.hostId}):null,Ne=Ae?H.profiles.findIndex(en=>lp(en)===Ae):-1,Le=Ne>=0?Ne:Math.max(0,H.profiles.findIndex(en=>en.id===H.activeProfileId)),rt={...H.profiles[Le]||ie||np({wsUrl:H.wsUrl||"/ws/client",token:"",pairCode:H.pairCode||"PENDING",displayName:`Herdr ${H.profiles.length+1}`},H.profiles.length),token:D.token,pairCode:void 0,...D.hostId?{hostId:D.hostId}:{},...D.deviceId?{deviceId:D.deviceId}:{},lastUsedAt:Date.now()};let Lt=[...H.profiles];Le>=0&&Le<Lt.length?Lt[Le]=rt:Lt.push(rt);const gl=ie==null?void 0:ie.id;Lt=Lt.filter((en,Q)=>Q===Le||en.id===rt.id?!0:!(Ne>=0&&gl&&en.id===gl));const dn=Ea({profiles:Lt,activeProfileId:rt.id,wsUrl:rt.wsUrl,token:rt.token,pairCode:"",autoReconnect:rt.autoReconnect});return Ot(dn),dn},[Ot]),ll=x.useCallback(D=>{const H=ze.current,ie=H.profiles.find(Ve=>Ve.id===H.activeProfileId);if(!ie||!D.hostId&&!D.hostname)return;const Ae=/^Herdr \d+$/.test(ie.displayName),Ne={...ie,...D.hostId?{hostId:D.hostId}:{},...D.hostname?{hostname:D.hostname}:{},...D.hostname&&Ae?{displayName:D.hostname}:{}},Le=Ea({profiles:H.profiles.map(Ve=>Ve.id===ie.id?Ne:Ve)});Ot(Le)},[Ot]);if(!Se.current){const D=new Nv(Bi(a));Se.current=D,D.on("stateChange",(H,ie,Ae)=>{d(H),b(Ae);const Ne=Ae?`serverErrors.${Ae}`:null,Le=Ne?St.current(Ne):null,Ve=Le&&Le!==Ne?Le:ie;p(Ve),H==="connected"?tt("success",St.current("toasts.connected")):H==="error"&&tt("error",Ve||St.current("toasts.connectionError")),H!=="connected"&&ke(null)}),D.on("ready",H=>{zt.current&&(Ge(),ue(ie=>ie+1)),zt.current=!0,y(H.role),T(H.controllerId),k(H.hostId),z(H.hostname),ll(H),H.clientId&&ae(H.clientId),I(H.terminalPalette||null)}),D.on("hostReconnecting",H=>{b(H||"host_reconnecting"),p(St.current(`serverErrors.${H||"host_reconnecting"}`)),y("viewer"),T(void 0),z(void 0),I(null),se(null),U(1),we(null),Ge()}),D.on("sessionRestarted",(H,ie,Ae,Ne)=>{Ge(),z(Ne),ll({hostId:D.getHostId(),hostname:Ne}),I(Ae||null),ue(Le=>Le+1)}),D.on("roleChange",(H,ie,Ae,Ne)=>{y(H),T(ie),Ae&&k(Ae),Ne&&ae(Ne)}),D.on("controlGranted",()=>{y("controller"),tt("success",St.current("toasts.controlGranted"))}),D.on("controlDenied",H=>{tt("warning",H||St.current("toasts.controlDenied"))}),D.on("controlRevoked",H=>{y("viewer"),tt("warning",H||St.current("toasts.controlRevoked"))}),D.on("paired",H=>{const ie=kl(H);tt("success",St.current("toasts.pairedSuccess")),$(Date.now()),D.reconnectWith(Bi(ie))}),D.on("exit",(H,ie)=>{tt("info",`${St.current("toasts.sessionEnded")}${ie?`: ${ie}`:""}${H!==void 0?` (${H})`:""}`)}),D.on("status",H=>{we(H)}),D.on("error",H=>{J.current!==null&&(De.current&&(clearTimeout(De.current),De.current=null),J.current=null,te(dl));const Ae=`serverErrors.${String(H.code)}`,Ne=St.current(Ae),Le=Ne&&Ne!==Ae?Ne:H.message||`[${H.code}]`;tt("error",Le)}),D.on("pasteFileReady",H=>{const ie=J.current;ie!==null&&(De.current&&(clearTimeout(De.current),De.current=null),te({active:!0,phase:"completed",ratio:1,percent:100,statusText:St.current("virtualKeyboard.uploadProgressCompleted")}),setTimeout(()=>{J.current===ie&&(J.current=null,te(dl))},1200));for(const Ae of B.current)try{Ae(H)}catch(Ne){console.error("Error in pasteFileReady listener:",Ne)}}),D.on("rttUpdate",H=>{se(H)}),D.on("peerCount",H=>{U(Math.max(1,H))}),D.on("sessionReady",()=>{d("connected")}),D.on("agentStatus",H=>{ke(H)}),D.on("binaryData",H=>{Ft.current(H)})}const al=Se.current,_n=a.profiles.find(D=>D.id===a.activeProfileId);x.useEffect(()=>{var D;(D=Se.current)==null||D.updateConfig(Bi(a))},[a]);const Fn=x.useCallback(D=>{Se.current&&(D&&Se.current.updateConfig(D),Se.current.connect(ft.current))},[]),Ln=x.useCallback(()=>{Se.current&&Se.current.disconnect()},[]),Zi=x.useCallback((D=!1)=>{Se.current&&Se.current.claimControl(D)},[]),Ma=x.useCallback(()=>{var D;(D=Se.current)==null||D.releaseControl()},[]),_a=x.useCallback(D=>{if(v!=="controller"){ut();return}const H=Se.current;if(!H)return;const ie=ed(D);for(const Ae of Me.current)try{Ae(ie)}catch(Ne){console.debug("Key input observer threw:",Ne)}H.sendInput(ie)},[v,ut]),La=x.useCallback(D=>(Me.current.add(D),()=>{Me.current.delete(D)}),[]),[Wl,il]=x.useState(co),zn=x.useRef(co),ai=x.useCallback(D=>{const H={...zn.current,[D]:!zn.current[D]};zn.current=H,il(H)},[]),Vn=x.useCallback(()=>{const D=zn.current;return!D.ctrl&&!D.alt&&!D.shift?null:(zn.current=co,il(co),D)},[]);x.useEffect(()=>{const D=Se.current;return D?Ev(D):void 0},[]);const Ht=x.useCallback(D=>{v!=="controller"&&!wo(D)||Se.current&&Se.current.sendInput(D)},[v]),$t=x.useCallback((D,H)=>{ft.current={cols:D,rows:H},Z({cols:D,rows:H}),Se.current&&Se.current.sendResize(D,H)},[]),Xn=x.useCallback((D,H)=>v!=="controller"?(ut(),!1):Se.current?(Se.current.sendPasteFile(D,H),!0):!1,[v,ut]),za=x.useCallback(D=>(B.current.add(D),()=>{B.current.delete(D)}),[]),ii=x.useCallback(()=>{De.current&&(clearTimeout(De.current),De.current=null),J.current=null,te(dl)},[]);x.useEffect(()=>{o!=="connected"&&J.current!==null&&(De.current&&(clearTimeout(De.current),De.current=null),J.current=null,te(dl))},[o]),x.useEffect(()=>()=>{De.current&&clearTimeout(De.current)},[]);const ri=x.useCallback(async D=>{if(v!=="controller")return ut(),!1;if(!Se.current||o!=="connected")return tt("error",Je("serverErrors.host_offline")),!1;if(J.current!==null)return!1;const H=++Ke.current;J.current=H,De.current&&(clearTimeout(De.current),De.current=null);const ie="dataBase64"in D&&typeof D.dataBase64=="string";try{let Ae;if(ie)Ae=D;else{const Le=D;if(te({active:!0,phase:"reading",ratio:.1,percent:10,statusText:Je("virtualKeyboard.uploadProgressReading")}),!Le||Le.size===0)return tt("error",Je("clipboard.fileEmpty")),J.current=null,te(dl),!1;if(Le.type&&!Le.type.startsWith("image/"))return tt("error",Je("clipboard.unsupportedType")),J.current=null,te(dl),!1;te({active:!0,phase:"processing",ratio:.35,percent:35,statusText:Je("virtualKeyboard.uploadProgressProcessing")});const Ve=await pg(Le);if(J.current!==H)return!1;if(!Ve)return tt("error",Je("clipboard.imageTooLarge")),J.current=null,te(dl),!1;Ae=Ve,te({active:!0,phase:"processing",ratio:.6,percent:60,statusText:Je("virtualKeyboard.uploadProgressProcessing")})}te({active:!0,phase:"sending",ratio:.75,percent:75,statusText:Je("virtualKeyboard.uploadProgressSending")});const Ne=Xn(Ae.mime,Ae.dataBase64);return J.current!==H?!1:Ne?(te({active:!0,phase:"waitingHost",ratio:.88,percent:88,statusText:Je("virtualKeyboard.uploadProgressWaitingHost")}),De.current=setTimeout(()=>{J.current===H&&(J.current=null,tt("error",Je("serverErrors.paste_file_write_failed")),te(dl))},3e4),!0):(J.current=null,te(dl),!1)}catch(Ae){return console.error("Failed to process/upload image:",Ae),J.current===H&&(J.current=null,tt("error",Je("clipboard.imageTooLarge")),te(dl)),!1}},[v,o,ut,tt,Je,Xn]);return u.jsx(bg.Provider,{value:{connectionState:o,stateDetail:f,stateCode:m,role:v,controllerId:w,hostId:R,hostname:K,assignedClientId:P,profiles:a.profiles,activeProfileId:a.activeProfileId,activeProfile:_n,isController:v==="controller",sharedWindowCount:G,terminalResetVersion:le,rttMs:be,statusPayload:ve,agentStatus:he,agentProfile:Ze,agentProfilePin:He,setAgentProfilePin:_e,lastPairedAt:V,settings:a,hostPalette:X,terminalDimensions:je,toasts:at,adapter:al,language:a.language,t:Je,setLanguage:Mn,connect:Fn,disconnect:Ln,switchProfile:an,addProfileAndConnect:Nl,renameProfile:El,removeProfile:Sn,claimControl:Zi,releaseControl:Ma,sendKey:_a,observeKeyInput:La,modifierLatch:Wl,toggleModifierLatch:ai,consumeModifierLatch:Vn,sendBinary:Ht,sendResize:$t,updateSettings:Pl,addToast:tt,removeToast:Ct,warnViewerMode:ut,subscribeToOutput:de,getPendingOutputChunkCount:Ue,sendPasteFile:Xn,subscribeToPasteFileReady:za,uploadProgress:E,uploadImage:ri,resetUploadProgress:ii},children:r})};function Nt(){const r=x.useContext(bg);if(!r)throw new Error("useTerminal must be used within a TerminalProvider");return r}function Qr(r){var a,i;return r?{blocked:((a=r.counts)==null?void 0:a.blocked)??0,done:((i=r.counts)==null?void 0:i.done)??0}:null}function hx(r){return r?r.blocked>0?"blocked":r.done>0?"done":null:null}function mx(r){if(!r)return"";const a=[];return r.blocked>0&&a.push(`${r.blocked}⚠`),r.done>0&&a.push(`${r.done}✓`),a.length>0?`(${a.join(" ")})`:""}function px(r,a){if(!r||!a)return null;const i=new Map(r.agents.map(p=>[p.paneId,p.status]));let o=null;for(const p of a.agents)if(!(p.status!=="blocked"&&p.status!=="done")&&i.get(p.paneId)!==p.status){if(p.status==="blocked")return"blocked";o="done"}const d=Qr(r),f=Qr(a);return f.blocked>d.blocked?"blocked":(!o&&f.done>d.done&&(o="done"),o)}const gx={blocked:"%23f9e2af",done:"%23a6e3a1"};function bx(r){return`<circle cx='19' cy='5' r='4.5' fill='${gx[r]}' stroke='%2311111b' stroke-width='1.5'/>`}function yx(r,a){return!a||!r.includes("</svg>")?r:r.replace("</svg>",`${bx(a)}</svg>`)}function cp(r,a=document){const i=a.querySelector('link[rel~="icon"]');if(!i)return;i.dataset.baseHref===void 0&&(i.dataset.baseHref=i.getAttribute("href")??"");const o=yx(i.dataset.baseHref,r);i.getAttribute("href")!==o&&i.setAttribute("href",o)}let ml=null;function vx(){if(typeof window>"u")return null;const r=window;return r.AudioContext??r.webkitAudioContext??null}function yg(){const r=vx();if(r)try{ml=ml??new r,ml.state==="suspended"&&ml.resume()}catch{ml=null}}function xx(r=window){const a=()=>{yg(),i()},i=()=>{r.removeEventListener("pointerdown",a),r.removeEventListener("keydown",a)};return r.addEventListener("pointerdown",a),r.addEventListener("keydown",a),i}const wx={blocked:[880,660],done:[660,880]};function vg(r){if(!(!ml||ml.state!=="running"))try{const a=ml.currentTime;wx[r].forEach((i,o)=>{const d=ml.createOscillator(),f=ml.createGain(),p=a+o*.11;d.type="sine",d.frequency.value=i,f.gain.setValueAtTime(1e-4,p),f.gain.exponentialRampToValueAtTime(.06,p+.01),f.gain.exponentialRampToValueAtTime(1e-4,p+.09),d.connect(f),f.connect(ml.destination),d.start(p),d.stop(p+.1)})}catch{}}const Sx=15e3,Cx={blocked:[70,50,70],done:[40]};function Tx(){const{agentStatus:r,settings:a,t:i}=Nt(),o=x.useRef(a);o.current=a;const d=x.useRef(i);d.current=i;const f=x.useRef(null),p=x.useRef(Number.NEGATIVE_INFINITY);x.useEffect(()=>{cp(a.agentAlertBadge?hx(Qr(r)):null)},[r,a.agentAlertBadge]),x.useEffect(()=>()=>cp(null),[]),x.useEffect(()=>{if(!(!a.agentAlertSound||typeof window>"u"))return xx(window)},[a.agentAlertSound]),x.useEffect(()=>{const m=f.current;f.current=r;const b=px(m,r);if(!b)return;const v=Date.now();if(v-p.current<Sx)return;p.current=v;const y=o.current,w=typeof document<"u"&&document.visibilityState==="hidden",T=w||typeof document<"u"&&!document.hasFocus();if(y.agentAlertVibrate&&!w&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(Cx[b])}catch{}if(y.agentAlertSound&&T&&vg(b),y.agentAlertNotify&&w&&typeof window<"u"&&window.isSecureContext&&"Notification"in window&&Notification.permission==="granted"){const R=Qr(r),k=b==="blocked"?d.current("agents.notifyBlocked",{count:R.blocked}):d.current("agents.notifyDone",{count:R.done});try{new Notification("Herdr Remote",{body:k,tag:"herdr-agents"})}catch{}}},[r])}function xg(r){var a,i,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var d=r.length;for(a=0;a<d;a++)r[a]&&(i=xg(r[a]))&&(o&&(o+=" "),o+=i)}else for(i in r)r[i]&&(o&&(o+=" "),o+=i);return o}function Ax(){for(var r,a,i=0,o="",d=arguments.length;i<d;i++)(r=arguments[i])&&(a=xg(r))&&(o&&(o+=" "),o+=a);return o}const Nx=(r,a)=>{const i=new Array(r.length+a.length);for(let o=0;o<r.length;o++)i[o]=r[o];for(let o=0;o<a.length;o++)i[r.length+o]=a[o];return i},Ex=(r,a)=>({classGroupId:r,validator:a}),wg=(r=new Map,a=null,i)=>({nextPart:r,validators:a,classGroupId:i}),Ao="-",up=[],kx="arbitrary..",Rx=r=>{const a=Mx(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:p=>{if(p.startsWith("[")&&p.endsWith("]"))return jx(p);const m=p.split(Ao),b=m[0]===""&&m.length>1?1:0;return Sg(m,b,a)},getConflictingClassGroupIds:(p,m)=>{if(m){const b=o[p],v=i[p];return b?v?Nx(v,b):b:v||up}return i[p]||up}}},Sg=(r,a,i)=>{if(r.length-a===0)return i.classGroupId;const d=r[a],f=i.nextPart.get(d);if(f){const v=Sg(r,a+1,f);if(v)return v}const p=i.validators;if(p===null)return;const m=a===0?r.join(Ao):r.slice(a).join(Ao),b=p.length;for(let v=0;v<b;v++){const y=p[v];if(y.validator(m))return y.classGroupId}},jx=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),i=a.indexOf(":"),o=a.slice(0,i);return o?kx+o:void 0})(),Mx=r=>{const{theme:a,classGroups:i}=r;return _x(i,a)},_x=(r,a)=>{const i=wg();for(const o in r){const d=r[o];rd(d,i,o,a)}return i},rd=(r,a,i,o)=>{const d=r.length;for(let f=0;f<d;f++){const p=r[f];Lx(p,a,i,o)}},Lx=(r,a,i,o)=>{if(typeof r=="string"){zx(r,a,i);return}if(typeof r=="function"){Dx(r,a,i,o);return}Ox(r,a,i,o)},zx=(r,a,i)=>{const o=r===""?a:Cg(a,r);o.classGroupId=i},Dx=(r,a,i,o)=>{if(Ux(r)){rd(r(o),a,i,o);return}a.validators===null&&(a.validators=[]),a.validators.push(Ex(i,r))},Ox=(r,a,i,o)=>{const d=Object.entries(r),f=d.length;for(let p=0;p<f;p++){const[m,b]=d[p];rd(b,Cg(a,m),i,o)}},Cg=(r,a)=>{let i=r;const o=a.split(Ao),d=o.length;for(let f=0;f<d;f++){const p=o[f];let m=i.nextPart.get(p);m||(m=wg(),i.nextPart.set(p,m)),i=m}return i},Ux=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,Bx=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,i=Object.create(null),o=Object.create(null);const d=(f,p)=>{i[f]=p,a++,a>r&&(a=0,o=i,i=Object.create(null))};return{get(f){let p=i[f];if(p!==void 0)return p;if((p=o[f])!==void 0)return d(f,p),p},set(f,p){f in i?i[f]=p:d(f,p)}}},Pu="!",dp=":",Hx=[],fp=(r,a,i,o,d)=>({modifiers:r,hasImportantModifier:a,baseClassName:i,maybePostfixModifierPosition:o,isExternal:d}),Kx=r=>{const{prefix:a,experimentalParseClassName:i}=r;let o=d=>{const f=[];let p=0,m=0,b=0,v;const y=d.length;for(let K=0;K<y;K++){const z=d[K];if(p===0&&m===0){if(z===dp){f.push(d.slice(b,K)),b=K+1;continue}if(z==="/"){v=K;continue}}z==="["?p++:z==="]"?p--:z==="("?m++:z===")"&&m--}const w=f.length===0?d:d.slice(b);let T=w,R=!1;w.endsWith(Pu)?(T=w.slice(0,-1),R=!0):w.startsWith(Pu)&&(T=w.slice(1),R=!0);const k=v&&v>b?v-b:void 0;return fp(f,R,T,k)};if(a){const d=a+dp,f=o;o=p=>p.startsWith(d)?f(p.slice(d.length)):fp(Hx,!1,p,void 0,!0)}if(i){const d=o;o=f=>i({className:f,parseClassName:d})}return o},Yx=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((i,o)=>{a.set(i,1e6+o)}),i=>{const o=[];let d=[];for(let f=0;f<i.length;f++){const p=i[f],m=p[0]==="[",b=a.has(p);m||b?(d.length>0&&(d.sort(),o.push(...d),d=[]),o.push(p)):d.push(p)}return d.length>0&&(d.sort(),o.push(...d)),o}},Gx=r=>({cache:Bx(r.cacheSize),parseClassName:Kx(r),sortModifiers:Yx(r),postfixLookupClassGroupIds:qx(r),...Rx(r)}),qx=r=>{const a=Object.create(null),i=r.postfixLookupClassGroups;if(i)for(let o=0;o<i.length;o++)a[i[o]]=!0;return a},Fx=/\s+/,Vx=(r,a)=>{const{parseClassName:i,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:f,postfixLookupClassGroupIds:p}=a,m=[],b=r.trim().split(Fx);let v="";for(let y=b.length-1;y>=0;y-=1){const w=b[y],{isExternal:T,modifiers:R,hasImportantModifier:k,baseClassName:K,maybePostfixModifierPosition:z}=i(w);if(T){v=w+(v.length>0?" "+v:v);continue}let X=!!z,I;if(X){const G=K.substring(0,z);I=o(G);const U=I&&p[I]?o(K):void 0;U&&U!==I&&(I=U,X=!1)}else I=o(K);if(!I){if(!X){v=w+(v.length>0?" "+v:v);continue}if(I=o(K),!I){v=w+(v.length>0?" "+v:v);continue}X=!1}const P=R.length===0?"":R.length===1?R[0]:f(R).join(":"),ae=k?P+Pu:P,be=ae+I;if(m.indexOf(be)>-1)continue;m.push(be);const se=d(I,X);for(let G=0;G<se.length;++G){const U=se[G];m.push(ae+U)}v=w+(v.length>0?" "+v:v)}return v},Xx=(...r)=>{let a=0,i,o,d="";for(;a<r.length;)(i=r[a++])&&(o=Tg(i))&&(d&&(d+=" "),d+=o);return d},Tg=r=>{if(typeof r=="string")return r;let a,i="";for(let o=0;o<r.length;o++)r[o]&&(a=Tg(r[o]))&&(i&&(i+=" "),i+=a);return i},Ix=(r,...a)=>{let i,o,d,f;const p=b=>{const v=a.reduce((y,w)=>w(y),r());return i=Gx(v),o=i.cache.get,d=i.cache.set,f=m,m(b)},m=b=>{const v=o(b);if(v)return v;const y=Vx(b,i);return d(b,y),y};return f=p,(...b)=>f(Xx(...b))},Zx=[],Wt=r=>{const a=i=>i[r]||Zx;return a.isThemeGetter=!0,a},Ag=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ng=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qx=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Px=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Wx=/\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$/,Jx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$x=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ka=r=>Qx.test(r),Ie=r=>!!r&&!Number.isNaN(Number(r)),Cl=r=>!!r&&Number.isInteger(Number(r)),zu=r=>r.endsWith("%")&&Ie(r.slice(0,-1)),Il=r=>Px.test(r),Eg=()=>!0,t0=r=>Wx.test(r)&&!Jx.test(r),sd=()=>!1,n0=r=>$x.test(r),l0=r=>e0.test(r),a0=r=>!me(r)&&!pe(r),i0=r=>r.startsWith("@container")&&(r[10]==="/"&&r[11]!==void 0||r[11]==="s"&&r[16]!==void 0&&r.startsWith("-size/",10)||r[11]==="n"&&r[18]!==void 0&&r.startsWith("-normal/",10)),r0=r=>ja(r,jg,sd),me=r=>Ag.test(r),Ja=r=>ja(r,Mg,t0),hp=r=>ja(r,m0,Ie),s0=r=>ja(r,Lg,Eg),o0=r=>ja(r,_g,sd),mp=r=>ja(r,kg,sd),c0=r=>ja(r,Rg,l0),uo=r=>ja(r,zg,n0),pe=r=>Ng.test(r),Ur=r=>li(r,Mg),u0=r=>li(r,_g),pp=r=>li(r,kg),d0=r=>li(r,jg),f0=r=>li(r,Rg),fo=r=>li(r,zg,!0),h0=r=>li(r,Lg,!0),ja=(r,a,i)=>{const o=Ag.exec(r);return o?o[1]?a(o[1]):i(o[2]):!1},li=(r,a,i=!1)=>{const o=Ng.exec(r);return o?o[1]?a(o[1]):i:!1},kg=r=>r==="position"||r==="percentage",Rg=r=>r==="image"||r==="url",jg=r=>r==="length"||r==="size"||r==="bg-size",Mg=r=>r==="length",m0=r=>r==="number",_g=r=>r==="family-name",Lg=r=>r==="number"||r==="weight",zg=r=>r==="shadow",p0=()=>{const r=Wt("color"),a=Wt("font"),i=Wt("text"),o=Wt("font-weight"),d=Wt("tracking"),f=Wt("leading"),p=Wt("breakpoint"),m=Wt("container"),b=Wt("spacing"),v=Wt("radius"),y=Wt("shadow"),w=Wt("inset-shadow"),T=Wt("text-shadow"),R=Wt("drop-shadow"),k=Wt("blur"),K=Wt("perspective"),z=Wt("aspect"),X=Wt("ease"),I=Wt("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],be=()=>[...ae(),pe,me],se=()=>["auto","hidden","clip","visible","scroll"],G=()=>["auto","contain","none"],U=()=>[pe,me,b],le=()=>[ka,"full","auto",...U()],ue=()=>[Cl,"none","subgrid",pe,me],ve=()=>["auto",{span:["full",Cl,pe,me]},Cl,pe,me],we=()=>[Cl,"auto",pe,me],he=()=>["auto","min","max","fr",pe,me],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],He=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...U()],V=()=>[ka,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],$=()=>[ka,"screen","full","dvw","lvw","svw","min","max","fit",...U()],je=()=>[ka,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],Z=()=>[r,pe,me],at=()=>[...ae(),pp,mp,{position:[pe,me]}],Qe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_e=()=>["auto","cover","contain",d0,r0,{size:[pe,me]}],Ze=()=>[zu,Ur,Ja],ze=()=>["","none","full",v,pe,me],Se=()=>["",Ie,Ur,Ja],zt=()=>["solid","dashed","dotted","double"],ft=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>[Ie,zu,pp,mp],Me=()=>["","none",k,pe,me],E=()=>["none",Ie,pe,me],te=()=>["none",Ie,pe,me],J=()=>[Ie,pe,me],Ke=()=>[ka,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Il],breakpoint:[Il],color:[Eg],container:[Il],"drop-shadow":[Il],ease:["in","out","in-out"],font:[a0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Il],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Il],shadow:[Il],spacing:["px",Ie],text:[Il],"text-shadow":[Il],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ka,me,pe,z]}],container:["container"],"container-type":[{"@container":["","normal","size",pe,me]}],"container-named":[i0],columns:[{columns:[Ie,me,pe,m]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:be()}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Cl,"auto",pe,me]}],basis:[{basis:[ka,"full","auto",m,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,ka,"auto","initial","none",me]}],grow:[{grow:["",Ie,pe,me]}],shrink:[{shrink:["",Ie,pe,me]}],order:[{order:[Cl,"first","last","none",pe,me]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:ve()}],"col-start":[{"col-start":we()}],"col-end":[{"col-end":we()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:ve()}],"row-start":[{"row-start":we()}],"row-end":[{"row-end":we()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...He(),"normal"]}],"justify-self":[{"justify-self":["auto",...He()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...He(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...He(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...He(),"baseline"]}],"place-self":[{"place-self":["auto",...He()]}],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:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[m,"screen",...V()]}],"min-w":[{"min-w":[m,"screen","none",...V()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[p]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",i,Ur,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,h0,s0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zu,me]}],"font-family":[{font:[u0,o0,a]}],"font-features":[{"font-features":[me]}],"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:[d,pe,me]}],"line-clamp":[{"line-clamp":[Ie,"none",pe,hp]}],leading:[{leading:[f,...U()]}],"list-image":[{"list-image":["none",pe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...zt(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",pe,Ja]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Ie,"auto",pe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"tab-size":[{tab:[Cl,pe,me]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,me]}],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",pe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:at()}],"bg-repeat":[{bg:Qe()}],"bg-size":[{bg:_e()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Cl,pe,me],radial:["",pe,me],conic:[Cl,pe,me]},f0,c0]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:Ze()}],"gradient-via-pos":[{via:Ze()}],"gradient-to-pos":[{to:Ze()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:ze()}],"rounded-s":[{"rounded-s":ze()}],"rounded-e":[{"rounded-e":ze()}],"rounded-t":[{"rounded-t":ze()}],"rounded-r":[{"rounded-r":ze()}],"rounded-b":[{"rounded-b":ze()}],"rounded-l":[{"rounded-l":ze()}],"rounded-ss":[{"rounded-ss":ze()}],"rounded-se":[{"rounded-se":ze()}],"rounded-ee":[{"rounded-ee":ze()}],"rounded-es":[{"rounded-es":ze()}],"rounded-tl":[{"rounded-tl":ze()}],"rounded-tr":[{"rounded-tr":ze()}],"rounded-br":[{"rounded-br":ze()}],"rounded-bl":[{"rounded-bl":ze()}],"border-w":[{border:Se()}],"border-w-x":[{"border-x":Se()}],"border-w-y":[{"border-y":Se()}],"border-w-s":[{"border-s":Se()}],"border-w-e":[{"border-e":Se()}],"border-w-bs":[{"border-bs":Se()}],"border-w-be":[{"border-be":Se()}],"border-w-t":[{"border-t":Se()}],"border-w-r":[{"border-r":Se()}],"border-w-b":[{"border-b":Se()}],"border-w-l":[{"border-l":Se()}],"divide-x":[{"divide-x":Se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...zt(),"hidden","none"]}],"divide-style":[{divide:[...zt(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-bs":[{"border-bs":Z()}],"border-color-be":[{"border-be":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...zt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,pe,me]}],"outline-w":[{outline:["",Ie,Ur,Ja]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",y,fo,uo]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",w,fo,uo]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:Se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Ie,Ja]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":Se()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",T,fo,uo]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Ie,pe,me]}],"mix-blend":[{"mix-blend":[...ft(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ft()}],"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":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[pe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"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":ae()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:at()}],"mask-repeat":[{mask:Qe()}],"mask-size":[{mask:_e()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,me]}],filter:[{filter:["","none",pe,me]}],blur:[{blur:Me()}],brightness:[{brightness:[Ie,pe,me]}],contrast:[{contrast:[Ie,pe,me]}],"drop-shadow":[{"drop-shadow":["","none",R,fo,uo]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Ie,pe,me]}],"hue-rotate":[{"hue-rotate":[Ie,pe,me]}],invert:[{invert:["",Ie,pe,me]}],saturate:[{saturate:[Ie,pe,me]}],sepia:[{sepia:["",Ie,pe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,me]}],"backdrop-blur":[{"backdrop-blur":Me()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,pe,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,pe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,pe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,pe,me]}],"backdrop-invert":[{"backdrop-invert":["",Ie,pe,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,pe,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,pe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,pe,me]}],"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",pe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",pe,me]}],ease:[{ease:["linear","initial",X,pe,me]}],delay:[{delay:[Ie,pe,me]}],animate:[{animate:["none",I,pe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[K,pe,me]}],"perspective-origin":[{"perspective-origin":be()}],rotate:[{rotate:E()}],"rotate-x":[{"rotate-x":E()}],"rotate-y":[{"rotate-y":E()}],"rotate-z":[{"rotate-z":E()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:J()}],"skew-x":[{"skew-x":J()}],"skew-y":[{"skew-y":J()}],transform:[{transform:[pe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:be()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],zoom:[{zoom:[Cl,pe,me]}],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"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",pe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Z()}],"scrollbar-track-color":[{"scrollbar-track":Z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"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",pe,me]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Ie,Ur,Ja,hp]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},g0=Ix(p0);function ne(...r){return g0(Ax(r))}var b0=Vp();const Xe={cursor:"▸",on:"●",off:"○",dot:"·",check:"✓",cross:"✗",warn:"!",arrowRight:"→",arrowLeft:"←",chevronDown:"▾",chevronRight:"▸",ellipsis:"…",meterFull:"█",meterEmpty:"░",tabDivider:"│"},tl={ok:{text:"text-tui-ok",edgeL:"border-l-tui-ok",edgeB:"border-b-tui-ok"},warn:{text:"text-tui-warn",edgeL:"border-l-tui-warn",edgeB:"border-b-tui-warn"},bad:{text:"text-tui-bad",edgeL:"border-l-tui-bad",edgeB:"border-b-tui-bad"},idle:{text:"text-tui-faint",edgeL:"border-l-tui-border",edgeB:"border-b-tui-border"},accent:{text:"text-tui-accent",edgeL:"border-l-tui-accent",edgeB:"border-b-tui-accent"},alt:{text:"text-tui-alt",edgeL:"border-l-tui-alt",edgeB:"border-b-tui-alt"},info:{text:"text-tui-info",edgeL:"border-l-tui-info",edgeB:"border-b-tui-info"}},Wr={ok:tl.ok.text,warn:tl.warn.text,bad:tl.bad.text,idle:tl.idle.text,accent:tl.accent.text,alt:tl.alt.text,info:tl.info.text},jn=({level:r,className:a})=>u.jsx("span",{"aria-hidden":"true",className:ne("select-none leading-none",Wr[r],a),children:r==="idle"?Xe.off:Xe.on}),Dg=({className:r})=>u.jsx("span",{"aria-hidden":"true",className:ne("select-none text-tui-faint",r),children:Xe.dot}),fn=({title:r,aside:a,tone:i="accent",className:o,bodyClassName:d,children:f,...p})=>u.jsxs("fieldset",{className:ne("tui-panel tui-block relative min-w-0 border border-tui-border bg-tui-base",r?"px-3 pb-3 pt-1":"p-3",o),...p,children:[r?u.jsx("legend",{className:ne("flex items-center gap-2 text-tui font-bold",Wr[i]),children:u.jsx("span",{children:r})}):null,a?u.jsx("span",{className:"pointer-events-none absolute -top-[10px] right-2 max-w-[60%] truncate bg-tui-base px-1 text-tui-sm text-tui-faint",children:a}):null,u.jsx("div",{className:ne("min-w-0",d),children:f})]}),fl=({label:r,labelWidth:a=16,className:i,children:o})=>u.jsxs("div",{className:ne("flex items-baseline gap-2 text-tui",i),children:[u.jsx("span",{className:"shrink-0 truncate text-tui-muted",style:{width:`${a}ch`},title:typeof r=="string"?r:void 0,children:r}),u.jsx("span",{className:"min-w-0 flex-1 text-tui-text",children:o})]}),hl=({className:r,label:a})=>a?u.jsxs("div",{className:ne("flex items-center gap-2",r),children:[u.jsx("span",{className:"h-px w-3 bg-tui-border-dim","aria-hidden":"true"}),u.jsx("span",{className:"text-tui-sm text-tui-faint",children:a}),u.jsx("span",{className:"h-px flex-1 bg-tui-border-dim","aria-hidden":"true"})]}):u.jsx("div",{className:ne("h-px w-full bg-tui-border-dim",r),"aria-hidden":"true"}),y0={default:"border-tui-border text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",primary:"border-tui-accent text-tui-accent hover:bg-tui-accent hover:text-tui-crust active:bg-tui-accent-dim",danger:"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust active:bg-tui-bad",warn:"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust active:bg-tui-warn",ghost:"border-transparent text-tui-muted hover:text-tui-accent hover:border-tui-border active:bg-tui-selection"},Oe=({variant:r="default",brackets:a=!0,glyph:i,block:o=!1,className:d,children:f,type:p="button",...m})=>u.jsxs("button",{type:p,className:ne("tui-focusable inline-flex select-none items-center justify-center gap-1.5 border bg-transparent px-2 py-0.5 text-tui font-medium transition-colors","disabled:cursor-not-allowed disabled:border-tui-border-dim disabled:text-tui-faint disabled:hover:bg-transparent",y0[r],o&&"w-full",d),...m,children:[a?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"["}):null,i?u.jsx("span",{"aria-hidden":"true",className:"leading-none",children:i}):null,u.jsx("span",{className:"truncate",children:f}),a?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"]"}):null]}),ko=({tone:r="accent",dot:a=!1,className:i,children:o})=>u.jsxs("span",{className:ne("inline-flex select-none items-center gap-1 whitespace-nowrap text-tui font-bold uppercase",Wr[r],i),children:[a?u.jsx(jn,{level:r}):null,o]}),od=({tabs:r,activeId:a,onSelect:i,ariaLabel:o,className:d,labelClassName:f})=>u.jsx("nav",{className:ne("flex items-center gap-2",d),"aria-label":o,children:r.map((p,m)=>{const b=p.id===a;return u.jsxs(pl.Fragment,{children:[m>0?u.jsx("span",{"aria-hidden":"true",className:"select-none text-tui-border",children:Xe.tabDivider}):null,u.jsxs("button",{type:"button",onClick:()=>i(p.id),"aria-current":b?"page":void 0,"aria-label":p.ariaLabel??p.label,title:p.title,className:ne("tui-focusable select-none whitespace-nowrap border-b px-0.5 pb-0.5 text-tui transition-colors",b?"border-tui-accent font-bold text-tui-accent":"border-transparent text-tui-muted hover:border-tui-border-bright hover:text-tui-text"),children:[p.index!==void 0?u.jsx("span",{"aria-hidden":"true",className:ne("text-tui-faint",b&&"text-tui-accent"),children:p.index}):null,u.jsx("span",{"aria-hidden":"true",className:ne("ml-1",f),children:p.label})]})]},p.id)})}),Og=({hints:r,className:a})=>u.jsx("div",{className:ne("flex flex-wrap items-center gap-x-3 gap-y-0.5 text-tui-sm text-tui-faint",a),children:r.map((i,o)=>u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("kbd",{className:"border border-tui-border-dim px-1 not-italic text-tui-muted",children:i.keys}),u.jsx("span",{children:i.action})]},`${i.keys}-${o}`))}),xn=({htmlFor:r,hint:a,className:i,children:o})=>u.jsxs("label",{htmlFor:r,className:ne("block text-tui-sm font-bold text-tui-muted",i),children:[o,a?u.jsx("span",{className:"ml-2 font-normal text-tui-faint",children:a}):null]}),wn=pl.forwardRef(({className:r,...a},i)=>u.jsx("input",{ref:i,className:ne("tui-input w-full px-2 py-1 text-tui",r),...a}));wn.displayName="Input";const Pr=pl.forwardRef(({className:r,children:a,...i},o)=>u.jsx("select",{ref:o,className:ne("tui-input w-full px-2 py-1 text-tui",r),...i,children:a}));Pr.displayName="Select";const Ra=({checked:r,onChange:a,disabled:i=!1,label:o,description:d,className:f,id:p})=>u.jsxs("label",{className:ne("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",i&&"cursor-not-allowed opacity-60",f),children:[u.jsx("input",{id:p,type:"checkbox",className:"sr-only",checked:r,disabled:i,onChange:m=>a(m.target.checked)}),u.jsx("span",{"aria-hidden":"true",className:ne("mt-px shrink-0 font-bold leading-tight",r?"text-tui-ok":"text-tui-faint",!i&&"group-hover:text-tui-accent"),children:r?"[x]":"[ ]"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:ne("block",r?"text-tui-text":"text-tui-muted"),children:o}),d?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:d}):null]})]}),Br=({checked:r,onChange:a,name:i,disabled:o=!1,label:d,description:f,className:p})=>u.jsxs("label",{className:ne("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",o&&"cursor-not-allowed opacity-60",p),children:[u.jsx("input",{type:"radio",name:i,className:"sr-only",checked:r,disabled:o,onChange:a}),u.jsx("span",{"aria-hidden":"true",className:ne("mt-px shrink-0 font-bold leading-tight",r?"text-tui-accent":"text-tui-faint",!o&&"group-hover:text-tui-accent"),children:r?"(•)":"( )"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:ne("block",r?"text-tui-text":"text-tui-muted"),children:d}),f?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:f}):null]})]}),v0=({value:r,width:a=20,tone:i="accent",className:o})=>{const d=Number.isFinite(r)?Math.min(1,Math.max(0,r)):0,f=Math.round(d*a);return u.jsxs("span",{className:ne("inline-flex select-none whitespace-pre font-mono leading-none",o),role:"presentation",children:[u.jsx("span",{className:Wr[i],children:Xe.meterFull.repeat(f)}),u.jsx("span",{className:"text-tui-border",children:Xe.meterEmpty.repeat(Math.max(0,a-f))})]})},x0={ok:"bg-tui-ok",warn:"bg-tui-warn",bad:"bg-tui-bad",idle:"bg-tui-border",accent:"bg-tui-accent",alt:"bg-tui-alt",info:"bg-tui-info"},w0=({ratio:r,label:a,tone:i="accent",className:o,...d})=>{const f=Number.isFinite(r)?Math.min(1,Math.max(0,r)):0;return u.jsxs("div",{className:ne("relative h-[var(--tui-row)] w-full overflow-hidden border border-tui-border bg-tui-mantle",o),role:"progressbar","aria-valuenow":Math.round(f*100),"aria-valuemin":0,"aria-valuemax":100,...d,children:[u.jsx("div",{className:ne("absolute inset-y-0 left-0",x0[i]),style:{width:`${f*100}%`},"aria-hidden":"true"}),a!==void 0?u.jsx("span",{className:"absolute inset-0 flex items-center justify-center whitespace-nowrap px-1 text-tui font-bold text-tui-text mix-blend-difference",children:a}):null]})};function cd({columns:r,items:a,rowKey:i,empty:o,className:d}){return a.length===0?u.jsx("div",{className:ne("px-1 py-4 text-center text-tui text-tui-faint",d),children:o}):u.jsx("div",{className:ne("w-full overflow-x-auto",d),children:u.jsxs("table",{className:"w-full border-collapse text-tui",children:[u.jsx("thead",{children:u.jsx("tr",{className:"border-b border-tui-border",children:r.map(f=>u.jsx("th",{scope:"col",style:f.width?{width:`${f.width}ch`}:void 0,className:ne("whitespace-nowrap px-2 py-1 text-tui-sm font-bold text-tui-muted",f.align==="right"?"text-right":"text-left",f.className),children:f.header},f.key))})}),u.jsx("tbody",{children:a.map((f,p)=>u.jsx("tr",{className:"border-b border-tui-border-dim last:border-b-0 hover:bg-tui-selection",children:r.map(m=>u.jsx("td",{className:ne("px-2 py-1 align-top text-tui-text",m.align==="right"?"text-right":"text-left",m.className),children:m.render(f,p)},m.key))},i(f,p)))})]})})}const ud=({isOpen:r,onClose:a,title:i,subtitle:o,closeLabel:d,footer:f,hints:p,size:m="md",className:b,children:v})=>{if(!r)return null;const y=m==="sm"?"max-w-md":m==="lg"?"max-w-3xl":"max-w-xl",w=`tui-modal-${i.replace(/\s+/g,"-").toLowerCase()}`,T=u.jsx("div",{className:"fixed inset-0 inset-x-0 z-50 grid place-items-center overflow-y-auto bg-tui-crust/85 p-3 sm:p-6",style:{height:"var(--app-height, 100dvh)",width:"100vw"},role:"dialog","aria-modal":"true","aria-labelledby":w,onMouseDown:R=>{R.target===R.currentTarget&&a()},children:u.jsxs("div",{className:ne("flex w-full flex-col border border-tui-border bg-tui-base",y,b),style:{maxHeight:"calc(var(--app-height, 100dvh) - 1.5rem)"},children:[u.jsxs("header",{className:"flex shrink-0 items-center gap-2 border-b border-tui-border bg-tui-mantle px-3 py-1.5",children:[u.jsx("h2",{id:w,className:"truncate text-tui font-bold text-tui-accent",children:i}),o?u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-sm text-tui-faint",children:o}):u.jsx("span",{className:"flex-1"}),u.jsx(Oe,{variant:"ghost",onClick:a,"aria-label":d,title:d,children:"esc"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:v}),f||p?u.jsxs("footer",{className:"flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-tui-border bg-tui-mantle px-3 py-1.5",children:[p?u.jsx(Og,{hints:p}):u.jsx("span",{}),f?u.jsx("div",{className:"flex items-center gap-2",children:f}):null]}):null]})});return typeof document>"u"?T:b0.createPortal(T,document.body)},yo=({tone:r="accent",className:a,children:i,action:o})=>{const d=r==="ok"?Xe.check:r==="bad"?Xe.cross:r==="warn"?Xe.warn:"›",f=tl[r].edgeL;return u.jsxs("div",{className:ne("flex items-start gap-2 border border-tui-border-dim border-l-2 bg-tui-mantle px-2 py-1.5 text-tui",f,a),children:[u.jsx("span",{"aria-hidden":"true",className:ne("shrink-0 font-bold",Wr[r]),children:d}),u.jsx("div",{className:"min-w-0 flex-1 leading-snug text-tui-text",children:i}),o?u.jsx("div",{className:"shrink-0",children:o}):null]})},gp=({active:r=!1,className:a,children:i})=>u.jsx("span",{className:ne("inline-flex min-w-[2ch] select-none items-center justify-center border px-1 text-tui",r?"border-tui-accent bg-tui-accent text-tui-crust":"border-tui-border bg-tui-surface text-tui-muted",a),children:i}),bp=({items:r,className:a})=>{const i=r.filter(Boolean);return u.jsx("span",{className:ne("flex min-w-0 items-center gap-1.5",a),children:i.map((o,d)=>u.jsxs(pl.Fragment,{children:[d>0?u.jsx(Dg,{className:"shrink-0"}):null,o]},d))})},Ug=({left:r,right:a,className:i})=>u.jsxs("footer",{className:ne("relative flex h-[var(--tui-row)] w-full shrink-0 items-center justify-between gap-3 overflow-visible border-t border-tui-border bg-tui-mantle px-2 text-tui-sm",i),children:[u.jsx("div",{className:"flex min-w-0 items-center gap-1.5 text-tui-muted",children:r}),u.jsx("div",{className:"flex shrink-0 items-center gap-3",children:a})]}),S0=({name:r,tagline:a,aside:i,tabs:o,activeTabId:d,onSelectTab:f,tabsAriaLabel:p,hints:m,footerAside:b,bodyClassName:v,className:y,children:w})=>u.jsxs("div",{className:ne("flex h-full min-h-0 w-full flex-col bg-tui-crust",y),children:[u.jsxs("div",{className:"flex h-[var(--tui-row)] shrink-0 items-center justify-between gap-3 overflow-hidden border-b border-tui-border bg-tui-mantle px-2 text-tui",children:[u.jsxs("span",{className:"flex min-w-0 items-baseline gap-2",children:[u.jsx("span",{className:"shrink-0 font-bold text-tui-accent",children:r}),a?u.jsx("span",{className:"hidden truncate text-tui-sm text-tui-faint sm:block",children:a}):null]}),i?u.jsx("span",{className:"flex shrink-0 items-center gap-2",children:i}):null]}),o&&o.length>0&&d!==void 0&&f?u.jsx("div",{className:"scrollbar-none shrink-0 overflow-x-auto border-b border-tui-border bg-tui-mantle px-2",children:u.jsx(od,{tabs:o,activeId:d,onSelect:f,ariaLabel:p,className:"gap-3"})}):null,u.jsx("div",{className:ne("min-h-0 flex-1 overflow-y-auto p-2",v),children:w}),m||b?u.jsx(Ug,{left:m?u.jsx(Og,{hints:m}):null,right:b}):null]}),yp=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Vi=({className:r,label:a})=>{const[i,o]=pl.useState(0);return pl.useEffect(()=>{const d=setInterval(()=>o(f=>(f+1)%yp.length),90);return()=>clearInterval(d)},[]),u.jsxs("span",{className:ne("inline-flex items-center gap-1.5",r),role:"status",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:yp[i]}),a?u.jsx("span",{children:a}):null]})},ho="tui-focusable select-none border border-transparent px-1.5 text-tui uppercase transition-colors",mo="text-tui-muted hover:border-tui-border hover:text-tui-accent",C0="border-tui-accent bg-tui-accent text-tui-crust",T0=({currentView:r,onNavigate:a,showAdminEntry:i=!0,onOpenPairing:o,onOpenSettings:d,onToggleVirtualKeyboard:f,isVirtualKeyboardOpen:p})=>{const{addToast:m,language:b,setLanguage:v,t:y}=Nt(),w=()=>{const R=b==="zh"?"en":"zh";v(R),m("info",id(R,"toasts.switchedLanguage",{lang:R==="zh"?"简体中文":"English"}))},T=[{id:"terminal",label:y("header.terminalTab"),index:1,ariaLabel:y("header.terminalTab")},...i||r==="admin"?[{id:"admin",label:y("header.adminTab"),index:2,ariaLabel:y("header.adminTab")}]:[]];return u.jsx("header",{role:"banner",className:"z-30 w-full shrink-0 select-none overflow-hidden border-b border-tui-border bg-tui-mantle px-2 pt-[max(env(safe-area-inset-top,0px),0.125rem)]",children:u.jsxs("div",{className:"scrollbar-none flex min-h-[var(--tui-row)] items-center gap-2 overflow-x-auto text-tui",children:[u.jsxs("span",{className:"flex shrink-0 items-baseline gap-2",children:[u.jsx("span",{className:"font-bold text-tui-accent",children:"herdr-remote"}),u.jsx("span",{className:"hidden text-tui-sm text-tui-faint sm:inline",children:y("header.tagline")})]}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsx(od,{tabs:T,activeId:r,onSelect:R=>a(R),ariaLabel:y("header.mainNavigationAria"),className:"shrink-0 gap-3"}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[u.jsx("button",{type:"button",onClick:w,className:ne(ho,mo),title:y("header.languageToggleTitle"),"aria-label":y("header.languageToggleTitle"),children:y("header.languageShort")}),r==="terminal"&&u.jsx("button",{type:"button",onClick:f,className:ne(ho,p?C0:mo),title:y("header.virtualKeyboardTitle"),"aria-label":y("header.virtualKeyboardTitle"),children:y("header.actionKeyboard")}),u.jsx("button",{type:"button",onClick:o,className:ne(ho,mo),title:y("header.pairingTitle"),"aria-label":y("header.pairingTitle"),children:y("header.actionPairing")}),u.jsx("button",{type:"button",onClick:d,className:ne(ho,mo),title:y("header.settingsTitle"),"aria-label":y("header.settingsTitle"),children:y("header.actionSettings")})]})]})})},po=({tone:r,glyph:a,message:i,assertive:o=!1,action:d})=>u.jsxs("aside",{className:ne("flex w-full items-center justify-between gap-3 border-b bg-tui-mantle px-2 py-0.5 text-tui sm:px-3",tl[r].edgeB),"aria-live":o?"assertive":"polite",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{"aria-hidden":"true",className:ne("shrink-0",tl[r].text),children:a}),u.jsx("span",{className:"truncate text-tui-text",children:i})]}),d]}),A0=()=>{const{connectionState:r,stateDetail:a,connect:i,settings:o,t:d}=Nt();return r==="connected"||!o.token&&!o.pairCode&&r==="disconnected"?null:r==="connecting"?u.jsx(po,{tone:"accent",glyph:u.jsx(Vi,{}),message:d("statusBanner.connecting")}):r==="reconnecting"?u.jsx(po,{tone:"warn",glyph:u.jsx(Vi,{}),assertive:!0,message:a||d("statusBanner.reconnectingDefault"),action:u.jsx(Oe,{variant:"warn",onClick:()=>i(),className:"shrink-0",children:d("statusBanner.reconnectNow")})}):r==="error"?u.jsx(po,{tone:"bad",glyph:Xe.cross,assertive:!0,message:a||d("statusBanner.errorDefault"),action:u.jsx(Oe,{variant:"danger",onClick:()=>i(),className:"shrink-0",children:d("common.retry")})}):r==="disconnected"?u.jsx(po,{tone:"idle",glyph:Xe.off,message:d("statusBanner.disconnected"),action:u.jsx(Oe,{variant:"primary",onClick:()=>i(),className:"shrink-0",children:d("common.connect")})}):null};var N0=nv(),E0=lv(),Du={exports:{}},vp;function k0(){return vp||(vp=1,(function(r,a){(function(i,o){r.exports=o()})(self,(()=>(()=>{var i={6:(p,m)=>{function b(y){try{const w=new URL(y),T=w.password&&w.username?`${w.protocol}//${w.username}:${w.password}@${w.host}`:w.username?`${w.protocol}//${w.username}@${w.host}`:`${w.protocol}//${w.host}`;return y.toLocaleLowerCase().startsWith(T.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(m,"__esModule",{value:!0}),m.LinkComputer=m.WebLinkProvider=void 0,m.WebLinkProvider=class{constructor(y,w,T,R={}){this._terminal=y,this._regex=w,this._handler=T,this._options=R}provideLinks(y,w){const T=v.computeLink(y,this._regex,this._terminal,this._handler);w(this._addCallbacks(T))}_addCallbacks(y){return y.map((w=>(w.leave=this._options.leave,w.hover=(T,R)=>{if(this._options.hover){const{range:k}=w;this._options.hover(T,R,k)}},w)))}};class v{static computeLink(w,T,R,k){const K=new RegExp(T.source,(T.flags||"")+"g"),[z,X]=v._getWindowedLineStrings(w-1,R),I=z.join("");let P;const ae=[];for(;P=K.exec(I);){const be=P[0];if(!b(be))continue;const[se,G]=v._mapStrIdx(R,X,0,P.index),[U,le]=v._mapStrIdx(R,se,G,be.length);if(se===-1||G===-1||U===-1||le===-1)continue;const ue={start:{x:G+1,y:se+1},end:{x:le,y:U+1}};ae.push({range:ue,text:be,activate:k})}return ae}static _getWindowedLineStrings(w,T){let R,k=w,K=w,z=0,X="";const I=[];if(R=T.buffer.active.getLine(w)){const P=R.translateToString(!0);if(R.isWrapped&&P[0]!==" "){for(z=0;(R=T.buffer.active.getLine(--k))&&z<2048&&(X=R.translateToString(!0),z+=X.length,I.push(X),R.isWrapped&&X.indexOf(" ")===-1););I.reverse()}for(I.push(P),z=0;(R=T.buffer.active.getLine(++K))&&R.isWrapped&&z<2048&&(X=R.translateToString(!0),z+=X.length,I.push(X),X.indexOf(" ")===-1););}return[I,k]}static _mapStrIdx(w,T,R,k){const K=w.buffer.active,z=K.getNullCell();let X=R;for(;k;){const I=K.getLine(T);if(!I)return[-1,-1];for(let P=X;P<I.length;++P){I.getCell(P,z);const ae=z.getChars();if(z.getWidth()&&(k-=ae.length||1,P===I.length-1&&ae==="")){const be=K.getLine(T+1);be&&be.isWrapped&&(be.getCell(0,z),z.getWidth()===2&&(k+=1))}if(k<0)return[T,P]}T++,X=0}return[T,X]}}m.LinkComputer=v}},o={};function d(p){var m=o[p];if(m!==void 0)return m.exports;var b=o[p]={exports:{}};return i[p](b,b.exports,d),b.exports}var f={};return(()=>{var p=f;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const m=d(6),b=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function v(y,w){const T=window.open();if(T){try{T.opener=null}catch{}T.location.href=w}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(y=v,w={}){this._handler=y,this._options=w}activate(y){this._terminal=y;const w=this._options,T=w.urlRegex||b;this._linkProvider=this._terminal.registerLinkProvider(new m.WebLinkProvider(this._terminal,T,this._handler,w))}dispose(){var y;(y=this._linkProvider)==null||y.dispose()}}})(),f})()))})(Du)),Du.exports}var R0=k0();const Bg="\x1B",j0=/^\x1b\[[IO]/,Hg=/^\x1b\[<(\d+);\d+;\d+[Mm]/,M0=/^\x1b\[M[\s\S]{3}/,_0=[/^\x1b\[\?[\d;]*c/,/^\x1b\[>[\d;]*c/,/^\x1b\[\d+;\d+R/,/^\x1b\[\?\d+;\d+R/,/^\x1b\[\d+n/,/^\x1b\[\?[\d;]*\$y/,/^\x1b\[[\d;]*t/,/^\x1b\[\?\d+u/,/^\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)/,/^\x1bP[\s\S]*?\x1b\\/],L0=/^\x1b\[1;[2-8]R/;function xp(r){if(L0.test(r))return 0;const a=j0.exec(r);if(a)return a[0].length;const i=Hg.exec(r);if(i){const o=Number(i[1]);return(o&32)!==0&&(o&3)===3&&(o&64)===0?i[0].length:0}for(const o of _0){const d=o.exec(r);if(d)return d[0].length}return 0}function Kg(r){if(!r.startsWith(Bg))return"keys";if(Hg.test(r)||M0.test(r)){let i=r;for(;i.length>0;){const o=xp(i);if(o===0)return"pointer";i=i.slice(o)}return"passive"}let a=r;for(;a.length>0;){const i=xp(a);if(i===0)return"keys";a=a.slice(i)}return"passive"}function z0(r){return r===Bg}const D0=20,O0=6,U0=500,B0=300,Xi=13,Yg=.602,Gg=1.3;function Ql(r,a){return Number.isFinite(r)&&r>0?r:a}function wp(r,a,i){return Math.min(i,Math.max(a,r))}function Sp(r){const{width:a,height:i,cellWidth:o,cellHeight:d,minCols:f=D0,minRows:p=O0,maxCols:m=U0,maxRows:b=B0}=r,v=Ql(o,Xi*Yg),y=Ql(d,Xi*Gg);return{cols:wp(Math.floor(Ql(a,0)/v),f,m),rows:wp(Math.floor(Ql(i,0)/y),p,b)}}function ti(r,a=Xi){var o,d,f;if(r)try{const p=r._core,m=(f=(d=(o=p==null?void 0:p._renderService)==null?void 0:o.dimensions)==null?void 0:d.css)==null?void 0:f.cell;if(m&&m.width&&m.width>0&&m.height&&m.height>0)return{cellWidth:m.width,cellHeight:m.height,measured:!0}}catch{}const i=Ql(a,Xi);return{cellWidth:Math.round(i*Yg*100)/100,cellHeight:Math.round(i*Gg*100)/100,measured:!1}}function H0(r){var o;const a=(o=r==null?void 0:r.querySelector)==null?void 0:o.call(r,".xterm-viewport");if(!a)return 0;const i=(a.offsetWidth||0)-(a.clientWidth||0);return Number.isFinite(i)&&i>0?i:0}function Ou(r,a,i){if(!r)return{width:a,height:i};let o=0,d=0;if(typeof r.getBoundingClientRect=="function"){const f=r.getBoundingClientRect();o=(f==null?void 0:f.width)||0,d=(f==null?void 0:f.height)||0}return{width:Ql(o,Ql(r.clientWidth,a)),height:Ql(d,Ql(r.clientHeight,i))}}function qg(r,a,i,o){const d=Number.isFinite(o)&&o>.01?o:1;return{clientX:i.left+(r-i.left)/d,clientY:i.top+(a-i.top)/d}}function Hr(r){var a,i;if(!r)return!1;try{const o=r.modes;if(o&&typeof o.mouseTrackingMode=="string"&&o.mouseTrackingMode!=="none")return!0;const d=r._core;if((a=d==null?void 0:d._coreMouseService)!=null&&a.areMouseEventsActive||(i=d==null?void 0:d.coreMouseService)!=null&&i.areMouseEventsActive||d!=null&&d.mouseMode&&d.mouseMode!=="none")return!0}catch{}return!1}function K0(r,a){const i=a.button??0,o=a.buttons??(r==="mouseup"?0:1);return new MouseEvent(r,{bubbles:!0,cancelable:!0,clientX:a.clientX,clientY:a.clientY,screenX:a.clientX,screenY:a.clientY,button:i,buttons:o})}function Cp(r,a,i){const o=K0(a,i);return r.dispatchEvent(o)}class Y0{constructor(a){fe(this,"options");fe(this,"state","idle");fe(this,"startX",0);fe(this,"startY",0);fe(this,"lastX",0);fe(this,"lastY",0);fe(this,"activeTarget",null);fe(this,"longPressTimer",null);fe(this,"capturedPointerId",null);fe(this,"captureElement",null);fe(this,"scrollRemainderY",0);this.options={longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,...a}}getState(){return this.state}setGestureState(a){var i,o;this.state!==a&&(this.state=a,(o=(i=this.options).onGestureStateChange)==null||o.call(i,a))}getActiveBuffer(a){var i;try{return((i=a.buffer)==null?void 0:i.active)||null}catch{return null}}getViewportY(a){var o;const i=(o=this.getActiveBuffer(a))==null?void 0:o.viewportY;return typeof i=="number"&&Number.isFinite(i)?i:null}blurTerminal(a){var i;try{(i=a.blur)==null||i.call(a)}catch{}}getLogicalCoordinates(a,i){const o=this.options.getScale?this.options.getScale():1,d=this.options.getSurfaceElement?this.options.getSurfaceElement():null;if(o!==1&&d&&typeof d.getBoundingClientRect=="function"){const f=d.getBoundingClientRect();return qg(a,i,f,o)}return{clientX:a,clientY:i}}getViewportElement(a){var d;const i=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(i==null?void 0:i.querySelector(".xterm-viewport"))||((d=a.element)==null?void 0:d.querySelector(".xterm-viewport"))||null}isInputLineHit(a,i){var I;const o=(I=i.buffer)==null?void 0:I.active,d=this.options.getSurfaceElement?this.options.getSurfaceElement():null,f=(d==null?void 0:d.querySelector(".xterm-screen"))||i.element||d,p=ti(i);if(!f||typeof f.getBoundingClientRect!="function"||p.cellHeight<=0)return!1;const m=f.getBoundingClientRect(),b=this.getLogicalCoordinates(a.clientX,a.clientY),v=m.width>0&&m.height>0;if(![o==null?void 0:o.cursorY,o==null?void 0:o.viewportY,o==null?void 0:o.baseY].every(P=>typeof P=="number"&&Number.isFinite(P)))return!1;const w=o==null?void 0:o.cursorY,T=o==null?void 0:o.viewportY,k=(o==null?void 0:o.baseY)+w-T,K=m.top+k*p.cellHeight,z=K+p.cellHeight,X=Number(i.rows);return k>=0&&(!Number.isFinite(X)||k<X)&&b.clientY>=K-2&&b.clientY<=z+2&&(!v||b.clientX>=m.left&&b.clientX<=m.right)}resolveDispatchTarget(a,i){var m;const o=this.options.getSurfaceElement?this.options.getSurfaceElement():null,d=(o==null?void 0:o.querySelector(".xterm-screen"))||i.querySelector(".xterm-screen")||null,f=((m=d==null?void 0:d.closest)==null?void 0:m.call(d,".xterm"))||null;let p=null;return typeof document<"u"&&typeof document.elementFromPoint=="function"&&(p=document.elementFromPoint(a.clientX,a.clientY)),p&&f&&(p===f||f.contains(p))?p:d||o||i}getMouseReport(a,i){const o=this.options.getSurfaceElement?this.options.getSurfaceElement():null,d=(o==null?void 0:o.querySelector(".xterm-screen"))||i.element;if(!d||typeof d.getBoundingClientRect!="function")return null;const f=d.getBoundingClientRect(),p=this.getLogicalCoordinates(a.clientX,a.clientY),m=ti(i);if(m.cellWidth<=0||m.cellHeight<=0)return null;const b=Math.max(1,f.width||i.cols*m.cellWidth),v=Math.max(1,f.height||i.rows*m.cellHeight),y=Math.max(0,Math.min(b-1,p.clientX-f.left)),w=Math.max(0,Math.min(v-1,p.clientY-f.top)),T=Math.max(0,Math.min(i.cols-1,Math.floor(y/m.cellWidth))),R=Math.max(0,Math.min(i.rows-1,Math.floor(w/m.cellHeight)));return{col:T,row:R,x:Math.floor(y),y:Math.floor(w),button:0,action:0}}getCoreMouseService(a){var o,d;const i=a;return i.coreMouseService||((o=i._core)==null?void 0:o.coreMouseService)||((d=i._core)==null?void 0:d._coreMouseService)||null}getCoreService(a){var o;const i=a;return i.coreService||((o=i._core)==null?void 0:o.coreService)||null}getWheelDispatchTarget(a){const i=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(i==null?void 0:i.querySelector(".xterm"))||a.element||null}dispatchWheel(a,i,o,d){const f=this.getWheelDispatchTarget(o);if(!f||typeof WheelEvent>"u"||i===0)return!1;const p=this.getLogicalCoordinates(a.clientX,a.clientY),m=i<0?-1:1;let b=0;for(let v=0;v<Math.abs(i);v+=1)try{const y=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:m,deltaMode:1,ctrlKey:!!(d!=null&&d.ctrlKey),altKey:!!(d!=null&&d.altKey),shiftKey:!!(d!=null&&d.shiftKey)});f.dispatchEvent(y),b+=1}catch{return b>0}return b>0}emitWheel(a,i,o,d){if(i===0)return!1;if(this.dispatchWheel(a,i,o,d))return!0;const f=this.getCoreMouseService(o);if(!(f!=null&&f.triggerMouseEvent))return!1;let p=0;for(let m=0;m<Math.abs(i);m+=1){const b=this.getMouseReport(a,o);b&&(b.button=4,b.action=i<0?0:1,b.ctrl=!!(d!=null&&d.ctrlKey),b.alt=!!(d!=null&&d.altKey),b.shift=!!(d!=null&&d.shiftKey),f.triggerMouseEvent(b)&&(p+=1))}return p>0}scrollAlternateBuffer(a,i,o,d){var p;if(i===0)return"none";const f=Hr(o);if(!f&&!this.options.getIsController())return"none";if(this.emitWheel(a,i,o,d))return f?"application-mouse":"application-keys";if(!f){const m=this.getCoreService(o);if(!(m!=null&&m.triggerDataEvent))return"none";const v=`\x1B${!!((p=m.decPrivateModes)!=null&&p.applicationCursorKeys)?"O":"["}${i<0?"A":"B"}`;return m.triggerDataEvent(v.repeat(Math.abs(i)),!0),"application-keys"}return"none"}emitMouse(a,i,o){const d=this.options.getTerminal();if(!d)return;const f=this.getCoreMouseService(d);if(f!=null&&f.triggerMouseEvent){const m=this.getMouseReport(i,d);m&&(m.action=a==="mousedown"?1:a==="mouseup"?0:32,m.ctrl=!!(o!=null&&o.ctrlKey),m.alt=!!(o!=null&&o.altKey),m.shift=!!(o!=null&&o.shiftKey),f.triggerMouseEvent(m));return}if(this.options.allowSyntheticMouseFallback===!1||!this.activeTarget)return;const p=this.getLogicalCoordinates(i.clientX,i.clientY);Cp(this.activeTarget,a,{clientX:p.clientX,clientY:p.clientY,button:0,buttons:a==="mouseup"?0:1})}beginGesture(a,i){this.startX=a.clientX,this.startY=a.clientY,this.lastX=a.clientX,this.lastY=a.clientY,this.setGestureState("pending"),this.scrollRemainderY=0,this.activeTarget=this.resolveDispatchTarget(a,i),this.clearLongPressTimer(),this.longPressTimer=setTimeout(()=>{var o,d;this.state==="pending"&&(this.setGestureState("longpress"),(d=(o=this.options).onLongPress)==null||d.call(o,{clientX:this.startX,clientY:this.startY}))},this.options.longPressDelayMs)}moveGesture(a,i){var v,y,w,T;if(this.state==="longpress"){(y=(v=this.options).onSelectionExtend)==null||y.call(v,{clientX:a.clientX,clientY:a.clientY}),i!=null&&i.cancelable&&((w=i.preventDefault)==null||w.call(i));return}if(this.state==="idle")return;const o=a.clientX-this.startX,d=a.clientY-this.startY,f=Math.hypot(o,d);if(this.state==="scrolling"){this.scrollGesture(a,i);return}const p=this.options.getTerminal(),m=this.options.getIsController(),b=Hr(p);if(!(f<=(this.options.dragThresholdPx||8))){if(this.clearLongPressTimer(),Math.abs(d)>=Math.abs(o)||!b||!m){this.setGestureState("scrolling"),p&&this.blurTerminal(p),this.lastX=a.clientX,this.lastY=this.startY,this.scrollRemainderY=0,this.scrollGesture(a,i);return}if(b&&m){this.state==="pending"&&(this.setGestureState("dragging"),this.emitMouse("mousedown",{clientX:this.startX,clientY:this.startY},i)),this.state==="dragging"&&(this.lastX=a.clientX,this.lastY=a.clientY,this.emitMouse("mousemove",a,i),i!=null&&i.cancelable&&((T=i.preventDefault)==null||T.call(i)));return}this.lastX=a.clientX,this.lastY=a.clientY}}scrollGesture(a,i){var k,K,z;const o=this.options.getTerminal();if(!o)return;const d=a.clientY-this.lastY;this.lastX=a.clientX,this.lastY=a.clientY;const f=ti(o),p=f.measured?f.cellHeight:this.options.scrollLineHeightPx||f.cellHeight||18;this.scrollRemainderY+=d;const m=Math.trunc(this.scrollRemainderY/p),b=-m;let v=!1,y="none";const w=this.getActiveBuffer(o),T=Hr(o);if(b!==0){if((w==null?void 0:w.type)==="alternate")y=this.scrollAlternateBuffer(a,b,o,i),v=y!=="none";else{const X=this.getViewportY(o);o.scrollLines(b);const I=this.getViewportY(o);y="buffer",v=X===null||I===null||X!==I}this.scrollRemainderY-=m*p}const R=this.getViewportElement(o);(K=(k=this.options).onGestureScroll)==null||K.call(k,{deltaY:d,lines:b,viewportY:this.getViewportY(o),scrollTop:(R==null?void 0:R.scrollTop)??null,scrollHeight:(R==null?void 0:R.scrollHeight)??null,clientHeight:(R==null?void 0:R.clientHeight)??null,moved:v,bufferType:(w==null?void 0:w.type)||null,baseY:typeof(w==null?void 0:w.baseY)=="number"?w.baseY:null,cursorY:typeof(w==null?void 0:w.cursorY)=="number"?w.cursorY:null,hasScrollback:typeof(w==null?void 0:w.hasScrollback)=="boolean"?w.hasScrollback:null,mouseTracking:T,scrollMode:y}),i!=null&&i.cancelable&&((z=i.preventDefault)==null||z.call(i))}endGesture(a,i){var p,m,b;this.clearLongPressTimer();const o=this.options.getTerminal(),d=this.options.getIsController(),f=Hr(o);if(this.state==="pending"){if(f&&d){const y={clientX:this.startX,clientY:this.startY};this.emitMouse("mousedown",y,i),this.emitMouse("mouseup",y,i)}const v={clientX:this.startX,clientY:this.startY};d&&o&&this.isInputLineHit(v,o)&&((m=(p=this.options).onFocus)==null||m.call(p))}else if(this.state==="dragging"&&f&&d){const v=a??{clientX:this.lastX,clientY:this.lastY};this.emitMouse("mouseup",v,i),i!=null&&i.cancelable&&((b=i.preventDefault)==null||b.call(i))}this.reset()}handlePointerDown(a,i){if(a.pointerType==="mouse")return!1;if(!a.isPrimary)return this.releasePointerCapture(),this.reset(),!1;if(a.cancelable&&a.preventDefault(),this.beginGesture(a,i),a.pointerType!=="touch")try{typeof i.setPointerCapture=="function"&&(i.setPointerCapture(a.pointerId),this.capturedPointerId=a.pointerId,this.captureElement=i)}catch{}return!0}handlePointerMove(a){a.pointerType==="mouse"||this.state==="idle"||this.moveGesture(a,a)}handlePointerUp(a){a.pointerType==="mouse"||this.state==="idle"||(this.releasePointerCapture(),this.endGesture(a,a))}handlePointerCancel(a){a&&a.pointerType==="mouse"||(this.releasePointerCapture(),this.cancelGesture())}handleTouchStart(a,i){if(a.touches.length!==1){this.reset();return}a.cancelable&&a.preventDefault(),this.beginGesture(a.touches[0],i)}handleTouchMove(a){a.touches.length===1&&this.moveGesture(a.touches[0],a)}handleTouchEnd(a){a.cancelable&&a.preventDefault(),this.endGesture(null,a)}handleTouchCancel(){this.cancelGesture()}cancelGesture(){this.clearLongPressTimer();const a=this.options.getTerminal(),i=this.options.getIsController(),o=Hr(a);if(this.state==="dragging"&&o&&i&&this.activeTarget){const d=this.getLogicalCoordinates(this.lastX,this.lastY);Cp(this.activeTarget,"mouseup",{clientX:d.clientX,clientY:d.clientY,button:0,buttons:0})}this.reset()}releasePointerCapture(){const a=this.captureElement,i=this.capturedPointerId;if(this.captureElement=null,this.capturedPointerId=null,!(!a||i===null))try{typeof a.releasePointerCapture=="function"&&(typeof a.hasPointerCapture!="function"||a.hasPointerCapture(i))&&a.releasePointerCapture(i)}catch{}}clearLongPressTimer(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}reset(){this.clearLongPressTimer(),this.releasePointerCapture(),this.setGestureState("idle"),this.activeTarget=null}}var G0=av();const Xr="herdr_remote_renderer_probe_v1",go=1,q0=720*60*60*1e3,Wu={};function Fg(){let r=null;if(typeof window>"u")r=Wu[Xr]||null;else try{r=window.localStorage?window.localStorage.getItem(Xr):null}catch{r=Wu[Xr]||null}if(!r)return{v:go,ua:{}};try{const a=JSON.parse(r);return typeof a=="object"&&a!==null&&a.v===go&&typeof a.ua=="object"&&a.ua!==null?a:{v:go,ua:{}}}catch{return{v:go,ua:{}}}}function F0(r,a=Date.now()){var d;const i=Fg();i.ua[r]={failedAt:a};const o=JSON.stringify(i);if(Wu[Xr]=o,typeof window<"u")try{(d=window.localStorage)==null||d.setItem(Xr,o)}catch(f){console.warn("Failed to write renderer probe result to localStorage:",f)}}function V0(r,a=Date.now()){const i=typeof navigator<"u"?navigator.userAgent:"";if(!i)return!1;const d=Fg().ua[i];return!(!d||typeof d.failedAt!="number"||a-d.failedAt>q0)}function Tp(r,a=Date.now()){const i=typeof navigator<"u"?navigator.userAgent:"";i&&F0(i,a)}function X0(r){if(r.length<4)return!0;const a=r[0],i=r[1],o=r[2],d=r[3];for(let f=4;f<r.length;f+=4)if(r[f]!==a||r[f+1]!==i||r[f+2]!==o||r[f+3]!==d)return!1;return!0}function I0(r){if(!r||r.width<=0||r.height<=0)return console.debug("Canvas probe inconclusive: text layer canvas missing or zero dimensions"),"inconclusive";let a=null;try{a=r.getContext("2d",{willReadFrequently:!0})||r.getContext("2d")}catch(d){return console.debug("Canvas probe inconclusive: failed to acquire 2D context:",d),"inconclusive"}if(!a)return console.debug("Canvas probe inconclusive: 2D context is null"),"inconclusive";const i=Math.min(r.width,640),o=Math.min(r.height,240);if(i<=0||o<=0)return console.debug("Canvas probe inconclusive: calculated sample dimensions are zero"),"inconclusive";try{const d=a.getImageData(0,0,i,o);return X0(d.data)?"blank":"healthy"}catch(d){return console.debug("Canvas probe inconclusive: getImageData threw exception:",d),"inconclusive"}}function Z0(r=2){return new Promise(a=>{if(typeof requestAnimationFrame!="function"){setTimeout(a,32);return}let i=r;const o=()=>{i--,i<=0?a():requestAnimationFrame(o)};requestAnimationFrame(o)})}function Q0(r,a={}){if(V0())return{kind:"dom",dispose:()=>{},verify:async()=>{}};try{const i=new G0.CanvasAddon;r.loadAddon(i);let o="canvas",d=!1,f=null;const p=()=>{var b;if(o!=="dom"){Tp();try{i.dispose()}catch{}o="dom",(b=a.onRendererSwapped)==null||b.call(a,"dom")}};return{get kind(){return o},dispose:()=>{d=!0;try{i.dispose()}catch{}},verify:async()=>{if(!(d||o!=="canvas"))return f||(f=(async()=>{var b;try{if(await Z0(2),d||o!=="canvas")return;const v=(b=r.element)==null?void 0:b.querySelector("canvas.xterm-text-layer"),y=I0(v);y==="blank"?p():y==="inconclusive"&&console.debug("Canvas probe inconclusive; retaining canvas renderer without blacklisting")}catch(v){console.debug("Canvas probe inconclusive: unexpected error during verify():",v)}finally{f=null}})(),f)}}}catch(i){console.debug("Canvas renderer unavailable, using the DOM renderer:",i),Tp()}return{kind:"dom",dispose:()=>{},verify:async()=>{}}}function Ap(r,a){const i=typeof window<"u"?window:void 0,o=i&&typeof i.devicePixelRatio=="number"&&i.devicePixelRatio>0?i.devicePixelRatio:1,d=i&&i.visualViewport&&typeof i.visualViewport.scale=="number"&&i.visualViewport.scale>0?i.visualViewport.scale:1,f=Math.max(0,r.width),p=Math.max(0,r.height),m=Math.round(f*o*100)/100,b=Math.round(p*o*100)/100;return{dpr:o,scale:d,cssWidth:f,cssHeight:p,physicalWidth:m,physicalHeight:b}}function P0(r){const{lastSnapshot:a,currentSnapshot:i,physicalTolerancePx:o=6}=r;if(!a)return{shouldIgnore:!1,isVisualZoom:!1,reason:"initial"};const d=Math.abs(i.scale-a.scale)>.01,f=Math.abs(i.scale-1)>.01;if(d||f)return{shouldIgnore:!0,isVisualZoom:!0,reason:"visual_pinch_zoom"};if(Math.abs(i.dpr-a.dpr)>.01){const v=Math.abs(i.physicalWidth-a.physicalWidth),y=Math.abs(i.physicalHeight-a.physicalHeight);if(v<=o&&y<=o)return{shouldIgnore:!0,isVisualZoom:!0,reason:"dpr_zoom"}}const m=Math.abs(i.cssWidth-a.cssWidth),b=Math.abs(i.cssHeight-a.cssHeight);return m<1&&b<1?{shouldIgnore:!0,isVisualZoom:!1,reason:"no_box_change"}:{shouldIgnore:!1,isVisualZoom:!1,reason:"genuine_resize"}}const W0=" ()[]{}'\"\\`";function Uu(r,a,i,o=1){var z,X;if(!a||!((z=a.buffer)!=null&&z.active)||a.cols<=0||a.rows<=0)return null;const d=i||((X=a.element)==null?void 0:X.querySelector(".xterm-screen"))||a.element;if(!d||typeof d.getBoundingClientRect!="function")return null;const f=d.getBoundingClientRect(),p=qg(r.clientX,r.clientY,f,o),m=ti(a);if(m.cellWidth<=0||m.cellHeight<=0)return null;const b=Math.max(1,f.width||a.cols*m.cellWidth),v=Math.max(1,f.height||a.rows*m.cellHeight),y=Math.max(0,Math.min(b-1,p.clientX-f.left)),w=Math.max(0,Math.min(v-1,p.clientY-f.top)),T=Math.max(0,Math.min(a.cols-1,Math.floor(y/m.cellWidth))),R=Math.max(0,Math.min(a.rows-1,Math.floor(w/m.cellHeight))),K=(a.buffer.active.viewportY??0)+R;return{col:T,bufferRow:K}}function J0(r,a){if(!r||r.length===0||r==="\0")return!0;for(const i of r)if(i==="\0"||/\s/.test(i)||a.includes(i))return!0;return!1}function $0(r,a,i){var T,R;if(!r||!((T=r.buffer)!=null&&T.active)||a<0||a>=r.cols)return null;const o=r.buffer.active.getLine(i);if(!o)return null;const d=((R=r.options)==null?void 0:R.wordSeparator)??W0,f=new Array(r.cols).fill(null),p=Math.min(r.cols,o.length);let m=0;for(;m<p;){const k=o.getCell(m);if(!k){f[m]={startCol:m,endCol:m+1,isSeparator:!0},m++;continue}const K=k.getWidth();if(K===0){f[m]||(f[m]={startCol:m,endCol:m+1,isSeparator:!0}),m++;continue}const z=k.getChars(),X=J0(z,d),I=Math.min(r.cols,m+K),P={startCol:m,endCol:I,isSeparator:X};for(let ae=m;ae<I;ae++)f[ae]=P;m+=Math.max(1,K)}for(let k=p;k<r.cols;k++)f[k]||(f[k]={startCol:k,endCol:k+1,isSeparator:!0});const b=f[a];if(!b||b.isSeparator)return null;let v=b.startCol;for(;v>0;){const k=f[v-1];if(k&&!k.isSeparator)v=k.startCol;else break}let y=b.endCol;for(;y<r.cols;){const k=f[y];if(k&&!k.isSeparator)y=k.endCol;else break}const w=y-v;return w<=0?null:{startCol:v,length:w}}function ew(r){var f;if(!r||!((f=r.buffer)!=null&&f.active))return"";const a=r.buffer.active,i=a.viewportY??0,o=r.rows,d=[];for(let p=0;p<o;p++){const m=a.getLine(i+p);d.push(m?m.translateToString(!0):"")}for(;d.length>0&&d[d.length-1]==="";)d.pop();return d.join(`
|
|
34
|
+
`)}const Np=new Set(["│","┃","╎","╏","┆","┇","┊","┋","║","▏","▕","|"]),tw=.6,nw=new Set(["─","━","═","┄","┅","┈","┉","-"]),lw=.8;function Bu(r,a){if(!r)return!1;let i=0;const o=Math.min(a,r.length);for(let d=0;d<o;d++){const f=r.getCell(d);if(f){const p=f.getChars();p&&nw.has(p)&&i++}}return i>=Math.max(5,Math.min(a*.25,10))}function Hu(r,a,i){var R;if(!r||!((R=r.buffer)!=null&&R.active)||r.cols<=0)return{startCol:0,endCol:0};const o=r.buffer.active,d=r.cols,f=Math.max(0,Math.min(d-1,a)),p=o.viewportY??0,m=r.rows>0?r.rows:1,b=new Int32Array(d);let v=0;for(let k=0;k<m;k++){const K=o.getLine(p+k);if(v++,!K)continue;const z=Math.min(d,K.length);for(let X=0;X<z;X++){const I=K.getCell(X);if(I){const P=I.getChars();P&&Np.has(P)&&b[X]++}}}if(v===0)return{startCol:0,endCol:d-1};const y=v*tw,w=k=>b[k]>=y;let T=!1;for(let k=0;k<d;k++)if(w(k)){T=!0;break}if(T){if(w(f))return{startCol:f,endCol:f};let k=-1;for(let z=f-1;z>=0;z--)if(w(z)){k=z;break}let K=d;for(let z=f+1;z<d;z++)if(w(z)){K=z;break}return{startCol:k+1,endCol:K-1}}if(i!==void 0){const k=Math.max(p,Math.min(p+m-1,i)),K=o.getLine(k);if(!Bu(K,d)){let z=p;for(let P=k-1;P>=p;P--)if(Bu(o.getLine(P),d)){z=P+1;break}let X=p+m-1;for(let P=k+1;P<=p+m-1;P++)if(Bu(o.getLine(P),d)){X=P-1;break}const I=X-z+1;if(I>=2){const P=new Int32Array(d);for(let G=z;G<=X;G++){const U=o.getLine(G);if(!U)continue;const le=Math.min(d,U.length);for(let ue=0;ue<le;ue++){const ve=U.getCell(ue);if(ve){const we=ve.getChars();we&&Np.has(we)&&P[ue]++}}}const ae=I*lw,be=G=>P[G]>=ae;let se=!1;for(let G=0;G<d;G++)if(be(G)){se=!0;break}if(se){if(be(f))return{startCol:f,endCol:f};let G=-1;for(let le=f-1;le>=0;le--)if(be(le)){G=le;break}let U=d;for(let le=f+1;le<d;le++)if(be(le)){U=le;break}return{startCol:G+1,endCol:U-1}}}}}return{startCol:0,endCol:d-1}}function Ep(r,a){const i=Math.min(r.startCol,r.endCol),o=Math.max(r.startCol,r.endCol),d=Math.min(r.startRow,r.endRow),f=Math.max(r.startRow,r.endRow);return{startCol:Math.max(a.startCol,Math.min(a.endCol,i)),endCol:Math.max(a.startCol,Math.min(a.endCol,o)),startRow:d,endRow:f}}function Ku(r,a){var v;if(!r||!((v=r.buffer)!=null&&v.active)||r.cols<=0)return"";const i=r.buffer.active,o=r.cols,d=Math.min(a.startRow,a.endRow),f=Math.max(a.startRow,a.endRow),p=Math.max(0,Math.min(a.startCol,a.endCol)),m=Math.min(o-1,Math.max(a.startCol,a.endCol));if(p>m||d>f)return"";const b=[];for(let y=d;y<=f;y++){const w=i.getLine(y);if(!w){b.push("");continue}const T=w.translateToString(!0,p,m+1);b.push(T.trimEnd())}return b.join(`
|
|
35
|
+
`)}async function ni(r){if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")try{return await navigator.clipboard.writeText(r),"clipboard"}catch{}if(typeof document<"u"&&typeof document.execCommand=="function"){let a=null,i=null,o=null;try{if(a=document.createElement("textarea"),a.style.userSelect="text",a.style.webkitUserSelect="text",a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.width="1px",a.style.height="1px",a.style.padding="0",a.style.border="none",a.style.outline="none",a.style.boxShadow="none",a.style.background="transparent",a.style.opacity="0",a.style.fontSize="16px",a.setAttribute("readonly",""),a.setAttribute("aria-hidden","true"),a.value=r,typeof window<"u"&&typeof window.getSelection=="function"&&(o=window.getSelection(),o&&o.rangeCount>0&&(i=o.getRangeAt(0))),document.body.appendChild(a),typeof navigator<"u"&&(/iPad|iPhone|iPod/.test(navigator.userAgent||"")||navigator.platform==="MacIntel"&&(navigator.maxTouchPoints||0)>1)){const p=document.createRange();p.selectNodeContents(a),o&&(o.removeAllRanges(),o.addRange(p)),a.setSelectionRange(0,r.length)}else a.focus({preventScroll:!0}),a.select();if(document.execCommand("copy"))return"exec"}catch{}finally{a&&a.parentNode&&a.parentNode.removeChild(a),o&&(o.removeAllRanges(),i&&o.addRange(i))}}return"failed"}async function aw(){if(!(typeof window>"u"||window.isSecureContext!==!1)||typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")return{ok:!1,reason:"insecure"};try{const a=await navigator.clipboard.readText();return!a||a.length===0?{ok:!1,reason:"empty"}:{ok:!0,text:a}}catch(a){return typeof window<"u"&&window.isSecureContext===!1?{ok:!1,reason:"insecure"}:(a==null?void 0:a.name)==="SecurityError"?{ok:!1,reason:"insecure"}:{ok:!1,reason:"denied"}}}async function iw(){if(!(typeof window>"u"||window.isSecureContext!==!1)||typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.read!="function")return{ok:!1,reason:"insecure"};try{const a=await navigator.clipboard.read();if(!a||a.length===0)return{ok:!1,reason:"empty"};for(const i of a){const o=i.types.find(d=>d.startsWith("image/"));if(o){const d=await i.getType(o);if(d&&d.size>0)return{ok:!0,blob:d}}}return{ok:!1,reason:"empty"}}catch(a){if(typeof window<"u"&&window.isSecureContext===!1)return{ok:!1,reason:"insecure"};const i=a==null?void 0:a.name;return i==="SecurityError"?{ok:!1,reason:"insecure"}:i==="NotAllowedError"?{ok:!1,reason:"denied"}:{ok:!1,reason:"empty"}}}function Vg(r){const a=r.clipboardData;if(!a)return null;if(a.files&&a.files.length>0)for(let i=0;i<a.files.length;i++){const o=a.files[i];if(o&&o.type.startsWith("image/"))return o}if(a.items&&a.items.length>0)for(let i=0;i<a.items.length;i++){const o=a.items[i];if(o&&o.type.startsWith("image/")){const d=o.getAsFile();if(d)return d}}return null}function rw(r){if(!r||r.length===0)return null;for(let a=0;a<r.length;a++){const i=r[a];if(i&&(i.type.startsWith("image/")||/\.(png|jpe?g|webp|gif)$/i.test(i.name)))return i}return null}const Yu="Herdr Remote",kp=80,sw=/[\u0000-\u001F\u007F-\u009F]/g;function Ju(r){if(typeof r!="string")return"";const a=r.replace(sw," ").replace(/\s+/g," ").trim();return a.length<=kp?a:`${a.slice(0,kp-1).trimEnd()}…`}function ow(r,a,i){const o=mx(i??null),d=o?`${o} `:"",f=Ju(r);if(f)return`${d}${f} · ${Yu}`;const p=Ju(a);return p?`${d}${p} · ${Yu}`:`${d}${Yu}`}function cw(r,a,i){const o=ow(r,a,i);return typeof document<"u"&&(document.title=o),o}const uw=new Set(["http:","https:","mailto:"]),Gu=/(?:https?:\/\/|mailto:|www\.)[^\s"'<>`]+/gi,dw=/[.,;:!?'"]+$/,Rp=8;function dd(r){return/^www\./i.test(r)?`https://${r}`:r}function fw(r){const a=(d,f)=>d.split(f).length-1;let i=r.replace(dw,"");const o=[["(",")"],["[","]"],["{","}"]];for(const[d,f]of o)for(;i.endsWith(f)&&a(i,f)>a(i,d);)i=i.slice(0,-1);return i}function Xg(r){if(typeof r!="string"||r.length===0)return!1;try{return uw.has(new URL(dd(r)).protocol)}catch{return!1}}function hw(r,a){if(typeof r!="string"||a<0)return null;Gu.lastIndex=0;for(let i=Gu.exec(r);i;i=Gu.exec(r)){const o=fw(i[0]);if(!o)continue;const d=i.index,f=d+o.length;if(a>=d&&a<f&&Xg(o))return o}return null}function mw(r,a,i){var m;const o=(m=r==null?void 0:r.buffer)==null?void 0:m.active;if(!o||typeof o.getLine!="function"||!o.getLine(i))return null;let d=i;for(let b=0;b<Rp;b+=1){const v=o.getLine(d);if(!(v!=null&&v.isWrapped)||d===0)break;d-=1}let f="",p=-1;for(let b=d;b<d+Rp;b+=1){const v=o.getLine(b);if(!v||b>d&&!v.isWrapped)break;b===i&&(p=f.length+a),f+=v.translateToString(!1)}return p<0?null:{text:f,index:p}}function pw(r,a,i){const o=mw(r,a,i);return o?hw(o.text,o.index):null}function gw(r){try{const a=new URL(dd(r));return a.host||a.pathname}catch{return""}}function qu(r){return!Xg(r)||typeof window>"u"||typeof window.open!="function"?!1:(window.open(dd(r),"_blank","noopener,noreferrer"),!0)}const Hi="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",Ki="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",bw=({anchorPoint:r,hasSelection:a,isController:i,vibrateOnKeyPress:o=!1,linkUrl:d=null,onOpenLink:f,onCopySelection:p,onCopyLine:m,onCopyScreen:b,onPaste:v,onClose:y})=>{const{t:w}=Nt(),T=x.useRef(null),[R,k]=x.useState(null);x.useEffect(()=>{if(o&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[o]),x.useLayoutEffect(()=>{const I=T.current;if(!I||!I.parentElement)return;const P=I.parentElement.getBoundingClientRect(),ae=I.getBoundingClientRect(),be=ae.width||208,se=ae.height||220,G=P.width,U=P.height;let le=r.x-be/2;le=Math.max(8,Math.min(Math.max(8,G-be-8),le));let ue=r.y-se-8;ue<8&&(ue=r.y+8),ue=Math.max(8,Math.min(Math.max(8,U-se-8),ue)),k({x:le,y:ue})},[r.x,r.y,a,i,d]);const K=Math.max(8,r.x-104),z=Math.max(8,r.y-200),X={position:"absolute",left:`${R?R.x:K}px`,top:`${R?R.y:z}px`,visibility:R?"visible":"hidden"};return u.jsx("div",{ref:T,role:"menu","aria-label":"终端选择操作",className:"z-50 w-52 select-none font-mono",style:X,onMouseDown:I=>I.stopPropagation(),onTouchStart:I=>I.stopPropagation(),onPointerDown:I=>I.stopPropagation(),children:u.jsxs(fn,{tone:"accent",className:"border border-tui-border bg-tui-base p-1.5 shadow-lg",bodyClassName:"flex flex-col gap-1",children:[d&&f&&u.jsxs("button",{type:"button",role:"menuitem",className:ne(Hi,Ki),onClick:()=>{f(d),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Xe.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.openLink")}),u.jsx("span",{className:"ml-auto max-w-[45%] truncate text-tui-faint",children:gw(d)})]}),a&&u.jsxs("button",{type:"button",role:"menuitem",className:ne(Hi,Ki),onClick:()=>{p(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Xe.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.copySelection")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:ne(Hi,Ki),onClick:()=>{m(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Xe.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.copyLine")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:ne(Hi,Ki),onClick:()=>{b(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Xe.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.copyScreen")})]}),i&&u.jsxs("button",{type:"button",role:"menuitem",className:ne(Hi,Ki),onClick:()=>{v(),y()},children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Xe.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.paste")})]}),u.jsxs("button",{type:"button",role:"menuitem",className:ne(Hi,Ki),onClick:y,children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint group-hover:text-tui-accent",children:Xe.cursor}),u.jsx("span",{className:"truncate",children:w("clipboard.cancel")})]})]})})},yw=({isOpen:r,onClose:a,onSend:i,onSendImage:o})=>{const{t:d,addToast:f}=Nt(),[p,m]=x.useState(""),[b,v]=x.useState(null),[y,w]=x.useState(!1),T=x.useRef(null),R=x.useRef(null),k=x.useRef(null);x.useEffect(()=>{r&&(m(""),v(null),w(!1),T.current&&(T.current.value=""),R.current&&(R.current.value=""))},[r]);const K=async se=>{if(se.size===0){f("error",d("clipboard.fileEmpty"));return}w(!0);try{const G=await pg(se);G?(v(G),m("")):f("error",d("clipboard.imageTooLarge"))}catch(G){console.error("Failed to process image:",G),f("error",d("clipboard.imageTooLarge"))}finally{w(!1)}},z=async se=>{const G=Vg(se);G&&(se.preventDefault(),await K(G))},X=async se=>{const G=rw(se.target.files);se.target.value="",G&&await K(G)},I=se=>{const G=se.target.value;m(G),G&&b&&v(null)},P=()=>{v(null),T.current&&(T.current.value=""),R.current&&(R.current.value="")},ae=()=>{b?(o==null||o(b),a()):p.trim()&&(i(p),a())},be=!!(p.trim()||b);return u.jsx(ud,{isOpen:r,onClose:a,title:d("clipboard.pasteTitle"),closeLabel:d("clipboard.cancel"),size:"sm",footer:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Oe,{variant:"ghost",onClick:a,children:d("clipboard.cancel")}),u.jsx(Oe,{variant:"primary",onClick:ae,disabled:!be||y,children:d("clipboard.pasteSend")})]}),children:u.jsxs("div",{className:"flex flex-col gap-3 p-3 font-mono select-text",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"paste-fallback-input",className:"text-tui-sm text-tui-muted font-sans font-medium",children:d("clipboard.pasteHint")}),u.jsx("textarea",{ref:k,id:"paste-fallback-input","data-testid":"paste-fallback-input",rows:4,autoFocus:!0,placeholder:d("clipboard.pasteHint"),value:p,onChange:I,onPaste:z,disabled:!!b||y,className:"tui-input min-h-[90px] w-full resize-none p-2 text-tui font-mono rounded border border-tui-border bg-tui-bg focus:outline-none focus:ring-1 focus:ring-tui-accent disabled:opacity-50"})]}),u.jsxs("div",{className:"relative my-1",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full border-t border-tui-border"})}),u.jsx("div",{className:"relative flex justify-center text-tui-xs uppercase",children:u.jsx("span",{className:"bg-tui-bg px-2 text-tui-muted font-sans",children:d("clipboard.imageSectionTitle")})})]}),u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("input",{ref:T,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/*",className:"hidden","data-testid":"paste-fallback-file-input",onChange:X}),u.jsx("input",{ref:R,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/*",capture:"environment",className:"hidden","data-testid":"paste-fallback-camera-input",onChange:X}),b?u.jsxs("div",{className:"flex flex-col items-center gap-2 p-3 border border-tui-border bg-tui-bg rounded",children:[u.jsx("img",{src:b.dataUrl,alt:"Pasted preview","data-testid":"pasted-image-preview",className:"max-h-40 max-w-full object-contain rounded border border-tui-border"}),u.jsxs("div",{className:"flex items-center justify-between w-full text-tui-xs text-tui-muted pt-1",children:[u.jsx("span",{children:d("clipboard.imageCompressedSize",{size:ix(b.byteLength)})}),u.jsx(Oe,{variant:"ghost",onClick:P,"aria-label":d("clipboard.removeImage"),children:d("clipboard.cancel")})]})]}):u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(Oe,{variant:"default",onClick:()=>{var se;return(se=T.current)==null?void 0:se.click()},disabled:y||!!p.trim(),className:"min-h-[44px] px-3 touch-manipulation text-tui-sm font-sans flex-1","aria-label":d("clipboard.chooseImage"),children:d("clipboard.chooseImage")}),u.jsx(Oe,{variant:"default",onClick:()=>{var se;return(se=R.current)==null?void 0:se.click()},disabled:y||!!p.trim(),className:"min-h-[44px] px-3 touch-manipulation text-tui-sm font-sans flex-1","aria-label":d("clipboard.takePhoto"),children:d("clipboard.takePhoto")})]}),y&&u.jsx("div",{className:"flex items-center gap-2 text-tui-xs text-tui-muted animate-pulse",children:u.jsx("span",{children:d("clipboard.imageCompressing")})})]})]})})},vw=[[12288,12329],[12334,12335],[12337,12348],[12350,12350],[12353,12438],[12443,12543],[13312,19903],[19968,40959],[44032,55203],[63744,64255],[65281,65376],[65504,65510],[131072,196605],[196608,262141]];function xw(r){if(r>=32&&r<=126)return 1;if(r<12288)return 0;for(const[a,i]of vw){if(r<a)return 0;if(r<=i)return 2}return 0}const ww=2,Sw="?!#",Cw=8,Tw=1500;function Yi(r){return r===""||r===" "?" ":r}function Aw(r){const a=r.buffer.active;return{key:"legacy",row:a.baseY+a.cursorY,caretCol:a.cursorX,startCol:a.cursorX,endCol:r.cols,empty:!1,agentLike:!1}}class Nw{constructor(a){fe(this,"getTerminal");fe(this,"getFieldOption");fe(this,"now");fe(this,"textDecoder",new TextDecoder("utf-8"));fe(this,"confidentKeys",new Set);fe(this,"field",null);fe(this,"predictions",[]);fe(this,"predictedCursor",null);fe(this,"srtt",null);fe(this,"isSuppressed",!1);fe(this,"suppressCursor",null);fe(this,"suppressSentAt",0);fe(this,"awaitingPrefixCommand",!1);fe(this,"mismatches",0);this.getTerminal=a.getTerminal,this.getFieldOption=a.getField,this.now=a.now??(typeof performance<"u"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now())}handleUserInput(a){if(this.pruneExpired(),a.length===0)return;const i=this.textDecoder.decode(a,{stream:!1});if(!i)return;const o=Kg(i);if(o==="passive")return;if(o==="pointer"){this.freeze("pointer");return}if(this.awaitingPrefixCommand){this.awaitingPrefixCommand=!1,this.freeze("Herdr prefix command",{demote:!0});return}if(z0(i)){this.freeze("escape",{demote:!0});return}const d=this.getTerminal();if(!d){this.reset("terminal unavailable",!0);return}for(const f of i){const p=f.codePointAt(0);if(p===void 0)continue;if(p===ww){this.awaitingPrefixCommand=!0,this.freeze("Herdr prefix",{demote:!0});return}if(p===27||p===9||p===10||p===13||p<32&&p!==8){this.freeze("control or escape sequence");return}if(p===8||p===127){if(!this.handleBackspace(d))return;continue}const m=xw(p);if(m===0){this.freeze("unpredictable character");return}if(!this.handlePrintable(f,m,d))return}}onServerOutput(){var f,p;const a=this.getTerminal(),i=a?{row:a.buffer.active.baseY+a.buffer.active.cursorY,col:a.buffer.active.cursorX}:null;if(this.isSuppressed){const m=this.now()-this.suppressSentAt>=this.suppressTimeout();(!!i&&!!this.suppressCursor&&(i.row!==this.suppressCursor.row||i.col!==this.suppressCursor.col)||m)&&(this.isSuppressed=!1,this.suppressCursor=null)}if(this.pruneExpired(),this.predictions.length===0||!a||!i)return;const o=this.field;if(this.getFieldOption){const m=this.getFieldOption();if(!m||m.key!==(o==null?void 0:o.key)){if(this.predictions.every(b=>b.frozenFrom)){this.predictions=[],this.predictedCursor=null;return}this.mismatch();return}if(m.layout!==o.layout){this.predictions=[],this.predictedCursor=null,this.field=m;return}}const d=[];for(const m of this.predictions){const b=(f=a.buffer.active.getLine(m.row))==null?void 0:f.getCell(m.col),v=Yi(b?b.getChars():""),y=m.kind==="char"?v===m.char&&(m.width===1||(((p=b==null?void 0:b.getWidth)==null?void 0:p.call(b))??2)===2):v===" ",w=m.kind==="char"?i.row>m.row||i.row===m.row&&i.col>=m.col+m.width:i.row<m.row||i.row===m.row&&i.col<=m.col,T=m.before.includes(v);if(y&&(w||!T))this.updateSrtt(Math.max(0,this.now()-m.sentAt)),o&&!m.frozenFrom&&this.markConfident(o.key);else if(m.frozenFrom){const R=m.frozenFrom;!w&&T&&i.row===R.row&&i.col>=R.col&&d.push(m)}else if(!w&&T)d.push(m);else{this.mismatch();return}}this.predictions=d,d.length===0&&(this.predictedCursor=null)}reset(a,i){var f;this.predictions=[],this.predictedCursor=null;const o=typeof i=="boolean"?i:(i==null?void 0:i.suppress)??!0;if(typeof i=="object"&&(i==null?void 0:i.demote)===!0){const p=this.field??((f=this.getFieldOption)==null?void 0:f.call(this))??null;p&&this.confidentKeys.delete(p.key)}if(o){this.isSuppressed=!0,this.suppressSentAt=this.now();const p=this.getTerminal();p?this.suppressCursor={row:p.buffer.active.baseY+p.buffer.active.cursorY,col:p.buffer.active.cursorX}:this.suppressCursor=null}else this.isSuppressed=!1,this.suppressCursor=null}forgetConfidence(){this.confidentKeys.clear(),this.field=null}getVisiblePredictions(){return this.pruneExpired(),this.visiblePredictions().map(a=>({row:a.row,col:a.col,char:a.char}))}getOverlayItems(){var y,w,T,R;this.pruneExpired();const a=this.visiblePredictions();if(a.length===0)return[];const i=a.map(k=>({row:k.row,col:k.col,char:k.char,width:k.width,kind:k.kind})),o=a[a.length-1],d=this.predictedCursor??{row:o.row,col:o.kind==="erase"?o.col:o.col+o.width},f=(k,K)=>a.some(z=>z.row===k&&z.col<=K&&K<z.col+z.width),p=this.getTerminal(),m=p==null?void 0:p.buffer.active;if(m){const k={row:m.baseY+m.cursorY,col:m.cursorX};if(!f(k.row,k.col)&&(k.row!==d.row||k.col!==d.col)){const K=((w=(y=m.getLine(k.row))==null?void 0:y.getCell(k.col))==null?void 0:w.getChars())??"";i.push({row:k.row,col:k.col,char:Yi(K),width:1,kind:"mask"})}}const b=a.find(k=>k.row===d.row&&k.col===d.col),v=b?b.char:Yi(((R=(T=m==null?void 0:m.getLine(d.row))==null?void 0:T.getCell(d.col))==null?void 0:R.getChars())??"");return i.push({row:d.row,col:d.col,char:v,width:1,kind:"caret"}),i}getState(){return this.field&&this.confidentKeys.has(this.field.key)?"confident":"tentative"}getField(){return this.field}getMismatchCount(){return this.mismatches}getEchoSrttMs(){return this.srtt}visiblePredictions(){const a=this.getState()==="confident";return this.predictions.filter(i=>i.frozenFrom?i.shownWhenFrozen:a)}freeze(a,i={}){var p;const o=this.getTerminal(),d=o?{row:o.buffer.active.baseY+o.buffer.active.cursorY,col:o.buffer.active.cursorX}:null,f=this.getState()==="confident";for(const m of this.predictions)m.frozenFrom||(m.frozenFrom=d??{row:m.row,col:m.col},m.shownWhenFrozen=f);if(this.predictedCursor=null,i.demote){const m=this.field??((p=this.getFieldOption)==null?void 0:p.call(this))??null;m&&this.confidentKeys.delete(m.key)}this.isSuppressed=!0,this.suppressSentAt=this.now(),this.suppressCursor=d}suppressTimeout(){return Math.max(300,(this.srtt??300)*1.5)}stillSuppressed(){return this.isSuppressed?this.now()-this.suppressSentAt>=this.suppressTimeout()?(this.isSuppressed=!1,this.suppressCursor=null,!1):!0:!1}handlePrintable(a,i,o){var w;if(this.stillSuppressed())return!1;const d=this.ensureField(o);if(!d||!this.predictedCursor)return!1;const f=this.predictedCursor,p=this.predictions.length===0&&f.col===d.caretCol;if(d.agentLike&&d.empty&&p&&Sw.includes(a))return this.freeze("agent mode switch"),!1;if(f.col+i>d.endCol-1)return this.freeze("cursor would reach the edge of the field"),!1;const m=(w=o.buffer.active.getLine(f.row))==null?void 0:w.getCell(f.col),b=[Yi(m?m.getChars():"")],v=this.predictions[this.predictions.length-1];let y;return v&&v.kind==="erase"&&v.row===f.row&&v.col===f.col&&(y=this.predictions.pop(),b.push(...v.before," ")),this.predictions.push({row:f.row,col:f.col,char:a,width:i,kind:"char",before:b,sentAt:this.now(),replaces:y}),f.col+=i,!0}handleBackspace(a){var o,d,f;const i=this.predictions[this.predictions.length-1];if(this.predictedCursor&&i&&!i.frozenFrom&&i.kind==="char"&&i.row===this.predictedCursor.row&&i.col+i.width===this.predictedCursor.col)return this.predictions.pop(),this.predictedCursor.col=i.col,i.replaces&&this.predictions.push(i.replaces),!0;if(!this.stillSuppressed()){const p=this.ensureField(a),m=this.predictedCursor;if(p&&m){const b=a.buffer.active.getLine(m.row),v=b==null?void 0:b.getCell(m.col-1),y=v&&((o=v.getWidth)==null?void 0:o.call(v))===0?2:1,w=m.col-y;let T=!0;for(let k=m.col;k<p.endCol&&T;k++)T=Yi(((d=b==null?void 0:b.getCell(k))==null?void 0:d.getChars())??"")===" ";const R=Yi(((f=b==null?void 0:b.getCell(w))==null?void 0:f.getChars())??"");if(w>p.startCol&&T&&R!==" ")return this.predictions.push({row:m.row,col:w,char:" ",width:y,kind:"erase",before:[R],sentAt:this.now()}),m.col=w,!0}}return this.freeze("backspace into server content"),!1}ensureField(a){if(this.predictedCursor&&this.field)return this.field;const i=this.getFieldOption?this.getFieldOption():Aw(a);return i?(this.field=i,this.predictions=this.predictions.filter(o=>o.frozenFrom),this.predictedCursor={row:i.row,col:i.caretCol},i):null}markConfident(a){for(this.confidentKeys.delete(a),this.confidentKeys.add(a);this.confidentKeys.size>Cw;){const i=this.confidentKeys.values().next().value;if(i===void 0)break;this.confidentKeys.delete(i)}}mismatch(){this.mismatches++,this.predictions=[],this.predictedCursor=null,this.field&&this.confidentKeys.delete(this.field.key),this.isSuppressed=!1,this.suppressCursor=null}pruneExpired(){if(this.predictions.length===0)return;const a=this.now(),i=this.predictions.filter(o=>a-o.sentAt<=Tw);i.length!==this.predictions.length&&(this.predictions=i,this.predictions.length===0&&(this.predictedCursor=null))}updateSrtt(a){this.srtt===null?this.srtt=a:this.srtt=this.srtt*.8+a*.2}}const jp="hr-predicting";function Ew(r){if(typeof requestAnimationFrame=="function"){const i=requestAnimationFrame(r);return()=>cancelAnimationFrame(i)}const a=setTimeout(r,16);return()=>clearTimeout(a)}function kw(r){var i,o,d,f;const a=(f=(d=(o=(i=r._core)==null?void 0:i._renderService)==null?void 0:o.dimensions)==null?void 0:d.css)==null?void 0:f.cell;return!(a!=null&&a.width)||!(a!=null&&a.height)?null:{width:a.width,height:a.height}}function Rw(r){var i,o,d,f,p;const a=(o=(i=r==null?void 0:r._core)==null?void 0:i._themeService)==null?void 0:o.colors;return{foreground:(d=a==null?void 0:a.foreground)==null?void 0:d.css,background:(f=a==null?void 0:a.background)==null?void 0:f.css,cursor:(p=a==null?void 0:a.cursor)==null?void 0:p.css}}class jw{constructor(a){fe(this,"options");fe(this,"layer",null);fe(this,"owner",null);fe(this,"cells",new Map);fe(this,"caret",null);fe(this,"retiring",new Set);fe(this,"cancelRetireFrame",null);this.options=a}sync(a){var y,w;const i=this.options.getTerminal(),o=i?this.ensureLayer(i):null,d=i?kw(i):null;if(!i||!o||!d){this.clear();return}const f=this.resolveStyle(),p=((w=(y=i.buffer)==null?void 0:y.active)==null?void 0:w.viewportY)??0,m=T=>T-p>=0&&T-p<i.rows,b=new Set;let v=null;for(const T of a){const R=T.kind??"char";if(!m(T.row))continue;if(R==="caret"){v=T;continue}const k=`${T.row}:${T.col}:${R}`;b.add(k);let K=this.cells.get(k);K||(K=this.createCell(o),this.cells.set(k,K)),this.retiring.delete(K),this.place(K,T,p,d,f),this.paintCell(K,T.char,R,T.width??1,f)}for(const[T,R]of this.cells)b.has(T)||(this.cells.delete(T),this.retire(R));v?(this.caret||(this.caret=this.createCell(o)),this.retiring.delete(this.caret),this.place(this.caret,v,p,d,f),this.paintCaret(this.caret,v.char,f)):this.caret&&(this.retire(this.caret),this.caret=null),this.updateOwnerClass()}afterRender(){this.flushRetired()}clear(){for(const a of this.cells.values())this.retire(a);this.cells.clear(),this.caret&&(this.retire(this.caret),this.caret=null),this.updateOwnerClass()}dispose(){var a,i,o;(a=this.cancelRetireFrame)==null||a.call(this),this.cancelRetireFrame=null,this.cells.clear(),this.retiring.clear(),this.caret=null,(i=this.layer)==null||i.remove(),this.layer=null,(o=this.owner)==null||o.classList.remove(jp),this.owner=null}ensureLayer(a){var f;const i=a.element??null,o=i==null?void 0:i.querySelector(".xterm-screen");if(!i||!o)return null;if(this.layer&&this.layer.parentElement===o)return this.layer;(f=this.layer)==null||f.remove();const d=document.createElement("div");return d.className="hr-prediction-layer",Object.assign(d.style,{position:"absolute",left:"0",top:"0",pointerEvents:"none",zIndex:"7"}),o.appendChild(d),this.layer=d,this.owner=i,d}createCell(a){const i=document.createElement("div");return Object.assign(i.style,{position:"absolute",overflow:"hidden",whiteSpace:"pre",pointerEvents:"none",userSelect:"none"}),a.appendChild(i),i}place(a,i,o,d,f){const p=i.width??1;a.style.left=`${i.col*d.width}px`,a.style.top=`${(i.row-o)*d.height}px`,a.style.width=`${p*d.width}px`,a.style.height=`${d.height}px`,a.style.lineHeight=`${d.height}px`,a.style.fontFamily=f.fontFamily??"inherit",a.style.fontSize=f.fontSize?`${f.fontSize}px`:"inherit",a.style.textAlign=p===2?"center":"left"}paintCell(a,i,o,d,f){a.textContent=o==="erase"?" ":i,a.style.color=f.color??"",a.style.backgroundColor=f.background??"",a.style.boxShadow="none",a.style.textDecoration=o==="char"&&f.underline?"underline":"none"}paintCaret(a,i,o){const d=o.cursor??o.color;if(a.textContent=i,a.style.textDecoration="none",a.style.boxShadow="none",a.style.color=o.color??"",a.style.backgroundColor="transparent",!!d)switch(o.cursorShape??"block"){case"bar":a.style.boxShadow=`inset 2px 0 0 ${d}`;break;case"underline":a.style.boxShadow=`inset 0 -2px 0 ${d}`;break;default:a.style.backgroundColor=d,o.background&&(a.style.color=o.background)}}resolveStyle(){const a=this.options.getStyle();if(a.color&&a.background&&a.cursor)return a;const i=Rw(this.options.getTerminal()),o=a.color??i.foreground;return{...a,color:o,background:a.background??i.background,cursor:a.cursor??i.cursor??o}}retire(a){this.retiring.add(a),this.cancelRetireFrame||(this.cancelRetireFrame=Ew(()=>{this.cancelRetireFrame=null,this.flushRetired()}))}flushRetired(){var a;for(const i of this.retiring)i.remove();this.retiring.clear(),(a=this.cancelRetireFrame)==null||a.call(this),this.cancelRetireFrame=null,this.updateOwnerClass()}updateOwnerClass(){if(!this.owner)return;const a=this.cells.size>0||this.caret!==null||this.retiring.size>0;this.owner.classList.toggle(jp,a)}}const vo=new Set(["│","┃","║","▐","▕","▏","▌"]),No=new Set(["┌","┐","└","┘","╭","╮","╰","╯","├","┤","┬","┴","┼","┏","┓","┗","┛","╔","╗","╚","╝","╠","╣","╟","╢","╞","╡"]),Mw=new Set(["╭","┌","┏","╔"]),_w=new Set(["╮","┐","┓","╗"]),Lw=new Set(["╰","└","┗","╚"]),zw=new Set(["╯","┘","┛","╝"]),Fu=new Set(["─","━","═","╌","┄"]),Dw=new Set(["❯","›",">","!"]),Mp=new Set(["$","#","%",">","❯","›","➜","λ","»"]),$u=8,Ow=12,_p=2,Lp=1,Uw=4,Bw=3,Hw=/-- INSERT --/,Kw=/-- (?:NORMAL|VISUAL(?: LINE| BLOCK)?|REPLACE) --/,Yw=/Esc to cancel|Enter to (?:confirm|select)|to navigate|Space to (?:change|toggle|select)/i,Gw=/^\s*\d+[.)]\s/;function Fi(r){return r===""||r===" "||r===" "}class qw{constructor(a){fe(this,"cell");fe(this,"top");fe(this,"bottom");var i;this.screen=a,this.cell=(i=a.getNullCell)==null?void 0:i.call(a),this.top=a.baseY,this.bottom=a.baseY+a.rows-1}get cols(){return this.screen.cols}at(a,i){var o;if(!(a<this.top||a>this.bottom||i<0||i>=this.screen.cols))return(o=this.screen.getLine(a))==null?void 0:o.getCell(i,this.cell)}char(a,i){var o;return((o=this.at(a,i))==null?void 0:o.getChars())??""}dim(a,i){var o,d;return!!((d=(o=this.at(a,i))==null?void 0:o.isDim)!=null&&d.call(o))}text(a,i,o){var d;return a<this.top||a>this.bottom?"":((d=this.screen.getLine(a))==null?void 0:d.translateToString(!0,i,o))??""}isEdge(a,i){if(!vo.has(this.char(a,i)))return!1;const o=this.char(a-1,i),d=this.char(a+1,i);return vo.has(o)||No.has(o)||vo.has(d)||No.has(d)}blankOrDim(a,i,o){var d;for(let f=i;f<o;f++){const p=this.at(a,f);if(p&&!Fi(p.getChars())&&!((d=p.isDim)!=null&&d.call(p)))return!1}return!0}}function Fw(r,a,i){if(r.isEdge(a,i))return null;let o=0;for(let f=i-1;f>=0;f--)if(r.isEdge(a,f)){o=f+1;break}let d=r.cols;for(let f=i+1;f<r.cols;f++)if(r.isEdge(a,f)){d=f;break}return o<d?{start:o,end:d}:null}function zp(r,a,i){if(!Fu.has(r.char(a,i.start))||!Fu.has(r.char(a,i.end-1))||No.has(r.char(a,i.start-1)))return!1;const o=i.end-i.start;let d=0;for(let f=i.start;f<i.end;f++)if(Fu.has(r.char(a,f)))d++;else if(f-i.start-d>o*.1)return!1;return d>=o*.9}function Ii(r){return`${r.start}-${r.end}`}function Vw(r,a,i){const o=i.start-1,d=i.end,{row:f}=a;if(o<0||d>=r.cols)return null;const p=r.char(f,o);if(!vo.has(p)||r.char(f,d)!==p)return null;let m=f-1;for(;m>=r.top&&r.char(m,o)===p;)m--;let b=f+1;for(;b<=r.bottom&&r.char(b,o)===p;)b++;if(b-m-1>$u||!Mw.has(r.char(m,o))||!_w.has(r.char(m,d))||!Lw.has(r.char(b,o))||!zw.has(r.char(b,d))||r.dim(f,o))return null;const v=i.start+Lp,y=i.end-Lp;return a.col<v||a.col>=y?null:{kind:"frame",key:`frame:${Ii(i)}:${b}`,region:Ii(i),layout:`${m}`,row:f,caretCol:a.col,startCol:v,endCol:y,empty:m+2===b&&a.col===v&&r.blankOrDim(f,v,y),agentLike:!0,vimInsert:null}}function Xw(r,a,i){const{row:o}=a;let d=-1;for(let y=o-1;y>=Math.max(r.top,o-$u);y--)if(zp(r,y,i)){d=y;break}if(d<0)return null;let f=-1;for(let y=o+1;y<=Math.min(r.bottom,o+$u);y++)if(zp(r,y,i)){f=y;break}if(f<0)return null;const p=d+1;let m=-1;for(let y=i.start;y<Math.min(i.end,i.start+3);y++){const w=r.char(p,y);if(!Fi(w)){Dw.has(w)&&Fi(r.char(p,y+1))&&(m=y);break}}if(m<0||r.dim(p,m)||Gw.test(r.text(p,m+1,i.end)))return null;for(let y=p+1;y<f;y++)for(let w=i.start;w<i.start+_p;w++)if(!Fi(r.char(y,w)))return null;let b="";for(let y=f+1;y<=Math.min(r.bottom,f+Ow)&&!No.has(r.char(y,i.start-1));y++)b+=`${r.text(y,i.start,i.end)}
|
|
36
|
+
`;if(Yw.test(b)||Kw.test(b))return null;const v=o===p?m+2:i.start+_p;return a.col<v||a.col>=i.end?null:{kind:"rule",key:`rule:${Ii(i)}:${f}`,region:Ii(i),layout:`${d}`,row:o,caretCol:a.col,startCol:v,endCol:i.end,empty:f-d===2&&a.col===v&&r.blankOrDim(o,v,i.end),agentLike:!0,vimInsert:Hw.test(b)}}function Iw(r,a,i){if(a.hidden)return null;const{row:o,col:d}=a;for(let f=d-2;f>=i.start;f--)if(!(!Mp.has(r.char(o,f))||!Fi(r.char(o,f+1))))return r.dim(o,f)?null:Dp(r,a,i,o,f+2,f===i.start);for(let f=o-1;f>=Math.max(r.top,o-Bw);f--){let p=i.end-1;for(;p>=i.start&&Fi(r.char(f,p));)p--;if(p>=i.end-1-Uw&&Mp.has(r.char(f,p)))return r.dim(f,p)?null:Dp(r,a,i,f,i.start,!1);if(p<i.end-1)return null}return null}function Dp(r,a,i,o,d,f){const p=a.row===o?d:i.start;return a.col<p||a.col>=i.end?null:{kind:"prompt",key:`prompt:${Ii(i)}:${o}`,region:Ii(i),layout:`${o}`,row:a.row,caretCol:a.col,startCol:p,endCol:i.end,empty:a.row===o&&a.col===p&&r.blankOrDim(a.row,p,i.end),agentLike:f,vimInsert:null}}function Zw(r,a){const i=new qw(r);if(a.row<i.top||a.row>i.bottom||a.col<0||a.col>=r.cols)return null;const o=Fw(i,a.row,a.col);return o?Vw(i,a,o)??Xw(i,a,o)??Iw(i,a,o):null}class Qw{constructor(){fe(this,"insertSeen",new Set)}detect(a,i){const o=Zw(a,i);return!o||o.vimInsert===null?o:o.vimInsert?(this.insertSeen.add(o.region),o):this.insertSeen.has(o.region)?null:o}reset(){this.insertSeen.clear()}}class Pw{constructor(a){fe(this,"tracker",new Qw);fe(this,"cached");fe(this,"lastComplete",null);fe(this,"detect",()=>{var a,i;if((i=(a=this.options).isSynchronizing)!=null&&i.call(a))return this.lastComplete;if(this.cached===void 0){const o=this.options.getScreen(),d=this.options.getCursor();this.cached=o&&d?this.tracker.detect(o,d):null,this.lastComplete=this.cached}return this.cached});this.options=a}invalidate(){this.cached=void 0}reset(){this.tracker.reset(),this.cached=void 0,this.lastComplete=null}}const Ww=25,Jw=2026,$w=1e3;function eS(r,a=()=>performance.now()){let i=!1,o=null;const d=()=>{i=!1,o=null},f=r.parser;if(!f||typeof f.registerCsiHandler!="function")return{isCursorHidden:()=>!1,isSynchronizing:()=>!1,reset:d,dispose:()=>{}};const p=b=>v=>{for(const y of v.flat())y===Ww&&(i=!b),y===Jw&&(o=b?a():null);return!1},m=[f.registerCsiHandler({prefix:"?",final:"h"},p(!0)),f.registerCsiHandler({prefix:"?",final:"l"},p(!1)),f.registerCsiHandler({intermediates:"!",final:"p"},()=>(d(),!1))];return typeof f.registerEscHandler=="function"&&m.push(f.registerEscHandler({final:"c"},()=>(d(),!1))),{isCursorHidden:()=>i,isSynchronizing:()=>o!==null&&a()-o<$w,reset:d,dispose:()=>{for(const b of m)b.dispose()}}}const Ig=40;function tS(r){return r?`${r.kind} row ${r.row} cols ${r.startCol}-${r.endCol} caret ${r.caretCol}`:"none"}function Op(r,a){return r==="off"?!1:r==="always"?!0:a!==null&&a>Ig}const nS=250,lS=({onTerminalFocus:r,isActive:a=!0})=>{var Ve,rt,Lt,gl,dn,en;const i=x.useRef(null),o=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=x.useRef(1),m=x.useRef({cols:0,rows:0}),b=x.useRef(null),v=x.useRef(null),y=x.useRef(null),w=x.useRef(null),T=x.useRef({width:0,height:0}),R=x.useRef(null),k=jv(),K=k||typeof navigator<"u"&&navigator.maxTouchPoints>0||typeof window<"u"&&"ontouchstart"in window,z=typeof window<"u"&&new URLSearchParams(window.location.search).get("debug")==="1",[X,I]=x.useState({state:"idle",deltaY:0,lines:0,viewportY:null,scrollTop:null,scrollHeight:null,clientHeight:null,moved:!1,focused:!1,bufferType:null,baseY:null,cursorY:null,hasScrollback:null,mouseTracking:!1,scrollMode:"none",scrollCalls:0,lastScrollLines:null,lastInputEvent:"",pointerEvents:0,touchEvents:0}),[P,ae]=x.useState({framesPerSec:0,bytesPerSec:0}),[be,se]=x.useState(null),G=x.useRef(null),U=x.useRef(!1),le=x.useRef(!1),ue=x.useRef([]);x.useEffect(()=>{if(!z)return;const Q=setInterval(()=>{const Ce=performance.now()-1e3,ye=ue.current;for(;ye.length>0&&ye[0].time<Ce;)ye.shift();let qe=0;for(let re=0;re<ye.length;re++)qe+=ye[re].bytes;ae({framesPerSec:ye.length,bytesPerSec:qe})},1e3);return()=>clearInterval(Q)},[z]);const{isController:ve,connectionState:we,settings:he,hostPalette:ke,terminalResetVersion:He,sendResize:L,sendBinary:V,observeKeyInput:$,consumeModifierLatch:je,agentStatus:Z,addToast:at,warnViewerMode:Qe,connect:_e,subscribeToOutput:Ze,subscribeToPasteFileReady:ze,uploadImage:Se,profiles:zt,activeProfileId:ft,t:B,rttMs:Me}=Nt(),E=pl.useMemo(()=>Zv(ke),[ke]),te=x.useRef(E);te.current=E;const J=x.useRef(ve);J.current=ve;const Ke=x.useRef(V);Ke.current=V;const De=x.useRef(at);De.current=at;const Je=x.useRef(Qe);Je.current=Qe;const St=x.useRef(L);St.current=L;const Gt=x.useRef(Se);Gt.current=Se;const qt=x.useRef(a);qt.current=a;const Jt=x.useRef(he);Jt.current=he;const lt=x.useRef(B);lt.current=B;const ht=x.useRef(null),Ft=x.useRef(null),de=x.useRef(null),Ue=x.useRef(je);Ue.current=je;const Ge=x.useRef(()=>{}),it=x.useRef(Q=>{var ee,Ce,ye,qe;(ee=ht.current)==null||ee.reset(Q),(Ce=ht.current)==null||Ce.forgetConfidence(),(ye=de.current)==null||ye.reset(),(qe=Ft.current)==null||qe.clear()}),[hn,mn]=x.useState(null),Et=x.useRef(null),[nl,pn]=x.useState(null),tt=x.useRef(null);tt.current=nl;const[Ct,Dt]=x.useState(null),ut=x.useRef(null);ut.current=Ct;const[Pl,Mn]=x.useState(""),Ot=x.useRef("");Ot.current=Pl;const[Nl,an]=x.useState(!1),El=x.useRef(!1);El.current=Nl;const Sn=x.useRef(!1),[kl,ll]=x.useState(0),al=x.useRef(null),_n=x.useRef(null),Fn=x.useRef(null),Ln=x.useRef(null),[Zi,Ma]=x.useState(!1),_a=x.useCallback(Q=>{var qe;const ee=f.current;if(!ee)return null;const Ce=((qe=d.current)==null?void 0:qe.querySelector(".xterm-screen"))||d.current,ye=Uu(Q,ee,Ce,p.current);return ye?pw(ee,ye.col,ye.bufferRow):null},[]),La=x.useCallback(Q=>{var qe;const ee=f.current;if(!ee)return;const Ce=((qe=d.current)==null?void 0:qe.querySelector(".xterm-screen"))||d.current,ye=Uu(Q,ee,Ce,p.current);if(ye){Fn.current=ye;const re=Hu(ee,ye.col,ye.bufferRow);Ln.current=re;const kt=$0(ee,ye.col,ye.bufferRow);if(kt){const dt={startCol:kt.startCol,endCol:kt.startCol+kt.length-1,startRow:ye.bufferRow,endRow:ye.bufferRow},Qt=Ep(dt,re),Rt=Ku(ee,Qt);Dt(Qt),Mn(Rt),an(!0)}else Dt(null),Mn(""),an(!1),Fn.current=null,Ln.current=null}else Dt(null),Mn(""),an(!1),Fn.current=null,Ln.current=null;al.current=Q,_n.current=null},[]),Wl=x.useCallback(Q=>{var Rt;const ee=f.current,Ce=Fn.current;if(!ee||!Ce)return;_n.current=Q;const ye=((Rt=d.current)==null?void 0:Rt.querySelector(".xterm-screen"))||d.current,qe=Uu(Q,ee,ye,p.current);if(!qe)return;const re=Ln.current??Hu(ee,Ce.col,Ce.bufferRow),kt={startCol:Math.min(Ce.col,qe.col),endCol:Math.max(Ce.col,qe.col),startRow:Math.min(Ce.bufferRow,qe.bufferRow),endRow:Math.max(Ce.bufferRow,qe.bufferRow)},dt=Ep(kt,re),Qt=Ku(ee,dt);Dt(dt),Mn(Qt),an(!0)},[]),il=x.useRef(La);il.current=La;const zn=x.useRef(Wl);zn.current=Wl;const ai=x.useCallback(async()=>{const Q=Ot.current;if(!Q)return;await ni(Q)==="failed"?De.current("error",lt.current("clipboard.copyFailed")):De.current("success",lt.current("clipboard.copied"))},[]),Vn=x.useCallback(async()=>{var dt,Qt,Rt,Dn;const Q=f.current;if(!Q)return;const ee=(dt=Q.buffer)==null?void 0:dt.active;if(!ee)return;const Ce=((Qt=ut.current)==null?void 0:Qt.startRow)??((Rt=Fn.current)==null?void 0:Rt.bufferRow)??ee.viewportY,ye=Ln.current??Hu(Q,((Dn=Fn.current)==null?void 0:Dn.col)??0,Ce),qe={startCol:ye.startCol,endCol:ye.endCol,startRow:Ce,endRow:Ce},re=Ku(Q,qe);await ni(re)==="failed"?De.current("error",lt.current("clipboard.copyFailed")):De.current("success",lt.current("clipboard.copied"))},[]),Ht=x.useCallback(async()=>{const Q=f.current;if(!Q)return;const ee=ew(Q);await ni(ee)==="failed"?De.current("error",lt.current("clipboard.copyFailed")):De.current("success",lt.current("clipboard.copied"))},[]),$t=x.useCallback(async()=>{var ee,Ce;const Q=f.current;if(Q){if(!J.current){Je.current();return}try{const ye=await iw();if(ye.ok){await Gt.current(ye.blob);return}}catch{}try{const ye=await aw();if(ye.ok){(ee=ht.current)==null||ee.reset("paste"),(Ce=Ft.current)==null||Ce.clear(),Q.paste(ye.text),De.current("success",lt.current("clipboard.pasted"));return}else if(ye.reason==="empty"){De.current("info",lt.current("clipboard.pasteUnavailable"));return}}catch{}Ma(!0)}},[]),Xn=x.useCallback(Q=>{var Ce,ye;const ee=f.current;if(ee){if(!J.current){Je.current();return}(Ce=ht.current)==null||Ce.reset("paste"),(ye=Ft.current)==null||ye.clear(),ee.paste(Q),De.current("success",lt.current("clipboard.pasted"))}},[]),za=x.useCallback(Q=>{if(f.current){if(!J.current){Je.current();return}Gt.current(Q)}},[]);x.useEffect(()=>ze(ee=>{var ye,qe;const Ce=f.current;Ce&&((ye=ht.current)==null||ye.reset("paste"),(qe=Ft.current)==null||qe.clear(),Ce.paste(ee),De.current("success",lt.current("clipboard.pasted")))}),[ze]);const ii=x.useCallback((Q,ee)=>{!Number.isFinite(Q)||!Number.isFinite(ee)||Q<=0||ee<=0||Q===m.current.cols&&ee===m.current.rows||(b.current={cols:Q,rows:ee},!v.current&&(v.current=setTimeout(()=>{v.current=null;const Ce=b.current;b.current=null,Ce&&(Ce.cols===m.current.cols&&Ce.rows===m.current.rows||(m.current=Ce,St.current(Ce.cols,Ce.rows),it.current("resize")))},nS)))},[]),ri=x.useCallback((Q=!1)=>{var bl;const ee=f.current,Ce=i.current,ye=d.current,qe=o.current;if(!ee||!Ce||!ye||!qe)return;const re=Ou(Ce,Gi(),_u());if(re.width<=0||re.height<=0)return;qe.style.width="100%",qe.style.height="100%",ye.style.width="100%",ye.style.height="100%",ye.style.transform="none",ye.style.transformOrigin="top left",p.current=1;const kt=Ap(re),dt=P0({lastSnapshot:R.current,currentSnapshot:kt});if(dt.isVisualZoom&&!Q){R.current=kt;try{ee.refresh(0,Math.max(0,ee.rows-1))}catch{}return}if(dt.shouldIgnore&&!Q)return;R.current=kt;const Qt=ti(ee,Xi),Rt=Sp({width:re.width-H0(ye),height:re.height,cellWidth:Qt.cellWidth,cellHeight:Qt.cellHeight}),Dn=Math.abs(re.width-T.current.width)>1||Math.abs(re.height-T.current.height)>1;if(ee.cols!==Rt.cols||ee.rows!==Rt.rows)try{ee.resize(Rt.cols,Rt.rows)}catch(Jl){console.debug("Error resizing terminal grid:",Jl)}U.current&&!le.current&&(Dn||ee.cols!==Rt.cols||ee.rows!==Rt.rows)&&(le.current=!0,(bl=G.current)==null||bl.verify());const rl=Rt.cols!==m.current.cols||Rt.rows!==m.current.rows;qt.current&&(Dn||Q||rl)&&(T.current={width:re.width,height:re.height},ii(Rt.cols,Rt.rows));try{ee.refresh(0,Math.max(0,ee.rows-1))}catch{}},[ii]),D=x.useRef(ri);D.current=ri;const H=x.useCallback(()=>{if(y.current===null){if(typeof requestAnimationFrame!="function"){D.current();return}y.current=requestAnimationFrame(()=>{y.current=null,D.current()})}},[]),ie=x.useCallback((Q=30)=>{w.current!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(w.current),w.current=null);let ee=0;const Ce=()=>{w.current=null,ee++;const ye=ee>=Q;D.current(!0),!ye&&ee<2&&typeof requestAnimationFrame=="function"&&(w.current=requestAnimationFrame(Ce))};typeof requestAnimationFrame=="function"?w.current=requestAnimationFrame(Ce):Ce()},[]);x.useEffect(()=>{var jl,Ml;if(!i.current||!d.current)return;const Q=i.current,ee=Ou(Q,Gi(),_u()),Ce=ti(null,Xi),ye=Sp({width:ee.width,height:ee.height,cellWidth:Ce.cellWidth,cellHeight:Ce.cellHeight});St.current(ye.cols,ye.rows),T.current={width:ee.width,height:ee.height},R.current=Ap(ee);const qe=Jm(he.fontSize,ee.width),re=new N0.Terminal({fontSize:qe,fontFamily:rp(he.fontFamily),lineHeight:1.15,...te.current?{theme:{...te.current}}:{},allowProposedApi:!0,convertEol:!0,scrollback:5e3,cols:ye.cols,rows:ye.rows,screenReaderMode:!1,linkHandler:{activate:(W,ce)=>{qu(ce)}}});try{const W=new E0.Unicode11Addon;re.loadAddon(W),re.unicode.activeVersion="11"}catch(W){console.debug("Unicode11 addon unavailable, using default width table:",W)}try{re.loadAddon(new R0.WebLinksAddon((W,ce)=>{qu(ce)}))}catch(W){console.debug("WebLinks addon unavailable, URLs stay plain text:",W)}re.open(d.current),f.current=re;const kt=re.onTitleChange(W=>{mn(Ju(W)||null)}),dt=eS(re),Qt=new Pw({getScreen:()=>{const W=f.current;if(!W)return null;const ce=W.buffer.active;return{cols:W.cols,rows:W.rows,baseY:ce.baseY,getLine:Be=>ce.getLine(Be),getNullCell:typeof ce.getNullCell=="function"?()=>ce.getNullCell():void 0}},getCursor:()=>{var ce;const W=(ce=f.current)==null?void 0:ce.buffer.active;return W?{row:W.baseY+W.cursorY,col:W.cursorX,hidden:dt.isCursorHidden()}:null},isSynchronizing:dt.isSynchronizing});de.current=Qt;const Rt=new Nw({getTerminal:()=>f.current,getField:Qt.detect});ht.current=Rt;const Dn=new jw({getTerminal:()=>f.current,getStyle:()=>{var xt,nn,On,bn,yn,la,rn,yl,Oa,aa,as,si,oi;const W=((xt=te.current)==null?void 0:xt.foreground)??((On=(nn=f.current)==null?void 0:nn.options.theme)==null?void 0:On.foreground),ce=((bn=te.current)==null?void 0:bn.background)??((la=(yn=f.current)==null?void 0:yn.options.theme)==null?void 0:la.background),Be=((rn=ht.current)==null?void 0:rn.getEchoSrttMs())??null,vt=Be!==null&&Be>Ig,jt=((yl=te.current)==null?void 0:yl.cursor)??((aa=(Oa=f.current)==null?void 0:Oa.options.theme)==null?void 0:aa.cursor)??W,gn=(as=f.current)==null?void 0:as.options.cursorStyle,Te=(si=f.current)==null?void 0:si.options.fontFamily,Mt=(oi=f.current)==null?void 0:oi.options.fontSize;return{color:W,background:ce,underline:vt,cursor:jt,cursorShape:gn,fontFamily:Te,fontSize:Mt}}});Ft.current=Dn;const rl=()=>{const W=ht.current,ce=Ft.current;if(!W||!ce)return;const Be=Jt.current.predictiveEcho,vt=W.getEchoSrttMs();if(!Op(Be,vt)){ce.clear();return}ce.sync(W.getOverlayItems())};Ge.current=rl,k&&re.textarea&&(re.textarea.readOnly=!1,re.textarea.tabIndex=0,re.textarea.inputMode="text");let bl=()=>{};if(z&&re.textarea){const W=()=>{I(ce=>({...ce,focused:document.activeElement===re.textarea}))};re.textarea.addEventListener("focus",W),re.textarea.addEventListener("blur",W),bl=()=>{var ce,Be;(ce=re.textarea)==null||ce.removeEventListener("focus",W),(Be=re.textarea)==null||Be.removeEventListener("blur",W)},W()}const Jl=async W=>{var Be,vt;(Be=ht.current)==null||Be.reset("paste"),(vt=Ft.current)==null||vt.clear();const ce=Vg(W);if(ce){if(W.preventDefault(),W.stopPropagation(),!J.current){Je.current();return}await Gt.current(ce)}};(jl=re.textarea)==null||jl.addEventListener("paste",Jl),Q.addEventListener("paste",Jl);const tn=Q0(re,{onRendererSwapped:W=>{Q&&(Q.dataset.renderer=W),se(W);try{re.refresh(0,Math.max(0,re.rows-1))}catch{}}});G.current=tn,Q&&(Q.dataset.renderer=tn.kind),se(tn.kind);const Qi=lt.current("terminal.bannerTitle"),Jr=lt.current("terminal.bannerSubtitle");if(re.writeln(" ___ ___ .___ "),re.writeln(` / | \\ ____ _______| _/______ \x1B[1m${Qi}\x1B[0m`),re.writeln(`/ ~ \\/ __ \\\\_ __ \\ __/ ___/ \x1B[2m${Jr}\x1B[0m`),re.writeln("\\ Y / ___/ | | \\/|_ \\___ \\ "),re.writeln(" \\___|_ / \\___ >|__| /___/____ >"),re.writeln(" \\/ \\/ \\/ "),re.writeln(""),U.current=!0,tn.verify(),!k)try{re.focus()}catch{}typeof document<"u"&&"fonts"in document&&typeof((Ml=document.fonts)==null?void 0:Ml.load)=="function"&&document.fonts.load('13px "Symbols Nerd Font Mono"').then(()=>{if(f.current){try{f.current.refresh(0,Math.max(0,f.current.rows-1))}catch{}ie(5)}}).catch(()=>{});const Pi=re.onData(W=>{var vt;let ce=W;if(J.current&&Kg(W)==="keys"&&pv(W)){const jt=Ue.current();jt&&(ce=xo(W,jt))}const Be=ed(ce);if(!J.current&&!wo(Be)){Je.current();return}(vt=ht.current)==null||vt.handleUserInput(Be),rl(),Ke.current(Be)}),$l=re.onBinary(W=>{const ce=new Uint8Array(W.length);for(let Be=0;Be<W.length;Be++)ce[Be]=W.charCodeAt(Be)&255;!J.current&&!wo(ce)||Ke.current(ce)}),$r=typeof re.onWriteParsed=="function"?re.onWriteParsed(()=>{var W;Sn.current=!0,Qt.invalidate(),!dt.isSynchronizing()&&((W=ht.current)==null||W.onServerOutput(),rl())}):{dispose:()=>{}},es=typeof re.onRender=="function"?re.onRender(W=>{var vt;(vt=Ft.current)==null||vt.afterRender();const ce=re.buffer.active.viewportY??0;ll(ce);const Be=ut.current;if(Be&&El.current){const jt=Be.startRow-ce,gn=Be.endRow-ce;Sn.current&&W.start<=gn&&W.end>=jt&&(an(!1),Sn.current=!1)}else Sn.current=!1}):{dispose:()=>{}},ea=typeof re.onScroll=="function"?re.onScroll(()=>{var ce,Be;const W=re.buffer.active.viewportY??0;ll(W),(ce=ht.current)==null||ce.reset("scroll"),(Be=Ft.current)==null||Be.clear()}):{dispose:()=>{}},Cn=new Y0({getTerminal:()=>f.current,getIsController:()=>J.current,getScale:()=>p.current,getSurfaceElement:()=>d.current,allowSyntheticMouseFallback:!1,onFocus:()=>{try{re.focus()}catch{}z&&I(W=>({...W,focused:document.activeElement===re.textarea})),r==null||r()},onGestureStateChange:W=>{z&&I(ce=>({...ce,state:W}))},onGestureScroll:({deltaY:W,lines:ce,viewportY:Be,scrollTop:vt,scrollHeight:jt,clientHeight:gn,moved:Te,bufferType:Mt,baseY:xt,cursorY:nn,hasScrollback:On,mouseTracking:bn,scrollMode:yn})=>{z&&I(la=>({...la,deltaY:W,lines:ce,viewportY:Be,scrollTop:vt,scrollHeight:jt,clientHeight:gn,moved:Te,focused:document.activeElement===re.textarea,bufferType:Mt,baseY:xt,cursorY:nn,hasScrollback:On,mouseTracking:bn,scrollMode:yn,scrollCalls:la.scrollCalls+(ce!==0?1:0),lastScrollLines:ce}))},longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,onLongPress:k?(W=>{var ce;return(ce=il.current)==null?void 0:ce.call(il,W)}):void 0,onSelectionExtend:k?(W=>{var ce;return(ce=zn.current)==null?void 0:ce.call(zn,W)}):void 0}),ts=typeof window<"u"&&"PointerEvent"in window,ns=typeof TouchEvent<"u",Rl=[],sl=(W,ce=!1)=>{const Be=W.target;return Be instanceof Node&&Q.contains(Be)||ce&&Cn.getState()!=="idle"};if(ts){const W={passive:!1,capture:!0},ce=Te=>{z&&I(Mt=>({...Mt,pointerEvents:Mt.pointerEvents+1,lastInputEvent:Te}))},Be=Te=>{if(!sl(Te))return;if(ce("pointerdown"),tt.current){pn(null),tt.current=null,Dt(null),ut.current=null,Mn(""),Ot.current="",an(!1),al.current=null,_n.current=null,Te.cancelable&&Te.preventDefault(),Te.stopPropagation();return}Cn.handlePointerDown(Te,Q)&&Te.stopPropagation()},vt=Te=>{sl(Te,!0)&&(ce("pointermove"),Cn.handlePointerMove(Te),Te.pointerType!=="mouse"&&Te.stopPropagation())},jt=Te=>{if(!sl(Te,!0))return;if(ce("pointerup"),Cn.getState()==="longpress"&&Et.current){const xt=_n.current??al.current;if(xt){const nn=Et.current.getBoundingClientRect(),On=xt.clientX-nn.left,bn=xt.clientY-nn.top,yn=_a(xt);pn({x:On,y:bn,link:yn}),tt.current={x:On,y:bn,link:yn}}}Cn.handlePointerUp(Te),Te.pointerType!=="mouse"&&Te.stopPropagation()},gn=Te=>{sl(Te,!0)&&(ce("pointercancel"),pn(null),tt.current=null,Dt(null),ut.current=null,Mn(""),Ot.current="",an(!1),al.current=null,_n.current=null,Cn.handlePointerCancel(Te),Te.pointerType!=="mouse"&&Te.stopPropagation())};if(document.addEventListener("pointerdown",Be,W),document.addEventListener("pointermove",vt,W),document.addEventListener("pointerup",jt,W),document.addEventListener("pointercancel",gn,W),Rl.push(()=>{document.removeEventListener("pointerdown",Be,W),document.removeEventListener("pointermove",vt,W),document.removeEventListener("pointerup",jt,W),document.removeEventListener("pointercancel",gn,W)}),ns){const Te=xt=>{sl(xt,!0)&&(z&&I(nn=>({...nn,touchEvents:nn.touchEvents+1})),xt.cancelable&&xt.preventDefault(),xt.stopPropagation())},Mt=["touchstart","touchmove","touchend","touchcancel"];for(const xt of Mt)document.addEventListener(xt,Te,W);Rl.push(()=>{for(const xt of Mt)document.removeEventListener(xt,Te,W)})}}else{const W={passive:!1,capture:!0},ce=Te=>{z&&I(Mt=>({...Mt,touchEvents:Mt.touchEvents+1,lastInputEvent:Te}))},Be=Te=>{if(sl(Te)){if(ce("touchstart"),tt.current){pn(null),tt.current=null,Dt(null),ut.current=null,Mn(""),Ot.current="",an(!1),al.current=null,_n.current=null,Te.cancelable&&Te.preventDefault(),Te.stopPropagation();return}Te.touches.length===1&&Te.stopPropagation(),Cn.handleTouchStart(Te,Q)}},vt=Te=>{sl(Te,!0)&&(ce("touchmove"),Te.touches.length===1&&Te.stopPropagation(),Cn.handleTouchMove(Te))},jt=Te=>{if(!sl(Te,!0))return;if(ce("touchend"),Cn.getState()==="longpress"&&Et.current){const xt=_n.current??al.current;if(xt){const nn=Et.current.getBoundingClientRect(),On=xt.clientX-nn.left,bn=xt.clientY-nn.top,yn=_a(xt);pn({x:On,y:bn,link:yn}),tt.current={x:On,y:bn,link:yn}}}Te.stopPropagation(),Cn.handleTouchEnd(Te)},gn=Te=>{sl(Te,!0)&&(ce("touchcancel"),pn(null),tt.current=null,Dt(null),ut.current=null,Mn(""),Ot.current="",an(!1),al.current=null,_n.current=null,Te.stopPropagation(),Cn.handleTouchCancel())};document.addEventListener("touchstart",Be,W),document.addEventListener("touchmove",vt,W),document.addEventListener("touchend",jt,W),document.addEventListener("touchcancel",gn,W),Rl.push(()=>{document.removeEventListener("touchstart",Be,W),document.removeEventListener("touchmove",vt,W),document.removeEventListener("touchend",jt,W),document.removeEventListener("touchcancel",gn,W)})}const ls=W=>{W.preventDefault()};Q.addEventListener("contextmenu",ls),Rl.push(()=>{Q.removeEventListener("contextmenu",ls)});const Da=new ResizeObserver(()=>{H()});Da.observe(Q);const Tn=()=>{H()},ta=()=>{var W,ce;if(document.visibilityState==="visible"){ie(10);try{(ce=f.current)==null||ce.refresh(0,Math.max(0,(((W=f.current)==null?void 0:W.rows)||1)-1))}catch{}}};window.addEventListener("resize",Tn),window.addEventListener("orientationchange",Tn),document.addEventListener("visibilitychange",ta),window.addEventListener("pageshow",ta);const na=()=>{H()};return typeof window<"u"&&window.visualViewport&&(window.visualViewport.addEventListener("resize",na),window.visualViewport.addEventListener("scroll",na)),()=>{var W,ce;Pi.dispose(),$l.dispose(),es.dispose(),ea.dispose(),$r.dispose(),kt.dispose(),(W=Ft.current)==null||W.dispose(),Ft.current=null,ht.current=null,de.current=null,Ge.current=()=>{},dt.dispose(),Cn.handlePointerCancel();for(const Be of Rl)Be();Da.disconnect(),window.removeEventListener("resize",Tn),window.removeEventListener("orientationchange",Tn),document.removeEventListener("visibilitychange",ta),window.removeEventListener("pageshow",ta),typeof window<"u"&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",na),window.visualViewport.removeEventListener("scroll",na)),v.current&&(clearTimeout(v.current),v.current=null),y.current!==null&&(cancelAnimationFrame(y.current),y.current=null),w.current!==null&&(cancelAnimationFrame(w.current),w.current=null),bl(),(ce=re.textarea)==null||ce.removeEventListener("paste",Jl),Q.removeEventListener("paste",Jl),tn.dispose(),G.current=null,re.dispose(),f.current=null}},[]);const Ae=pl.useMemo(()=>{var Q;return((Q=zt.find(ee=>ee.id===ft))==null?void 0:Q.displayName)??null},[zt,ft]);x.useEffect(()=>{we!=="connected"&&mn(null)},[we]),x.useEffect(()=>{const Q=a&&we==="connected",ee=he.agentAlertBadge?Qr(Z):null;cw(Q?hn:null,Ae,ee)},[a,we,hn,Ae,Z,he.agentAlertBadge]),x.useEffect(()=>{const Q=f.current;if(!Q)return;const ee=Ou(i.current,Gi(),_u());Q.options.fontSize=Jm(he.fontSize,ee.width),Q.options.fontFamily=rp(he.fontFamily);try{Q.refresh(0,Math.max(0,Q.rows-1))}catch{}ie(10)},[he.fontSize,he.fontFamily]),x.useEffect(()=>$(Q=>{var ee;(ee=ht.current)==null||ee.handleUserInput(Q),Ge.current()}),[$]),x.useEffect(()=>{const Q=ht.current,ee=Ft.current;if(!Q||!ee)return;const Ce=Q.getEchoSrttMs();Op(he.predictiveEcho,Ce)?ee.sync(Q.getOverlayItems()):ee.clear()},[he.predictiveEcho]);const Ne=x.useRef(He);x.useEffect(()=>{var ee;if(Ne.current===He)return;Ne.current=He,it.current("resetVersion");const Q=f.current;if(Q)try{(ee=Q.reset)==null||ee.call(Q),Q.clear(),Q.refresh(0,Math.max(0,Q.rows-1))}catch{}},[He]),x.useEffect(()=>{it.current("connectionState")},[we]),x.useEffect(()=>{const Q=f.current;if(!(!Q||!E)){Q.options.theme={...E};try{Q.refresh(0,Math.max(0,Q.rows-1))}catch{}}},[E]),x.useEffect(()=>Ze(ee=>{const Ce=f.current;if(!Ce)throw new Error("terminal not ready");if(Ce.write(ee),z){const ye=performance.now(),qe=ue.current;qe.push({time:ye,bytes:ee.byteLength});const re=ye-1e3;for(;qe.length>0&&qe[0].time<re;)qe.shift()}}),[Ze,z]),x.useEffect(()=>{if(!a)return;ie(10);const Q=f.current;if(Q){try{Q.refresh(0,Math.max(0,Q.rows-1))}catch{}if(!k)try{Q.focus()}catch{}}},[a,k,ie]),x.useEffect(()=>{we==="disconnected"&&_e()},[]);const Le=Q=>{Q.preventDefault()};return u.jsxs("main",{ref:Et,className:"flex-1 w-full min-w-0 min-h-0 overflow-hidden relative flex flex-col",onContextMenu:Le,"aria-label":B("terminal.windowAriaLabel"),children:[u.jsx("div",{id:"terminal-container",ref:i,className:"absolute inset-0 overflow-hidden cursor-text",style:{touchAction:K?"none":"auto"},tabIndex:0,onContextMenu:Le,"aria-label":B("terminal.bufferAriaLabel"),role:"region",children:u.jsx("div",{id:"terminal-frame",ref:o,className:"relative overflow-hidden",style:{width:"100%",height:"100%"},children:u.jsx("div",{id:"terminal-surface",ref:d,className:"absolute top-0 left-0",style:{transformOrigin:"top left",width:"100%",height:"100%"}})})}),z&&u.jsxs("pre",{"data-testid":"terminal-touch-debug",className:"pointer-events-none absolute left-1 top-1 z-50 border border-tui-border bg-tui-crust/90 px-2 py-1 font-mono text-tui-sm leading-relaxed text-tui-muted","aria-hidden":"true",children:[`gesture: ${X.state}
|
|
37
|
+
`,`deltaY: ${X.deltaY} lines: ${X.lines}
|
|
38
|
+
`,`viewportY: ${X.viewportY??"-"} focus: ${X.focused}
|
|
39
|
+
`,`buffer: ${X.bufferType??"-"} base: ${X.baseY??"-"} cursor: ${X.cursorY??"-"} scrollback: ${X.hasScrollback??"-"}
|
|
40
|
+
`,`scroll: ${X.scrollTop??"-"} / ${X.scrollHeight??"-"} (h ${X.clientHeight??"-"}) moved: ${X.moved}
|
|
41
|
+
`,`mode: ${X.scrollMode} calls: ${X.scrollCalls} lines: ${X.lastScrollLines??"-"} mouse: ${X.mouseTracking}
|
|
42
|
+
`,`event: ${X.lastInputEvent||"-"} pointer: ${X.pointerEvents} touch: ${X.touchEvents}
|
|
43
|
+
`,`rtt: ${Me!==null?`${Me}ms`:"-"} frames/s: ${P.framesPerSec} bytes/s: ${P.bytesPerSec} renderer: ${be??"-"}
|
|
44
|
+
`,`prediction: ${((Ve=ht.current)==null?void 0:Ve.getState())??"-"} mode: ${he.predictiveEcho} pending: ${((rt=ht.current)==null?void 0:rt.getVisiblePredictions().length)??0} srtt: ${((Lt=ht.current)==null?void 0:Lt.getEchoSrttMs())!==null&&((gl=ht.current)==null?void 0:gl.getEchoSrttMs())!==void 0?`${Math.round(ht.current.getEchoSrttMs())}ms`:"-"}
|
|
45
|
+
`,`field: ${tS(((dn=de.current)==null?void 0:dn.detect())??null)} mismatches: ${((en=ht.current)==null?void 0:en.getMismatchCount())??0}`]}),k&&Ct&&Nl&&(()=>{var rl;const Q=f.current;if(!Q||!Et.current)return null;const ee=ti(Q);if(ee.cellWidth<=0||ee.cellHeight<=0)return null;const Ce=((rl=d.current)==null?void 0:rl.querySelector(".xterm-screen"))||d.current;if(!Ce)return null;const ye=Ce.getBoundingClientRect(),qe=Et.current.getBoundingClientRect(),re=Ct.startRow-kl;if(Ct.endRow-kl<0||re>=Q.rows)return null;const dt=ye.top-qe.top+re*ee.cellHeight,Qt=ye.left-qe.left+Ct.startCol*ee.cellWidth,Rt=(Ct.endCol-Ct.startCol+1)*ee.cellWidth,Dn=(Ct.endRow-Ct.startRow+1)*ee.cellHeight;return u.jsx("div",{"data-testid":"terminal-selection-overlay",className:"pointer-events-none absolute z-20 bg-tui-accent/35",style:{top:`${dt}px`,left:`${Qt}px`,width:`${Rt}px`,height:`${Dn}px`}})})(),k&&nl&&u.jsx(bw,{anchorPoint:nl,hasSelection:!!Pl,isController:ve,vibrateOnKeyPress:he.vibrateOnKeyPress,linkUrl:nl.link??null,onOpenLink:Q=>{qu(Q)||at("warning",B("clipboard.openLinkFailed"))},onCopySelection:ai,onCopyLine:Vn,onCopyScreen:Ht,onPaste:$t,onClose:()=>{pn(null),tt.current=null,Dt(null),ut.current=null,Mn(""),Ot.current="",an(!1)}}),k&&u.jsx(yw,{isOpen:Zi,onClose:()=>Ma(!1),onSend:Xn,onSendImage:za})]})},aS=({onPairedSuccess:r})=>{const{settings:a,updateSettings:i,connect:o,connectionState:d,stateDetail:f,addToast:p,t:m}=Nt(),[b,v]=x.useState(""),[y,w]=x.useState(null),[T,R]=x.useState(!1),[k,K]=x.useState(a.wsUrl||"/ws/client"),[z,X]=x.useState(a.token||""),[I,P]=x.useState(a.clientId||""),ae="node bin/service.js pair",be="node bin/config-tui.js",se="herdr plugin pane open --plugin herdr.remote.web --entrypoint config --placement zoomed --focus",G=ve=>{ni(ve).then(we=>{if(we==="failed"){p("error",m("clipboard.copyFailed"));return}w(ve),p("success",m("toasts.commandCopied")),setTimeout(()=>w(null),2e3)})},U=ve=>{ve.preventDefault();const we=b.trim().toUpperCase();if(!we&&!z.trim()){p("warning",m("toasts.connectionError"));return}const he={pairCode:we,wsUrl:k.trim()||"/ws/client",clientId:I.trim()||a.clientId};z.trim()&&(he.token=z.trim()),i(he),o({pairCode:we||void 0,token:z.trim()||void 0,wsUrl:k.trim()||"/ws/client",clientId:I.trim()||a.clientId}),r&&r()},le=d==="connecting"||d==="reconnecting",ue=({n:ve})=>u.jsxs("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:["[",ve,"]"]});return u.jsx("div",{className:"flex h-full w-full flex-1 justify-center overflow-y-auto bg-tui-crust p-2 sm:p-4",children:u.jsxs("div",{className:"my-auto w-full max-w-3xl space-y-3",children:[u.jsxs("div",{className:"border border-tui-border bg-tui-base px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[u.jsx("span",{"aria-hidden":"true",className:"font-bold text-tui-accent",children:"herdr-remote"}),u.jsx("h1",{className:"text-tui font-bold text-tui-text",children:m("onboarding.title")}),u.jsx("span",{className:"text-tui uppercase text-tui-warn",children:m("onboarding.firstTimeSetup")})]}),u.jsx("p",{className:"mt-0.5 text-tui leading-snug text-tui-muted",children:m("onboarding.description")})]}),d==="error"&&u.jsxs(yo,{tone:"warn",action:u.jsx(Oe,{variant:"warn",onClick:()=>o(),children:m("common.retry")}),children:[u.jsx("span",{className:"block font-bold",children:m("onboarding.authRequired")}),u.jsx("span",{className:"block text-tui-muted",children:f||m("onboarding.authRequiredDesc")})]}),u.jsxs("form",{onSubmit:U,className:"grid gap-3",children:[u.jsx(fn,{title:m("onboarding.step1Title"),className:"min-w-0",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("p",{className:"flex items-start gap-2 text-tui text-tui-muted",children:[u.jsx(ue,{n:1}),u.jsx("span",{className:"leading-snug",children:m("onboarding.step1Desc")})]}),u.jsxs("div",{className:"flex items-center gap-2 border border-tui-border bg-tui-mantle px-2 py-1",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none text-tui-ok",children:"$"}),u.jsx("code",{className:"min-w-0 flex-1 truncate text-tui text-tui-text",children:ae}),u.jsx(Oe,{onClick:()=>G(ae),glyph:y===ae?Xe.check:"⧉",className:ne("shrink-0",y===ae&&"border-tui-ok text-tui-ok"),children:m(y===ae?"common.copied":"common.copy")})]}),u.jsxs("div",{className:"space-y-0.5 text-tui-sm",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-tui-faint",children:m("onboarding.step1CopyPlugin")}),u.jsx("button",{type:"button",onClick:()=>G(se),className:"tui-focusable shrink-0 text-tui-accent underline-offset-2 hover:underline",children:m(y===se?"common.copied":"onboarding.step1CopyCli")})]}),u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate text-tui-faint",children:m("onboarding.step1TuiNote")}),u.jsx("code",{onClick:()=>G(be),className:"shrink-0 cursor-pointer border border-tui-border-dim px-1 text-tui-muted hover:border-tui-accent hover:text-tui-accent",title:m("common.clickToCopy"),children:be})]})]})]})}),u.jsx(fn,{title:m("onboarding.step2Title"),className:"min-w-0",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(ue,{n:2}),u.jsx(wn,{type:"text",value:b,onChange:ve=>v(ve.target.value.toUpperCase()),placeholder:m("onboarding.step2Placeholder"),maxLength:12,autoFocus:!0,"aria-label":m("onboarding.step2Title"),className:"font-bold uppercase"})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("onboarding.step2Note")})]})}),u.jsx(Oe,{variant:"primary",type:"submit",block:!0,disabled:le,className:"py-1.5",children:le?u.jsx(Vi,{label:m("onboarding.connectingAndPairing")}):m("onboarding.connectAndPair")}),u.jsxs("div",{className:"border border-tui-border bg-tui-base",children:[u.jsxs("button",{type:"button",onClick:()=>R(!T),"aria-expanded":T,className:"tui-focusable flex w-full items-center gap-2 px-2 py-1 text-left text-tui text-tui-muted transition-colors hover:text-tui-accent",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:T?Xe.chevronDown:Xe.chevronRight}),u.jsx("span",{className:"uppercase",children:m("onboarding.advancedTitle")})]}),T&&u.jsxs("div",{className:"space-y-2.5 border-t border-tui-border-dim px-2 py-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"onboarding-token",children:m("onboarding.manualTokenLabel")}),u.jsx(wn,{id:"onboarding-token",type:"password",value:z,onChange:ve=>X(ve.target.value),placeholder:m("onboarding.manualTokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"onboarding-ws",children:m("onboarding.wsEndpointLabel")}),u.jsx(wn,{id:"onboarding-ws",type:"text",value:k,onChange:ve=>K(ve.target.value),placeholder:m("onboarding.wsEndpointPlaceholder")})]}),u.jsx(hl,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"onboarding-client-id",children:m("onboarding.clientIdLabel")}),u.jsx(wn,{id:"onboarding-client-id",type:"text",value:I,onChange:ve=>P(ve.target.value)})]})]})]})]})]})})},$a="tui-focusable inline-flex shrink-0 select-none items-center justify-center border text-tui font-medium transition-colors",Fr="border-tui-border bg-tui-surface text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",iS="border-tui-accent bg-tui-accent text-tui-crust font-bold",rS="border-tui-ok bg-transparent text-tui-ok hover:bg-tui-ok hover:text-tui-crust font-bold",Up={default:Fr,bad:"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust",warn:"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust"},sS=({compact:r=!1})=>{const{sendKey:a,settings:i,updateSettings:o,isController:d,warnViewerMode:f,t:p,uploadProgress:m,uploadImage:b,modifierLatch:v,toggleModifierLatch:y,consumeModifierLatch:w,agentProfile:T,agentProfilePin:R,setAgentProfilePin:k}=Nt(),K="h-9 min-w-[2.25rem] px-2",z="h-9 w-9",X="h-9 px-2",I=x.useRef(null),P=x.useRef(null),ae=x.useCallback(()=>{if(i.vibrateOnKeyPress&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[i.vibrateOnKeyPress]),be=x.useCallback(()=>{var B;if(ae(),!d){f();return}m.active||(B=I.current)==null||B.click()},[ae,d,f,m.active]),se=x.useCallback(B=>{const Me=B.target.files,E=Me&&Me[0];B.target.value="",E&&b(E)},[b]),G=()=>u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:I,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/*",className:"hidden","data-testid":"key-toolbar-file-input",onChange:se}),u.jsx("input",{ref:P,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif,image/*",capture:"environment",className:"hidden","data-testid":"key-toolbar-camera-input",onChange:se})]}),U=(B=!1)=>m.active?u.jsx("div",{"data-testid":B?"key-toolbar-progress-collapsed":"key-toolbar-progress",className:"w-full border-b border-tui-border-dim bg-tui-crust px-2 py-1",children:u.jsx(w0,{ratio:m.ratio,label:m.statusText,tone:m.phase==="completed"?"ok":m.phase==="error"?"bad":"accent","aria-label":m.statusText})}):null,le=()=>{const B=m.active;return u.jsx("button",{type:"button","data-testid":"image-upload-btn",onClick:be,disabled:B,className:ne($a,K,B?"border-tui-border-dim bg-tui-surface opacity-60 cursor-not-allowed":Fr),title:B?m.statusText:p("virtualKeyboard.uploadImageTitle"),"aria-label":p("virtualKeyboard.uploadImage"),children:u.jsx("span",{className:"font-medium",children:B?`${m.percent}%`:p("virtualKeyboard.image")})})},[ue,ve]=x.useState(!1),[we,he]=x.useState(!1),[ke,He]=x.useState(!1),[L,V]=x.useState(!1),$=x.useRef([]);x.useEffect(()=>()=>{$.current.forEach(B=>clearTimeout(B)),$.current=[]},[]);const je=x.useCallback(B=>{if(ae(),!d){f();return}let Me;try{Me=Al(B)}catch{return}if(w(),Me.length===1){a(Me[0]);return}Me.forEach((E,te)=>{const J=setTimeout(()=>{$.current=$.current.filter(Ke=>Ke!==J),a(E)},te*120);$.current.push(J)})},[w,d,a,ae,f]),Z=ex(T,i.agentKeymaps[T]),at=B=>{let Me="";try{Me=bo(B.combo)}catch{}const E=B.custom?B.customLabel||"":p(`agentActions.${B.labelKey}`),te=B.labelKey==="interrupt"&&B.combo.trim().toLowerCase()==="ctrl+c"?"bad":B.combo.trim().toLowerCase()==="ctrl+z"?"warn":"default";return u.jsxs("button",{type:"button","data-testid":`agent-key-${B.id}`,onClick:()=>je(B.combo),className:ne($a,"h-8 gap-1.5 px-2",Up[te]),title:`${Me} ${E}`.trim(),children:[u.jsx("span",{className:"font-bold",children:Me}),u.jsx("span",{className:"text-tui-sm opacity-70",children:E})]},B.id)},Qe=()=>{const B=Zl[T];return u.jsxs("div",{"data-testid":"agent-key-drawer",className:"space-y-1.5 border-b border-tui-border-dim bg-tui-crust p-1.5",children:[u.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[u.jsx("span",{className:"min-w-0 font-bold text-tui-accent","data-testid":"agent-key-drawer-title",children:R==="auto"?p("agentKeymaps.autoProfile",{profile:B.name}):p("agentKeymaps.pinnedProfile",{profile:B.name})}),u.jsxs("label",{className:"flex min-w-0 flex-wrap items-center gap-1 text-tui-sm text-tui-faint",children:[u.jsx("span",{children:p("agentKeymaps.keymapLabel")}),u.jsxs(Pr,{"aria-label":p("agentKeymaps.keymapLabel"),value:R,onChange:Me=>k(Me.target.value),className:"h-8 w-auto max-w-full min-w-[7rem] px-1.5",children:[u.jsx("option",{value:"auto",children:p("agentKeymaps.auto")}),fg.filter(Me=>Me!=="shell").map(Me=>u.jsx("option",{value:Me,children:Zl[Me].name},Me)),u.jsx("option",{value:"shell",children:p("agentKeymaps.shell")})]})]})]}),u.jsxs("div",{className:"flex flex-wrap gap-1.5","data-testid":"agent-key-actions",children:[Z.agentActions.map(at),Z.agentActions.length===0&&u.jsx("span",{className:"py-1 text-tui-sm text-tui-faint",children:p("agentKeymaps.noAgentActions")})]}),u.jsx(hl,{label:p("agentKeymaps.genericGroup")}),u.jsx("div",{className:"flex flex-wrap gap-1.5","data-testid":"generic-key-actions",children:Z.genericActions.map(at)})]})},_e=x.useCallback((B,Me=!0)=>{if(ae(),!d){f();return}const E=w();a(Me&&E?xo(B,E):B)},[d,a,f,ae,w]);if(!i.toolbarVisible)return u.jsxs("div",{"data-testid":"key-toolbar-collapsed",className:"z-20 flex shrink-0 flex-col border-t border-tui-border bg-tui-mantle pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]",children:[G(),U(!0),u.jsx("div",{className:"flex items-center justify-center px-2 py-0.5",children:u.jsxs("button",{type:"button",onClick:()=>o({toolbarVisible:!0}),className:"tui-focusable flex h-6 w-28 items-center justify-center gap-1 text-tui uppercase text-tui-faint transition-colors hover:text-tui-accent",title:p("virtualKeyboard.expandToolbar"),"aria-label":p("virtualKeyboard.expandToolbar"),"aria-expanded":!1,children:[u.jsx("span",{"aria-hidden":"true",children:"▴"}),u.jsx("span",{"aria-hidden":"true",children:p("common.keyBar")})]})})]});const Ze=i.virtualKeys&&i.virtualKeys.length>0?i.virtualKeys.filter(B=>B.enabled):tg,ze=B=>B.id==="left"?u.jsx("span",{"aria-hidden":"true",children:"←"}):B.id==="up"?u.jsx("span",{"aria-hidden":"true",children:"↑"}):B.id==="down"?u.jsx("span",{"aria-hidden":"true",children:"↓"}):B.id==="right"?u.jsx("span",{"aria-hidden":"true",children:"→"}):B.id==="enter"?u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{"aria-hidden":"true",children:"⏎"}),u.jsx("span",{className:"hidden sm:inline",children:p("virtualKeyboard.keyEnter")})]}):B.id==="drawer_chords"?u.jsx("span",{children:"^C"}):B.id==="drawer_agent"?u.jsxs("span",{className:"flex items-center gap-0.5",children:[u.jsx("span",{children:Zl[T].shortName}),u.jsx("span",{"aria-hidden":"true",children:L?"▾":"▴"}),R!=="auto"&&u.jsx("span",{"aria-hidden":"true",className:"ml-0.5",children:"•"})]}):B.id==="drawer_fn"?u.jsxs("span",{className:"flex items-center gap-0.5",children:[u.jsx("span",{children:"Fn"}),u.jsx("span",{"aria-hidden":"true",children:ue?"▾":"▴"})]}):u.jsx("span",{children:B.label}),Se=B=>{if(ae(),B.type==="modifier"){B.modifierType==="ctrl"||B.modifierType==="alt"||B.modifierType==="shift"?y(B.modifierType):B.modifierType==="meta"&&_e(oe.ESC);return}if(B.type==="drawer"){B.drawerType==="fn"?(ve(!ue),he(!1),He(!1),V(!1)):B.drawerType==="chords"?(He(!ke),ve(!1),he(!1),V(!1)):B.drawerType==="symbols"?(he(!we),ve(!1),He(!1),V(!1)):B.drawerType==="agent"&&(V(!L),ve(!1),he(!1),He(!1));return}_e(B.code,B.type!=="chord")},zt=B=>{if(B.type==="modifier"){if(B.modifierType==="ctrl")return v.ctrl;if(B.modifierType==="alt")return v.alt;if(B.modifierType==="shift")return v.shift}if(B.type==="drawer"){if(B.drawerType==="fn")return ue;if(B.drawerType==="chords")return ke;if(B.drawerType==="symbols")return we;if(B.drawerType==="agent")return L}return!1},ft=(B,Me,E,te,J="default")=>u.jsxs("button",{type:"button",onClick:()=>_e(B,!1),className:ne($a,"h-8 gap-1.5 px-2",Up[J]),title:E,children:[u.jsx("span",{className:"font-bold",children:Me}),u.jsx("span",{className:"text-tui-sm opacity-70",children:te})]});return u.jsxs("div",{"data-testid":"key-toolbar",className:ne("z-20 flex shrink-0 select-none flex-col border-t border-tui-border bg-tui-mantle",r?"pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]":"pb-[max(env(safe-area-inset-bottom,0px),0.25rem)]"),role:"toolbar","aria-label":p("virtualKeyboard.touchKeyboardShortcuts"),children:[G(),U(!1),ue&&u.jsx("div",{className:"grid grid-cols-6 gap-1 border-b border-tui-border-dim bg-tui-crust p-1.5 sm:grid-cols-12",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(B=>{const Me=`F${B}`;return u.jsxs("button",{type:"button",onClick:()=>_e(oe[Me]),className:ne($a,Fr,"h-8"),children:["F",B]},Me)})}),ke&&u.jsxs("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto border-b border-tui-border-dim bg-tui-crust p-1.5",children:[ft(oe.CTRL_C,"^C",p("virtualKeyboard.ctrlCTitle"),p("virtualKeyboard.badgeSigint"),"bad"),ft(oe.CTRL_D,"^D",p("virtualKeyboard.ctrlDTitle"),p("virtualKeyboard.badgeEof")),ft(oe.CTRL_Z,"^Z",p("virtualKeyboard.ctrlZTitle"),p("virtualKeyboard.badgeTstp"),"warn"),ft(oe.CTRL_L,"^L",p("virtualKeyboard.ctrlLTitle"),p("virtualKeyboard.badgeClear")),ft(oe.CTRL_R,"^R",p("virtualKeyboard.ctrlRTitle"),p("virtualKeyboard.badgeSearch")),ft(oe.CTRL_A,"^A",p("virtualKeyboard.ctrlATitle"),p("virtualKeyboard.badgeStart")),ft(oe.CTRL_E,"^E",p("virtualKeyboard.ctrlETitle"),p("virtualKeyboard.badgeEnd")),ft(oe.CTRL_K,"^K",p("virtualKeyboard.ctrlKTitle"),p("virtualKeyboard.badgeKill"))]}),L&&Qe(),we&&u.jsx("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto border-b border-tui-border-dim bg-tui-crust p-1.5",children:["|","~","/","\\","-","_","$","&",";",":","`",'"',"'",">","<","=","#","@","{","}","[","]"].map(B=>u.jsx("button",{type:"button",onClick:()=>_e(B,!0),className:ne($a,Fr,"h-8 w-8 font-bold"),children:B},B))}),u.jsxs("div",{"data-testid":"key-toolbar-row",className:ne("flex flex-wrap items-center justify-center gap-1",r?"px-1.5 py-1":"px-2 py-1.5"),children:[u.jsx("button",{type:"button",onClick:()=>o({toolbarVisible:!1}),className:ne($a,z,"mr-1 border-tui-border-dim bg-transparent text-tui-faint hover:border-tui-border hover:text-tui-text"),title:p("virtualKeyboard.collapseToolbar"),"aria-label":p("virtualKeyboard.collapseToolbar"),"aria-expanded":!0,children:u.jsx("span",{"aria-hidden":"true",children:"▾"})}),Ze.map(B=>{const Me=zt(B),E=B.id==="enter",te=["left","up","down","right"].includes(B.id),J=B.type==="drawer",Ke=Vu(B,p),De=B.id==="drawer_agent"?`${Zl[T].name} ${p("agentKeymaps.keymapLabel")}`:Ke,Je=u.jsx("button",{type:"button",onClick:()=>Se(B),"data-testid":B.id==="drawer_agent"?"agent-key-drawer-toggle":void 0,className:ne($a,te?z:J?X:K,E?rS:Me?iS:Fr),title:De,"aria-label":De,"aria-pressed":Me,children:ze(B)},B.id);return E?u.jsxs(pl.Fragment,{children:[le(),Je]},"enter-with-image"):Je}),!Ze.some(B=>B.id==="enter")&&le()]})]})},oS=["ls -la","clear","git status","pwd","top","exit","cat"],cS=({isOpen:r,onClose:a})=>{const{sendKey:i,isController:o,warnViewerMode:d,t:f}=Nt(),[p,m]=x.useState("");if(!r)return null;const b=y=>{if(y&&y.preventDefault(),!o){d();return}p.length>0?(i(p+"\r"),m("")):i("\r")},v=y=>{if(!o){d();return}i(y+"\r")};return u.jsxs("div",{className:"z-20 flex flex-col gap-1.5 border-t border-tui-border bg-tui-mantle p-2",role:"region","aria-label":f("virtualKeyboard.helperTitle"),children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-tui font-bold uppercase text-tui-accent",children:f("virtualKeyboard.helperTitle")}),u.jsx(Oe,{variant:"ghost",onClick:a,"aria-label":f("virtualKeyboard.closeHelper"),children:"esc"})]}),u.jsx("div",{className:"scrollbar-none flex items-center gap-1 overflow-x-auto py-0.5",children:oS.map(y=>u.jsx("button",{type:"button",onClick:()=>v(y),className:"tui-focusable shrink-0 select-none border border-tui-border bg-tui-surface px-2 py-0.5 text-tui-sm text-tui-muted transition-colors hover:border-tui-accent hover:text-tui-accent",children:y},y))}),u.jsxs("form",{onSubmit:b,className:"flex items-center gap-1.5",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none font-bold text-tui-ok",children:"$"}),u.jsxs("div",{className:"relative flex-1",children:[u.jsx("label",{htmlFor:"virtual-keyboard-input",className:"sr-only",children:f("virtualKeyboard.placeholder")}),u.jsx(wn,{id:"virtual-keyboard-input",name:"terminal-input",type:"text",value:p,onChange:y=>m(y.target.value),placeholder:f("virtualKeyboard.placeholder"),inputMode:"text",enterKeyHint:"send",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,className:"select-text pr-7"}),p.length>0&&u.jsx("button",{type:"button",onClick:()=>m(""),className:"tui-focusable absolute right-1 top-1/2 -translate-y-1/2 px-1 text-tui-faint hover:text-tui-bad","aria-label":f("virtualKeyboard.clearInput"),children:u.jsx("span",{"aria-hidden":"true",children:Xe.cross})})]}),u.jsx(Oe,{variant:"primary",type:"submit",title:f("virtualKeyboard.sendButton"),glyph:"⏎",className:"h-9 shrink-0",children:u.jsx("span",{className:"hidden sm:inline",children:f("virtualKeyboard.sendButton")})})]})]})};function Ro(r,a){const i=(o,d)=>a?a(o):d;switch(r){case"connected":return{label:i("connection.live","Live"),level:"ok",needsAttention:!1};case"connecting":return{label:i("connection.connecting","Connecting"),level:"warn",needsAttention:!0};case"reconnecting":return{label:i("connection.reconnecting","Reconnecting"),level:"warn",needsAttention:!0,actionLabel:i("connection.reconnectNow","Reconnect now")};case"error":return{label:i("connection.error","Error"),level:"bad",needsAttention:!0,actionLabel:i("connection.retry","Retry")};default:return{label:i("connection.offline","Offline"),level:"idle",needsAttention:!0,actionLabel:i("connection.connect","Connect")}}}const uS={connected:"ok",connecting:"warn",reconnecting:"warn",error:"bad",disconnected:"idle"},dS=({isOpen:r,onClose:a,isAddMode:i=!1})=>{const{settings:o,updateSettings:d,connect:f,disconnect:p,connectionState:m,hostId:b,addToast:v,t:y,activeProfile:w,activeProfileId:T,addProfileAndConnect:R,renameProfile:k}=Nt(),[K,z]=x.useState(o.wsUrl),[X,I]=x.useState(o.token),[P,ae]=x.useState(o.pairCode),[be,se]=x.useState(o.clientId),[G,U]=x.useState((w==null?void 0:w.displayName)||""),[le,ue]=x.useState(o.autoReconnect),[ve,we]=x.useState(!1);if(x.useEffect(()=>{r&&(z(o.wsUrl),I(i?"":o.token),ae(i?"":o.pairCode),se(o.clientId),U(i?"":(w==null?void 0:w.displayName)||""),ue(o.autoReconnect))},[r,i,o,w]),!r)return null;const he=V=>{V.preventDefault();const $={wsUrl:K.trim()||"/ws/client",token:X.trim(),pairCode:P.trim().toUpperCase(),clientId:be.trim()||o.clientId,autoReconnect:le};if(!$.token&&!$.pairCode){v("warning",y("pairing.credentialsRequired"));return}i?R({...$,displayName:G.trim()||void 0}):(d($),T&&G.trim()&&k(T,G),p(),f({wsUrl:$.wsUrl,token:$.token||void 0,pairCode:$.pairCode||void 0,clientId:$.clientId,autoReconnect:le})),a()},ke=()=>{const V=`client-${Math.random().toString(36).substring(2,8)}`;se(V)},He=()=>{const V=new URL(window.location.href);V.search="",P.trim()&&V.searchParams.set("pairCode",P.trim().toUpperCase()),ni(V.toString()).then($=>{if($==="failed"){v("error",y("clipboard.copyFailed"));return}we(!0),v("success",y("toasts.pairingLinkCopied")),setTimeout(()=>we(!1),2e3)})},L=uS[m]??"idle";return u.jsxs(ud,{isOpen:r,onClose:a,title:y(i?"pairing.addTitle":"pairing.title"),subtitle:y("pairing.subtitle"),closeLabel:y("common.closeDialog"),hints:[{keys:"esc",action:y("common.close")},{keys:"⏎",action:y("pairing.saveAndConnect")}],footer:u.jsxs(u.Fragment,{children:[m==="connected"&&u.jsx(Oe,{variant:"danger",onClick:()=>{p(),a()},children:y("common.disconnect")}),u.jsx(Oe,{variant:"primary",type:"submit",form:"pairing-form",children:y("pairing.saveAndConnect")})]}),children:[u.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 border-b border-tui-border-dim pb-2 text-tui",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(jn,{level:L}),u.jsx("span",{className:"text-tui-muted",children:y("common.status")}),u.jsx("span",{className:ne(L==="ok"?"text-tui-ok":L==="bad"?"text-tui-bad":L==="warn"?"text-tui-warn":"text-tui-faint"),children:Ro(m,y).label})]}),b&&u.jsxs("span",{className:"flex items-center gap-1.5 text-tui-muted",children:[y("common.host")," ",u.jsx("span",{className:"text-tui-text",children:b})]})]}),u.jsxs("form",{id:"pairing-form",onSubmit:he,className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"pairing-name",children:y("pairing.displayNameLabel")}),u.jsx(wn,{id:"pairing-name",type:"text",value:G,onChange:V=>U(V.target.value),placeholder:y("pairing.displayNamePlaceholder"),maxLength:64,autoComplete:"off"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:y("pairing.displayNameHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"pairing-code",hint:y("pairing.pairCodeNote"),children:y("pairing.pairCodeLabel")}),u.jsx(wn,{id:"pairing-code",type:"text",value:P,onChange:V=>ae(V.target.value.toUpperCase()),placeholder:y("pairing.pairCodePlaceholder"),maxLength:12,className:"uppercase"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:y("pairing.pairCodeHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"pairing-token",hint:y("pairing.tokenNote"),children:y("pairing.tokenLabel")}),u.jsx(wn,{id:"pairing-token",type:"password",value:X,onChange:V=>I(V.target.value),placeholder:y("pairing.tokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"pairing-ws",children:y("pairing.wsUrlLabel")}),u.jsx(wn,{id:"pairing-ws",type:"text",value:K,onChange:V=>z(V.target.value),placeholder:y("pairing.wsUrlPlaceholder")}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:y("pairing.wsUrlDefaultNote")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"pairing-client-id",children:y("pairing.clientIdLabel")}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(wn,{id:"pairing-client-id",type:"text",value:be,onChange:V=>se(V.target.value),className:"flex-1"}),u.jsx(Oe,{onClick:ke,title:y("pairing.regenerateClientIdTitle"),className:"shrink-0",children:y("pairing.newIdButton")})]})]}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Ra,{checked:le,onChange:ue,label:y("pairing.autoReconnectLabel"),description:y("pairing.autoReconnectDesc")})}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Oe,{onClick:He,block:!0,glyph:ve?Xe.check:"⧉",className:ne(ve&&"border-tui-ok text-tui-ok"),children:y("pairing.copyDirectLink")})})]})]})},fS=({isOpen:r,onClose:a})=>{const{settings:i,updateSettings:o,addToast:d,language:f,setLanguage:p,t:m,agentProfile:b}=Nt(),[v,y]=x.useState("appearance"),[w,T]=x.useState(null),[R,k]=x.useState({}),K=x.useRef({}),[z,X]=x.useState(""),[I,P]=x.useState(""),[ae,be]=x.useState(!1);if(!r)return null;const se=Qu.find(E=>E.font===i.fontFamily),G=i.virtualKeys&&i.virtualKeys.length>0?i.virtualKeys:Ir(),U=w||b,le=i.agentKeymaps[U]||{},ue=hg(U,le),ve=E=>{o({agentKeymaps:{...i.agentKeymaps,[U]:E}})},we=(E,te)=>{var J;ve({...le,actions:{...le.actions,[E]:{...(J=le.actions)==null?void 0:J[E],...te}}})},he=E=>{we(E.id,{keys:E.defaultCombo})},ke=(E,te)=>{const J=E+(te==="up"?-1:1);if(J<0||J>=ue.length)return;const Ke=ue.map(De=>De.id);[Ke[E],Ke[J]]=[Ke[J],Ke[E]],ve({...le,order:Ke})},He=E=>{var te;ve({...le,custom:(le.custom||[]).filter(J=>J.id!==E),order:(te=le.order)==null?void 0:te.filter(J=>J!==E)})},L=()=>{const E={...i.agentKeymaps};delete E[U],o({agentKeymaps:E})},V=()=>{const E=z.trim();if(!E)return;try{Al(I)}catch{return}const te=`custom-${Date.now().toString(36)}`;ve({...le,custom:[...le.custom||[],{id:te,label:E,keys:I.trim()}],order:[...ue.map(J=>J.id),te]}),X(""),P("")},$=E=>E instanceof Tl?m(`agentKeymaps.errors.${E.code}`,E.params):String(E),je=(E,te)=>`${E}:${te}`,Z=(E,te)=>{const J=je(U,E);K.current={...K.current,[J]:te},k(K.current);try{Al(te),we(E,{keys:te})}catch{}},at=E=>{const te=je(U,E),J=K.current[te];if(J!==void 0){delete K.current[te],k({...K.current});try{Al(J),we(E,{keys:J})}catch{}}},Qe=typeof window<"u"&&window.isSecureContext&&"Notification"in window,_e=()=>{const E=ig();o({fontSize:E.fontSize,fontFamily:E.fontFamily,toolbarVisible:E.toolbarVisible,vibrateOnKeyPress:E.vibrateOnKeyPress,predictiveEcho:E.predictiveEcho,agentAlertBadge:E.agentAlertBadge,agentAlertSound:E.agentAlertSound,agentAlertVibrate:E.agentAlertVibrate,agentAlertNotify:E.agentAlertNotify,language:E.language,virtualKeys:E.virtualKeys}),d("info",m("settings.resetDefaultsToast"))},Ze=E=>{const te=G.map(J=>J.id===E?{...J,enabled:!J.enabled}:J);o({virtualKeys:te})},ze=(E,te)=>{const J=te==="up"?E-1:E+1;if(J<0||J>=G.length)return;const Ke=[...G],De=Ke[E];Ke[E]=Ke[J],Ke[J]=De,o({virtualKeys:Ke})},Se=E=>{if(G.some(J=>J.id===E.id)){const J=G.map(Ke=>Ke.id===E.id?{...Ke,enabled:!0}:Ke);o({virtualKeys:J})}else{const J=[...G,{...E,enabled:!0}];o({virtualKeys:J})}be(!1)},zt=E=>{const te=G.filter(J=>J.id!==E);o({virtualKeys:te})},ft=()=>{o({virtualKeys:Ir()}),d("info",m("toasts.keyLayoutReset"))},B=10,Me=24;return u.jsxs(ud,{isOpen:r,onClose:a,title:m("settings.title"),subtitle:m("settings.subtitle"),closeLabel:m("common.closeDialog"),size:"lg",hints:[{keys:"esc",action:m("common.close")}],footer:u.jsxs(u.Fragment,{children:[u.jsx(Oe,{variant:"ghost",onClick:_e,children:m("settings.resetDefaults")}),u.jsx(Oe,{variant:"primary",onClick:a,children:m("common.done")})]}),children:[u.jsx(od,{tabs:[{id:"appearance",label:m("settings.tabAppearance"),index:1},{id:"virtualKeys",label:m("settings.tabVirtualKeys"),index:2},{id:"agentKeymaps",label:m("settings.tabAgentKeymaps"),index:3}],activeId:v,onSelect:E=>y(E),className:"mb-3 border-b border-tui-border-dim pb-1"}),v==="appearance"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{children:m("settings.languageLabel")}),u.jsxs("div",{className:"grid gap-0.5 sm:grid-cols-2",children:[u.jsx(Br,{name:"ui-language",checked:f==="zh",onChange:()=>p("zh"),label:"简体中文"}),u.jsx(Br,{name:"ui-language",checked:f==="en",onChange:()=>p("en"),label:"English"})]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"terminal-font-select",children:m("settings.fontFamilyLabel")}),u.jsxs(Pr,{id:"terminal-font-select",value:i.fontFamily,onChange:E=>o({fontFamily:E.target.value}),"aria-label":m("settings.fontFamilyLabel"),children:[!se&&u.jsx("option",{value:i.fontFamily,children:i.fontFamily}),Qu.map(E=>u.jsx("option",{value:E.font,children:m(`fontPresets.${E.id}`)||E.name},E.id))]}),u.jsxs("div",{className:"overflow-x-auto whitespace-nowrap border border-tui-border bg-tui-mantle px-2 py-1.5 leading-snug text-tui-text",style:{fontFamily:i.fontFamily,fontSize:`${i.fontSize}px`},children:[u.jsx("span",{className:"text-tui-ok",children:"$"}),' echo "Herdr 0O 1lI ',' [] () -> => !="']})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"terminal-font-size",children:m("settings.fontSizeLabel",{size:i.fontSize})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(v0,{value:(i.fontSize-B)/(Me-B),width:24,className:"hidden shrink-0 sm:inline-flex"}),u.jsx("input",{id:"terminal-font-size",type:"range",min:B,max:Me,step:1,value:i.fontSize,onChange:E=>o({fontSize:Number(E.target.value)}),className:"h-1 w-full cursor-pointer appearance-none bg-tui-border accent-tui-accent"})]}),u.jsxs("div",{className:"flex justify-between text-tui-sm text-tui-faint",children:[u.jsx("span",{children:m("settings.fontSizeCompact")}),u.jsx("span",{children:m("settings.fontSizeDefault")}),u.jsx("span",{children:m("settings.fontSizeLarge")})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("settings.mobileFontNote")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("settings.windowZoomSharedNote")})]}),u.jsx(hl,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{children:m("settings.predictiveEchoLabel")}),u.jsxs("div",{className:"grid gap-0.5 sm:grid-cols-3",children:[u.jsx(Br,{name:"predictive-echo",checked:i.predictiveEcho==="auto",onChange:()=>o({predictiveEcho:"auto"}),label:m("settings.predictiveEchoAuto")}),u.jsx(Br,{name:"predictive-echo",checked:i.predictiveEcho==="always",onChange:()=>o({predictiveEcho:"always"}),label:m("settings.predictiveEchoAlways")}),u.jsx(Br,{name:"predictive-echo",checked:i.predictiveEcho==="off",onChange:()=>o({predictiveEcho:"off"}),label:m("settings.predictiveEchoOff")})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("settings.predictiveEchoDesc")})]}),u.jsx(hl,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Ra,{checked:i.toolbarVisible,onChange:E=>o({toolbarVisible:E}),label:m("settings.touchKeyToolbar"),description:m("settings.touchKeyToolbarDesc")}),u.jsx(Ra,{checked:i.vibrateOnKeyPress,onChange:E=>o({vibrateOnKeyPress:E}),label:m("settings.touchHaptics"),description:m("settings.touchHapticsDesc")})]}),u.jsx(hl,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{children:m("settings.agentAlertsLabel")}),u.jsx(Ra,{checked:i.agentAlertBadge,onChange:E=>o({agentAlertBadge:E}),label:m("settings.agentAlertBadge"),description:m("settings.agentAlertBadgeDesc")}),u.jsx(Ra,{checked:i.agentAlertVibrate,onChange:E=>o({agentAlertVibrate:E}),label:m("settings.agentAlertVibrate"),description:m("settings.agentAlertVibrateDesc")}),u.jsx(Ra,{checked:i.agentAlertSound,onChange:E=>{o({agentAlertSound:E}),E&&(yg(),vg("done"))},label:m("settings.agentAlertSound"),description:m("settings.agentAlertSoundDesc")}),Qe&&u.jsx(Ra,{checked:i.agentAlertNotify,onChange:E=>{if(E&&Notification.permission!=="granted"){Notification.requestPermission().then(te=>o({agentAlertNotify:te==="granted"}));return}o({agentAlertNotify:E})},label:m("settings.agentAlertNotify"),description:m("settings.agentAlertNotifyDesc")})]}),u.jsx(hl,{}),u.jsxs("p",{className:"text-tui-sm leading-snug text-tui-faint",children:[u.jsx("span",{"aria-hidden":"true",className:"mr-1",children:Xe.arrowRight}),m("settings.colorPassthroughNote")]})]}),v==="virtualKeys"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-tui font-bold uppercase text-tui-accent",children:m("virtualKeyboard.customizeTitle")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:m("virtualKeyboard.customizeDesc")})]}),u.jsx(Oe,{variant:"ghost",onClick:ft,className:"shrink-0",children:m("virtualKeyboard.resetLayout")})]}),u.jsx("div",{className:"max-h-72 overflow-y-auto border border-tui-border bg-tui-mantle",children:G.map((E,te)=>u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-tui-border-dim px-2 py-1 last:border-b-0 hover:bg-tui-selection",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("input",{type:"checkbox",checked:E.enabled,onChange:()=>Ze(E.id),className:"sr-only",id:`toggle-${E.id}`}),u.jsx("label",{htmlFor:`toggle-${E.id}`,className:ne("shrink-0 cursor-pointer select-none font-bold",E.enabled?"text-tui-ok":"text-tui-faint"),"aria-hidden":"true",children:E.enabled?"[x]":"[ ]"}),u.jsx(gp,{className:ne(!E.enabled&&"opacity-50"),children:E.label}),u.jsx("span",{className:"truncate text-tui-sm text-tui-muted",children:Vu(E,m)})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Oe,{variant:"ghost",brackets:!1,disabled:te===0,onClick:()=>ze(te,"up"),title:m("virtualKeyboard.moveUp"),"aria-label":m("virtualKeyboard.moveUp"),className:"px-1",children:"↑"}),u.jsx(Oe,{variant:"ghost",brackets:!1,disabled:te===G.length-1,onClick:()=>ze(te,"down"),title:m("virtualKeyboard.moveDown"),"aria-label":m("virtualKeyboard.moveDown"),className:"px-1",children:"↓"}),u.jsx(Oe,{variant:"ghost",brackets:!1,onClick:()=>zt(E.id),title:m("virtualKeyboard.deleteKeyTitle"),"aria-label":m("virtualKeyboard.deleteKeyTitle"),className:"px-1 text-tui-bad hover:text-tui-bad",children:Xe.cross})]})]},E.id))}),u.jsx(Oe,{block:!0,glyph:"+",onClick:()=>be(!ae),className:"border-dashed",children:m("virtualKeyboard.addKey")}),ae&&u.jsxs("div",{className:"space-y-2 border border-tui-border bg-tui-mantle p-2",children:[u.jsx(hl,{label:m("virtualKeyboard.availableKeys")}),u.jsx("div",{className:"flex max-h-48 flex-wrap gap-1 overflow-y-auto",children:Mv.map(E=>{const te=G.some(J=>J.id===E.id);return u.jsxs("button",{type:"button",onClick:()=>Se(E),title:Vu(E,m),className:ne("tui-focusable flex select-none items-center gap-1 border px-1.5 py-0.5 text-tui-sm transition-colors",te?"border-tui-border-dim text-tui-faint":"border-tui-border text-tui-text hover:border-tui-accent hover:text-tui-accent"),children:[u.jsx("span",{children:E.label}),u.jsx("span",{"aria-hidden":"true",className:te?"text-tui-ok":"text-tui-accent",children:te?Xe.check:"+"})]},E.id)})})]})]}),v==="agentKeymaps"&&u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"agent-keymap-profile",children:m("agentKeymaps.settingsProfileLabel")}),u.jsx(Pr,{id:"agent-keymap-profile","aria-label":m("agentKeymaps.settingsProfileLabel"),value:U,onChange:E=>T(E.target.value),children:fg.map(E=>u.jsx("option",{value:E,children:Zl[E].name},E))}),Zl[U].configHint&&u.jsx("p",{className:"text-tui-sm text-tui-faint",children:m("agentKeymaps.configHint",{path:Zl[U].configHint})})]}),u.jsx(hl,{label:m("agentKeymaps.agentGroup")}),u.jsx("div",{className:"max-h-72 overflow-y-auto border border-tui-border bg-tui-mantle",children:ue.map((E,te)=>{var qt,Jt;const J=E.custom?E.customLabel||"":m(`agentActions.${E.labelKey}`),Ke=((Jt=(qt=le.actions)==null?void 0:qt[E.id])==null?void 0:Jt.keys)??E.combo,De=je(U,E.id),Je=R[De]??Ke;let St="",Gt=null;try{Al(Je),St=bo(Je)}catch(lt){Gt=$(lt)}return u.jsxs("div",{"data-testid":`agent-setting-row-${E.id}`,className:"flex flex-wrap items-center gap-2 border-b border-tui-border-dim px-2 py-1.5 last:border-b-0",children:[u.jsx(Ra,{checked:!E.hidden,onChange:lt=>we(E.id,{hidden:!lt}),label:m("agentKeymaps.showAction"),className:"shrink-0 items-center gap-1 text-tui-sm"}),u.jsx(gp,{className:"shrink-0 font-bold",children:St||"—"}),u.jsxs("span",{className:"min-w-[5rem] flex-1 text-tui-sm text-tui-text",children:[J,!E.verified&&u.jsx("span",{className:"ml-1 text-tui-sm text-tui-faint",children:m("agentKeymaps.unverified")})]}),u.jsxs("label",{className:"sr-only",htmlFor:`agent-combo-${E.id}`,children:[m("agentKeymaps.shortcutLabel")," ",J]}),u.jsx(wn,{id:`agent-combo-${E.id}`,"aria-label":`${m("agentKeymaps.shortcutLabel")} ${J}`,value:Je,onChange:lt=>Z(E.id,lt.target.value),onBlur:()=>at(E.id),onKeyDown:lt=>{lt.key==="Enter"&<.currentTarget.blur()},placeholder:m("agentKeymaps.comboPlaceholder"),"aria-invalid":!!Gt,className:"w-36 shrink-0"}),u.jsx("span",{className:"text-tui-sm text-tui-faint",children:m("agentKeymaps.defaultCombo",{combo:bo(E.defaultCombo)})}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Oe,{variant:"ghost",brackets:!1,className:"px-1",onClick:()=>he(E),title:m("agentKeymaps.resetAction"),"aria-label":`${m("agentKeymaps.resetAction")} ${J}`,children:"↺"}),u.jsx(Oe,{variant:"ghost",brackets:!1,className:"px-1",disabled:te===0,onClick:()=>ke(te,"up"),title:m("agentKeymaps.moveUp"),"aria-label":`${m("agentKeymaps.moveUp")} ${J}`,children:"↑"}),u.jsx(Oe,{variant:"ghost",brackets:!1,className:"px-1",disabled:te===ue.length-1,onClick:()=>ke(te,"down"),title:m("agentKeymaps.moveDown"),"aria-label":`${m("agentKeymaps.moveDown")} ${J}`,children:"↓"}),E.custom&&u.jsx(Oe,{variant:"ghost",brackets:!1,className:"px-1 text-tui-bad",onClick:()=>He(E.id),title:m("agentKeymaps.removeCustom"),"aria-label":`${m("agentKeymaps.removeCustom")} ${J}`,children:Xe.cross})]}),Gt&&u.jsx("p",{className:"w-full pl-24 text-tui-sm text-tui-bad",role:"alert",children:m("agentKeymaps.invalidCombo",{error:Gt})})]},E.id)})}),u.jsx(hl,{label:m("agentKeymaps.addCustom")}),u.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[u.jsxs("label",{className:"min-w-[9rem] flex-1 space-y-1 text-tui-sm text-tui-faint",children:[u.jsx("span",{children:m("agentKeymaps.customLabel")}),u.jsx(wn,{value:z,onChange:E=>X(E.target.value)})]}),u.jsxs("label",{className:"min-w-[9rem] flex-1 space-y-1 text-tui-sm text-tui-faint",children:[u.jsx("span",{children:m("agentKeymaps.customCombo")}),u.jsx(wn,{value:I,onChange:E=>P(E.target.value)})]}),u.jsx(Oe,{onClick:V,disabled:!z.trim()||!I.trim(),children:m("agentKeymaps.addAction")})]}),I.trim()&&(()=>{try{return Al(I),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:bo(I)})}catch(E){const te=$(E);return u.jsx("p",{className:"text-tui-sm text-tui-bad",role:"alert",children:te})}})(),u.jsx(Oe,{variant:"ghost",onClick:L,children:m("agentKeymaps.restoreProfile")})]})]})},hS={success:"ok",warning:"warn",error:"bad",info:"accent"},mS={success:Xe.check,warning:Xe.warn,error:Xe.cross,info:"›"},pS=()=>{const{toasts:r,removeToast:a,t:i}=Nt();return r.length===0?null:u.jsx("div",{className:"pointer-events-none fixed right-2 top-12 z-50 flex w-[calc(100vw-16px)] max-w-sm flex-col gap-1","aria-live":"polite","aria-atomic":"true",children:r.map(o=>{const d=hS[o.type];return u.jsxs("div",{className:ne("pointer-events-auto flex items-start gap-2 border border-tui-border border-l-2 bg-tui-base px-2 py-1 text-tui",tl[d].edgeL),role:"alert",children:[u.jsx("span",{"aria-hidden":"true",className:ne("shrink-0 font-bold",tl[d].text),children:mS[o.type]}),u.jsx("div",{className:"min-w-0 flex-1 break-words leading-snug text-tui-text",children:o.message}),o.count>1&&u.jsxs("span",{className:"shrink-0 border border-tui-border-dim px-1 text-tui-sm text-tui-muted","aria-label":`×${o.count}`,children:["×",o.count]}),u.jsx("button",{type:"button",onClick:()=>a(o.id),className:"tui-focusable shrink-0 select-none px-0.5 text-tui-faint transition-colors hover:text-tui-bad","aria-label":i("common.dismissNotification"),children:u.jsx("span",{"aria-hidden":"true",children:Xe.cross})})]},o.id)})})},gS=[{status:"blocked",level:"warn"},{status:"done",level:"ok"},{status:"working",level:"accent"}],Zg=({className:r,compact:a=!1})=>{const{agentStatus:i,t:o}=Nt();if(!i)return null;const d=gS.map(({status:p,level:m})=>{var b;return{status:p,level:m,count:((b=i.counts)==null?void 0:b[p])??0}}).filter(p=>p.count>0),f=a?d.slice(0,1):d;return f.length===0?i.total===0?null:u.jsxs("span",{"data-testid":"agent-status-chip",className:ne("flex shrink-0 items-center gap-1 px-1 text-tui-muted",r),title:o("agents.title"),children:[u.jsx(jn,{level:"idle"}),u.jsx("span",{className:"text-tui-faint",children:o("agents.allIdle")})]}):u.jsx("span",{"data-testid":"agent-status-chip",className:ne("flex shrink-0 items-center gap-2 px-1",r),title:o("agents.title"),children:f.map(({status:p,level:m,count:b})=>u.jsxs("span",{className:"flex items-center gap-1 text-tui-muted",children:[u.jsx(jn,{level:m}),u.jsx("span",{className:"text-tui-text",children:b}),u.jsx("span",{className:"text-tui-faint",children:o(`agents.${p}`)})]},p))})},fd=({onAddProfile:r,mobile:a=!1,statusBar:i=!1})=>{const{profiles:o,activeProfileId:d,activeProfile:f,connectionState:p,switchProfile:m,renameProfile:b,removeProfile:v,t:y}=Nt(),[w,T]=x.useState(!1),[R,k]=x.useState(null),[K,z]=x.useState(""),X=x.useRef(null);x.useEffect(()=>{if(!w)return;const G=U=>{X.current&&!X.current.contains(U.target)&&T(!1)};return document.addEventListener("pointerdown",G),()=>document.removeEventListener("pointerdown",G)},[w]);const I=(G,U)=>{k(G),z(U)},P=G=>{const U=K.trim();U&&b(G,U),k(null)},ae=G=>{typeof window<"u"&&!window.confirm(y("profiles.removeConfirm"))||(v(G),k(null))},be=(f==null?void 0:f.displayName)||y("profiles.addHost"),se=p==="connected"?"ok":p==="connecting"||p==="reconnecting"?"warn":p==="error"?"bad":"idle";return u.jsxs("div",{ref:X,className:ne("relative min-w-0",a&&"w-full",i&&"flex-1"),children:[u.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":w,"aria-label":y("profiles.switcherLabel"),onClick:()=>T(G=>!G),className:ne("tui-focusable flex min-w-0 items-center gap-1.5 border border-transparent text-left text-tui-muted transition-colors hover:border-tui-border hover:text-tui-accent",i?"min-h-11 w-full max-w-none px-2":a?"min-h-11 w-full px-2":"min-h-[24px] max-w-[18rem] px-1"),children:[u.jsx(jn,{level:se}),u.jsx("span",{className:ne("truncate text-tui-text",i&&"min-w-0 flex-1"),children:be}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:w?Xe.chevronDown:Xe.chevronRight})]}),w&&u.jsxs("div",{role:"menu","aria-label":y("profiles.switcherLabel"),className:ne("absolute bottom-full left-0 z-[100] mb-1 max-h-[min(70vh,24rem)] overflow-y-auto border border-tui-border bg-tui-base p-1 shadow-lg",i?"w-80 max-w-[calc(100vw-1rem)]":a?"inset-x-0 bottom-auto top-full mt-1 mb-0 w-full":"w-80 max-w-[calc(100vw-1rem)]"),children:[u.jsx("div",{className:"border-b border-tui-border-dim px-2 py-1 text-tui-sm uppercase text-tui-faint",children:y("profiles.title")}),o.length===0?u.jsx("p",{className:"px-2 py-2 text-tui-sm text-tui-muted",children:y("profiles.empty")}):o.map(G=>{const U=G.id===d,le=G.id===R;return u.jsxs("div",{role:"none",className:"border-b border-tui-border-dim last:border-b-0",children:[u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs("button",{type:"button",role:"menuitem","aria-current":U?"true":void 0,onClick:()=>{m(G.id),T(!1)},className:ne("tui-focusable flex min-h-11 min-w-0 flex-1 items-center gap-2 px-2 text-left text-tui transition-colors hover:bg-tui-selection",U?"text-tui-accent":"text-tui-text"),children:[u.jsx("span",{"aria-hidden":"true",className:"w-3 shrink-0",children:U?Xe.cursor:""}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate font-bold",children:G.displayName}),u.jsx("span",{className:"block truncate text-tui-sm text-tui-faint",title:G.hostname||G.hostId,children:G.hostname||G.hostId||G.wsUrl})]}),U&&u.jsx("span",{className:"shrink-0 text-tui-sm text-tui-ok",children:y("profiles.current")})]}),u.jsx("button",{type:"button",role:"menuitem","aria-label":y("profiles.rename"),title:y("profiles.rename"),onClick:()=>I(G.id,G.displayName),className:"tui-focusable min-h-11 min-w-11 px-2 text-tui-muted hover:text-tui-accent",children:Xe.ellipsis})]}),le&&u.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[u.jsx("input",{autoFocus:!0,value:K,maxLength:64,onChange:ue=>z(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&P(G.id),ue.key==="Escape"&&k(null)},"aria-label":y("profiles.rename"),className:"tui-input min-w-0 flex-1 px-2 py-1 text-tui"}),u.jsx(Oe,{onClick:()=>P(G.id),variant:"primary",className:"min-h-11",children:y("common.save")}),u.jsx(Oe,{onClick:()=>ae(G.id),variant:"danger",className:"min-h-11",children:y("profiles.remove")})]})]},G.id)}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{T(!1),r()},className:"tui-focusable flex min-h-11 w-full items-center gap-2 px-2 text-left text-tui-accent hover:bg-tui-selection",children:[u.jsx("span",{"aria-hidden":"true",children:"+"}),u.jsx("span",{children:y("profiles.addHost")})]})]})]})},bS=({onAddProfile:r=()=>{}})=>{const{connectionState:a,role:i,hostId:o,assignedClientId:d,sharedWindowCount:f,settings:p,rttMs:m,t:b}=Nt(),v=Ro(a,b),y=a==="connected";return u.jsx(Ug,{left:u.jsxs(u.Fragment,{children:[u.jsx(fd,{onAddProfile:r}),u.jsx(bp,{items:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(jn,{level:v.level}),u.jsx("span",{className:"text-tui-text",children:v.label})]},"status"),y?u.jsx(ko,{tone:i==="controller"?"ok":"warn",children:b(i==="controller"?"role.sharedControl":"common.viewer")},"role"):null,y&&f>1?u.jsx("span",{className:"text-tui-muted",children:b("role.sharedWindows",{count:f})},"windows"):null,o?u.jsxs("span",{children:[u.jsxs("span",{className:"text-tui-faint",children:[b("common.host"),":"]})," ",u.jsx("span",{className:"text-tui-text",children:o})]},"host"):null,u.jsxs("span",{children:[u.jsx("span",{className:"text-tui-faint",children:b("header.clientIdLabel")})," ",u.jsx("span",{className:"text-tui-text",children:d||p.clientId})]},"client")]})]}),right:u.jsx(bp,{items:[y?u.jsx(Zg,{},"agents"):null,m!==null?u.jsxs("span",{className:"text-tui-muted",children:[b("header.latencyTitle"),": ",u.jsxs("span",{className:"text-tui-text",children:[m,"ms"]})]},"rtt"):null,u.jsx("span",{className:"hidden text-tui-faint sm:inline",children:b("header.tagline")},"mode")]})})},yS=[[/\biPhone\b/i,"iPhone"],[/\biPad\b/i,"iPad"],[/\biPod\b/i,"iPod"],[/\bAndroid\b/i,"Android"],[/\bCrOS\b/i,"ChromeOS"],[/\bWindows NT\b/i,"Windows"],[/\bMac OS X\b|\bMacintosh\b/i,"macOS"],[/\bLinux\b/i,"Linux"]],vS=[[/\bEdgA?\/|\bEdge\//i,"Edge"],[/\bOPR\/|\bOpera\//i,"Opera"],[/\bSamsungBrowser\//i,"Samsung Internet"],[/\bFirefox\/|\bFxiOS\//i,"Firefox"],[/\bCriOS\//i,"Chrome"],[/\bChrome\//i,"Chrome"],[/\bSafari\//i,"Safari"]];function Bp(r,a){for(const[i,o]of r)if(i.test(a))return o;return null}function hd(r){const a=typeof r=="string"?r.trim():"";if(!a)return{label:"",raw:""};const i=Bp(yS,a),o=Bp(vS,a);return i&&o?{label:`${i} · ${o}`,raw:a}:i?{label:i,raw:a}:o?{label:o,raw:a}:{label:a.length>32?`${a.slice(0,32)}…`:a,raw:a}}function Hp(r){if(r===0)return"0 B";const a=1024,i=["B","KB","MB","GB"],o=Math.floor(Math.log(r)/Math.log(a));return`${(r/Math.pow(a,o)).toFixed(1)} ${i[o]}`}const xS=({clients:r})=>{const{t:a}=Nt(),i=[{key:"id",header:a("admin.colClientId"),render:o=>u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(jn,{level:"ok"}),u.jsx("span",{className:"font-bold text-tui-text",children:o.id})]})},{key:"role",header:a("admin.colRole"),width:12,render:o=>{const d=o.role==="controller";return u.jsx(ko,{tone:d?"ok":"warn",children:a(d?"common.controller":"common.viewer")})}},{key:"device",header:a("admin.colDevice"),render:o=>{const d=hd(o.userAgent);return d.label?u.jsx("span",{className:"text-tui-muted",title:d.raw,children:d.label}):u.jsx("span",{className:"text-tui-faint",children:a("admin.unknownDevice")})}},{key:"ip",header:a("admin.colIp"),render:o=>u.jsx("span",{className:"text-tui-muted",children:o.ip||"127.0.0.1"})},{key:"connectedAt",header:a("admin.colConnectedAt"),render:o=>u.jsx("span",{className:"text-tui-muted",children:o.connectedAt?new Date(o.connectedAt).toLocaleTimeString():a("admin.startedRecently")})},{key:"traffic",header:a("admin.colTraffic"),align:"right",render:o=>u.jsxs("span",{className:"whitespace-nowrap",children:[u.jsx("span",{className:"text-tui-accent",children:Hp(o.bytesReceived||0)}),u.jsx("span",{"aria-hidden":"true",className:"mx-1 text-tui-faint",children:"/"}),u.jsx("span",{className:"text-tui-ok",children:Hp(o.bytesSent||0)})]})}];return u.jsx(fn,{title:a("admin.connectedClientsTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(cd,{columns:i,items:r,rowKey:o=>o.id,empty:a("admin.noClients")})})},Kp={online:"ok",busy:"ok",reconnecting:"warn",offline:"idle"};function wS(r=[],a=[]){const i=new Map;for(const f of a){if(!(f!=null&&f.hostId))continue;const p=i.get(f.hostId);p?p.push(f):i.set(f.hostId,[f])}const o=r.map(f=>{const p=i.get(f.id)||[];return{id:f.id,hostname:f.hostname||f.id,status:f.status||"online",connectedDeviceCount:f.connectedDeviceCount??0,pairedDeviceCount:f.pairedDeviceCount??p.length,devices:p,fromRosterOnly:!1}}),d=new Set(o.map(f=>f.id));for(const[f,p]of i)d.has(f)||o.push({id:f,hostname:f,status:"offline",connectedDeviceCount:0,pairedDeviceCount:p.length,devices:p,fromRosterOnly:!0});return o.sort((f,p)=>f.fromRosterOnly!==p.fromRosterOnly?f.fromRosterOnly?1:-1:f.hostname.localeCompare(p.hostname))}const SS=({hosts:r,devices:a})=>{const{t:i}=Nt(),o=wS(r,a),d={online:i("admin.hostStatusOnline"),busy:i("admin.hostStatusBusy"),reconnecting:i("admin.hostStatusReconnecting"),offline:i("admin.hostStatusOffline")};return u.jsx(fn,{title:i("admin.hostsTitle",{count:o.length}),bodyClassName:"space-y-2",children:o.length===0?u.jsx("p",{className:"px-1 py-2 text-tui text-tui-faint",children:i("admin.noHosts")}):o.map(f=>u.jsxs("div",{className:"border border-tui-border-dim bg-tui-mantle",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b border-tui-border-dim px-2 py-1",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-tui",children:[u.jsx(jn,{level:Kp[f.status]}),u.jsx("span",{className:"truncate font-bold text-tui-text",children:f.hostname}),f.hostname!==f.id?u.jsx("code",{className:"truncate text-tui-sm text-tui-faint",children:f.id}):null]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-3 text-tui-sm",children:[u.jsx(ko,{tone:Kp[f.status],children:d[f.status]}),u.jsx("span",{className:"text-tui-accent",children:i("admin.hostConnectedDevices",{count:f.connectedDeviceCount})}),u.jsx("span",{className:"text-tui-muted",children:i("admin.hostPairedDevices",{count:f.pairedDeviceCount})})]})]}),f.devices.length>0?u.jsx("ul",{className:"divide-y divide-tui-border-dim",children:f.devices.map(p=>{const m=hd(p.userAgent);return u.jsxs("li",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5 px-2 py-0.5 text-tui",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:"·"}),u.jsx("span",{className:"truncate text-tui-text",title:m.raw,children:m.label||i("admin.unknownDevice")}),u.jsx("code",{className:"truncate text-tui-sm text-tui-muted",children:p.deviceId}),u.jsx("span",{className:"ml-auto shrink-0 text-tui-sm text-tui-faint",children:p.lastIp||"—"})]},p.deviceId)})}):u.jsx("p",{className:"px-2 py-1 text-tui-sm text-tui-faint",children:f.pairedDeviceCount>0?i("admin.hostRosterOperatorOnly"):i("admin.noDevices")})]},f.id))})},CS=({ptys:r})=>{const{t:a}=Nt(),i=[{key:"id",header:a("admin.colPtyId"),render:o=>u.jsx("span",{className:"font-bold text-tui-accent",children:o.id})},{key:"pid",header:a("admin.colPid"),width:9,render:o=>u.jsx("span",{className:"text-tui-muted",children:o.pid})},{key:"command",header:a("admin.colCommand"),render:o=>u.jsx("code",{className:"border border-tui-border-dim bg-tui-mantle px-1 text-tui-text",children:o.command})},{key:"grid",header:a("admin.colGrid"),width:11,render:o=>u.jsxs("span",{className:"whitespace-nowrap text-tui-muted",children:[o.cols,u.jsx("span",{"aria-hidden":"true",className:"mx-0.5 text-tui-faint",children:"×"}),o.rows]})},{key:"cwd",header:a("admin.colCwd"),className:"max-w-xs truncate",render:o=>u.jsx("span",{className:"text-tui-muted",children:o.cwd||"~"})},{key:"viewers",header:a("admin.colViewers"),align:"right",width:9,render:o=>u.jsx("span",{className:"font-bold text-tui-ok",children:o.activeClients})}];return u.jsx(fn,{title:a("admin.activePtysTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(cd,{columns:i,items:r,rowKey:o=>o.id,empty:a("admin.noPtys")})})};function TS(r){if(!r)return"—";const a=new Date(r);return Number.isNaN(a.getTime())?"—":a.toLocaleString()}const AS=({devices:r,onRevoke:a})=>{const{t:i}=Nt(),[o,d]=x.useState(null),[f,p]=x.useState(null),m=async v=>{if(o!==v){d(v);return}p(v);try{await a(v)}finally{p(null),d(null)}},b=[{key:"device",header:i("admin.colDevice"),render:v=>{const y=hd(v.userAgent);return u.jsx("span",{className:"text-tui-text",title:y.raw,children:y.label||i("admin.unknownDevice")})}},{key:"deviceId",header:i("admin.colDeviceId"),render:v=>u.jsx("span",{className:"text-tui-muted",children:v.deviceId})},{key:"ip",header:i("admin.colIp"),render:v=>u.jsx("span",{className:"text-tui-muted",children:v.lastIp||"—"})},{key:"lastSeen",header:i("admin.colLastSeen"),render:v=>u.jsx("span",{className:"whitespace-nowrap text-tui-muted",children:TS(v.lastSeenAt)})},{key:"actions",header:i("admin.colActions"),align:"right",render:v=>{const y=o===v.deviceId,w=f===v.deviceId;return u.jsx(Oe,{variant:"danger",disabled:w,onClick:()=>void m(v.deviceId),onBlur:()=>d(T=>T===v.deviceId?null:T),"aria-label":i("admin.revokeDevice"),className:y?"bg-tui-bad text-tui-crust":void 0,children:w?u.jsx(Vi,{}):i(y?"admin.revokeConfirm":"admin.revokeDevice")})}}];return u.jsx(fn,{title:i("admin.pairedDevicesTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(cd,{columns:b,items:r,rowKey:v=>v.deviceId,empty:i("admin.noDevices")})})};function Qg(r){if(typeof window>"u"||!r||r.startsWith("/"))return"";try{const a=new URL(r.replace(/^ws/,"http")),i=a.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"");return a.origin===window.location.origin&&!i?"":`${a.origin}${i}`}catch{return""}}function Kr(r,a){const i=Qg(r);return i?`${i}${a.startsWith("/")?a:`/${a}`}`:a}const NS=({onBackToTerminal:r,onOpenPairing:a})=>{var Me,E,te,J,Ke,De,Je,St,Gt,qt,Jt,lt,ht,Ft;const{settings:i,updateSettings:o,addToast:d,t:f}=Nt(),p=Qg(i.wsUrl)||(typeof window<"u"?window.location.origin:"local"),m=((Me=i.adminTokens)==null?void 0:Me[p])||(p===(typeof window<"u"?window.location.origin:"local")?i.adminToken:"")||"",[b,v]=x.useState(null),[y,w]=x.useState(null),[T,R]=x.useState(!1),[k,K]=x.useState(!0),[z,X]=x.useState(null),[I,P]=x.useState(!1),[ae,be]=x.useState(3e3),[se,G]=x.useState(null),[U,le]=x.useState("overview"),[ue,ve]=x.useState(!1),[we,he]=x.useState(m),[ke,He]=x.useState(!!m),L="node bin/service.js pair";x.useEffect(()=>{he(m),He(!!m),v(null),w(null),R(!1)},[p]);const V=()=>{ni(L).then(de=>{if(de==="failed"){d("error",f("clipboard.copyFailed"));return}ve(!0),d("success",f("toasts.commandCopied")),setTimeout(()=>ve(!1),2e3)})};x.useEffect(()=>{let de=!0;K(!0);async function Ue(){try{const Ge=await fetch(Kr(i.wsUrl,"/api/info"),{headers:{Accept:"application/json"}});if(Ge.ok){const it=await Ge.json();de&&(w(it),R(!0));return}}catch{}if(de){const Ge=!!(i.wsUrl&&!i.wsUrl.startsWith("/")&&!i.wsUrl.includes("localhost")&&!i.wsUrl.includes("127.0.0.1")&&typeof window<"u"&&!i.wsUrl.startsWith(window.location.origin.replace("http","ws")));w({ok:!0,version:"0.1.0",protocol:1,relayMode:Ge?"remote":"local",adminConfigured:!1,adminPath:"/admin",adminStatusPath:"/api/admin/status"}),R(!0)}}return Ue(),()=>{de=!1}},[i.wsUrl,p]);const $=(y==null?void 0:y.relayMode)==="remote",je=()=>{if(y!=null&&y.adminPath)return y.publicUrl?`${y.publicUrl.replace(/\/$/,"")}${y.adminPath}`:Kr(i.wsUrl,y.adminPath);if(b!=null&&b.remoteAdminUrl)return b.remoteAdminUrl;if(i.wsUrl)try{return Kr(i.wsUrl,"/admin")}catch{}return"/admin"},Z=x.useCallback(async()=>{if(T){if($){if(!ke&&!we){v(null),K(!1),X(null),P(!1);return}try{K(!0);const de=Kr(i.wsUrl,(y==null?void 0:y.adminStatusPath)||"/api/admin/status"),Ge=await fetch(de,{headers:{Accept:"application/json","X-Relay-Admin-Token":we}});if(Ge.status===401||Ge.status===403){P(!0),X(f("admin.relayAdminAuthError")),v(null);return}if(!Ge.ok)throw new Error(`HTTP ${Ge.status}: ${Ge.statusText}`);const it=await Ge.json();v(it),X(null),P(!1),G(new Date)}catch(de){console.warn("GET /api/admin/status request failed:",de),P(!1),X(de instanceof Error?de.message:"Failed to fetch remote admin status"),v(null)}finally{K(!1)}return}try{K(!0);const de={Accept:"application/json"};i.token&&(de.Authorization=`Bearer ${i.token}`);const Ue=await fetch("/api/status",{headers:de});if(Ue.status===401||Ue.status===403){P(!0),X(`Authentication failed (HTTP ${Ue.status}): Access denied. Please configure an authorized token or pair with the host.`),v(null);return}if(!Ue.ok)throw new Error(`HTTP ${Ue.status}: ${Ue.statusText}`);const Ge=await Ue.json();v(Ge),X(null),P(!1),G(new Date)}catch(de){console.warn("GET /api/status request failed:",de),P(!1),X(de instanceof Error?de.message:"Failed to fetch status"),v(null)}finally{K(!1)}}},[T,$,ke,we,y,i.token,i.wsUrl,p,f]),at=x.useCallback(async de=>{try{if(!(await fetch(Kr(i.wsUrl,`/api/admin/devices/${encodeURIComponent(de)}`),{method:"DELETE",headers:{Accept:"application/json","X-Relay-Admin-Token":we}})).ok){X(f("admin.revokeFailed"));return}await Z()}catch{X(f("admin.revokeFailed"))}},[we,Z,i.wsUrl,f]);x.useEffect(()=>{if(!T)return;Z();let de=null;const Ue=()=>{ae>0&&!de&&(de=setInterval(()=>{document.visibilityState==="visible"&&Z()},ae))},Ge=()=>{de&&(clearInterval(de),de=null)},it=()=>{document.visibilityState==="visible"?(Z(),Ue()):Ge()};return Ue(),document.addEventListener("visibilitychange",it),()=>{Ge(),document.removeEventListener("visibilitychange",it)}},[T,Z,ae]);const Qe=de=>{de.preventDefault();const Ue=we.trim();o({adminToken:Ue,adminTokens:{...i.adminTokens||{},[p]:Ue}}),He(!!Ue)},_e=de=>{const Ue=Math.max(0,Math.floor(de)),Ge=Math.floor(Ue/86400),it=Math.floor(Ue%86400/3600),hn=Math.floor(Ue%3600/60),mn=Ue%60,Et=(nl,pn)=>`${nl}${f(`admin.unit${pn}`)}`;return Ge>0?[Et(Ge,"Day"),Et(it,"Hour"),Et(hn,"Minute")].join(" "):it>0?[Et(it,"Hour"),Et(hn,"Minute"),Et(mn,"Second")].join(" "):[Et(hn,"Minute"),Et(mn,"Second")].join(" ")},Ze=de=>{if(!de||de===0)return"0 B";const Ue=1024,Ge=["B","KB","MB","GB"],it=Math.floor(Math.log(de)/Math.log(Ue));return`${(de/Math.pow(Ue,it)).toFixed(1)} ${Ge[it]}`},ze=()=>{const de=je();window.open(de,"_blank","noopener,noreferrer")},Se=b?b.activeUserCount??((E=b.clients)==null?void 0:E.length)??0:0,zt=b?[{id:"overview",label:f("admin.tabOverview"),index:1},{id:"clients",label:f("admin.tabClients",{count:((te=b.clients)==null?void 0:te.length)||0}),index:2},{id:"ptys",label:f("admin.tabPtys",{count:((J=b.ptys)==null?void 0:J.length)||0}),index:3},...b.devices?[{id:"devices",label:f("admin.tabDevices",{count:b.devices.length}),index:4}]:[]]:[],ft=zt.map(de=>de.id);x.useEffect(()=>{const de=Ue=>{if(Ue.ctrlKey||Ue.altKey||Ue.metaKey)return;const Ge=Ue.target;if(Ge instanceof HTMLInputElement||Ge instanceof HTMLTextAreaElement||Ge instanceof HTMLSelectElement||Ge!=null&&Ge.isContentEditable||document.querySelector('[role="dialog"]'))return;if(Ue.key==="Escape"&&r){Ue.preventDefault(),r();return}if(Ue.key.toLowerCase()==="r"){Ue.preventDefault(),Z();return}const it=Number.parseInt(Ue.key,10)-1;Number.isInteger(it)&&it>=0&&it<ft.length&&(Ue.preventDefault(),le(ft[it]))};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[Z,ft.join("|")]);const B=u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r&&u.jsx(Oe,{variant:"ghost",onClick:r,title:f("admin.returnToTerminal"),"aria-label":f("admin.returnToTerminal"),glyph:Xe.arrowLeft,brackets:!1,className:"shrink-0",children:u.jsx("span",{className:"sr-only",children:f("admin.returnToTerminal")})}),u.jsxs("span",{className:"hidden text-tui-sm text-tui-accent sm:inline",children:["v",(y==null?void 0:y.version)||(b==null?void 0:b.version)||"0.1.0"]}),u.jsx(ko,{tone:$?"alt":"ok",children:f($?"admin.modeRemote":"admin.localWorkstationBadge")}),u.jsxs("label",{className:"hidden items-center gap-1.5 text-tui-sm text-tui-muted md:flex",children:[u.jsx("span",{children:f("admin.autoRefresh")}),u.jsxs(Pr,{value:ae,onChange:de=>be(Number(de.target.value)),"aria-label":f("admin.autoRefresh"),className:"w-auto",children:[u.jsx("option",{value:0,children:f("admin.paused")}),u.jsx("option",{value:1e3,children:"1s"}),u.jsx("option",{value:3e3,children:"3s"}),u.jsx("option",{value:5e3,children:"5s"}),u.jsx("option",{value:1e4,children:"10s"})]})]}),u.jsx(Oe,{variant:"primary",onClick:Z,disabled:k,title:f("admin.refreshNow"),children:k?u.jsx(Vi,{}):f("admin.refreshNow")})]});return u.jsxs(S0,{name:f("admin.title"),tagline:f("admin.subtitle"),aside:B,tabs:zt,activeTabId:U,onSelectTab:de=>le(de),tabsAriaLabel:f("header.mainNavigationAria"),hints:[{keys:"1–4",action:f("admin.hintTabs")},{keys:"r",action:f("admin.hintRefresh")},...r?[{keys:"esc",action:f("admin.hintBack")}]:[]],footerAside:se?u.jsx("span",{className:"text-tui-faint",children:f("admin.updatedAt",{time:se.toLocaleTimeString()})}):null,bodyClassName:"space-y-3 pb-2",children:[!T&&u.jsx("div",{className:"flex items-center justify-center gap-2 border border-tui-border bg-tui-base px-3 py-8 text-tui text-tui-muted",children:u.jsx(Vi,{label:f("admin.loadingStatus")})}),T&&$&&!ke&&u.jsxs(fn,{title:f("admin.remoteRelayTitle"),aside:f("admin.remoteRelayBadge"),bodyClassName:"space-y-2",children:[u.jsx("p",{className:"text-tui leading-snug text-tui-muted",children:f("admin.remoteRelayNotice")}),u.jsxs("div",{className:"space-y-0.5 border border-tui-border-dim bg-tui-mantle px-2 py-1.5",children:[u.jsx(fl,{label:f("admin.remoteRelayEndpoint"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-accent",children:i.wsUrl})}),u.jsx(fl,{label:f("admin.remoteRelayAdminUrl"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-ok",children:je()})})]}),u.jsx(hl,{}),u.jsxs("div",{className:"flex flex-col items-start justify-between gap-2 sm:flex-row sm:items-center",children:[u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:f("admin.remoteRelayHelp")}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[u.jsx(Oe,{onClick:()=>He(!0),children:f("admin.relayAdminLoginBtn")}),u.jsx(Oe,{variant:"primary",onClick:ze,glyph:Xe.arrowRight,children:f("admin.openRemoteAdminBtn")})]})]})]}),T&&$&&ke&&!b&&u.jsxs(fn,{title:f("admin.relayAdminTitle"),bodyClassName:"space-y-2",children:[u.jsx(yo,{tone:(y==null?void 0:y.adminConfigured)===!1?"warn":"bad",children:(y==null?void 0:y.adminConfigured)===!1?f("admin.relayAdminNotConfigured"):f("admin.relayAdminAuthError")}),u.jsxs("form",{onSubmit:Qe,className:"space-y-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(xn,{htmlFor:"relay-admin-token",children:f("admin.relayAdminTokenLabel")}),u.jsx(wn,{id:"relay-admin-token",type:"password",value:we,onChange:de=>he(de.target.value),placeholder:f("admin.relayAdminTokenPlaceholder")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Oe,{variant:"primary",type:"submit",children:f("admin.relayAdminLoginBtn")}),u.jsx(Oe,{variant:"ghost",onClick:()=>He(!1),children:f("common.cancel")})]})]})]}),T&&!$&&I&&u.jsxs(fn,{title:f("admin.unauthorizedTitle"),tone:"bad",bodyClassName:"space-y-2",children:[u.jsx(yo,{tone:"bad",children:f("admin.unauthorizedDesc")}),u.jsxs("div",{className:"space-y-1.5 border border-tui-border-dim bg-tui-mantle px-2 py-1.5",children:[u.jsx("span",{className:"block text-tui-sm uppercase text-tui-muted",children:f("admin.pairingStepsTitle")}),u.jsxs("div",{className:"flex items-center gap-2 border border-tui-border bg-tui-crust px-2 py-1",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 select-none text-tui-ok",children:"$"}),u.jsx("code",{className:"min-w-0 flex-1 truncate text-tui-text",children:L}),u.jsx(Oe,{onClick:V,glyph:ue?Xe.check:"⧉",className:ne("shrink-0",ue&&"border-tui-ok text-tui-ok"),children:f(ue?"admin.copiedJson":"common.copy")})]}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:f("admin.pairingStepsHelp")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[a&&u.jsx(Oe,{variant:"primary",onClick:a,children:f("admin.enterPairCodeBtn")}),u.jsx(Oe,{onClick:Z,children:f("admin.retryFetchBtn")})]})]}),T&&z&&!I&&!(!$&&I)&&u.jsx(yo,{tone:"warn",action:u.jsx(Oe,{variant:"warn",onClick:Z,children:f("common.retry")}),children:f("admin.errorConnecting",{error:z})}),b&&u.jsxs(u.Fragment,{children:[U==="overview"&&u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-2",children:[u.jsxs(fn,{title:f("admin.accessPanel"),aside:_e(b.uptimeSeconds||0),bodyClassName:"space-y-0.5",children:[u.jsx(fl,{label:f("admin.connectedHosts"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(jn,{level:(Ke=b.hosts)!=null&&Ke.length?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:((De=b.hosts)==null?void 0:De.length)||0})]})}),u.jsx(fl,{label:f("admin.activeUsers"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(jn,{level:Se?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:Se}),u.jsx("span",{className:"text-tui-faint",children:f("admin.acrossWindows",{count:((Je=b.clients)==null?void 0:Je.length)||0})})]})}),u.jsxs(fl,{label:f("admin.activePtys"),labelWidth:14,children:[u.jsx("span",{className:"font-bold",children:((St=b.ptys)==null?void 0:St.length)||0}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.terminalShells")})]}),u.jsx(fl,{label:f("admin.uptime"),labelWidth:14,children:u.jsx("span",{className:"text-tui-muted",children:b.startTime?f("admin.startedAt",{time:new Date(b.startTime).toLocaleTimeString()}):f("admin.startedRecently")})})]}),u.jsxs(fn,{title:f("admin.throughput"),aside:f("admin.perSecond",{value:Ze(((Gt=b.throughput)==null?void 0:Gt.bytesOutPerSec)||0)}),bodyClassName:"space-y-0.5",children:[u.jsxs(fl,{label:f("admin.bytesInTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-accent",children:Ze(((qt=b.throughput)==null?void 0:qt.bytesIn)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.perSecond",{value:Ze(((Jt=b.throughput)==null?void 0:Jt.bytesInPerSec)||0)})})]}),u.jsxs(fl,{label:f("admin.bytesOutTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-ok",children:Ze(((lt=b.throughput)==null?void 0:lt.bytesOut)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.perSecond",{value:Ze(((ht=b.throughput)==null?void 0:ht.bytesOutPerSec)||0)})})]}),u.jsx(hl,{}),u.jsx(fl,{label:f("admin.frameRate"),labelWidth:13,children:u.jsx("span",{className:"font-bold",children:f("admin.framesPerSecond",{count:(((Ft=b.throughput)==null?void 0:Ft.framesOutPerSec)||0).toFixed(0)})})})]})]}),u.jsx(SS,{hosts:b.hosts||[],devices:b.devices})]}),U==="clients"&&u.jsx(xS,{clients:b.clients||[]}),U==="ptys"&&u.jsx(CS,{ptys:b.ptys||[]}),U==="devices"&&u.jsx(AS,{devices:b.devices||[],onRevoke:at})]})]})},ES=({compact:r=!1})=>{const{role:a,connectionState:i,sharedWindowCount:o,assignedClientId:d,t:f}=Nt();if(!(i==="connected"))return u.jsxs("div",{className:"inline-flex select-none items-center gap-1.5 text-tui uppercase text-tui-faint",role:"status","aria-label":f("terminal.offlineStatusAria"),children:[u.jsx(jn,{level:"idle"}),u.jsx("span",{children:f("common.offline")})]});const m=a==="controller",b=o>1,v=u.jsxs("div",{className:ne("inline-flex min-w-0 select-none items-center gap-1.5 text-tui uppercase",m?"text-tui-ok":"text-tui-warn"),role:"status","aria-label":f(m?"role.controllerMode":"role.viewerMode"),children:[u.jsx(jn,{level:m?"ok":"warn"}),u.jsx("span",{className:"truncate",children:f(m?"role.sharedControl":"role.viewerReadOnly")}),b?u.jsx("span",{className:"shrink-0 normal-case text-tui-muted",children:f("role.sharedWindows",{count:o})}):null]});return r?v:u.jsxs("div",{className:"flex w-full flex-col gap-1",children:[v,u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:f("role.sharedControlDesc")}),d?u.jsx(fl,{label:f("role.thisWindow"),labelWidth:9,className:"text-tui-sm",children:u.jsx("span",{className:"truncate text-tui-muted",children:d})}):null]})},Yr="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",Gr="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",kS="border-tui-accent bg-tui-selection text-tui-accent",qr=({active:r=!1})=>u.jsx("span",{"aria-hidden":"true",className:ne("shrink-0",r?"text-tui-accent":"text-tui-faint group-hover:text-tui-accent"),children:Xe.cursor}),RS=({onClose:r,onNavigateAdmin:a,showAdminEntry:i=!0,onOpenPairing:o,onOpenSettings:d,onAddProfile:f=()=>{}})=>{const{connectionState:p,stateDetail:m,rttMs:b,hostId:v,settings:y,updateSettings:w,connect:T,addToast:R,language:k,setLanguage:K,t:z}=Nt(),[X,I]=pl.useState(!1),P=Ro(p,z),ae=G=>()=>{var le;const U=document.activeElement;(le=U==null?void 0:U.blur)==null||le.call(U),G()},be=()=>{ni(y.clientId).then(G=>{if(G==="failed"){R("error",z("clipboard.copyFailed"));return}I(!0),R("info",z("toasts.clientIdCopied",{id:y.clientId})),setTimeout(()=>I(!1),2e3)})},se=()=>{const G=k==="zh"?"en":"zh";K(G),R("info",id(G,"toasts.switchedLanguage",{lang:G==="zh"?"简体中文":"English"}))};return u.jsxs("div",{className:"flex flex-col gap-3 px-3 pb-2 pt-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-tui-border pb-1.5",children:[u.jsx("h2",{className:"text-tui font-bold uppercase text-tui-accent",children:z("mobile.sessionControls")}),u.jsx(Oe,{variant:"ghost",onClick:r,"aria-label":z("mobile.closeSessionControls"),children:"esc"})]}),u.jsx(fn,{title:z("profiles.title"),tone:"accent",bodyClassName:"space-y-1",children:u.jsx(fd,{mobile:!0,onAddProfile:f})}),u.jsxs(fn,{title:z("common.status"),tone:P.level==="ok"?"ok":P.level==="bad"?"bad":"warn",bodyClassName:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2","aria-label":z("mobile.connectionStatusAria"),children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(jn,{level:P.level}),u.jsx("span",{className:"truncate text-tui uppercase text-tui-text",children:P.label}),p==="connected"&&b!==null&&u.jsxs("span",{className:"text-tui-sm text-tui-muted",children:[b,"ms"]})]}),P.actionLabel&&u.jsx(Oe,{variant:"primary",onClick:()=>T(),className:"shrink-0",children:P.actionLabel})]}),P.needsAttention&&m&&u.jsx("p",{className:"text-tui-sm leading-snug text-tui-muted",children:m}),v&&u.jsx(fl,{label:z("common.host"),labelWidth:9,children:v}),u.jsxs("button",{type:"button",onClick:be,className:"tui-focusable flex w-full items-baseline gap-2 text-left text-tui",title:z("header.copyClientIdTitle"),children:[u.jsx("span",{className:"shrink-0 text-tui-muted",style:{width:"9ch"},children:z("header.clientIdLabel")}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-text",children:y.clientId}),u.jsx("span",{"aria-hidden":"true",className:ne("shrink-0",X?"text-tui-ok":"text-tui-faint"),children:X?Xe.check:"⧉"})]})]}),u.jsx(fn,{title:z("mobile.inputControl"),tone:"accent","aria-label":z("mobile.terminalControlAria"),children:u.jsx(ES,{})}),u.jsxs(fn,{title:z("mobile.menu"),tone:"accent",bodyClassName:"flex flex-col gap-1",children:[u.jsxs("button",{type:"button",onClick:se,className:ne(Yr,Gr),"aria-label":z("header.languageToggleTitle"),children:[u.jsx(qr,{}),u.jsx("span",{className:"truncate",children:k==="zh"?"English":"中文"})]}),u.jsxs("button",{type:"button",onClick:ae(d),className:ne(Yr,Gr),"aria-label":z("mobile.settingsAria"),children:[u.jsx(qr,{}),u.jsx("span",{className:"truncate",children:z("common.settings")})]}),u.jsxs("button",{type:"button",onClick:ae(o),className:ne(Yr,Gr),"aria-label":z("mobile.pairingAria"),children:[u.jsx(qr,{}),u.jsx("span",{className:"truncate",children:z("common.pairing")})]}),i&&u.jsxs("button",{type:"button",onClick:ae(a),className:ne(Yr,Gr),"aria-label":z("mobile.adminAria"),children:[u.jsx(qr,{}),u.jsx("span",{className:"truncate",children:z("common.admin")})]}),u.jsxs("button",{type:"button",onClick:()=>w({toolbarVisible:!y.toolbarVisible}),className:ne(Yr,y.toolbarVisible?kS:Gr),"aria-label":z("mobile.keybarAria"),"aria-pressed":y.toolbarVisible,children:[u.jsx(qr,{active:y.toolbarVisible}),u.jsx("span",{className:"truncate",children:z("common.keyBar")}),u.jsx("span",{"aria-hidden":"true",className:"ml-auto shrink-0 text-tui-sm",children:y.toolbarVisible?"[x]":"[ ]"})]})]})]})},jS=({onAddProfile:r})=>{const{rttMs:a,t:i}=Nt();return u.jsxs("footer",{"data-testid":"mobile-status-bar",role:"status","aria-label":i("mobile.statusBarAria"),className:"absolute inset-x-0 bottom-0 z-40 flex h-11 shrink-0 items-center gap-2 border-t border-tui-border bg-tui-mantle px-1 text-tui-sm",children:[u.jsx(fd,{statusBar:!0,onAddProfile:r}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-border",children:"│"}),u.jsx(Zg,{compact:!0}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1 px-1 text-tui-muted",title:i("header.latencyTitle"),children:[u.jsx("span",{className:"text-tui-faint",children:"RTT"}),u.jsx("span",{className:ne(a===null?"text-tui-faint":"text-tui-text"),children:a===null?"—":`${a}ms`})]})]})},MS=({onNavigateAdmin:r,showAdminEntry:a=!0,onOpenPairing:i,onOpenSettings:o,onAddProfile:d=()=>{}})=>{const{connectionState:f,isController:p,t:m}=Nt(),[b,v]=x.useState(!1),y=x.useRef(null),w=x.useCallback(()=>v(!1),[]);x.useEffect(()=>{if(!b)return;const R=k=>{if(!(k.ctrlKey||k.altKey||k.metaKey)&&k.key==="Escape"){const K=k.target;K&&typeof K.closest=="function"&&!!K.closest("#terminal-container")||(k.stopPropagation(),k.preventDefault(),w())}};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[b,w]),x.useEffect(()=>{var R;b&&((R=y.current)==null||R.focus({preventScroll:!0}))},[b]);const T=Ro(f,m);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{"data-testid":"mobile-topbar",role:"toolbar","aria-label":m("mobile.sessionControls"),className:"pointer-events-none absolute inset-x-0 top-0 z-40 flex h-12 items-center justify-between gap-2 border-b border-tui-border bg-tui-mantle px-2 text-tui",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 text-tui-sm text-tui-muted",children:[u.jsx("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:"herdr"}),u.jsx(Dg,{className:"shrink-0"}),u.jsx(jn,{level:T.level}),u.jsx("span",{className:"truncate uppercase",children:T.label})]}),u.jsxs("button",{type:"button","data-testid":"mobile-chrome-trigger",onClick:()=>v(!0),"aria-label":m("mobile.sessionControls"),"aria-expanded":b,"aria-haspopup":"dialog",className:ne("tui-focusable pointer-events-auto flex h-9 shrink-0 select-none items-center gap-1.5 border px-2 text-tui uppercase transition-colors",T.needsAttention?"border-tui-warn text-tui-warn":p?"border-tui-border text-tui-muted":"border-tui-accent text-tui-accent"),children:[!p&&!T.needsAttention&&u.jsx("span",{className:"max-w-[8rem] truncate",children:m("common.viewer")}),u.jsx("span",{"aria-hidden":"true",className:"text-tui",children:Xe.chevronDown}),u.jsx("span",{"aria-hidden":"true",children:m("mobile.menu")})]})]}),b&&u.jsxs(u.Fragment,{children:[u.jsx("div",{"data-testid":"mobile-sheet-scrim",className:"absolute inset-0 z-40 bg-tui-crust/70",onClick:w,"aria-hidden":"true"}),u.jsx("div",{ref:y,"data-testid":"mobile-control-sheet",role:"dialog","aria-modal":"true","aria-label":m("mobile.sessionControls"),tabIndex:-1,className:"herdr-sheet absolute inset-x-0 bottom-0 z-50 max-h-[85%] overflow-y-auto border-t border-tui-border bg-tui-base pb-3 focus:outline-none",children:u.jsx(RS,{onClose:w,showAdminEntry:a,onNavigateAdmin:()=>{w(),r()},onOpenPairing:()=>{w(),i()},onOpenSettings:()=>{w(),o()},onAddProfile:()=>{w(),d()}})})]}),u.jsx(jS,{onAddProfile:d})]})},Pg="--app-height",Wg="--keyboard-inset",_S=80;function LS(){if(typeof window>"u")return{height:768,keyboardInset:0};const r=window.innerHeight||768,a=window.visualViewport;if(a&&typeof a.height=="number"&&a.height>0){const i=r-a.height-(a.offsetTop||0),o=i>=_S?Math.round(i):0;return{height:Math.round(a.height),keyboardInset:o}}return{height:r,keyboardInset:0}}function Yp(r,a=LS()){return r.style.setProperty(Pg,`${a.height}px`),r.style.setProperty(Wg,`${a.keyboardInset}px`),a}function zS(r=typeof document<"u"?document.documentElement:null){if(!r||typeof window>"u")return()=>{};let a=null;const i=()=>{a=null,Yp(r)},o=()=>{if(a===null){if(typeof requestAnimationFrame!="function"){i();return}a=requestAnimationFrame(i)}};Yp(r);const d=window.visualViewport;return d==null||d.addEventListener("resize",o),d==null||d.addEventListener("scroll",o),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),()=>{a!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(a),a=null),d==null||d.removeEventListener("resize",o),d==null||d.removeEventListener("scroll",o),window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o),r.style.removeProperty(Pg),r.style.removeProperty(Wg)}}const DS=900;function Gp(){if(typeof window>"u")return!1;const r=Gi();return r<nd?!0:r<=DS}function OS(){const[r,a]=x.useState(Gp);return x.useEffect(()=>{var d,f;const i=()=>{const p=Gp();a(m=>m===p?m:p)};i();let o=null;try{o=typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null}catch{o=null}return(d=o==null?void 0:o.addEventListener)==null||d.call(o,"change",i),window.addEventListener("resize",i),window.addEventListener("orientationchange",i),(f=window.visualViewport)==null||f.addEventListener("resize",i),()=>{var p,m;(p=o==null?void 0:o.removeEventListener)==null||p.call(o,"change",i),window.removeEventListener("resize",i),window.removeEventListener("orientationchange",i),(m=window.visualViewport)==null||m.removeEventListener("resize",i)}},[]),r}function US(r){const a=r.target;if(!a)return!1;if(a.id==="terminal-container"||a.id==="terminal-frame"||a.id==="terminal-surface"||a.classList.contains("xterm-helper-textarea")||a.classList.contains("xterm")||a.closest("#terminal-container")||a.closest(".xterm"))return!0;if(typeof document<"u"&&document.activeElement){const i=document.activeElement;if(i.id==="terminal-container"||i.classList.contains("xterm-helper-textarea")||i.closest("#terminal-container")||i.closest(".xterm"))return!0}return!1}function BS(r,a={}){if(typeof window>"u")return()=>{};const i=o=>{var d;o.ctrlKey||o.altKey||o.metaKey||o.key==="Escape"&&(a.isModalOpen||a.isSheetOpen)&&(US(o)||(o.preventDefault(),o.stopPropagation(),(d=r.onCloseModals)==null||d.call(r)))};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}}function HS(){const[r,a]=x.useState("terminal"),[i,o]=x.useState(!1),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[b,v]=x.useState(!1),{updateSettings:y,settings:w,connectionState:T,stateDetail:R,stateCode:k,lastPairedAt:K}=Nt();Tx();const z=OS();x.useEffect(()=>zS(),[]);const[X,I]=x.useState(!0);x.useEffect(()=>{let he=!1;return fetch("/api/info",{headers:{Accept:"application/json"}}).then(ke=>ke.ok?ke.json():null).then(ke=>{he||!ke||I(!ke.isRemoteRelay)}).catch(()=>{}),()=>{he=!0}},[]),x.useEffect(()=>{ug()},[]),x.useEffect(()=>{const he=i||p||b;if(he)return BS({onCloseModals:()=>{o(!1),m(!1),v(!1)}},{isModalOpen:he})},[i,p,b]),x.useEffect(()=>{const he=()=>{const ke=window.location.pathname,He=window.location.hash;a(ke==="/admin"||He==="#admin"?"admin":"terminal")};he(),window.addEventListener("popstate",he),window.addEventListener("hashchange",he);try{const ke=new URL(window.location.href),He=ke.searchParams.get("token"),L=ke.searchParams.get("pairCode"),V=ke.searchParams.get("ws")||ke.searchParams.get("wsUrl"),$={};He&&($.token=He),L&&($.pairCode=L.toUpperCase()),V&&($.wsUrl=V),Object.keys($).length>0&&y($);let je=!1;if(ke.searchParams.has("token")&&(ke.searchParams.delete("token"),je=!0),ke.searchParams.has("pairCode")&&(ke.searchParams.delete("pairCode"),je=!0),je){const Z=ke.searchParams.toString(),at=ke.pathname+(Z?`?${Z}`:"")+ke.hash;window.history.replaceState({},"",at)}}catch(ke){console.warn("Failed to parse URL query params:",ke)}return()=>{window.removeEventListener("popstate",he),window.removeEventListener("hashchange",he)}},[]);const P=(he=!1)=>{f(he),o(!0)},ae=()=>{o(!1),f(!1)},be=he=>{a(he),he==="admin"?window.history.pushState({},"","/admin"):window.history.pushState({},"","/")},se=!w.token&&!w.pairCode&&T!=="connected",G=T==="error"&&(["auth_required","unauthorized","device_revoked"].includes(k||"")||/auth|unauthor|forbidden|permission|token|pair/i.test(R||"")),U=se||G,[le,ue]=x.useState(!U);x.useEffect(()=>{U||ue(!0)},[U]),x.useEffect(()=>{K&&(o(!1),ue(!0),a("terminal"))},[K]);const ve=r==="terminal"&&!U,we=he=>({visibility:he?"visible":"hidden",opacity:he?1:0,pointerEvents:he?"auto":"none",zIndex:he?1:0});return u.jsxs("div",{"data-testid":"app-shell",style:z?{paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)",paddingLeft:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)"}:void 0,className:"flex h-full w-full select-none flex-col overflow-hidden bg-tui-crust font-mono text-tui text-tui-text",onContextMenu:he=>{he.preventDefault(),he.stopPropagation()},children:[!z&&u.jsx(T0,{currentView:r,onNavigate:be,showAdminEntry:X,onOpenPairing:()=>P(!1),onOpenSettings:()=>m(!0),onToggleVirtualKeyboard:()=>v(!b),isVirtualKeyboardOpen:b}),!z&&!U&&u.jsx(A0,{}),u.jsxs("div",{className:"flex-1 min-h-0 w-full overflow-hidden relative",children:[le&&u.jsxs("div",{"data-testid":"terminal-layer",className:`absolute ${z?"inset-x-0 top-12 bottom-11":"inset-0"} flex flex-col min-h-0 w-full overflow-hidden`,style:we(ve),"aria-hidden":!ve,children:[u.jsx(lS,{isActive:ve}),!z&&u.jsx(cS,{isOpen:b,onClose:()=>v(!1)}),u.jsx(sS,{compact:z})]}),r==="terminal"&&U&&u.jsx("div",{"data-testid":"onboarding-layer",className:"absolute inset-0 flex flex-col min-h-0 w-full overflow-hidden z-10",children:u.jsx(aS,{onPairedSuccess:()=>{}})}),r==="admin"&&u.jsx("div",{"data-testid":"admin-layer",className:"absolute inset-0 flex flex-col min-h-0 w-full overflow-hidden z-20",children:u.jsx(NS,{onBackToTerminal:()=>be("terminal"),onOpenPairing:()=>P(!1)})}),z&&ve&&u.jsx(MS,{onNavigateAdmin:()=>be("admin"),showAdminEntry:X,onOpenPairing:()=>P(!1),onOpenSettings:()=>m(!0),onAddProfile:()=>P(!0)})]}),!z&&r!=="admin"&&u.jsx(bS,{onAddProfile:()=>P(!0)}),u.jsx(dS,{isOpen:i,isAddMode:d,onClose:ae}),u.jsx(fS,{isOpen:p,onClose:()=>m(!1)}),u.jsx(pS,{})]})}function KS(){return u.jsx(fx,{children:u.jsx(HS,{})})}const Jg=document.getElementById("root");if(!Jg)throw new Error("Root element not found");fv.createRoot(Jg).render(u.jsx(pl.StrictMode,{children:u.jsx(KS,{})}));
|