herdr-remote-relay 0.2.6 → 0.2.7

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,39 @@
1
+ var Mg=Object.defineProperty;var _g=(r,s,o)=>s in r?Mg(r,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[s]=o;var Je=(r,s,o)=>_g(r,typeof s!="symbol"?s+"":s,o);import{r as Mh,g as _h,a as Dh}from"./vendor-react-CYSfZuHu.js";import{r as Dg,a as kg,b as Og,c as Lg}from"./vendor-xterm-Bldps5fz.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))c(m);new MutationObserver(m=>{for(const f of m)if(f.type==="childList")for(const b of f.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&c(b)}).observe(document,{childList:!0,subtree:!0});function o(m){const f={};return m.integrity&&(f.integrity=m.integrity),m.referrerPolicy&&(f.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?f.credentials="include":m.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(m){if(m.ep)return;m.ep=!0;const f=o(m);fetch(m.href,f)}})();var jc={exports:{}},Mi={};/**
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 Wm;function Ug(){if(Wm)return Mi;Wm=1;var r=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function o(c,m,f){var b=null;if(f!==void 0&&(b=""+f),m.key!==void 0&&(b=""+m.key),"key"in m){f={};for(var p in m)p!=="key"&&(f[p]=m[p])}else f=m;return m=f.ref,{$$typeof:r,type:c,key:b,ref:m!==void 0?m:null,props:f}}return Mi.Fragment=s,Mi.jsx=o,Mi.jsxs=o,Mi}var Im;function Bg(){return Im||(Im=1,jc.exports=Ug()),jc.exports}var u=Bg(),w=Mh();const tl=_h(w);var Rc={exports:{}},_i={},zc={exports:{}},Mc={};/**
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 $m;function Hg(){return $m||($m=1,(function(r){function s(E,L){var Z=E.length;E.push(L);e:for(;0<Z;){var pe=Z-1>>>1,k=E[pe];if(0<m(k,L))E[pe]=L,E[Z]=k,Z=pe;else break e}}function o(E){return E.length===0?null:E[0]}function c(E){if(E.length===0)return null;var L=E[0],Z=E.pop();if(Z!==L){E[0]=Z;e:for(var pe=0,k=E.length,We=k>>>1;pe<We;){var Ue=2*(pe+1)-1,xe=E[Ue],Se=Ue+1,De=E[Se];if(0>m(xe,Z))Se<k&&0>m(De,xe)?(E[pe]=De,E[Se]=Z,pe=Se):(E[pe]=xe,E[Ue]=Z,pe=Ue);else if(Se<k&&0>m(De,Z))E[pe]=De,E[Se]=Z,pe=Se;else break e}}return L}function m(E,L){var Z=E.sortIndex-L.sortIndex;return Z!==0?Z:E.id-L.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 b=Date,p=b.now();r.unstable_now=function(){return b.now()-p}}var x=[],T=[],v=1,j=null,G=3,U=!1,X=!1,V=!1,Y=!1,Q=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function ce(E){for(var L=o(T);L!==null;){if(L.callback===null)c(T);else if(L.startTime<=E)c(T),L.sortIndex=L.expirationTime,s(x,L);else break;L=o(T)}}function he(E){if(V=!1,ce(E),!X)if(o(x)!==null)X=!0,K||(K=!0,me());else{var L=o(T);L!==null&&ve(he,L.startTime-E)}}var K=!1,H=-1,z=5,re=-1;function _e(){return Y?!0:!(r.unstable_now()-re<z)}function Te(){if(Y=!1,K){var E=r.unstable_now();re=E;var L=!0;try{e:{X=!1,V&&(V=!1,ee(H),H=-1),U=!0;var Z=G;try{t:{for(ce(E),j=o(x);j!==null&&!(j.expirationTime>E&&_e());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,G=j.priorityLevel;var k=pe(j.expirationTime<=E);if(E=r.unstable_now(),typeof k=="function"){j.callback=k,ce(E),L=!0;break t}j===o(x)&&c(x),ce(E)}else c(x);j=o(x)}if(j!==null)L=!0;else{var We=o(T);We!==null&&ve(he,We.startTime-E),L=!1}}break e}finally{j=null,G=Z,U=!1}L=void 0}}finally{L?me():K=!1}}}var me;if(typeof W=="function")me=function(){W(Te)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,se=q.port2;q.port1.onmessage=Te,me=function(){se.postMessage(null)}}else me=function(){Q(Te,0)};function ve(E,L){H=Q(function(){E(r.unstable_now())},L)}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(E){E.callback=null},r.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<E?Math.floor(1e3/E):5},r.unstable_getCurrentPriorityLevel=function(){return G},r.unstable_next=function(E){switch(G){case 1:case 2:case 3:var L=3;break;default:L=G}var Z=G;G=L;try{return E()}finally{G=Z}},r.unstable_requestPaint=function(){Y=!0},r.unstable_runWithPriority=function(E,L){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var Z=G;G=E;try{return L()}finally{G=Z}},r.unstable_scheduleCallback=function(E,L,Z){var pe=r.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?pe+Z:pe):Z=pe,E){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=Z+k,E={id:v++,callback:L,priorityLevel:E,startTime:Z,expirationTime:k,sortIndex:-1},Z>pe?(E.sortIndex=Z,s(T,E),o(x)===null&&E===o(T)&&(V?(ee(H),H=-1):V=!0,ve(he,Z-pe))):(E.sortIndex=k,s(x,E),X||U||(X=!0,K||(K=!0,me()))),E},r.unstable_shouldYield=_e,r.unstable_wrapCallback=function(E){var L=G;return function(){var Z=G;G=L;try{return E.apply(this,arguments)}finally{G=Z}}}})(Mc)),Mc}var Pm;function Kg(){return Pm||(Pm=1,zc.exports=Hg()),zc.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 eh;function Yg(){if(eh)return _i;eh=1;var r=Kg(),s=Mh(),o=Dh();function c(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 m(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 b(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 p(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 x(e){if(f(e)!==e)throw Error(c(188))}function T(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return x(a),e;if(i===l)return x(a),t;i=i.sibling}throw Error(c(188))}if(n.return!==l.return)n=a,l=i;else{for(var d=!1,h=a.child;h;){if(h===n){d=!0,n=a,l=i;break}if(h===l){d=!0,l=a,n=i;break}h=h.sibling}if(!d){for(h=i.child;h;){if(h===n){d=!0,n=i,l=a;break}if(h===l){d=!0,l=i,n=a;break}h=h.sibling}if(!d)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,G=Symbol.for("react.element"),U=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),V=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),W=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),Te=Symbol.iterator;function me(e){return e===null||typeof e!="object"?null:(e=Te&&e[Te]||e["@@iterator"],typeof e=="function"?e:null)}var q=Symbol.for("react.client.reference");function se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case V:return"Fragment";case Q:return"Profiler";case Y:return"StrictMode";case he:return"Suspense";case K:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case W:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case ce:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:se(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ve=Array.isArray,E=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},pe=[],k=-1;function We(e){return{current:e}}function Ue(e){0>k||(e.current=pe[k],pe[k]=null,k--)}function xe(e,t){k++,pe[k]=e.current,e.current=t}var Se=We(null),De=We(null),Ee=We(null),ct=We(null);function ft(e,t){switch(xe(Ee,t),xe(De,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vm(t),e=xm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ue(Se),xe(Se,e)}function Ye(){Ue(Se),Ue(De),Ue(Ee)}function Ut(e){e.memoizedState!==null&&xe(ct,e);var t=Se.current,n=xm(t,e.type);t!==n&&(xe(De,e),xe(Se,n))}function ne(e){De.current===e&&(Ue(Se),Ue(De)),ct.current===e&&(Ue(ct),Ei._currentValue=Z)}var ye,Be;function ke(e){if(ye===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||"",Be=-1<n.stack.indexOf(`
26
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
27
+ `+ye+e+Be}var kt=!1;function ie(e,t){if(!e||kt)return"";kt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(R){var A=R}Reflect.construct(e,[],O)}else{try{O.call()}catch(R){A=R}e.call(O.prototype)}}else{try{throw Error()}catch(R){A=R}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(R){if(R&&A&&typeof R.stack=="string")return[R.stack,A.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),d=i[0],h=i[1];if(d&&h){var g=d.split(`
28
+ `),N=h.split(`
29
+ `);for(a=l=0;l<g.length&&!g[l].includes("DetermineComponentFrameRoot");)l++;for(;a<N.length&&!N[a].includes("DetermineComponentFrameRoot");)a++;if(l===g.length||a===N.length)for(l=g.length-1,a=N.length-1;1<=l&&0<=a&&g[l]!==N[a];)a--;for(;1<=l&&0<=a;l--,a--)if(g[l]!==N[a]){if(l!==1||a!==1)do if(l--,a--,0>a||g[l]!==N[a]){var M=`
30
+ `+g[l].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=l&&0<=a);break}}}finally{kt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ke(n):""}function Ot(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 ie(e.type,!1);case 11:return ie(e.type.render,!1);case 1:return ie(e.type,!0);case 31:return ke("Activity");default:return""}}function Yt(e){try{var t="",n=null;do t+=Ot(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
31
+ Error generating stack: `+l.message+`
32
+ `+l.stack}}var Bt=Object.prototype.hasOwnProperty,Ie=r.unstable_scheduleCallback,ln=r.unstable_cancelCallback,an=r.unstable_shouldYield,mt=r.unstable_requestPaint,I=r.unstable_now,we=r.unstable_getCurrentPriorityLevel,fe=r.unstable_ImmediatePriority,Ge=r.unstable_UserBlockingPriority,Jt=r.unstable_NormalPriority,kn=r.unstable_LowPriority,Ct=r.unstable_IdlePriority,jn=r.log,xn=r.unstable_setDisableYieldValue,ae=null,be=null;function $e(e){if(typeof jn=="function"&&xn(e),be&&typeof be.setStrictMode=="function")try{be.setStrictMode(ae,e)}catch{}}var ot=Math.clz32?Math.clz32:ge,Sn=Math.log,wn=Math.LN2;function ge(e){return e>>>=0,e===0?32:31-(Sn(e)/wn|0)|0}var Nt=256,jt=262144,_=4194304;function B(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 te(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var h=l&134217727;return h!==0?(l=h&~i,l!==0?a=B(l):(d&=h,d!==0?a=B(d):n||(n=h&~e,n!==0&&(a=B(n))))):(h=l&~i,h!==0?a=B(h):d!==0?a=B(d):n||(n=l&~e,n!==0&&(a=B(n)))),a===0?0:t!==0&&t!==a&&(t&i)===0&&(i=a&-a,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:a}function Ne(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function je(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 qe(){var e=_;return _<<=1,(_&62914560)===0&&(_=4194304),e}function Qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function St(e,t,n,l,a,i){var d=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 h=e.entanglements,g=e.expirationTimes,N=e.hiddenUpdates;for(n=d&~n;0<n;){var M=31-ot(n),O=1<<M;h[M]=0,g[M]=-1;var A=N[M];if(A!==null)for(N[M]=null,M=0;M<A.length;M++){var R=A[M];R!==null&&(R.lane&=-536870913)}n&=~O}l!==0&&zl(e,l,0),i!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function zl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-ot(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function nl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-ot(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function Tn(e,t){var n=t&-t;return n=(n&42)!==0?1:Ya(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ya(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 yo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function lu(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:qm(e.type))}function au(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var ll=Math.random().toString(36).slice(2),Rt="__reactFiber$"+ll,Gt="__reactProps$"+ll,Il="__reactContainer$"+ll,vo="__reactEvents$"+ll,xp="__reactListeners$"+ll,Sp="__reactHandles$"+ll,iu="__reactResources$"+ll,Ga="__reactMarker$"+ll;function xo(e){delete e[Rt],delete e[Gt],delete e[vo],delete e[xp],delete e[Sp]}function $l(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Il]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Em(e);e!==null;){if(n=e[Rt])return n;e=Em(e)}return t}e=n,n=e.parentNode}return null}function Pl(e){if(e=e[Rt]||e[Il]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ea(e){var t=e[iu];return t||(t=e[iu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[Ga]=!0}var su=new Set,ou={};function Ml(e,t){ta(e,t),ta(e+"Capture",t)}function ta(e,t){for(ou[e]=t,e=0;e<t.length;e++)su.add(t[e])}var wp=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]*$"),ru={},cu={};function Tp(e){return Bt.call(cu,e)?!0:Bt.call(ru,e)?!1:wp.test(e)?cu[e]=!0:(ru[e]=!0,!1)}function Vi(e,t,n){if(Tp(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 Zi(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 On(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 sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cp(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 a=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(d){n=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function So(e){if(!e._valueTracker){var t=uu(e)?"checked":"value";e._valueTracker=Cp(e,t,""+e[t])}}function du(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=uu(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Qi(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 Np=/[\n"\\]/g;function on(e){return e.replace(Np,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wo(e,t,n,l,a,i,d,h){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+sn(t)):e.value!==""+sn(t)&&(e.value=""+sn(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?To(e,d,sn(t)):n!=null?To(e,d,sn(n)):l!=null&&e.removeAttribute("value"),a==null&&i!=null&&(e.defaultChecked=!!i),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+sn(h):e.removeAttribute("name")}function fu(e,t,n,l,a,i,d,h){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){So(e);return}n=n!=null?""+sn(n):"",t=t!=null?""+sn(t):n,h||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=h?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),So(e)}function To(e,t,n){t==="number"&&Qi(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function na(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+sn(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function mu(e,t,n){if(t!=null&&(t=""+sn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+sn(n):""}function hu(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(ve(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=sn(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),So(e)}function la(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ap=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 pu(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||Ap.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function bu(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(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 a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&pu(e,a,l)}else for(var i in t)t.hasOwnProperty(i)&&pu(e,i,t[i])}function Co(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 Ep=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"]]),jp=/^[\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 Fi(e){return jp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ln(){}var No=null;function Ao(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var aa=null,ia=null;function gu(e){var t=Pl(e);if(t&&(e=t.stateNode)){var n=e[Gt]||null;e:switch(e=t.stateNode,t.type){case"input":if(wo(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="'+on(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[Gt]||null;if(!a)throw Error(c(90));wo(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&du(l)}break e;case"textarea":mu(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&na(e,!!n.multiple,t,!1)}}}var Eo=!1;function yu(e,t,n){if(Eo)return e(t,n);Eo=!0;try{var l=e(t);return l}finally{if(Eo=!1,(aa!==null||ia!==null)&&(Os(),aa&&(t=aa,e=ia,ia=aa=null,gu(t),e)))for(t=0;t<e.length;t++)gu(e[t])}}function Xa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[Gt]||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(c(231,t,typeof n));return n}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jo=!1;if(Un)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){jo=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{jo=!1}var al=null,Ro=null,Ji=null;function vu(){if(Ji)return Ji;var e,t=Ro,n=t.length,l,a="value"in al?al.value:al.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===a[i-l];l++);return Ji=a.slice(e,1<l?1-l:void 0)}function Wi(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 Ii(){return!0}function xu(){return!1}function qt(e){function t(n,l,a,i,d){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(n=e[h],this[h]=n?n(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ii:xu,this.isPropagationStopped=xu,this}return j(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=Ii)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ii)},persist:function(){},isPersistent:Ii}),t}var _l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=qt(_l),Za=j({},_l,{view:0,detail:0}),Rp=qt(Za),zo,Mo,Qa,Pi=j({},Za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Do,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!==Qa&&(Qa&&e.type==="mousemove"?(zo=e.screenX-Qa.screenX,Mo=e.screenY-Qa.screenY):Mo=zo=0,Qa=e),zo)},movementY:function(e){return"movementY"in e?e.movementY:Mo}}),Su=qt(Pi),zp=j({},Pi,{dataTransfer:0}),Mp=qt(zp),_p=j({},Za,{relatedTarget:0}),_o=qt(_p),Dp=j({},_l,{animationName:0,elapsedTime:0,pseudoElement:0}),kp=qt(Dp),Op=j({},_l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lp=qt(Op),Up=j({},_l,{data:0}),wu=qt(Up),Bp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hp={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"},Kp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kp[e])?!!t[e]:!1}function Do(){return Yp}var Gp=j({},Za,{key:function(e){if(e.key){var t=Bp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Do,charCode:function(e){return e.type==="keypress"?Wi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qp=qt(Gp),Xp=j({},Pi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tu=qt(Xp),Vp=j({},Za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Do}),Zp=qt(Vp),Qp=j({},_l,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fp=qt(Qp),Jp=j({},Pi,{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}),Wp=qt(Jp),Ip=j({},_l,{newState:0,oldState:0}),$p=qt(Ip),Pp=[9,13,27,32],ko=Un&&"CompositionEvent"in window,Fa=null;Un&&"documentMode"in document&&(Fa=document.documentMode);var eb=Un&&"TextEvent"in window&&!Fa,Cu=Un&&(!ko||Fa&&8<Fa&&11>=Fa),Nu=" ",Au=!1;function Eu(e,t){switch(e){case"keyup":return Pp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ju(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sa=!1;function tb(e,t){switch(e){case"compositionend":return ju(t);case"keypress":return t.which!==32?null:(Au=!0,Nu);case"textInput":return e=t.data,e===Nu&&Au?null:e;default:return null}}function nb(e,t){if(sa)return e==="compositionend"||!ko&&Eu(e,t)?(e=vu(),Ji=Ro=al=null,sa=!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 Cu&&t.locale!=="ko"?null:t.data;default:return null}}var lb={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 Ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lb[e.type]:t==="textarea"}function zu(e,t,n,l){aa?ia?ia.push(l):ia=[l]:aa=l,t=Gs(t,"onChange"),0<t.length&&(n=new $i("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Ja=null,Wa=null;function ab(e){mm(e,0)}function es(e){var t=qa(e);if(du(t))return e}function Mu(e,t){if(e==="change")return t}var _u=!1;if(Un){var Oo;if(Un){var Lo="oninput"in document;if(!Lo){var Du=document.createElement("div");Du.setAttribute("oninput","return;"),Lo=typeof Du.oninput=="function"}Oo=Lo}else Oo=!1;_u=Oo&&(!document.documentMode||9<document.documentMode)}function ku(){Ja&&(Ja.detachEvent("onpropertychange",Ou),Wa=Ja=null)}function Ou(e){if(e.propertyName==="value"&&es(Wa)){var t=[];zu(t,Wa,e,Ao(e)),yu(ab,t)}}function ib(e,t,n){e==="focusin"?(ku(),Ja=t,Wa=n,Ja.attachEvent("onpropertychange",Ou)):e==="focusout"&&ku()}function sb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return es(Wa)}function ob(e,t){if(e==="click")return es(t)}function rb(e,t){if(e==="input"||e==="change")return es(t)}function cb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:cb;function Ia(e,t){if(Wt(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 a=n[l];if(!Bt.call(t,a)||!Wt(e[a],t[a]))return!1}return!0}function Lu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Uu(e,t){var n=Lu(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=Lu(n)}}function Bu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qi(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=Qi(e.document)}return t}function Uo(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 ub=Un&&"documentMode"in document&&11>=document.documentMode,oa=null,Bo=null,$a=null,Ho=!1;function Ku(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ho||oa==null||oa!==Qi(l)||(l=oa,"selectionStart"in l&&Uo(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}),$a&&Ia($a,l)||($a=l,l=Gs(Bo,"onSelect"),0<l.length&&(t=new $i("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=oa)))}function Dl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ra={animationend:Dl("Animation","AnimationEnd"),animationiteration:Dl("Animation","AnimationIteration"),animationstart:Dl("Animation","AnimationStart"),transitionrun:Dl("Transition","TransitionRun"),transitionstart:Dl("Transition","TransitionStart"),transitioncancel:Dl("Transition","TransitionCancel"),transitionend:Dl("Transition","TransitionEnd")},Ko={},Yu={};Un&&(Yu=document.createElement("div").style,"AnimationEvent"in window||(delete ra.animationend.animation,delete ra.animationiteration.animation,delete ra.animationstart.animation),"TransitionEvent"in window||delete ra.transitionend.transition);function kl(e){if(Ko[e])return Ko[e];if(!ra[e])return e;var t=ra[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yu)return Ko[e]=t[n];return e}var Gu=kl("animationend"),qu=kl("animationiteration"),Xu=kl("animationstart"),db=kl("transitionrun"),fb=kl("transitionstart"),mb=kl("transitioncancel"),Vu=kl("transitionend"),Zu=new Map,Yo="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(" ");Yo.push("scrollEnd");function Cn(e,t){Zu.set(e,t),Ml(t,[e])}var ts=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)},rn=[],ca=0,Go=0;function ns(){for(var e=ca,t=Go=ca=0;t<e;){var n=rn[t];rn[t++]=null;var l=rn[t];rn[t++]=null;var a=rn[t];rn[t++]=null;var i=rn[t];if(rn[t++]=null,l!==null&&a!==null){var d=l.pending;d===null?a.next=a:(a.next=d.next,d.next=a),l.pending=a}i!==0&&Qu(n,a,i)}}function ls(e,t,n,l){rn[ca++]=e,rn[ca++]=t,rn[ca++]=n,rn[ca++]=l,Go|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function qo(e,t,n,l){return ls(e,t,n,l),as(e)}function Ol(e,t){return ls(e,null,null,t),as(e)}function Qu(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,i=e.return;i!==null;)i.childLanes|=n,l=i.alternate,l!==null&&(l.childLanes|=n),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(a=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,a&&t!==null&&(a=31-ot(n),e=i.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),i):null}function as(e){if(50<xi)throw xi=0,$r=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ua={};function hb(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 It(e,t,n,l){return new hb(e,t,n,l)}function Xo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bn(e,t){var n=e.alternate;return n===null?(n=It(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 Fu(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 is(e,t,n,l,a,i){var d=0;if(l=e,typeof e=="function")Xo(e)&&(d=1);else if(typeof e=="string")d=vg(e,n,Se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case re:return e=It(31,n,t,a),e.elementType=re,e.lanes=i,e;case V:return Ll(n.children,a,i,t);case Y:d=8,a|=24;break;case Q:return e=It(12,n,t,a|2),e.elementType=Q,e.lanes=i,e;case he:return e=It(13,n,t,a),e.elementType=he,e.lanes=i,e;case K:return e=It(19,n,t,a),e.elementType=K,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:d=10;break e;case ee:d=9;break e;case ce:d=11;break e;case H:d=14;break e;case z:d=16,l=null;break e}d=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=It(d,n,t,a),t.elementType=e,t.type=l,t.lanes=i,t}function Ll(e,t,n,l){return e=It(7,e,l,t),e.lanes=n,e}function Vo(e,t,n){return e=It(6,e,null,t),e.lanes=n,e}function Ju(e){var t=It(18,null,null,0);return t.stateNode=e,t}function Zo(e,t,n){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wu=new WeakMap;function cn(e,t){if(typeof e=="object"&&e!==null){var n=Wu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Yt(t)},Wu.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var da=[],fa=0,ss=null,Pa=0,un=[],dn=0,il=null,Rn=1,zn="";function Hn(e,t){da[fa++]=Pa,da[fa++]=ss,ss=e,Pa=t}function Iu(e,t,n){un[dn++]=Rn,un[dn++]=zn,un[dn++]=il,il=e;var l=Rn;e=zn;var a=32-ot(l)-1;l&=~(1<<a),n+=1;var i=32-ot(t)+a;if(30<i){var d=a-a%5;i=(l&(1<<d)-1).toString(32),l>>=d,a-=d,Rn=1<<32-ot(t)+a|n<<a|l,zn=i+e}else Rn=1<<i|n<<a|l,zn=e}function Qo(e){e.return!==null&&(Hn(e,1),Iu(e,1,0))}function Fo(e){for(;e===ss;)ss=da[--fa],da[fa]=null,Pa=da[--fa],da[fa]=null;for(;e===il;)il=un[--dn],un[dn]=null,zn=un[--dn],un[dn]=null,Rn=un[--dn],un[dn]=null}function $u(e,t){un[dn++]=Rn,un[dn++]=zn,un[dn++]=il,Rn=t.id,zn=t.overflow,il=e}var zt=null,it=null,He=!1,sl=null,fn=!1,Jo=Error(c(519));function ol(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ei(cn(t,e)),Jo}function Pu(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Rt]=e,t[Gt]=l,n){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(n=0;n<wi.length;n++)Me(wi[n],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),fu(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),hu(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||gm(t.textContent,n)?(l.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),l.onScroll!=null&&Me("scroll",t),l.onScrollEnd!=null&&Me("scrollend",t),l.onClick!=null&&(t.onclick=Ln),t=!0):t=!1,t||ol(e,!0)}function ed(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:fn=!1;return;case 27:case 3:fn=!0;return;default:zt=zt.return}}function ma(e){if(e!==zt)return!1;if(!He)return ed(e),He=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||mc(e.type,e.memoizedProps)),n=!n),n&&it&&ol(e),ed(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));it=Am(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));it=Am(e)}else t===27?(t=it,Sl(e.type)?(e=yc,yc=null,it=e):it=t):it=zt?hn(e.stateNode.nextSibling):null;return!0}function Ul(){it=zt=null,He=!1}function Wo(){var e=sl;return e!==null&&(Qt===null?Qt=e:Qt.push.apply(Qt,e),sl=null),e}function ei(e){sl===null?sl=[e]:sl.push(e)}var Io=We(null),Bl=null,Kn=null;function rl(e,t,n){xe(Io,t._currentValue),t._currentValue=n}function Yn(e){e._currentValue=Io.current,Ue(Io)}function $o(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 Po(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var i=a.dependencies;if(i!==null){var d=a.child;i=i.firstContext;e:for(;i!==null;){var h=i;i=a;for(var g=0;g<t.length;g++)if(h.context===t[g]){i.lanes|=n,h=i.alternate,h!==null&&(h.lanes|=n),$o(i.return,n,e),l||(d=null);break e}i=h.next}}else if(a.tag===18){if(d=a.return,d===null)throw Error(c(341));d.lanes|=n,i=d.alternate,i!==null&&(i.lanes|=n),$o(d,n,e),d=null}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===e){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}}function ha(e,t,n,l){e=null;for(var a=t,i=!1;a!==null;){if(!i){if((a.flags&524288)!==0)i=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var d=a.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var h=a.type;Wt(a.pendingProps.value,d.value)||(e!==null?e.push(h):e=[h])}}else if(a===ct.current){if(d=a.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ei):e=[Ei])}a=a.return}e!==null&&Po(t,e,n,l),t.flags|=262144}function os(e){for(e=e.firstContext;e!==null;){if(!Wt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hl(e){Bl=e,Kn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Mt(e){return td(Bl,e)}function rs(e,t){return Bl===null&&Hl(e),td(e,t)}function td(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Kn===null){if(e===null)throw Error(c(308));Kn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Kn=Kn.next=t;return n}var pb=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()})}},bb=r.unstable_scheduleCallback,gb=r.unstable_NormalPriority,gt={$$typeof:W,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function er(){return{controller:new pb,data:new Map,refCount:0}}function ti(e){e.refCount--,e.refCount===0&&bb(gb,function(){e.controller.abort()})}var ni=null,tr=0,pa=0,ba=null;function yb(e,t){if(ni===null){var n=ni=[];tr=0,pa=ac(),ba={status:"pending",value:void 0,then:function(l){n.push(l)}}}return tr++,t.then(nd,nd),t}function nd(){if(--tr===0&&ni!==null){ba!==null&&(ba.status="fulfilled");var e=ni;ni=null,pa=0,ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function vb(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var ld=E.S;E.S=function(e,t){Yf=I(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yb(e,t),ld!==null&&ld(e,t)};var Kl=We(null);function nr(){var e=Kl.current;return e!==null?e:at.pooledCache}function cs(e,t){t===null?xe(Kl,Kl.current):xe(Kl,t.pool)}function ad(){var e=nr();return e===null?null:{parent:gt._currentValue,pool:e}}var ga=Error(c(460)),lr=Error(c(474)),us=Error(c(542)),ds={then:function(){}};function id(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sd(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ln,Ln),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rd(e),e;default:if(typeof t.status=="string")t.then(Ln,Ln);else{if(e=at,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rd(e),e}throw Gl=t,ga}}function Yl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Gl=n,ga):n}}var Gl=null;function od(){if(Gl===null)throw Error(c(459));var e=Gl;return Gl=null,e}function rd(e){if(e===ga||e===us)throw Error(c(483))}var ya=null,li=0;function fs(e){var t=li;return li+=1,ya===null&&(ya=[]),sd(ya,e,t)}function ai(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ms(e,t){throw t.$$typeof===G?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cd(e){function t(S,y){if(e){var C=S.deletions;C===null?(S.deletions=[y],S.flags|=16):C.push(y)}}function n(S,y){if(!e)return null;for(;y!==null;)t(S,y),y=y.sibling;return null}function l(S){for(var y=new Map;S!==null;)S.key!==null?y.set(S.key,S):y.set(S.index,S),S=S.sibling;return y}function a(S,y){return S=Bn(S,y),S.index=0,S.sibling=null,S}function i(S,y,C){return S.index=C,e?(C=S.alternate,C!==null?(C=C.index,C<y?(S.flags|=67108866,y):C):(S.flags|=67108866,y)):(S.flags|=1048576,y)}function d(S){return e&&S.alternate===null&&(S.flags|=67108866),S}function h(S,y,C,D){return y===null||y.tag!==6?(y=Vo(C,S.mode,D),y.return=S,y):(y=a(y,C),y.return=S,y)}function g(S,y,C,D){var oe=C.type;return oe===V?M(S,y,C.props.children,D,C.key):y!==null&&(y.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===z&&Yl(oe)===y.type)?(y=a(y,C.props),ai(y,C),y.return=S,y):(y=is(C.type,C.key,C.props,null,S.mode,D),ai(y,C),y.return=S,y)}function N(S,y,C,D){return y===null||y.tag!==4||y.stateNode.containerInfo!==C.containerInfo||y.stateNode.implementation!==C.implementation?(y=Zo(C,S.mode,D),y.return=S,y):(y=a(y,C.children||[]),y.return=S,y)}function M(S,y,C,D,oe){return y===null||y.tag!==7?(y=Ll(C,S.mode,D,oe),y.return=S,y):(y=a(y,C),y.return=S,y)}function O(S,y,C){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Vo(""+y,S.mode,C),y.return=S,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case U:return C=is(y.type,y.key,y.props,null,S.mode,C),ai(C,y),C.return=S,C;case X:return y=Zo(y,S.mode,C),y.return=S,y;case z:return y=Yl(y),O(S,y,C)}if(ve(y)||me(y))return y=Ll(y,S.mode,C,null),y.return=S,y;if(typeof y.then=="function")return O(S,fs(y),C);if(y.$$typeof===W)return O(S,rs(S,y),C);ms(S,y)}return null}function A(S,y,C,D){var oe=y!==null?y.key:null;if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return oe!==null?null:h(S,y,""+C,D);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case U:return C.key===oe?g(S,y,C,D):null;case X:return C.key===oe?N(S,y,C,D):null;case z:return C=Yl(C),A(S,y,C,D)}if(ve(C)||me(C))return oe!==null?null:M(S,y,C,D,null);if(typeof C.then=="function")return A(S,y,fs(C),D);if(C.$$typeof===W)return A(S,y,rs(S,C),D);ms(S,C)}return null}function R(S,y,C,D,oe){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return S=S.get(C)||null,h(y,S,""+D,oe);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case U:return S=S.get(D.key===null?C:D.key)||null,g(y,S,D,oe);case X:return S=S.get(D.key===null?C:D.key)||null,N(y,S,D,oe);case z:return D=Yl(D),R(S,y,C,D,oe)}if(ve(D)||me(D))return S=S.get(C)||null,M(y,S,D,oe,null);if(typeof D.then=="function")return R(S,y,C,fs(D),oe);if(D.$$typeof===W)return R(S,y,C,rs(y,D),oe);ms(y,D)}return null}function P(S,y,C,D){for(var oe=null,Ve=null,le=y,Ae=y=0,Le=null;le!==null&&Ae<C.length;Ae++){le.index>Ae?(Le=le,le=null):Le=le.sibling;var Ze=A(S,le,C[Ae],D);if(Ze===null){le===null&&(le=Le);break}e&&le&&Ze.alternate===null&&t(S,le),y=i(Ze,y,Ae),Ve===null?oe=Ze:Ve.sibling=Ze,Ve=Ze,le=Le}if(Ae===C.length)return n(S,le),He&&Hn(S,Ae),oe;if(le===null){for(;Ae<C.length;Ae++)le=O(S,C[Ae],D),le!==null&&(y=i(le,y,Ae),Ve===null?oe=le:Ve.sibling=le,Ve=le);return He&&Hn(S,Ae),oe}for(le=l(le);Ae<C.length;Ae++)Le=R(le,S,Ae,C[Ae],D),Le!==null&&(e&&Le.alternate!==null&&le.delete(Le.key===null?Ae:Le.key),y=i(Le,y,Ae),Ve===null?oe=Le:Ve.sibling=Le,Ve=Le);return e&&le.forEach(function(Al){return t(S,Al)}),He&&Hn(S,Ae),oe}function ue(S,y,C,D){if(C==null)throw Error(c(151));for(var oe=null,Ve=null,le=y,Ae=y=0,Le=null,Ze=C.next();le!==null&&!Ze.done;Ae++,Ze=C.next()){le.index>Ae?(Le=le,le=null):Le=le.sibling;var Al=A(S,le,Ze.value,D);if(Al===null){le===null&&(le=Le);break}e&&le&&Al.alternate===null&&t(S,le),y=i(Al,y,Ae),Ve===null?oe=Al:Ve.sibling=Al,Ve=Al,le=Le}if(Ze.done)return n(S,le),He&&Hn(S,Ae),oe;if(le===null){for(;!Ze.done;Ae++,Ze=C.next())Ze=O(S,Ze.value,D),Ze!==null&&(y=i(Ze,y,Ae),Ve===null?oe=Ze:Ve.sibling=Ze,Ve=Ze);return He&&Hn(S,Ae),oe}for(le=l(le);!Ze.done;Ae++,Ze=C.next())Ze=R(le,S,Ae,Ze.value,D),Ze!==null&&(e&&Ze.alternate!==null&&le.delete(Ze.key===null?Ae:Ze.key),y=i(Ze,y,Ae),Ve===null?oe=Ze:Ve.sibling=Ze,Ve=Ze);return e&&le.forEach(function(zg){return t(S,zg)}),He&&Hn(S,Ae),oe}function lt(S,y,C,D){if(typeof C=="object"&&C!==null&&C.type===V&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case U:e:{for(var oe=C.key;y!==null;){if(y.key===oe){if(oe=C.type,oe===V){if(y.tag===7){n(S,y.sibling),D=a(y,C.props.children),D.return=S,S=D;break e}}else if(y.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===z&&Yl(oe)===y.type){n(S,y.sibling),D=a(y,C.props),ai(D,C),D.return=S,S=D;break e}n(S,y);break}else t(S,y);y=y.sibling}C.type===V?(D=Ll(C.props.children,S.mode,D,C.key),D.return=S,S=D):(D=is(C.type,C.key,C.props,null,S.mode,D),ai(D,C),D.return=S,S=D)}return d(S);case X:e:{for(oe=C.key;y!==null;){if(y.key===oe)if(y.tag===4&&y.stateNode.containerInfo===C.containerInfo&&y.stateNode.implementation===C.implementation){n(S,y.sibling),D=a(y,C.children||[]),D.return=S,S=D;break e}else{n(S,y);break}else t(S,y);y=y.sibling}D=Zo(C,S.mode,D),D.return=S,S=D}return d(S);case z:return C=Yl(C),lt(S,y,C,D)}if(ve(C))return P(S,y,C,D);if(me(C)){if(oe=me(C),typeof oe!="function")throw Error(c(150));return C=oe.call(C),ue(S,y,C,D)}if(typeof C.then=="function")return lt(S,y,fs(C),D);if(C.$$typeof===W)return lt(S,y,rs(S,C),D);ms(S,C)}return typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint"?(C=""+C,y!==null&&y.tag===6?(n(S,y.sibling),D=a(y,C),D.return=S,S=D):(n(S,y),D=Vo(C,S.mode,D),D.return=S,S=D),d(S)):n(S,y)}return function(S,y,C,D){try{li=0;var oe=lt(S,y,C,D);return ya=null,oe}catch(le){if(le===ga||le===us)throw le;var Ve=It(29,le,null,S.mode);return Ve.lanes=D,Ve.return=S,Ve}finally{}}}var ql=cd(!0),ud=cd(!1),cl=!1;function ar(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ir(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 ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function dl(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Fe&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=as(e),Qu(e,null,n),t}return ls(e,l,t,n),as(e)}function ii(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,nl(e,n)}}function sr(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?a=i=d:i=i.next=d,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 or=!1;function si(){if(or){var e=ba;if(e!==null)throw e}}function oi(e,t,n,l){or=!1;var a=e.updateQueue;cl=!1;var i=a.firstBaseUpdate,d=a.lastBaseUpdate,h=a.shared.pending;if(h!==null){a.shared.pending=null;var g=h,N=g.next;g.next=null,d===null?i=N:d.next=N,d=g;var M=e.alternate;M!==null&&(M=M.updateQueue,h=M.lastBaseUpdate,h!==d&&(h===null?M.firstBaseUpdate=N:h.next=N,M.lastBaseUpdate=g))}if(i!==null){var O=a.baseState;d=0,M=N=g=null,h=i;do{var A=h.lane&-536870913,R=A!==h.lane;if(R?(Oe&A)===A:(l&A)===A){A!==0&&A===pa&&(or=!0),M!==null&&(M=M.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var P=e,ue=h;A=t;var lt=n;switch(ue.tag){case 1:if(P=ue.payload,typeof P=="function"){O=P.call(lt,O,A);break e}O=P;break e;case 3:P.flags=P.flags&-65537|128;case 0:if(P=ue.payload,A=typeof P=="function"?P.call(lt,O,A):P,A==null)break e;O=j({},O,A);break e;case 2:cl=!0}}A=h.callback,A!==null&&(e.flags|=64,R&&(e.flags|=8192),R=a.callbacks,R===null?a.callbacks=[A]:R.push(A))}else R={lane:A,tag:h.tag,payload:h.payload,callback:h.callback,next:null},M===null?(N=M=R,g=O):M=M.next=R,d|=A;if(h=h.next,h===null){if(h=a.shared.pending,h===null)break;R=h,h=R.next,R.next=null,a.lastBaseUpdate=R,a.shared.pending=null}}while(!0);M===null&&(g=O),a.baseState=g,a.firstBaseUpdate=N,a.lastBaseUpdate=M,i===null&&(a.shared.lanes=0),bl|=d,e.lanes=d,e.memoizedState=O}}function dd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function fd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)dd(n[e],t)}var va=We(null),hs=We(0);function md(e,t){e=Wn,xe(hs,e),xe(va,t),Wn=e|t.baseLanes}function rr(){xe(hs,Wn),xe(va,va.current)}function cr(){Wn=hs.current,Ue(va),Ue(hs)}var $t=We(null),mn=null;function fl(e){var t=e.alternate;xe(ht,ht.current&1),xe($t,e),mn===null&&(t===null||va.current!==null||t.memoizedState!==null)&&(mn=e)}function ur(e){xe(ht,ht.current),xe($t,e),mn===null&&(mn=e)}function hd(e){e.tag===22?(xe(ht,ht.current),xe($t,e),mn===null&&(mn=e)):ml()}function ml(){xe(ht,ht.current),xe($t,$t.current)}function Pt(e){Ue($t),mn===e&&(mn=null),Ue(ht)}var ht=We(0);function ps(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||bc(n)||gc(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 Gn=0,Ce=null,tt=null,yt=null,bs=!1,xa=!1,Xl=!1,gs=0,ri=0,Sa=null,xb=0;function ut(){throw Error(c(321))}function dr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wt(e[n],t[n]))return!1;return!0}function fr(e,t,n,l,a,i){return Gn=i,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Id:Er,Xl=!1,i=n(l,a),Xl=!1,xa&&(i=bd(t,n,l,a)),pd(e),i}function pd(e){E.H=di;var t=tt!==null&&tt.next!==null;if(Gn=0,yt=tt=Ce=null,bs=!1,ri=0,Sa=null,t)throw Error(c(300));e===null||vt||(e=e.dependencies,e!==null&&os(e)&&(vt=!0))}function bd(e,t,n,l){Ce=e;var a=0;do{if(xa&&(Sa=null),ri=0,xa=!1,25<=a)throw Error(c(301));if(a+=1,yt=tt=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}E.H=$d,i=t(n,l)}while(xa);return i}function Sb(){var e=E.H,t=e.useState()[0];return t=typeof t.then=="function"?ci(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Ce.flags|=1024),t}function mr(){var e=gs!==0;return gs=0,e}function hr(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function pr(e){if(bs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bs=!1}Gn=0,yt=tt=Ce=null,xa=!1,ri=gs=0,Sa=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yt===null?Ce.memoizedState=yt=e:yt=yt.next=e,yt}function pt(){if(tt===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=yt===null?Ce.memoizedState:yt.next;if(t!==null)yt=t,tt=e;else{if(e===null)throw Ce.alternate===null?Error(c(467)):Error(c(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},yt===null?Ce.memoizedState=yt=e:yt=yt.next=e}return yt}function ys(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ci(e){var t=ri;return ri+=1,Sa===null&&(Sa=[]),e=sd(Sa,e,t),t=Ce,(yt===null?t.memoizedState:yt.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Id:Er),e}function vs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ci(e);if(e.$$typeof===W)return Mt(e)}throw Error(c(438,String(e)))}function br(e){var t=null,n=Ce.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=Ce.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=ys(),Ce.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]=_e;return t.index++,n}function qn(e,t){return typeof t=="function"?t(e):t}function xs(e){var t=pt();return gr(t,tt,e)}function gr(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var a=e.baseQueue,i=l.pending;if(i!==null){if(a!==null){var d=a.next;a.next=i.next,i.next=d}t.baseQueue=a=i,l.pending=null}if(i=e.baseState,a===null)e.memoizedState=i;else{t=a.next;var h=d=null,g=null,N=t,M=!1;do{var O=N.lane&-536870913;if(O!==N.lane?(Oe&O)===O:(Gn&O)===O){var A=N.revertLane;if(A===0)g!==null&&(g=g.next={lane:0,revertLane:0,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),O===pa&&(M=!0);else if((Gn&A)===A){N=N.next,A===pa&&(M=!0);continue}else O={lane:0,revertLane:N.revertLane,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},g===null?(h=g=O,d=i):g=g.next=O,Ce.lanes|=A,bl|=A;O=N.action,Xl&&n(i,O),i=N.hasEagerState?N.eagerState:n(i,O)}else A={lane:O,revertLane:N.revertLane,gesture:N.gesture,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},g===null?(h=g=A,d=i):g=g.next=A,Ce.lanes|=O,bl|=O;N=N.next}while(N!==null&&N!==t);if(g===null?d=i:g.next=h,!Wt(i,e.memoizedState)&&(vt=!0,M&&(n=ba,n!==null)))throw n;e.memoizedState=i,e.baseState=d,e.baseQueue=g,l.lastRenderedState=i}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function yr(e){var t=pt(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var d=a=a.next;do i=e(i,d.action),d=d.next;while(d!==a);Wt(i,t.memoizedState)||(vt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,l]}function gd(e,t,n){var l=Ce,a=pt(),i=He;if(i){if(n===void 0)throw Error(c(407));n=n()}else n=t();var d=!Wt((tt||a).memoizedState,n);if(d&&(a.memoizedState=n,vt=!0),a=a.queue,Sr(xd.bind(null,l,a,e),[e]),a.getSnapshot!==t||d||yt!==null&&yt.memoizedState.tag&1){if(l.flags|=2048,wa(9,{destroy:void 0},vd.bind(null,l,a,n,t),null),at===null)throw Error(c(349));i||(Gn&127)!==0||yd(l,t,n)}return n}function yd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ce.updateQueue,t===null?(t=ys(),Ce.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vd(e,t,n,l){t.value=n,t.getSnapshot=l,Sd(t)&&wd(e)}function xd(e,t,n){return n(function(){Sd(t)&&wd(e)})}function Sd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wt(e,n)}catch{return!0}}function wd(e){var t=Ol(e,2);t!==null&&Ft(t,e,2)}function vr(e){var t=Ht();if(typeof e=="function"){var n=e;if(e=n(),Xl){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:e},t}function Td(e,t,n,l){return e.baseState=n,gr(e,tt,typeof l=="function"?l:qn)}function wb(e,t,n,l,a){if(Ts(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};E.T!==null?n(!0):i.isTransition=!1,l(i),n=t.pending,n===null?(i.next=t.pending=i,Cd(t,i)):(i.next=n.next,t.pending=n.next=i)}}function Cd(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var i=E.T,d={};E.T=d;try{var h=n(a,l),g=E.S;g!==null&&g(d,h),Nd(e,t,h)}catch(N){xr(e,t,N)}finally{i!==null&&d.types!==null&&(i.types=d.types),E.T=i}}else try{i=n(a,l),Nd(e,t,i)}catch(N){xr(e,t,N)}}function Nd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Ad(e,t,l)},function(l){return xr(e,t,l)}):Ad(e,t,n)}function Ad(e,t,n){t.status="fulfilled",t.value=n,Ed(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cd(e,n)))}function xr(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,Ed(t),t=t.next;while(t!==l)}e.action=null}function Ed(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jd(e,t){return t}function Rd(e,t){if(He){var n=at.formState;if(n!==null){e:{var l=Ce;if(He){if(it){t:{for(var a=it,i=fn;a.nodeType!==8;){if(!i){a=null;break t}if(a=hn(a.nextSibling),a===null){a=null;break t}}i=a.data,a=i==="F!"||i==="F"?a:null}if(a){it=hn(a.nextSibling),l=a.data==="F!";break e}}ol(l)}l=!1}l&&(t=n[0])}}return n=Ht(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jd,lastRenderedState:t},n.queue=l,n=Fd.bind(null,Ce,l),l.dispatch=n,l=vr(!1),i=Ar.bind(null,Ce,!1,l.queue),l=Ht(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=wb.bind(null,Ce,a,i,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function zd(e){var t=pt();return Md(t,tt,e)}function Md(e,t,n){if(t=gr(e,t,jd)[0],e=xs(qn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=ci(t)}catch(d){throw d===ga?us:d}else l=t;t=pt();var a=t.queue,i=a.dispatch;return n!==t.memoizedState&&(Ce.flags|=2048,wa(9,{destroy:void 0},Tb.bind(null,a,n),null)),[l,i,e]}function Tb(e,t){e.action=t}function _d(e){var t=pt(),n=tt;if(n!==null)return Md(t,n,e);pt(),t=t.memoizedState,n=pt();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function wa(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=Ce.updateQueue,t===null&&(t=ys(),Ce.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 Dd(){return pt().memoizedState}function Ss(e,t,n,l){var a=Ht();Ce.flags|=e,a.memoizedState=wa(1|t,{destroy:void 0},n,l===void 0?null:l)}function ws(e,t,n,l){var a=pt();l=l===void 0?null:l;var i=a.memoizedState.inst;tt!==null&&l!==null&&dr(l,tt.memoizedState.deps)?a.memoizedState=wa(t,i,n,l):(Ce.flags|=e,a.memoizedState=wa(1|t,i,n,l))}function kd(e,t){Ss(8390656,8,e,t)}function Sr(e,t){ws(2048,8,e,t)}function Cb(e){Ce.flags|=4;var t=Ce.updateQueue;if(t===null)t=ys(),Ce.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Od(e){var t=pt().memoizedState;return Cb({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Ld(e,t){return ws(4,2,e,t)}function Ud(e,t){return ws(4,4,e,t)}function Bd(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 Hd(e,t,n){n=n!=null?n.concat([e]):null,ws(4,4,Bd.bind(null,t,e),n)}function wr(){}function Kd(e,t){var n=pt();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&dr(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function Yd(e,t){var n=pt();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&dr(t,l[1]))return l[0];if(l=e(),Xl){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[l,t],l}function Tr(e,t,n){return n===void 0||(Gn&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=qf(),Ce.lanes|=e,bl|=e,n)}function Gd(e,t,n,l){return Wt(n,t)?n:va.current!==null?(e=Tr(e,n,l),Wt(e,t)||(vt=!0),e):(Gn&42)===0||(Gn&1073741824)!==0&&(Oe&261930)===0?(vt=!0,e.memoizedState=n):(e=qf(),Ce.lanes|=e,bl|=e,t)}function qd(e,t,n,l,a){var i=L.p;L.p=i!==0&&8>i?i:8;var d=E.T,h={};E.T=h,Ar(e,!1,t,n);try{var g=a(),N=E.S;if(N!==null&&N(h,g),g!==null&&typeof g=="object"&&typeof g.then=="function"){var M=vb(g,l);ui(e,t,M,nn(e))}else ui(e,t,l,nn(e))}catch(O){ui(e,t,{then:function(){},status:"rejected",reason:O},nn())}finally{L.p=i,d!==null&&h.types!==null&&(d.types=h.types),E.T=d}}function Nb(){}function Cr(e,t,n,l){if(e.tag!==5)throw Error(c(476));var a=Xd(e).queue;qd(e,a,t,Z,n===null?Nb:function(){return Vd(e),n(l)})}function Xd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:Z},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vd(e){var t=Xd(e);t.next===null&&(t=e.alternate.memoizedState),ui(e,t.next.queue,{},nn())}function Nr(){return Mt(Ei)}function Zd(){return pt().memoizedState}function Qd(){return pt().memoizedState}function Ab(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=nn();e=ul(n);var l=dl(t,e,n);l!==null&&(Ft(l,t,n),ii(l,t,n)),t={cache:er()},e.payload=t;return}t=t.return}}function Eb(e,t,n){var l=nn();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ts(e)?Jd(t,n):(n=qo(e,t,n,l),n!==null&&(Ft(n,e,l),Wd(n,t,l)))}function Fd(e,t,n){var l=nn();ui(e,t,n,l)}function ui(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ts(e))Jd(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,h=i(d,n);if(a.hasEagerState=!0,a.eagerState=h,Wt(h,d))return ls(e,t,a,0),at===null&&ns(),!1}catch{}finally{}if(n=qo(e,t,a,l),n!==null)return Ft(n,e,l),Wd(n,t,l),!0}return!1}function Ar(e,t,n,l){if(l={lane:2,revertLane:ac(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ts(e)){if(t)throw Error(c(479))}else t=qo(e,n,l,2),t!==null&&Ft(t,e,2)}function Ts(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Jd(e,t){xa=bs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Wd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,nl(e,n)}}var di={readContext:Mt,use:vs,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};di.useEffectEvent=ut;var Id={readContext:Mt,use:vs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:kd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ss(4194308,4,Bd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ss(4194308,4,e,t)},useInsertionEffect:function(e,t){Ss(4,2,e,t)},useMemo:function(e,t){var n=Ht();t=t===void 0?null:t;var l=e();if(Xl){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=Ht();if(n!==void 0){var a=n(t);if(Xl){$e(!0);try{n(t)}finally{$e(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Eb.bind(null,Ce,e),[l.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=vr(e);var t=e.queue,n=Fd.bind(null,Ce,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:wr,useDeferredValue:function(e,t){var n=Ht();return Tr(n,e,t)},useTransition:function(){var e=vr(!1);return e=qd.bind(null,Ce,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=Ce,a=Ht();if(He){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),at===null)throw Error(c(349));(Oe&127)!==0||yd(l,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,kd(xd.bind(null,l,i,e),[e]),l.flags|=2048,wa(9,{destroy:void 0},vd.bind(null,l,i,n,t),null),n},useId:function(){var e=Ht(),t=at.identifierPrefix;if(He){var n=zn,l=Rn;n=(l&~(1<<32-ot(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=gs++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=xb++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Nr,useFormState:Rd,useActionState:Rd,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ar.bind(null,Ce,!0,n),n.dispatch=t,[e,t]},useMemoCache:br,useCacheRefresh:function(){return Ht().memoizedState=Ab.bind(null,Ce)},useEffectEvent:function(e){var t=Ht(),n={impl:e};return t.memoizedState=n,function(){if((Fe&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Er={readContext:Mt,use:vs,useCallback:Kd,useContext:Mt,useEffect:Sr,useImperativeHandle:Hd,useInsertionEffect:Ld,useLayoutEffect:Ud,useMemo:Yd,useReducer:xs,useRef:Dd,useState:function(){return xs(qn)},useDebugValue:wr,useDeferredValue:function(e,t){var n=pt();return Gd(n,tt.memoizedState,e,t)},useTransition:function(){var e=xs(qn)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:ci(e),t]},useSyncExternalStore:gd,useId:Zd,useHostTransitionStatus:Nr,useFormState:zd,useActionState:zd,useOptimistic:function(e,t){var n=pt();return Td(n,tt,e,t)},useMemoCache:br,useCacheRefresh:Qd};Er.useEffectEvent=Od;var $d={readContext:Mt,use:vs,useCallback:Kd,useContext:Mt,useEffect:Sr,useImperativeHandle:Hd,useInsertionEffect:Ld,useLayoutEffect:Ud,useMemo:Yd,useReducer:yr,useRef:Dd,useState:function(){return yr(qn)},useDebugValue:wr,useDeferredValue:function(e,t){var n=pt();return tt===null?Tr(n,e,t):Gd(n,tt.memoizedState,e,t)},useTransition:function(){var e=yr(qn)[0],t=pt().memoizedState;return[typeof e=="boolean"?e:ci(e),t]},useSyncExternalStore:gd,useId:Zd,useHostTransitionStatus:Nr,useFormState:_d,useActionState:_d,useOptimistic:function(e,t){var n=pt();return tt!==null?Td(n,tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:br,useCacheRefresh:Qd};$d.useEffectEvent=Od;function jr(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rr={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=nn(),a=ul(l);a.payload=t,n!=null&&(a.callback=n),t=dl(e,a,l),t!==null&&(Ft(t,e,l),ii(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=nn(),a=ul(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=dl(e,a,l),t!==null&&(Ft(t,e,l),ii(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nn(),l=ul(n);l.tag=2,t!=null&&(l.callback=t),t=dl(e,l,n),t!==null&&(Ft(t,e,n),ii(t,e,n))}};function Pd(e,t,n,l,a,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,d):t.prototype&&t.prototype.isPureReactComponent?!Ia(n,l)||!Ia(a,i):!0}function ef(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&&Rr.enqueueReplaceState(t,t.state,null)}function Vl(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=j({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function tf(e){ts(e)}function nf(e){console.error(e)}function lf(e){ts(e)}function Cs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function af(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function zr(e,t,n){return n=ul(n),n.tag=3,n.payload={element:null},n.callback=function(){Cs(e,t)},n}function sf(e){return e=ul(e),e.tag=3,e}function of(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var i=l.value;e.payload=function(){return a(i)},e.callback=function(){af(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){af(t,n,l),typeof a!="function"&&(gl===null?gl=new Set([this]):gl.add(this));var h=l.stack;this.componentDidCatch(l.value,{componentStack:h!==null?h:""})})}function jb(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&ha(t,n,a,!0),n=$t.current,n!==null){switch(n.tag){case 31:case 13:return mn===null?Ls():n.alternate===null&&dt===0&&(dt=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===ds?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),tc(e,l,a)),!1;case 22:return n.flags|=65536,l===ds?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)),tc(e,l,a)),!1}throw Error(c(435,n.tag))}return tc(e,l,a),Ls(),!1}if(He)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==Jo&&(e=Error(c(422),{cause:l}),ei(cn(e,n)))):(l!==Jo&&(t=Error(c(423),{cause:l}),ei(cn(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=cn(l,n),a=zr(e.stateNode,l,a),sr(e,a),dt!==4&&(dt=2)),!1;var i=Error(c(520),{cause:l});if(i=cn(i,n),vi===null?vi=[i]:vi.push(i),dt!==4&&(dt=2),t===null)return!0;l=cn(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=zr(n.stateNode,l,e),sr(n,e),!1;case 1:if(t=n.type,i=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(gl===null||!gl.has(i))))return n.flags|=65536,a&=-a,n.lanes|=a,a=sf(a),of(a,e,n,l),sr(n,a),!1}n=n.return}while(n!==null);return!1}var Mr=Error(c(461)),vt=!1;function _t(e,t,n,l){t.child=e===null?ud(t,null,n,l):ql(t,e.child,n,l)}function rf(e,t,n,l,a){n=n.render;var i=t.ref;if("ref"in l){var d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}else d=l;return Hl(t),l=fr(e,t,n,d,i,a),h=mr(),e!==null&&!vt?(hr(e,t,a),Xn(e,t,a)):(He&&h&&Qo(t),t.flags|=1,_t(e,t,l,a),t.child)}function cf(e,t,n,l,a){if(e===null){var i=n.type;return typeof i=="function"&&!Xo(i)&&i.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=i,uf(e,t,i,l,a)):(e=is(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Hr(e,a)){var d=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ia,n(d,l)&&e.ref===t.ref)return Xn(e,t,a)}return t.flags|=1,e=Bn(i,l),e.ref=t.ref,e.return=t,t.child=e}function uf(e,t,n,l,a){if(e!==null){var i=e.memoizedProps;if(Ia(i,l)&&e.ref===t.ref)if(vt=!1,t.pendingProps=l=i,Hr(e,a))(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,Xn(e,t,a)}return _r(e,t,n,l,a)}function df(e,t,n,l){var a=l.children,i=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(i=i!==null?i.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~i}else l=0,t.child=null;return ff(e,t,i,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cs(t,i!==null?i.cachePool:null),i!==null?md(t,i):rr(),hd(t);else return l=t.lanes=536870912,ff(e,t,i!==null?i.baseLanes|n:n,n,l)}else i!==null?(cs(t,i.cachePool),md(t,i),ml(),t.memoizedState=null):(e!==null&&cs(t,null),rr(),ml());return _t(e,t,a,n),t.child}function fi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ff(e,t,n,l,a){var i=nr();return i=i===null?null:{parent:gt._currentValue,pool:i},t.memoizedState={baseLanes:n,cachePool:i},e!==null&&cs(t,null),rr(),hd(t),e!==null&&ha(e,t,l,!0),t.childLanes=a,null}function Ns(e,t){return t=Es({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mf(e,t,n){return ql(t,e.child,null,n),e=Ns(t,t.pendingProps),e.flags|=2,Pt(t),t.memoizedState=null,e}function Rb(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(l.mode==="hidden")return e=Ns(t,l),t.lanes=536870912,fi(null,e);if(ur(t),(e=it)?(e=Nm(e,fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:il!==null?{id:Rn,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},n=Ju(e),n.return=t,t.child=n,zt=t,it=null)):e=null,e===null)throw ol(t);return t.lanes=536870912,null}return Ns(t,l)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(ur(t),a)if(t.flags&256)t.flags&=-257,t=mf(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(vt||ha(e,t,n,!1),a=(n&e.childLanes)!==0,vt||a){if(l=at,l!==null&&(d=Tn(l,n),d!==0&&d!==i.retryLane))throw i.retryLane=d,Ol(e,d),Ft(l,e,d),Mr;Ls(),t=mf(e,t,n)}else e=i.treeContext,it=hn(d.nextSibling),zt=t,He=!0,sl=null,fn=!1,e!==null&&$u(t,e),t=Ns(t,l),t.flags|=4096;return t}return e=Bn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function As(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(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _r(e,t,n,l,a){return Hl(t),n=fr(e,t,n,l,void 0,a),l=mr(),e!==null&&!vt?(hr(e,t,a),Xn(e,t,a)):(He&&l&&Qo(t),t.flags|=1,_t(e,t,n,a),t.child)}function hf(e,t,n,l,a,i){return Hl(t),t.updateQueue=null,n=bd(t,l,n,a),pd(e),l=mr(),e!==null&&!vt?(hr(e,t,i),Xn(e,t,i)):(He&&l&&Qo(t),t.flags|=1,_t(e,t,n,i),t.child)}function pf(e,t,n,l,a){if(Hl(t),t.stateNode===null){var i=ua,d=n.contextType;typeof d=="object"&&d!==null&&(i=Mt(d)),i=new n(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Rr,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},ar(t),d=n.contextType,i.context=typeof d=="object"&&d!==null?Mt(d):ua,i.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(jr(t,n,d,l),i.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Rr.enqueueReplaceState(i,i.state,null),oi(t,l,i,a),si(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var h=t.memoizedProps,g=Vl(n,h);i.props=g;var N=i.context,M=n.contextType;d=ua,typeof M=="object"&&M!==null&&(d=Mt(M));var O=n.getDerivedStateFromProps;M=typeof O=="function"||typeof i.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,M||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(h||N!==d)&&ef(t,i,l,d),cl=!1;var A=t.memoizedState;i.state=A,oi(t,l,i,a),si(),N=t.memoizedState,h||A!==N||cl?(typeof O=="function"&&(jr(t,n,O,l),N=t.memoizedState),(g=cl||Pd(t,n,g,l,A,N,d))?(M||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=N),i.props=l,i.state=N,i.context=d,l=g):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,ir(e,t),d=t.memoizedProps,M=Vl(n,d),i.props=M,O=t.pendingProps,A=i.context,N=n.contextType,g=ua,typeof N=="object"&&N!==null&&(g=Mt(N)),h=n.getDerivedStateFromProps,(N=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==O||A!==g)&&ef(t,i,l,g),cl=!1,A=t.memoizedState,i.state=A,oi(t,l,i,a),si();var R=t.memoizedState;d!==O||A!==R||cl||e!==null&&e.dependencies!==null&&os(e.dependencies)?(typeof h=="function"&&(jr(t,n,h,l),R=t.memoizedState),(M=cl||Pd(t,n,M,l,A,R,g)||e!==null&&e.dependencies!==null&&os(e.dependencies))?(N||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,R,g),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,R,g)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=R),i.props=l,i.state=R,i.context=g,l=M):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,As(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=ql(t,e.child,null,a),t.child=ql(t,null,n,a)):_t(e,t,n,a),t.memoizedState=i.state,e=t.child):e=Xn(e,t,a),e}function bf(e,t,n,l){return Ul(),t.flags|=256,_t(e,t,n,l),t.child}var Dr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kr(e){return{baseLanes:e,cachePool:ad()}}function Or(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=tn),e}function gf(e,t,n){var l=t.pendingProps,a=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(ht.current&2)!==0),d&&(a=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(a?fl(t):ml(),(e=it)?(e=Nm(e,fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:il!==null?{id:Rn,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},n=Ju(e),n.return=t,t.child=n,zt=t,it=null)):e=null,e===null)throw ol(t);return gc(e)?t.lanes=32:t.lanes=536870912,null}var h=l.children;return l=l.fallback,a?(ml(),a=t.mode,h=Es({mode:"hidden",children:h},a),l=Ll(l,a,n,null),h.return=t,l.return=t,h.sibling=l,t.child=h,l=t.child,l.memoizedState=kr(n),l.childLanes=Or(e,d,n),t.memoizedState=Dr,fi(null,l)):(fl(t),Lr(t,h))}var g=e.memoizedState;if(g!==null&&(h=g.dehydrated,h!==null)){if(i)t.flags&256?(fl(t),t.flags&=-257,t=Ur(e,t,n)):t.memoizedState!==null?(ml(),t.child=e.child,t.flags|=128,t=null):(ml(),h=l.fallback,a=t.mode,l=Es({mode:"visible",children:l.children},a),h=Ll(h,a,n,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,ql(t,e.child,null,n),l=t.child,l.memoizedState=kr(n),l.childLanes=Or(e,d,n),t.memoizedState=Dr,t=fi(null,l));else if(fl(t),gc(h)){if(d=h.nextSibling&&h.nextSibling.dataset,d)var N=d.dgst;d=N,l=Error(c(419)),l.stack="",l.digest=d,ei({value:l,source:null,stack:null}),t=Ur(e,t,n)}else if(vt||ha(e,t,n,!1),d=(n&e.childLanes)!==0,vt||d){if(d=at,d!==null&&(l=Tn(d,n),l!==0&&l!==g.retryLane))throw g.retryLane=l,Ol(e,l),Ft(d,e,l),Mr;bc(h)||Ls(),t=Ur(e,t,n)}else bc(h)?(t.flags|=192,t.child=e.child,t=null):(e=g.treeContext,it=hn(h.nextSibling),zt=t,He=!0,sl=null,fn=!1,e!==null&&$u(t,e),t=Lr(t,l.children),t.flags|=4096);return t}return a?(ml(),h=l.fallback,a=t.mode,g=e.child,N=g.sibling,l=Bn(g,{mode:"hidden",children:l.children}),l.subtreeFlags=g.subtreeFlags&65011712,N!==null?h=Bn(N,h):(h=Ll(h,a,n,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,fi(null,l),l=t.child,h=e.child.memoizedState,h===null?h=kr(n):(a=h.cachePool,a!==null?(g=gt._currentValue,a=a.parent!==g?{parent:g,pool:g}:a):a=ad(),h={baseLanes:h.baseLanes|n,cachePool:a}),l.memoizedState=h,l.childLanes=Or(e,d,n),t.memoizedState=Dr,fi(e.child,l)):(fl(t),n=e.child,e=n.sibling,n=Bn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function Lr(e,t){return t=Es({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Es(e,t){return e=It(22,e,null,t),e.lanes=0,e}function Ur(e,t,n){return ql(t,e.child,null,n),e=Lr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yf(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),$o(e.return,t,n)}function Br(e,t,n,l,a,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=a,d.treeForkCount=i)}function vf(e,t,n){var l=t.pendingProps,a=l.revealOrder,i=l.tail;l=l.children;var d=ht.current,h=(d&2)!==0;if(h?(d=d&1|2,t.flags|=128):d&=1,xe(ht,d),_t(e,t,l,n),l=He?Pa:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yf(e,n,t);else if(e.tag===19)yf(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(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ps(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Br(t,!1,a,n,i,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ps(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Br(t,!0,n,null,i,l);break;case"together":Br(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function Xn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ha(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Hr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&os(e)))}function zb(e,t,n){switch(t.tag){case 3:ft(t,t.stateNode.containerInfo),rl(t,gt,e.memoizedState.cache),Ul();break;case 27:case 5:Ut(t);break;case 4:ft(t,t.stateNode.containerInfo);break;case 10:rl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ur(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(fl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?gf(e,t,n):(fl(t),e=Xn(e,t,n),e!==null?e.sibling:null);fl(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(ha(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return vf(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),xe(ht,ht.current),l)break;return null;case 22:return t.lanes=0,df(e,t,n,t.pendingProps);case 24:rl(t,gt,e.memoizedState.cache)}return Xn(e,t,n)}function xf(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)vt=!0;else{if(!Hr(e,n)&&(t.flags&128)===0)return vt=!1,zb(e,t,n);vt=(e.flags&131072)!==0}else vt=!1,He&&(t.flags&1048576)!==0&&Iu(t,Pa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Yl(t.elementType),t.type=e,typeof e=="function")Xo(e)?(l=Vl(e,l),t.tag=1,t=pf(null,t,e,l,n)):(t.tag=0,t=_r(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===ce){t.tag=11,t=rf(null,t,e,l,n);break e}else if(a===H){t.tag=14,t=cf(null,t,e,l,n);break e}}throw t=se(e)||e,Error(c(306,t,""))}}return t;case 0:return _r(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=Vl(l,t.pendingProps),pf(e,t,l,a,n);case 3:e:{if(ft(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var i=t.memoizedState;a=i.element,ir(e,t),oi(t,l,null,n);var d=t.memoizedState;if(l=d.cache,rl(t,gt,l),l!==i.cache&&Po(t,[gt],n,!0),si(),l=d.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=bf(e,t,l,n);break e}else if(l!==a){a=cn(Error(c(424)),t),ei(a),t=bf(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(it=hn(e.firstChild),zt=t,He=!0,sl=null,fn=!0,n=ud(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ul(),l===a){t=Xn(e,t,n);break e}_t(e,t,l,n)}t=t.child}return t;case 26:return As(e,t),e===null?(n=Mm(t.type,null,t.pendingProps,null))?t.memoizedState=n:He||(n=t.type,e=t.pendingProps,l=qs(Ee.current).createElement(n),l[Rt]=t,l[Gt]=e,Dt(l,n,e),At(l),t.stateNode=l):t.memoizedState=Mm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ut(t),e===null&&He&&(l=t.stateNode=jm(t.type,t.pendingProps,Ee.current),zt=t,fn=!0,a=it,Sl(t.type)?(yc=a,it=hn(l.firstChild)):it=a),_t(e,t,t.pendingProps.children,n),As(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((a=l=it)&&(l=sg(l,t.type,t.pendingProps,fn),l!==null?(t.stateNode=l,zt=t,it=hn(l.firstChild),fn=!1,a=!0):a=!1),a||ol(t)),Ut(t),a=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,l=i.children,mc(a,i)?l=null:d!==null&&mc(a,d)&&(t.flags|=32),t.memoizedState!==null&&(a=fr(e,t,Sb,null,null,n),Ei._currentValue=a),As(e,t),_t(e,t,l,n),t.child;case 6:return e===null&&He&&((e=n=it)&&(n=og(n,t.pendingProps,fn),n!==null?(t.stateNode=n,zt=t,it=null,e=!0):e=!1),e||ol(t)),null;case 13:return gf(e,t,n);case 4:return ft(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ql(t,null,l,n):_t(e,t,l,n),t.child;case 11:return rf(e,t,t.type,t.pendingProps,n);case 7:return _t(e,t,t.pendingProps,n),t.child;case 8:return _t(e,t,t.pendingProps.children,n),t.child;case 12:return _t(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,rl(t,t.type,l.value),_t(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Hl(t),a=Mt(a),l=l(a),t.flags|=1,_t(e,t,l,n),t.child;case 14:return cf(e,t,t.type,t.pendingProps,n);case 15:return uf(e,t,t.type,t.pendingProps,n);case 19:return vf(e,t,n);case 31:return Rb(e,t,n);case 22:return df(e,t,n,t.pendingProps);case 24:return Hl(t),l=Mt(gt),e===null?(a=nr(),a===null&&(a=at,i=er(),a.pooledCache=i,i.refCount++,i!==null&&(a.pooledCacheLanes|=n),a=i),t.memoizedState={parent:l,cache:a},ar(t),rl(t,gt,a)):((e.lanes&n)!==0&&(ir(e,t),oi(t,null,null,n),si()),a=e.memoizedState,i=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),rl(t,gt,l)):(l=i.cache,rl(t,gt,l),l!==a.cache&&Po(t,[gt],n,!0))),_t(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Vn(e){e.flags|=4}function Kr(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Qf())e.flags|=8192;else throw Gl=ds,lr}else e.flags&=-16777217}function Sf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Lm(t))if(Qf())e.flags|=8192;else throw Gl=ds,lr}function js(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qe():536870912,e.lanes|=t,Aa|=t)}function mi(e,t){if(!He)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 st(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Mb(e,t,n){var l=t.pendingProps;switch(Fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Yn(gt),Ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ma(t)?Vn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Wo())),st(t),null;case 26:var a=t.type,i=t.memoizedState;return e===null?(Vn(t),i!==null?(st(t),Sf(t,i)):(st(t),Kr(t,a,null,l,n))):i?i!==e.memoizedState?(Vn(t),st(t),Sf(t,i)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&Vn(t),st(t),Kr(t,a,e,l,n)),null;case 27:if(ne(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Vn(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return st(t),null}e=Se.current,ma(t)?Pu(t):(e=jm(a,l,n),t.stateNode=e,Vn(t))}return st(t),null;case 5:if(ne(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&Vn(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return st(t),null}if(i=Se.current,ma(t))Pu(t);else{var d=qs(Ee.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?d.createElement(a,{is:l.is}):d.createElement(a)}}i[Rt]=t,i[Gt]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(Dt(i,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Vn(t)}}return st(t),Kr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Vn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ee.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=zt,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||gm(e.nodeValue,n)),e||ol(t,!0)}else e=qs(e).createTextNode(l),e[Rt]=t,t.stateNode=e}return st(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=ma(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Rt]=t}else Ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else n=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Pt(t),t):(Pt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return st(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(c(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(c(317));a[Rt]=t}else Ul(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),a=!1}else a=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Pt(t),t):(Pt(t),null)}return Pt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),js(t,t.updateQueue),st(t),null);case 4:return Ye(),e===null&&rc(t.stateNode.containerInfo),st(t),null;case 10:return Yn(t.type),st(t),null;case 19:if(Ue(ht),l=t.memoizedState,l===null)return st(t),null;if(a=(t.flags&128)!==0,i=l.rendering,i===null)if(a)mi(l,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=ps(e),i!==null){for(t.flags|=128,mi(l,!1),e=i.updateQueue,t.updateQueue=e,js(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Fu(n,e),n=n.sibling;return xe(ht,ht.current&1|2),He&&Hn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&I()>Ds&&(t.flags|=128,a=!0,mi(l,!1),t.lanes=4194304)}else{if(!a)if(e=ps(i),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,js(t,e),mi(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!He)return st(t),null}else 2*I()-l.renderingStartTime>Ds&&n!==536870912&&(t.flags|=128,a=!0,mi(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=I(),e.sibling=null,n=ht.current,xe(ht,a?n&1|2:n&1),He&&Hn(t,l.treeForkCount),e):(st(t),null);case 22:case 23:return Pt(t),cr(),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&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),n=t.updateQueue,n!==null&&js(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&&Ue(Kl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yn(gt),st(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function _b(e,t){switch(Fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yn(gt),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ne(t),null;case 31:if(t.memoizedState!==null){if(Pt(t),t.alternate===null)throw Error(c(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue(ht),null;case 4:return Ye(),null;case 10:return Yn(t.type),null;case 22:case 23:return Pt(t),cr(),e!==null&&Ue(Kl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yn(gt),null;case 25:return null;default:return null}}function wf(e,t){switch(Fo(t),t.tag){case 3:Yn(gt),Ye();break;case 26:case 27:case 5:ne(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&Pt(t);break;case 13:Pt(t);break;case 19:Ue(ht);break;case 10:Yn(t.type);break;case 22:case 23:Pt(t),cr(),e!==null&&Ue(Kl);break;case 24:Yn(gt)}}function hi(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var i=n.create,d=n.inst;l=i(),d.destroy=l}n=n.next}while(n!==a)}}catch(h){et(t,t.return,h)}}function hl(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var i=a.next;l=i;do{if((l.tag&e)===e){var d=l.inst,h=d.destroy;if(h!==void 0){d.destroy=void 0,a=t;var g=n,N=h;try{N()}catch(M){et(a,g,M)}}}l=l.next}while(l!==i)}}catch(M){et(t,t.return,M)}}function Tf(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{fd(t,n)}catch(l){et(e,e.return,l)}}}function Cf(e,t,n){n.props=Vl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){et(e,t,l)}}function pi(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(a){et(e,t,a)}}function Mn(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){et(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){et(e,t,a)}else n.current=null}function Nf(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(a){et(e,e.return,a)}}function Yr(e,t,n){try{var l=e.stateNode;eg(l,e.type,n,t),l[Gt]=t}catch(a){et(e,e.return,a)}}function Af(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sl(e.type)||e.tag===4}function Gr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Af(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&&Sl(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 qr(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=Ln));else if(l!==4&&(l===27&&Sl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qr(e,t,n),e=e.sibling;e!==null;)qr(e,t,n),e=e.sibling}function Rs(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&&Sl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Rs(e,t,n),e=e.sibling;e!==null;)Rs(e,t,n),e=e.sibling}function Ef(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Dt(t,l,n),t[Rt]=e,t[Gt]=n}catch(i){et(e,e.return,i)}}var Zn=!1,xt=!1,Xr=!1,jf=typeof WeakSet=="function"?WeakSet:Set,Et=null;function Db(e,t){if(e=e.containerInfo,dc=Ws,e=Hu(e),Uo(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 a=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var d=0,h=-1,g=-1,N=0,M=0,O=e,A=null;t:for(;;){for(var R;O!==n||a!==0&&O.nodeType!==3||(h=d+a),O!==i||l!==0&&O.nodeType!==3||(g=d+l),O.nodeType===3&&(d+=O.nodeValue.length),(R=O.firstChild)!==null;)A=O,O=R;for(;;){if(O===e)break t;if(A===n&&++N===a&&(h=d),A===i&&++M===l&&(g=d),(R=O.nextSibling)!==null)break;O=A,A=O.parentNode}O=R}n=h===-1||g===-1?null:{start:h,end:g}}else n=null}n=n||{start:0,end:0}}else n=null;for(fc={focusedElem:e,selectionRange:n},Ws=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,i=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++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,n=t,a=i.memoizedProps,i=i.memoizedState,l=n.stateNode;try{var P=Vl(n.type,a);e=l.getSnapshotBeforeUpdate(P,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(ue){et(n,n.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":pc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function Rf(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:Fn(e,n),l&4&&hi(5,n);break;case 1:if(Fn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){et(n,n.return,d)}else{var a=Vl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){et(n,n.return,d)}}l&64&&Tf(n),l&512&&pi(n,n.return);break;case 3:if(Fn(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{fd(e,t)}catch(d){et(n,n.return,d)}}break;case 27:t===null&&l&4&&Ef(n);case 26:case 5:Fn(e,n),t===null&&l&4&&Nf(n),l&512&&pi(n,n.return);break;case 12:Fn(e,n);break;case 31:Fn(e,n),l&4&&_f(e,n);break;case 13:Fn(e,n),l&4&&Df(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Gb.bind(null,n),rg(e,n))));break;case 22:if(l=n.memoizedState!==null||Zn,!l){t=t!==null&&t.memoizedState!==null||xt,a=Zn;var i=xt;Zn=l,(xt=t)&&!i?Jn(e,n,(n.subtreeFlags&8772)!==0):Fn(e,n),Zn=a,xt=i}break;case 30:break;default:Fn(e,n)}}function zf(e){var t=e.alternate;t!==null&&(e.alternate=null,zf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xo(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 rt=null,Xt=!1;function Qn(e,t,n){for(n=n.child;n!==null;)Mf(e,t,n),n=n.sibling}function Mf(e,t,n){if(be&&typeof be.onCommitFiberUnmount=="function")try{be.onCommitFiberUnmount(ae,n)}catch{}switch(n.tag){case 26:xt||Mn(n,t),Qn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:xt||Mn(n,t);var l=rt,a=Xt;Sl(n.type)&&(rt=n.stateNode,Xt=!1),Qn(e,t,n),Ci(n.stateNode),rt=l,Xt=a;break;case 5:xt||Mn(n,t);case 6:if(l=rt,a=Xt,rt=null,Qn(e,t,n),rt=l,Xt=a,rt!==null)if(Xt)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(i){et(n,t,i)}else try{rt.removeChild(n.stateNode)}catch(i){et(n,t,i)}break;case 18:rt!==null&&(Xt?(e=rt,Tm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ka(e)):Tm(rt,n.stateNode));break;case 4:l=rt,a=Xt,rt=n.stateNode.containerInfo,Xt=!0,Qn(e,t,n),rt=l,Xt=a;break;case 0:case 11:case 14:case 15:hl(2,n,t),xt||hl(4,n,t),Qn(e,t,n);break;case 1:xt||(Mn(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Cf(n,t,l)),Qn(e,t,n);break;case 21:Qn(e,t,n);break;case 22:xt=(l=xt)||n.memoizedState!==null,Qn(e,t,n),xt=l;break;default:Qn(e,t,n)}}function _f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ka(e)}catch(n){et(t,t.return,n)}}}function Df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ka(e)}catch(n){et(t,t.return,n)}}function kb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new jf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new jf),t;default:throw Error(c(435,e.tag))}}function zs(e,t){var n=kb(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=qb.bind(null,e,l);l.then(a,a)}})}function Vt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],i=e,d=t,h=d;e:for(;h!==null;){switch(h.tag){case 27:if(Sl(h.type)){rt=h.stateNode,Xt=!1;break e}break;case 5:rt=h.stateNode,Xt=!1;break e;case 3:case 4:rt=h.stateNode.containerInfo,Xt=!0;break e}h=h.return}if(rt===null)throw Error(c(160));Mf(i,d,a),rt=null,Xt=!1,i=a.alternate,i!==null&&(i.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kf(t,e),t=t.sibling}var Nn=null;function kf(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vt(t,e),Zt(e),l&4&&(hl(3,e,e.return),hi(3,e),hl(5,e,e.return));break;case 1:Vt(t,e),Zt(e),l&512&&(xt||n===null||Mn(n,n.return)),l&64&&Zn&&(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 a=Nn;if(Vt(t,e),Zt(e),l&512&&(xt||n===null||Mn(n,n.return)),l&4){var i=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,a=a.ownerDocument||a;t:switch(l){case"title":i=a.getElementsByTagName("title")[0],(!i||i[Ga]||i[Rt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=a.createElement(l),a.head.insertBefore(i,a.querySelector("head > title"))),Dt(i,l,n),i[Rt]=e,At(i),l=i;break e;case"link":var d=km("link","href",a).get(l+(n.href||""));if(d){for(var h=0;h<d.length;h++)if(i=d[h],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(h,1);break t}}i=a.createElement(l),Dt(i,l,n),a.head.appendChild(i);break;case"meta":if(d=km("meta","content",a).get(l+(n.content||""))){for(h=0;h<d.length;h++)if(i=d[h],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(h,1);break t}}i=a.createElement(l),Dt(i,l,n),a.head.appendChild(i);break;default:throw Error(c(468,l))}i[Rt]=e,At(i),l=i}e.stateNode=l}else Om(a,e.type,e.stateNode);else e.stateNode=Dm(a,l,e.memoizedProps);else i!==l?(i===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):i.count--,l===null?Om(a,e.type,e.stateNode):Dm(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Yr(e,e.memoizedProps,n.memoizedProps)}break;case 27:Vt(t,e),Zt(e),l&512&&(xt||n===null||Mn(n,n.return)),n!==null&&l&4&&Yr(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Vt(t,e),Zt(e),l&512&&(xt||n===null||Mn(n,n.return)),e.flags&32){a=e.stateNode;try{la(a,"")}catch(P){et(e,e.return,P)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Yr(e,a,n!==null?n.memoizedProps:a)),l&1024&&(Xr=!0);break;case 6:if(Vt(t,e),Zt(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(P){et(e,e.return,P)}}break;case 3:if(Zs=null,a=Nn,Nn=Xs(t.containerInfo),Vt(t,e),Nn=a,Zt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{ka(t.containerInfo)}catch(P){et(e,e.return,P)}Xr&&(Xr=!1,Of(e));break;case 4:l=Nn,Nn=Xs(e.stateNode.containerInfo),Vt(t,e),Zt(e),Nn=l;break;case 12:Vt(t,e),Zt(e);break;case 31:Vt(t,e),Zt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zs(e,l)));break;case 13:Vt(t,e),Zt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(_s=I()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zs(e,l)));break;case 22:a=e.memoizedState!==null;var g=n!==null&&n.memoizedState!==null,N=Zn,M=xt;if(Zn=N||a,xt=M||g,Vt(t,e),xt=M,Zn=N,Zt(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||g||Zn||xt||Zl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){g=n=t;try{if(i=g.stateNode,a)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{h=g.stateNode;var O=g.memoizedProps.style,A=O!=null&&O.hasOwnProperty("display")?O.display:null;h.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(P){et(g,g.return,P)}}}else if(t.tag===6){if(n===null){g=t;try{g.stateNode.nodeValue=a?"":g.memoizedProps}catch(P){et(g,g.return,P)}}}else if(t.tag===18){if(n===null){g=t;try{var R=g.stateNode;a?Cm(R,!0):Cm(g.stateNode,!1)}catch(P){et(g,g.return,P)}}}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,zs(e,n))));break;case 19:Vt(t,e),Zt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,zs(e,l)));break;case 30:break;case 21:break;default:Vt(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Af(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var a=n.stateNode,i=Gr(e);Rs(e,i,a);break;case 5:var d=n.stateNode;n.flags&32&&(la(d,""),n.flags&=-33);var h=Gr(e);Rs(e,h,d);break;case 3:case 4:var g=n.stateNode.containerInfo,N=Gr(e);qr(e,N,g);break;default:throw Error(c(161))}}catch(M){et(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Of(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Of(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Fn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Rf(e,t.alternate,t),t=t.sibling}function Zl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:hl(4,t,t.return),Zl(t);break;case 1:Mn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Cf(t,t.return,n),Zl(t);break;case 27:Ci(t.stateNode);case 26:case 5:Mn(t,t.return),Zl(t);break;case 22:t.memoizedState===null&&Zl(t);break;case 30:Zl(t);break;default:Zl(t)}e=e.sibling}}function Jn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:Jn(a,i,n),hi(4,i);break;case 1:if(Jn(a,i,n),l=i,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(N){et(l,l.return,N)}if(l=i,a=l.updateQueue,a!==null){var h=l.stateNode;try{var g=a.shared.hiddenCallbacks;if(g!==null)for(a.shared.hiddenCallbacks=null,a=0;a<g.length;a++)dd(g[a],h)}catch(N){et(l,l.return,N)}}n&&d&64&&Tf(i),pi(i,i.return);break;case 27:Ef(i);case 26:case 5:Jn(a,i,n),n&&l===null&&d&4&&Nf(i),pi(i,i.return);break;case 12:Jn(a,i,n);break;case 31:Jn(a,i,n),n&&d&4&&_f(a,i);break;case 13:Jn(a,i,n),n&&d&4&&Df(a,i);break;case 22:i.memoizedState===null&&Jn(a,i,n),pi(i,i.return);break;case 30:break;default:Jn(a,i,n)}t=t.sibling}}function Vr(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&&ti(n))}function Zr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ti(e))}function An(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Lf(e,t,n,l),t=t.sibling}function Lf(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,n,l),a&2048&&hi(9,t);break;case 1:An(e,t,n,l);break;case 3:An(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ti(e)));break;case 12:if(a&2048){An(e,t,n,l),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,h=i.onPostCommit;typeof h=="function"&&h(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(g){et(t,t.return,g)}}else An(e,t,n,l);break;case 31:An(e,t,n,l);break;case 13:An(e,t,n,l);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?An(e,t,n,l):bi(e,t):i._visibility&2?An(e,t,n,l):(i._visibility|=2,Ta(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&Vr(d,t);break;case 24:An(e,t,n,l),a&2048&&Zr(t.alternate,t);break;default:An(e,t,n,l)}}function Ta(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,h=n,g=l,N=d.flags;switch(d.tag){case 0:case 11:case 15:Ta(i,d,h,g,a),hi(8,d);break;case 23:break;case 22:var M=d.stateNode;d.memoizedState!==null?M._visibility&2?Ta(i,d,h,g,a):bi(i,d):(M._visibility|=2,Ta(i,d,h,g,a)),a&&N&2048&&Vr(d.alternate,d);break;case 24:Ta(i,d,h,g,a),a&&N&2048&&Zr(d.alternate,d);break;default:Ta(i,d,h,g,a)}t=t.sibling}}function bi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:bi(n,l),a&2048&&Vr(l.alternate,l);break;case 24:bi(n,l),a&2048&&Zr(l.alternate,l);break;default:bi(n,l)}t=t.sibling}}var gi=8192;function Ca(e,t,n){if(e.subtreeFlags&gi)for(e=e.child;e!==null;)Uf(e,t,n),e=e.sibling}function Uf(e,t,n){switch(e.tag){case 26:Ca(e,t,n),e.flags&gi&&e.memoizedState!==null&&xg(n,Nn,e.memoizedState,e.memoizedProps);break;case 5:Ca(e,t,n);break;case 3:case 4:var l=Nn;Nn=Xs(e.stateNode.containerInfo),Ca(e,t,n),Nn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=gi,gi=16777216,Ca(e,t,n),gi=l):Ca(e,t,n));break;default:Ca(e,t,n)}}function Bf(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 yi(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];Et=l,Kf(l,e)}Bf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hf(e),e=e.sibling}function Hf(e){switch(e.tag){case 0:case 11:case 15:yi(e),e.flags&2048&&hl(9,e,e.return);break;case 3:yi(e);break;case 12:yi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ms(e)):yi(e);break;default:yi(e)}}function Ms(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];Et=l,Kf(l,e)}Bf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:hl(8,t,t.return),Ms(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ms(t));break;default:Ms(t)}e=e.sibling}}function Kf(e,t){for(;Et!==null;){var n=Et;switch(n.tag){case 0:case 11:case 15:hl(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:ti(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Et=l;else e:for(n=e;Et!==null;){l=Et;var a=l.sibling,i=l.return;if(zf(l),l===n){Et=null;break e}if(a!==null){a.return=i,Et=a;break e}Et=i}}}var Ob={getCacheForType:function(e){var t=Mt(gt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Mt(gt).controller.signal}},Lb=typeof WeakMap=="function"?WeakMap:Map,Fe=0,at=null,ze=null,Oe=0,Pe=0,en=null,pl=!1,Na=!1,Qr=!1,Wn=0,dt=0,bl=0,Ql=0,Fr=0,tn=0,Aa=0,vi=null,Qt=null,Jr=!1,_s=0,Yf=0,Ds=1/0,ks=null,gl=null,wt=0,yl=null,Ea=null,In=0,Wr=0,Ir=null,Gf=null,xi=0,$r=null;function nn(){return(Fe&2)!==0&&Oe!==0?Oe&-Oe:E.T!==null?ac():lu()}function qf(){if(tn===0)if((Oe&536870912)===0||He){var e=jt;jt<<=1,(jt&3932160)===0&&(jt=262144),tn=e}else tn=536870912;return e=$t.current,e!==null&&(e.flags|=32),tn}function Ft(e,t,n){(e===at&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(ja(e,0),vl(e,Oe,tn,!1)),Lt(e,n),((Fe&2)===0||e!==at)&&(e===at&&((Fe&2)===0&&(Ql|=n),dt===4&&vl(e,Oe,tn,!1)),_n(e))}function Xf(e,t,n){if((Fe&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ne(e,t),a=l?Hb(e,t):ec(e,t,!0),i=l;do{if(a===0){Na&&!l&&vl(e,t,0,!1);break}else{if(n=e.current.alternate,i&&!Ub(n)){a=ec(e,t,!1),i=!1;continue}if(a===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var h=e;a=vi;var g=h.current.memoizedState.isDehydrated;if(g&&(ja(h,d).flags|=256),d=ec(h,d,!1),d!==2){if(Qr&&!g){h.errorRecoveryDisabledLanes|=i,Ql|=i,a=4;break e}i=Qt,Qt=a,i!==null&&(Qt===null?Qt=i:Qt.push.apply(Qt,i))}a=d}if(i=!1,a!==2)continue}}if(a===1){ja(e,0),vl(e,t,0,!0);break}e:{switch(l=e,i=a,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:vl(l,t,tn,!pl);break e;case 2:Qt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(a=_s+300-I(),10<a)){if(vl(l,t,tn,!pl),te(l,0,!0)!==0)break e;In=t,l.timeoutHandle=Sm(Vf.bind(null,l,n,Qt,ks,Jr,t,tn,Ql,Aa,pl,i,"Throttled",-0,0),a);break e}Vf(l,n,Qt,ks,Jr,t,tn,Ql,Aa,pl,i,null,-0,0)}}break}while(!0);_n(e)}function Vf(e,t,n,l,a,i,d,h,g,N,M,O,A,R){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ln},Uf(t,i,O);var P=(i&62914560)===i?_s-I():(i&4194048)===i?Yf-I():0;if(P=Sg(O,P),P!==null){In=i,e.cancelPendingCommit=P(Pf.bind(null,e,t,i,n,l,a,d,h,g,M,O,null,A,R)),vl(e,i,d,!N);return}}Pf(e,t,i,n,l,a,d,h,g)}function Ub(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 a=n[l],i=a.getSnapshot;a=a.value;try{if(!Wt(i(),a))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 vl(e,t,n,l){t&=~Fr,t&=~Ql,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var i=31-ot(a),d=1<<i;l[i]=-1,a&=~d}n!==0&&zl(e,n,t)}function Os(){return(Fe&6)===0?(Si(0),!1):!0}function Pr(){if(ze!==null){if(Pe===0)var e=ze.return;else e=ze,Kn=Bl=null,pr(e),ya=null,li=0,e=ze;for(;e!==null;)wf(e.alternate,e),e=e.return;ze=null}}function ja(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,lg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),In=0,Pr(),at=e,ze=n=Bn(e.current,null),Oe=t,Pe=0,en=null,pl=!1,Na=Ne(e,t),Qr=!1,Aa=tn=Fr=Ql=bl=dt=0,Qt=vi=null,Jr=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-ot(l),i=1<<a;t|=e[a],l&=~i}return Wn=t,ns(),n}function Zf(e,t){Ce=null,E.H=di,t===ga||t===us?(t=od(),Pe=3):t===lr?(t=od(),Pe=4):Pe=t===Mr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,en=t,ze===null&&(dt=1,Cs(e,cn(t,e.current)))}function Qf(){var e=$t.current;return e===null?!0:(Oe&4194048)===Oe?mn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===mn:!1}function Ff(){var e=E.H;return E.H=di,e===null?di:e}function Jf(){var e=E.A;return E.A=Ob,e}function Ls(){dt=4,pl||(Oe&4194048)!==Oe&&$t.current!==null||(Na=!0),(bl&134217727)===0&&(Ql&134217727)===0||at===null||vl(at,Oe,tn,!1)}function ec(e,t,n){var l=Fe;Fe|=2;var a=Ff(),i=Jf();(at!==e||Oe!==t)&&(ks=null,ja(e,t)),t=!1;var d=dt;e:do try{if(Pe!==0&&ze!==null){var h=ze,g=en;switch(Pe){case 8:Pr(),d=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var N=Pe;if(Pe=0,en=null,Ra(e,h,g,N),n&&Na){d=0;break e}break;default:N=Pe,Pe=0,en=null,Ra(e,h,g,N)}}Bb(),d=dt;break}catch(M){Zf(e,M)}while(!0);return t&&e.shellSuspendCounter++,Kn=Bl=null,Fe=l,E.H=a,E.A=i,ze===null&&(at=null,Oe=0,ns()),d}function Bb(){for(;ze!==null;)Wf(ze)}function Hb(e,t){var n=Fe;Fe|=2;var l=Ff(),a=Jf();at!==e||Oe!==t?(ks=null,Ds=I()+500,ja(e,t)):Na=Ne(e,t);e:do try{if(Pe!==0&&ze!==null){t=ze;var i=en;t:switch(Pe){case 1:Pe=0,en=null,Ra(e,t,i,1);break;case 2:case 9:if(id(i)){Pe=0,en=null,If(t);break}t=function(){Pe!==2&&Pe!==9||at!==e||(Pe=7),_n(e)},i.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:id(i)?(Pe=0,en=null,If(t)):(Pe=0,en=null,Ra(e,t,i,7));break;case 5:var d=null;switch(ze.tag){case 26:d=ze.memoizedState;case 5:case 27:var h=ze;if(d?Lm(d):h.stateNode.complete){Pe=0,en=null;var g=h.sibling;if(g!==null)ze=g;else{var N=h.return;N!==null?(ze=N,Us(N)):ze=null}break t}}Pe=0,en=null,Ra(e,t,i,5);break;case 6:Pe=0,en=null,Ra(e,t,i,6);break;case 8:Pr(),dt=6;break e;default:throw Error(c(462))}}Kb();break}catch(M){Zf(e,M)}while(!0);return Kn=Bl=null,E.H=l,E.A=a,Fe=n,ze!==null?0:(at=null,Oe=0,ns(),dt)}function Kb(){for(;ze!==null&&!an();)Wf(ze)}function Wf(e){var t=xf(e.alternate,e,Wn);e.memoizedProps=e.pendingProps,t===null?Us(e):ze=t}function If(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hf(n,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=hf(n,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:pr(t);default:wf(n,t),t=ze=Fu(t,Wn),t=xf(n,t,Wn)}e.memoizedProps=e.pendingProps,t===null?Us(e):ze=t}function Ra(e,t,n,l){Kn=Bl=null,pr(t),ya=null,li=0;var a=t.return;try{if(jb(e,a,t,n,Oe)){dt=1,Cs(e,cn(n,e.current)),ze=null;return}}catch(i){if(a!==null)throw ze=a,i;dt=1,Cs(e,cn(n,e.current)),ze=null;return}t.flags&32768?(He||l===1?e=!0:Na||(Oe&536870912)!==0?e=!1:(pl=e=!0,(l===2||l===9||l===3||l===6)&&(l=$t.current,l!==null&&l.tag===13&&(l.flags|=16384))),$f(t,e)):Us(t)}function Us(e){var t=e;do{if((t.flags&32768)!==0){$f(t,pl);return}e=t.return;var n=Mb(t.alternate,t,Wn);if(n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);dt===0&&(dt=5)}function $f(e,t){do{var n=_b(e.alternate,e);if(n!==null){n.flags&=32767,ze=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=n}while(e!==null);dt=6,ze=null}function Pf(e,t,n,l,a,i,d,h,g){e.cancelPendingCommit=null;do Bs();while(wt!==0);if((Fe&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=Go,St(e,n,i,d,h,g),e===at&&(ze=at=null,Oe=0),Ea=t,yl=e,In=n,Wr=i,Ir=a,Gf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xb(Jt,function(){return am(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=E.T,E.T=null,a=L.p,L.p=2,d=Fe,Fe|=4;try{Db(e,t,n)}finally{Fe=d,L.p=a,E.T=l}}wt=1,em(),tm(),nm()}}function em(){if(wt===1){wt=0;var e=yl,t=Ea,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=E.T,E.T=null;var l=L.p;L.p=2;var a=Fe;Fe|=4;try{kf(t,e);var i=fc,d=Hu(e.containerInfo),h=i.focusedElem,g=i.selectionRange;if(d!==h&&h&&h.ownerDocument&&Bu(h.ownerDocument.documentElement,h)){if(g!==null&&Uo(h)){var N=g.start,M=g.end;if(M===void 0&&(M=N),"selectionStart"in h)h.selectionStart=N,h.selectionEnd=Math.min(M,h.value.length);else{var O=h.ownerDocument||document,A=O&&O.defaultView||window;if(A.getSelection){var R=A.getSelection(),P=h.textContent.length,ue=Math.min(g.start,P),lt=g.end===void 0?ue:Math.min(g.end,P);!R.extend&&ue>lt&&(d=lt,lt=ue,ue=d);var S=Uu(h,ue),y=Uu(h,lt);if(S&&y&&(R.rangeCount!==1||R.anchorNode!==S.node||R.anchorOffset!==S.offset||R.focusNode!==y.node||R.focusOffset!==y.offset)){var C=O.createRange();C.setStart(S.node,S.offset),R.removeAllRanges(),ue>lt?(R.addRange(C),R.extend(y.node,y.offset)):(C.setEnd(y.node,y.offset),R.addRange(C))}}}}for(O=[],R=h;R=R.parentNode;)R.nodeType===1&&O.push({element:R,left:R.scrollLeft,top:R.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<O.length;h++){var D=O[h];D.element.scrollLeft=D.left,D.element.scrollTop=D.top}}Ws=!!dc,fc=dc=null}finally{Fe=a,L.p=l,E.T=n}}e.current=t,wt=2}}function tm(){if(wt===2){wt=0;var e=yl,t=Ea,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=E.T,E.T=null;var l=L.p;L.p=2;var a=Fe;Fe|=4;try{Rf(e,t.alternate,t)}finally{Fe=a,L.p=l,E.T=n}}wt=3}}function nm(){if(wt===4||wt===3){wt=0,mt();var e=yl,t=Ea,n=In,l=Gf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,Ea=yl=null,lm(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(gl=null),yo(n),t=t.stateNode,be&&typeof be.onCommitFiberRoot=="function")try{be.onCommitFiberRoot(ae,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=E.T,a=L.p,L.p=2,E.T=null;try{for(var i=e.onRecoverableError,d=0;d<l.length;d++){var h=l[d];i(h.value,{componentStack:h.stack})}}finally{E.T=t,L.p=a}}(In&3)!==0&&Bs(),_n(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===$r?xi++:(xi=0,$r=e):xi=0,Si(0)}}function lm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ti(t)))}function Bs(){return em(),tm(),nm(),am()}function am(){if(wt!==5)return!1;var e=yl,t=Wr;Wr=0;var n=yo(In),l=E.T,a=L.p;try{L.p=32>n?32:n,E.T=null,n=Ir,Ir=null;var i=yl,d=In;if(wt=0,Ea=yl=null,In=0,(Fe&6)!==0)throw Error(c(331));var h=Fe;if(Fe|=4,Hf(i.current),Lf(i,i.current,d,n),Fe=h,Si(0,!1),be&&typeof be.onPostCommitFiberRoot=="function")try{be.onPostCommitFiberRoot(ae,i)}catch{}return!0}finally{L.p=a,E.T=l,lm(e,t)}}function im(e,t,n){t=cn(n,t),t=zr(e.stateNode,t,2),e=dl(e,t,2),e!==null&&(Lt(e,2),_n(e))}function et(e,t,n){if(e.tag===3)im(e,e,n);else for(;t!==null;){if(t.tag===3){im(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(gl===null||!gl.has(l))){e=cn(n,e),n=sf(2),l=dl(t,n,2),l!==null&&(of(n,l,t,e),Lt(l,2),_n(l));break}}t=t.return}}function tc(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Lb;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(Qr=!0,a.add(n),e=Yb.bind(null,e,t,n),t.then(e,e))}function Yb(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,at===e&&(Oe&n)===n&&(dt===4||dt===3&&(Oe&62914560)===Oe&&300>I()-_s?(Fe&2)===0&&ja(e,0):Fr|=n,Aa===Oe&&(Aa=0)),_n(e)}function sm(e,t){t===0&&(t=qe()),e=Ol(e,t),e!==null&&(Lt(e,t),_n(e))}function Gb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sm(e,n)}function qb(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),sm(e,n)}function Xb(e,t){return Ie(e,t)}var Hs=null,za=null,nc=!1,Ks=!1,lc=!1,xl=0;function _n(e){e!==za&&e.next===null&&(za===null?Hs=za=e:za=za.next=e),Ks=!0,nc||(nc=!0,Zb())}function Si(e,t){if(!lc&&Ks){lc=!0;do for(var n=!1,l=Hs;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var i=0;else{var d=l.suspendedLanes,h=l.pingedLanes;i=(1<<31-ot(42|e)+1)-1,i&=a&~(d&~h),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,um(l,i))}else i=Oe,i=te(l,l===at?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||Ne(l,i)||(n=!0,um(l,i));l=l.next}while(n);lc=!1}}function Vb(){om()}function om(){Ks=nc=!1;var e=0;xl!==0&&ng()&&(e=xl);for(var t=I(),n=null,l=Hs;l!==null;){var a=l.next,i=rm(l,t);i===0?(l.next=null,n===null?Hs=a:n.next=a,a===null&&(za=n)):(n=l,(e!==0||(i&3)!==0)&&(Ks=!0)),l=a}wt!==0&&wt!==5||Si(e),xl!==0&&(xl=0)}function rm(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-ot(i),h=1<<d,g=a[d];g===-1?((h&n)===0||(h&l)!==0)&&(a[d]=je(h,t)):g<=t&&(e.expiredLanes|=h),i&=~h}if(t=at,n=Oe,n=te(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&ln(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ne(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&ln(l),yo(n)){case 2:case 8:n=Ge;break;case 32:n=Jt;break;case 268435456:n=Ct;break;default:n=Jt}return l=cm.bind(null,e),n=Ie(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&ln(l),e.callbackPriority=2,e.callbackNode=null,2}function cm(e,t){if(wt!==0&&wt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bs()&&e.callbackNode!==n)return null;var l=Oe;return l=te(e,e===at?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Xf(e,l,t),rm(e,I()),e.callbackNode!=null&&e.callbackNode===n?cm.bind(null,e):null)}function um(e,t){if(Bs())return null;Xf(e,t,!0)}function Zb(){ag(function(){(Fe&6)!==0?Ie(fe,Vb):om()})}function ac(){if(xl===0){var e=pa;e===0&&(e=Nt,Nt<<=1,(Nt&261888)===0&&(Nt=256)),xl=e}return xl}function dm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Fi(""+e)}function fm(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 Qb(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var i=dm((a[Gt]||null).action),d=l.submitter;d&&(t=(t=d[Gt]||null)?dm(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var h=new $i("action","action",null,l,a);e.push({event:h,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(xl!==0){var g=d?fm(a,d):new FormData(a);Cr(n,{pending:!0,data:g,method:a.method,action:i},null,g)}}else typeof i=="function"&&(h.preventDefault(),g=d?fm(a,d):new FormData(a),Cr(n,{pending:!0,data:g,method:a.method,action:i},i,g))},currentTarget:a}]})}}for(var ic=0;ic<Yo.length;ic++){var sc=Yo[ic],Fb=sc.toLowerCase(),Jb=sc[0].toUpperCase()+sc.slice(1);Cn(Fb,"on"+Jb)}Cn(Gu,"onAnimationEnd"),Cn(qu,"onAnimationIteration"),Cn(Xu,"onAnimationStart"),Cn("dblclick","onDoubleClick"),Cn("focusin","onFocus"),Cn("focusout","onBlur"),Cn(db,"onTransitionRun"),Cn(fb,"onTransitionStart"),Cn(mb,"onTransitionCancel"),Cn(Vu,"onTransitionEnd"),ta("onMouseEnter",["mouseout","mouseover"]),ta("onMouseLeave",["mouseout","mouseover"]),ta("onPointerEnter",["pointerout","pointerover"]),ta("onPointerLeave",["pointerout","pointerover"]),Ml("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ml("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ml("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ml("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ml("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ml("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wi="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(" "),Wb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wi));function mm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var d=l.length-1;0<=d;d--){var h=l[d],g=h.instance,N=h.currentTarget;if(h=h.listener,g!==i&&a.isPropagationStopped())break e;i=h,a.currentTarget=N;try{i(a)}catch(M){ts(M)}a.currentTarget=null,i=g}else for(d=0;d<l.length;d++){if(h=l[d],g=h.instance,N=h.currentTarget,h=h.listener,g!==i&&a.isPropagationStopped())break e;i=h,a.currentTarget=N;try{i(a)}catch(M){ts(M)}a.currentTarget=null,i=g}}}}function Me(e,t){var n=t[vo];n===void 0&&(n=t[vo]=new Set);var l=e+"__bubble";n.has(l)||(hm(t,e,2,!1),n.add(l))}function oc(e,t,n){var l=0;t&&(l|=4),hm(n,e,l,t)}var Ys="_reactListening"+Math.random().toString(36).slice(2);function rc(e){if(!e[Ys]){e[Ys]=!0,su.forEach(function(n){n!=="selectionchange"&&(Wb.has(n)||oc(n,!1,e),oc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ys]||(t[Ys]=!0,oc("selectionchange",!1,t))}}function hm(e,t,n,l){switch(qm(t)){case 2:var a=Cg;break;case 8:a=Ng;break;default:a=Tc}n=a.bind(null,t,n,e),a=void 0,!jo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function cc(e,t,n,l,a){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var h=l.stateNode.containerInfo;if(h===a)break;if(d===4)for(d=l.return;d!==null;){var g=d.tag;if((g===3||g===4)&&d.stateNode.containerInfo===a)return;d=d.return}for(;h!==null;){if(d=$l(h),d===null)return;if(g=d.tag,g===5||g===6||g===26||g===27){l=i=d;continue e}h=h.parentNode}}l=l.return}yu(function(){var N=i,M=Ao(n),O=[];e:{var A=Zu.get(e);if(A!==void 0){var R=$i,P=e;switch(e){case"keypress":if(Wi(n)===0)break e;case"keydown":case"keyup":R=qp;break;case"focusin":P="focus",R=_o;break;case"focusout":P="blur",R=_o;break;case"beforeblur":case"afterblur":R=_o;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":R=Su;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":R=Mp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":R=Zp;break;case Gu:case qu:case Xu:R=kp;break;case Vu:R=Fp;break;case"scroll":case"scrollend":R=Rp;break;case"wheel":R=Wp;break;case"copy":case"cut":case"paste":R=Lp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":R=Tu;break;case"toggle":case"beforetoggle":R=$p}var ue=(t&4)!==0,lt=!ue&&(e==="scroll"||e==="scrollend"),S=ue?A!==null?A+"Capture":null:A;ue=[];for(var y=N,C;y!==null;){var D=y;if(C=D.stateNode,D=D.tag,D!==5&&D!==26&&D!==27||C===null||S===null||(D=Xa(y,S),D!=null&&ue.push(Ti(y,D,C))),lt)break;y=y.return}0<ue.length&&(A=new R(A,P,null,n,M),O.push({event:A,listeners:ue}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",A&&n!==No&&(P=n.relatedTarget||n.fromElement)&&($l(P)||P[Il]))break e;if((R||A)&&(A=M.window===M?M:(A=M.ownerDocument)?A.defaultView||A.parentWindow:window,R?(P=n.relatedTarget||n.toElement,R=N,P=P?$l(P):null,P!==null&&(lt=f(P),ue=P.tag,P!==lt||ue!==5&&ue!==27&&ue!==6)&&(P=null)):(R=null,P=N),R!==P)){if(ue=Su,D="onMouseLeave",S="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(ue=Tu,D="onPointerLeave",S="onPointerEnter",y="pointer"),lt=R==null?A:qa(R),C=P==null?A:qa(P),A=new ue(D,y+"leave",R,n,M),A.target=lt,A.relatedTarget=C,D=null,$l(M)===N&&(ue=new ue(S,y+"enter",P,n,M),ue.target=C,ue.relatedTarget=lt,D=ue),lt=D,R&&P)t:{for(ue=Ib,S=R,y=P,C=0,D=S;D;D=ue(D))C++;D=0;for(var oe=y;oe;oe=ue(oe))D++;for(;0<C-D;)S=ue(S),C--;for(;0<D-C;)y=ue(y),D--;for(;C--;){if(S===y||y!==null&&S===y.alternate){ue=S;break t}S=ue(S),y=ue(y)}ue=null}else ue=null;R!==null&&pm(O,A,R,ue,!1),P!==null&&lt!==null&&pm(O,lt,P,ue,!0)}}e:{if(A=N?qa(N):window,R=A.nodeName&&A.nodeName.toLowerCase(),R==="select"||R==="input"&&A.type==="file")var Ve=Mu;else if(Ru(A))if(_u)Ve=rb;else{Ve=sb;var le=ib}else R=A.nodeName,!R||R.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?N&&Co(N.elementType)&&(Ve=Mu):Ve=ob;if(Ve&&(Ve=Ve(e,N))){zu(O,Ve,n,M);break e}le&&le(e,A,N),e==="focusout"&&N&&A.type==="number"&&N.memoizedProps.value!=null&&To(A,"number",A.value)}switch(le=N?qa(N):window,e){case"focusin":(Ru(le)||le.contentEditable==="true")&&(oa=le,Bo=N,$a=null);break;case"focusout":$a=Bo=oa=null;break;case"mousedown":Ho=!0;break;case"contextmenu":case"mouseup":case"dragend":Ho=!1,Ku(O,n,M);break;case"selectionchange":if(ub)break;case"keydown":case"keyup":Ku(O,n,M)}var Ae;if(ko)e:{switch(e){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else sa?Eu(e,n)&&(Le="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Le="onCompositionStart");Le&&(Cu&&n.locale!=="ko"&&(sa||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&sa&&(Ae=vu()):(al=M,Ro="value"in al?al.value:al.textContent,sa=!0)),le=Gs(N,Le),0<le.length&&(Le=new wu(Le,e,null,n,M),O.push({event:Le,listeners:le}),Ae?Le.data=Ae:(Ae=ju(n),Ae!==null&&(Le.data=Ae)))),(Ae=eb?tb(e,n):nb(e,n))&&(Le=Gs(N,"onBeforeInput"),0<Le.length&&(le=new wu("onBeforeInput","beforeinput",null,n,M),O.push({event:le,listeners:Le}),le.data=Ae)),Qb(O,e,N,n,M)}mm(O,t)})}function Ti(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gs(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,i=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||i===null||(a=Xa(e,n),a!=null&&l.unshift(Ti(e,a,i)),a=Xa(e,t),a!=null&&l.push(Ti(e,a,i))),e.tag===3)return l;e=e.return}return[]}function Ib(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pm(e,t,n,l,a){for(var i=t._reactName,d=[];n!==null&&n!==l;){var h=n,g=h.alternate,N=h.stateNode;if(h=h.tag,g!==null&&g===l)break;h!==5&&h!==26&&h!==27||N===null||(g=N,a?(N=Xa(n,i),N!=null&&d.unshift(Ti(n,N,g))):a||(N=Xa(n,i),N!=null&&d.push(Ti(n,N,g)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var $b=/\r\n?/g,Pb=/\u0000|\uFFFD/g;function bm(e){return(typeof e=="string"?e:""+e).replace($b,`
33
+ `).replace(Pb,"")}function gm(e,t){return t=bm(t),bm(e)===t}function nt(e,t,n,l,a,i){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||la(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&la(e,""+l);break;case"className":Zi(e,"class",l);break;case"tabIndex":Zi(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Zi(e,n,l);break;case"style":bu(e,l,i);break;case"data":if(t!=="object"){Zi(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=Fi(""+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 i=="function"&&(n==="formAction"?(t!=="input"&&nt(e,t,"name",a.name,a,null),nt(e,t,"formEncType",a.formEncType,a,null),nt(e,t,"formMethod",a.formMethod,a,null),nt(e,t,"formTarget",a.formTarget,a,null)):(nt(e,t,"encType",a.encType,a,null),nt(e,t,"method",a.method,a,null),nt(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=Fi(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=Ln);break;case"onScroll":l!=null&&Me("scroll",e);break;case"onScrollEnd":l!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(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=Fi(""+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":Me("beforetoggle",e),Me("toggle",e),Vi(e,"popover",l);break;case"xlinkActuate":On(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":On(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":On(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":On(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":On(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":On(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":On(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":On(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":On(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Vi(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=Ep.get(n)||n,Vi(e,n,l))}}function uc(e,t,n,l,a,i){switch(n){case"style":bu(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?la(e,l):(typeof l=="number"||typeof l=="bigint")&&la(e,""+l);break;case"onScroll":l!=null&&Me("scroll",e);break;case"onScrollEnd":l!=null&&Me("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Ln);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ou.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),i=e[Gt]||null,i=i!=null?i[n]:null,typeof i=="function"&&e.removeEventListener(t,i,a),typeof l=="function")){typeof i!="function"&&i!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Vi(e,n,l)}}}function Dt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var l=!1,a=!1,i;for(i in n)if(n.hasOwnProperty(i)){var d=n[i];if(d!=null)switch(i){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:nt(e,t,i,d,n,null)}}a&&nt(e,t,"srcSet",n.srcSet,n,null),l&&nt(e,t,"src",n.src,n,null);return;case"input":Me("invalid",e);var h=i=d=a=null,g=null,N=null;for(l in n)if(n.hasOwnProperty(l)){var M=n[l];if(M!=null)switch(l){case"name":a=M;break;case"type":d=M;break;case"checked":g=M;break;case"defaultChecked":N=M;break;case"value":i=M;break;case"defaultValue":h=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(c(137,t));break;default:nt(e,t,l,M,n,null)}}fu(e,i,h,g,N,d,a,!1);return;case"select":Me("invalid",e),l=d=i=null;for(a in n)if(n.hasOwnProperty(a)&&(h=n[a],h!=null))switch(a){case"value":i=h;break;case"defaultValue":d=h;break;case"multiple":l=h;default:nt(e,t,a,h,n,null)}t=i,n=d,e.multiple=!!l,t!=null?na(e,!!l,t,!1):n!=null&&na(e,!!l,n,!0);return;case"textarea":Me("invalid",e),i=a=l=null;for(d in n)if(n.hasOwnProperty(d)&&(h=n[d],h!=null))switch(d){case"value":l=h;break;case"defaultValue":a=h;break;case"children":i=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(c(91));break;default:nt(e,t,d,h,n,null)}hu(e,l,a,i);return;case"option":for(g in n)if(n.hasOwnProperty(g)&&(l=n[g],l!=null))switch(g){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:nt(e,t,g,l,n,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(l=0;l<wi.length;l++)Me(wi[l],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("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(N in n)if(n.hasOwnProperty(N)&&(l=n[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:nt(e,t,N,l,n,null)}return;default:if(Co(t)){for(M in n)n.hasOwnProperty(M)&&(l=n[M],l!==void 0&&uc(e,t,M,l,n,void 0));return}}for(h in n)n.hasOwnProperty(h)&&(l=n[h],l!=null&&nt(e,t,h,l,n,null))}function eg(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 a=null,i=null,d=null,h=null,g=null,N=null,M=null;for(R in n){var O=n[R];if(n.hasOwnProperty(R)&&O!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":g=O;default:l.hasOwnProperty(R)||nt(e,t,R,null,l,O)}}for(var A in l){var R=l[A];if(O=n[A],l.hasOwnProperty(A)&&(R!=null||O!=null))switch(A){case"type":i=R;break;case"name":a=R;break;case"checked":N=R;break;case"defaultChecked":M=R;break;case"value":d=R;break;case"defaultValue":h=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(c(137,t));break;default:R!==O&&nt(e,t,A,R,l,O)}}wo(e,d,h,g,N,M,i,a);return;case"select":R=d=h=A=null;for(i in n)if(g=n[i],n.hasOwnProperty(i)&&g!=null)switch(i){case"value":break;case"multiple":R=g;default:l.hasOwnProperty(i)||nt(e,t,i,null,l,g)}for(a in l)if(i=l[a],g=n[a],l.hasOwnProperty(a)&&(i!=null||g!=null))switch(a){case"value":A=i;break;case"defaultValue":h=i;break;case"multiple":d=i;default:i!==g&&nt(e,t,a,i,l,g)}t=h,n=d,l=R,A!=null?na(e,!!n,A,!1):!!l!=!!n&&(t!=null?na(e,!!n,t,!0):na(e,!!n,n?[]:"",!1));return;case"textarea":R=A=null;for(h in n)if(a=n[h],n.hasOwnProperty(h)&&a!=null&&!l.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:nt(e,t,h,null,l,a)}for(d in l)if(a=l[d],i=n[d],l.hasOwnProperty(d)&&(a!=null||i!=null))switch(d){case"value":A=a;break;case"defaultValue":R=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(c(91));break;default:a!==i&&nt(e,t,d,a,l,i)}mu(e,A,R);return;case"option":for(var P in n)if(A=n[P],n.hasOwnProperty(P)&&A!=null&&!l.hasOwnProperty(P))switch(P){case"selected":e.selected=!1;break;default:nt(e,t,P,null,l,A)}for(g in l)if(A=l[g],R=n[g],l.hasOwnProperty(g)&&A!==R&&(A!=null||R!=null))switch(g){case"selected":e.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:nt(e,t,g,A,l,R)}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 ue in n)A=n[ue],n.hasOwnProperty(ue)&&A!=null&&!l.hasOwnProperty(ue)&&nt(e,t,ue,null,l,A);for(N in l)if(A=l[N],R=n[N],l.hasOwnProperty(N)&&A!==R&&(A!=null||R!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(c(137,t));break;default:nt(e,t,N,A,l,R)}return;default:if(Co(t)){for(var lt in n)A=n[lt],n.hasOwnProperty(lt)&&A!==void 0&&!l.hasOwnProperty(lt)&&uc(e,t,lt,void 0,l,A);for(M in l)A=l[M],R=n[M],!l.hasOwnProperty(M)||A===R||A===void 0&&R===void 0||uc(e,t,M,A,l,R);return}}for(var S in n)A=n[S],n.hasOwnProperty(S)&&A!=null&&!l.hasOwnProperty(S)&&nt(e,t,S,null,l,A);for(O in l)A=l[O],R=n[O],!l.hasOwnProperty(O)||A===R||A==null&&R==null||nt(e,t,O,A,l,R)}function ym(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],i=a.transferSize,d=a.initiatorType,h=a.duration;if(i&&h&&ym(d)){for(d=0,h=a.responseEnd,l+=1;l<n.length;l++){var g=n[l],N=g.startTime;if(N>h)break;var M=g.transferSize,O=g.initiatorType;M&&ym(O)&&(g=g.responseEnd,d+=M*(g<h?1:(h-N)/(g-N)))}if(--l,t+=8*(i+d)/(a.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 dc=null,fc=null;function qs(e){return e.nodeType===9?e:e.ownerDocument}function vm(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 xm(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 mc(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 hc=null;function ng(){var e=window.event;return e&&e.type==="popstate"?e===hc?!1:(hc=e,!0):(hc=null,!1)}var Sm=typeof setTimeout=="function"?setTimeout:void 0,lg=typeof clearTimeout=="function"?clearTimeout:void 0,wm=typeof Promise=="function"?Promise:void 0,ag=typeof queueMicrotask=="function"?queueMicrotask:typeof wm<"u"?function(e){return wm.resolve(null).then(e).catch(ig)}:Sm;function ig(e){setTimeout(function(){throw e})}function Sl(e){return e==="head"}function Tm(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),ka(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Ci(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ci(n);for(var i=n.firstChild;i;){var d=i.nextSibling,h=i.nodeName;i[Ga]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=d}}else n==="body"&&Ci(e.ownerDocument.body);n=a}while(n);ka(t)}function Cm(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 pc(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":pc(n),xo(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function sg(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ga])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=hn(e.nextSibling),e===null)break}return null}function og(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=hn(e.nextSibling),e===null))return null;return e}function Nm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=hn(e.nextSibling),e===null))return null;return e}function bc(e){return e.data==="$?"||e.data==="$~"}function gc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rg(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 hn(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 yc=null;function Am(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return hn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Em(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 jm(e,t,n){switch(t=qs(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Ci(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xo(e)}var pn=new Map,Rm=new Set;function Xs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $n=L.d;L.d={f:cg,r:ug,D:dg,C:fg,L:mg,m:hg,X:bg,S:pg,M:gg};function cg(){var e=$n.f(),t=Os();return e||t}function ug(e){var t=Pl(e);t!==null&&t.tag===5&&t.type==="form"?Vd(t):$n.r(e)}var Ma=typeof document>"u"?null:document;function zm(e,t,n){var l=Ma;if(l&&typeof t=="string"&&t){var a=on(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),Rm.has(a)||(Rm.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),Dt(t,"link",e),At(t),l.head.appendChild(t)))}}function dg(e){$n.D(e),zm("dns-prefetch",e,null)}function fg(e,t){$n.C(e,t),zm("preconnect",e,t)}function mg(e,t,n){$n.L(e,t,n);var l=Ma;if(l&&e&&t){var a='link[rel="preload"][as="'+on(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+on(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+on(n.imageSizes)+'"]')):a+='[href="'+on(e)+'"]';var i=a;switch(t){case"style":i=_a(e);break;case"script":i=Da(e)}pn.has(i)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),pn.set(i,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(Ni(i))||t==="script"&&l.querySelector(Ai(i))||(t=l.createElement("link"),Dt(t,"link",e),At(t),l.head.appendChild(t)))}}function hg(e,t){$n.m(e,t);var n=Ma;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+on(l)+'"][href="'+on(e)+'"]',i=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Da(e)}if(!pn.has(i)&&(e=j({rel:"modulepreload",href:e},t),pn.set(i,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ai(i)))return}l=n.createElement("link"),Dt(l,"link",e),At(l),n.head.appendChild(l)}}}function pg(e,t,n){$n.S(e,t,n);var l=Ma;if(l&&e){var a=ea(l).hoistableStyles,i=_a(e);t=t||"default";var d=a.get(i);if(!d){var h={loading:0,preload:null};if(d=l.querySelector(Ni(i)))h.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=pn.get(i))&&vc(e,n);var g=d=l.createElement("link");At(g),Dt(g,"link",e),g._p=new Promise(function(N,M){g.onload=N,g.onerror=M}),g.addEventListener("load",function(){h.loading|=1}),g.addEventListener("error",function(){h.loading|=2}),h.loading|=4,Vs(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:h},a.set(i,d)}}}function bg(e,t){$n.X(e,t);var n=Ma;if(n&&e){var l=ea(n).hoistableScripts,a=Da(e),i=l.get(a);i||(i=n.querySelector(Ai(a)),i||(e=j({src:e,async:!0},t),(t=pn.get(a))&&xc(e,t),i=n.createElement("script"),At(i),Dt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function gg(e,t){$n.M(e,t);var n=Ma;if(n&&e){var l=ea(n).hoistableScripts,a=Da(e),i=l.get(a);i||(i=n.querySelector(Ai(a)),i||(e=j({src:e,async:!0,type:"module"},t),(t=pn.get(a))&&xc(e,t),i=n.createElement("script"),At(i),Dt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(a,i))}}function Mm(e,t,n,l){var a=(a=Ee.current)?Xs(a):null;if(!a)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=_a(n.href),n=ea(a).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=_a(n.href);var i=ea(a).hoistableStyles,d=i.get(e);if(d||(a=a.ownerDocument||a,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=a.querySelector(Ni(e)))&&!i._p&&(d.instance=i,d.state.loading=5),pn.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},pn.set(e,n),i||yg(a,e,n,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Da(n),n=ea(a).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(c(444,e))}}function _a(e){return'href="'+on(e)+'"'}function Ni(e){return'link[rel="stylesheet"]['+e+"]"}function _m(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function yg(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}),Dt(t,"link",n),At(t),e.head.appendChild(t))}function Da(e){return'[src="'+on(e)+'"]'}function Ai(e){return"script[async]"+e}function Dm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+on(n.href)+'"]');if(l)return t.instance=l,At(l),l;var a=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),At(l),Dt(l,"style",a),Vs(l,n.precedence,e),t.instance=l;case"stylesheet":a=_a(n.href);var i=e.querySelector(Ni(a));if(i)return t.state.loading|=4,t.instance=i,At(i),i;l=_m(n),(a=pn.get(a))&&vc(l,a),i=(e.ownerDocument||e).createElement("link"),At(i);var d=i;return d._p=new Promise(function(h,g){d.onload=h,d.onerror=g}),Dt(i,"link",l),t.state.loading|=4,Vs(i,n.precedence,e),t.instance=i;case"script":return i=Da(n.src),(a=e.querySelector(Ai(i)))?(t.instance=a,At(a),a):(l=n,(a=pn.get(i))&&(l=j({},n),xc(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),At(a),Dt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Vs(l,n.precedence,e));return t.instance}function Vs(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,i=a,d=0;d<l.length;d++){var h=l[d];if(h.dataset.precedence===t)i=h;else if(i!==a)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Zs=null;function km(e,t,n){if(Zs===null){var l=new Map,a=Zs=new Map;a.set(n,l)}else a=Zs,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var i=n[a];if(!(i[Ga]||i[Rt]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var h=l.get(d);h?h.push(i):l.set(d,[i])}}return l}function Om(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function vg(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 Lm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xg(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 a=_a(l.href),i=t.querySelector(Ni(a));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,At(i);return}i=t.ownerDocument||t,l=_m(l),(a=pn.get(a))&&vc(l,a),i=i.createElement("link"),At(i);var d=i;d._p=new Promise(function(h,g){d.onload=h,d.onerror=g}),Dt(i,"link",l),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Qs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Sc=0;function Sg(e,t){return e.stylesheets&&e.count===0&&Js(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Js(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Sc===0&&(Sc=62500*tg());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Js(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Sc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Js(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fs=null;function Js(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fs=new Map,t.forEach(wg,e),Fs=null,Qs.call(e))}function wg(e,t){if(!(t.state.loading&4)){var n=Fs.get(e);if(n)var l=n.get(null);else{n=new Map,Fs.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<a.length;i++){var d=a[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}a=t.instance,d=a.getAttribute("data-precedence"),i=n.get(d)||l,i===l&&n.set(null,a),n.set(d,a),this.count++,l=Qs.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),i?i.parentNode.insertBefore(a,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ei={$$typeof:W,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function Tg(e,t,n,l,a,i,d,h,g){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=Qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qe(0),this.hiddenUpdates=Qe(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=g,this.incompleteTransitions=new Map}function Um(e,t,n,l,a,i,d,h,g,N,M,O){return e=new Tg(e,t,n,d,g,N,M,O,h),t=1,i===!0&&(t|=24),i=It(3,null,null,t),e.current=i,i.stateNode=e,t=er(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:n,cache:t},ar(i),e}function Bm(e){return e?(e=ua,e):ua}function Hm(e,t,n,l,a,i){a=Bm(a),l.context===null?l.context=a:l.pendingContext=a,l=ul(t),l.payload={element:n},i=i===void 0?null:i,i!==null&&(l.callback=i),n=dl(e,l,t),n!==null&&(Ft(n,e,t),ii(n,e,t))}function Km(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function wc(e,t){Km(e,t),(e=e.alternate)&&Km(e,t)}function Ym(e){if(e.tag===13||e.tag===31){var t=Ol(e,67108864);t!==null&&Ft(t,e,67108864),wc(e,67108864)}}function Gm(e){if(e.tag===13||e.tag===31){var t=nn();t=Ya(t);var n=Ol(e,t);n!==null&&Ft(n,e,t),wc(e,t)}}var Ws=!0;function Cg(e,t,n,l){var a=E.T;E.T=null;var i=L.p;try{L.p=2,Tc(e,t,n,l)}finally{L.p=i,E.T=a}}function Ng(e,t,n,l){var a=E.T;E.T=null;var i=L.p;try{L.p=8,Tc(e,t,n,l)}finally{L.p=i,E.T=a}}function Tc(e,t,n,l){if(Ws){var a=Cc(l);if(a===null)cc(e,t,l,Is,n),Xm(e,l);else if(Eg(a,e,t,n,l))l.stopPropagation();else if(Xm(e,l),t&4&&-1<Ag.indexOf(e)){for(;a!==null;){var i=Pl(a);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=B(i.pendingLanes);if(d!==0){var h=i;for(h.pendingLanes|=2,h.entangledLanes|=2;d;){var g=1<<31-ot(d);h.entanglements[1]|=g,d&=~g}_n(i),(Fe&6)===0&&(Ds=I()+500,Si(0))}}break;case 31:case 13:h=Ol(i,2),h!==null&&Ft(h,i,2),Os(),wc(i,2)}if(i=Cc(l),i===null&&cc(e,t,l,Is,n),i===a)break;a=i}a!==null&&l.stopPropagation()}else cc(e,t,l,null,n)}}function Cc(e){return e=Ao(e),Nc(e)}var Is=null;function Nc(e){if(Is=null,e=$l(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=b(t),e!==null)return e;e=null}else if(n===31){if(e=p(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 Is=e,null}function qm(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(we()){case fe:return 2;case Ge:return 8;case Jt:case kn:return 32;case Ct:return 268435456;default:return 32}default:return 32}}var Ac=!1,wl=null,Tl=null,Cl=null,ji=new Map,Ri=new Map,Nl=[],Ag="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 Xm(e,t){switch(e){case"focusin":case"focusout":wl=null;break;case"dragenter":case"dragleave":Tl=null;break;case"mouseover":case"mouseout":Cl=null;break;case"pointerover":case"pointerout":ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ri.delete(t.pointerId)}}function zi(e,t,n,l,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Pl(t),t!==null&&Ym(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Eg(e,t,n,l,a){switch(t){case"focusin":return wl=zi(wl,e,t,n,l,a),!0;case"dragenter":return Tl=zi(Tl,e,t,n,l,a),!0;case"mouseover":return Cl=zi(Cl,e,t,n,l,a),!0;case"pointerover":var i=a.pointerId;return ji.set(i,zi(ji.get(i)||null,e,t,n,l,a)),!0;case"gotpointercapture":return i=a.pointerId,Ri.set(i,zi(Ri.get(i)||null,e,t,n,l,a)),!0}return!1}function Vm(e){var t=$l(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=b(n),t!==null){e.blockedOn=t,au(e.priority,function(){Gm(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,au(e.priority,function(){Gm(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 $s(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);No=l,n.target.dispatchEvent(l),No=null}else return t=Pl(n),t!==null&&Ym(t),e.blockedOn=n,!1;t.shift()}return!0}function Zm(e,t,n){$s(e)&&n.delete(t)}function jg(){Ac=!1,wl!==null&&$s(wl)&&(wl=null),Tl!==null&&$s(Tl)&&(Tl=null),Cl!==null&&$s(Cl)&&(Cl=null),ji.forEach(Zm),Ri.forEach(Zm)}function Ps(e,t){e.blockedOn===t&&(e.blockedOn=null,Ac||(Ac=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,jg)))}var eo=null;function Qm(e){eo!==e&&(eo=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){eo===e&&(eo=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(Nc(l||n)===null)continue;break}var i=Pl(n);i!==null&&(e.splice(t,3),t-=3,Cr(i,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function ka(e){function t(g){return Ps(g,e)}wl!==null&&Ps(wl,e),Tl!==null&&Ps(Tl,e),Cl!==null&&Ps(Cl,e),ji.forEach(t),Ri.forEach(t);for(var n=0;n<Nl.length;n++){var l=Nl[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Nl.length&&(n=Nl[0],n.blockedOn===null);)Vm(n),n.blockedOn===null&&Nl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],i=n[l+1],d=a[Gt]||null;if(typeof i=="function")d||Qm(n);else if(d){var h=null;if(i&&i.hasAttribute("formAction")){if(a=i,d=i[Gt]||null)h=d.formAction;else if(Nc(a)!==null)continue}else h=d.action;typeof h=="function"?n[l+1]=h:(n.splice(l,3),l-=3),Qm(n)}}}function Fm(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return a=d})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=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),a!==null&&(a(),a=null)}}}function Ec(e){this._internalRoot=e}to.prototype.render=Ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=nn();Hm(n,l,e,t,null,null)},to.prototype.unmount=Ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hm(e.current,2,null,e,null,null),Os(),t[Il]=null}};function to(e){this._internalRoot=e}to.prototype.unstable_scheduleHydration=function(e){if(e){var t=lu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nl.length&&t!==0&&t<Nl[n].priority;n++);Nl.splice(n,0,e),n===0&&Vm(e)}};var Jm=s.version;if(Jm!=="19.2.8")throw Error(c(527,Jm,"19.2.8"));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=T(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Rg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var no=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!no.isDisabled&&no.supportsFiber)try{ae=no.inject(Rg),be=no}catch{}}return _i.createRoot=function(e,t){if(!m(e))throw Error(c(299));var n=!1,l="",a=tf,i=nf,d=lf;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Um(e,1,!1,null,null,n,l,null,a,i,d,Fm),e[Il]=t.current,rc(e),new Ec(t)},_i.hydrateRoot=function(e,t,n){if(!m(e))throw Error(c(299));var l=!1,a="",i=tf,d=nf,h=lf,g=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(i=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(h=n.onRecoverableError),n.formState!==void 0&&(g=n.formState)),t=Um(e,1,!0,t,n??null,l,a,g,i,d,h,Fm),t.context=Bm(null),n=t.current,l=nn(),l=Ya(l),a=ul(l),a.callback=null,dl(n,a,l),n=l,t.current.lanes=n,Lt(t,n),_n(t),e[Il]=t.current,rc(e),new to(t)},_i.version="19.2.8",_i}var th;function Gg(){if(th)return Rc.exports;th=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(s){console.error(s)}}return r(),Rc.exports=Yg(),Rc.exports}var qg=Gg();const Xg=_h(qg),de={ESC:"\x1B",TAB:" ",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~"},Vg=new TextEncoder;function kh(r){return Vg.encode(r)}function Zg(r){if(!r||r.length===0)return"";const o=r.toUpperCase().charCodeAt(0);return o>=65&&o<=90?String.fromCharCode(o-64):r==="@"||r===" "?"\0":r==="["?"\x1B":r==="\\"?"":r==="]"?"":r==="^"?"":r==="_"?"":r==="?"?"":r}function Qg(r){return`\x1B${r}`}function Fg(r,s){let o=r;return s.shift&&r.length===1&&!s.ctrl&&(o=r.toUpperCase()),s.ctrl&&(o=Zg(o)),s.alt&&(o=Qg(o)),o}class Jg{constructor(s){Je(this,"ws",null);Je(this,"config");Je(this,"state","disconnected");Je(this,"currentRole","viewer");Je(this,"controllerId");Je(this,"hostId");Je(this,"assignedClientId");Je(this,"reconnectAttempts",0);Je(this,"reconnectTimer",null);Je(this,"pingTimer",null);Je(this,"pingTimestamp",null);Je(this,"isManuallyClosed",!1);Je(this,"authFailureDetail",null);Je(this,"authFailureCode",null);Je(this,"temporaryFailureCode",null);Je(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});Je(this,"terminalCols",80);Je(this,"terminalRows",24);this.config={...s}}updateConfig(s){this.config={...this.config,...s}}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(s,o){return this.listeners[s].add(o),()=>{this.listeners[s].delete(o)}}emit(s,...o){this.listeners[s].forEach(m=>{try{m(...o)}catch(f){console.error(`Error in event listener for ${s}:`,f)}})}setState(s,o,c){this.state!==s&&(this.state=s,this.emit("stateChange",s,o,c))}connect(s){if(s&&(this.terminalCols=s.cols,this.terminalRows=s.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.clearTimers(),this.setState("connecting");try{const o=this.resolveWsUrl(this.config.wsUrl),c=new WebSocket(o);this.ws=c,c.binaryType="arraybuffer",c.onopen=()=>{this.isStaleSocket(c)||this.handleOpen()},c.onmessage=m=>{this.isStaleSocket(c)||this.handleMessage(m)},c.onerror=m=>{this.isStaleSocket(c)||this.handleError(m)},c.onclose=m=>{this.isStaleSocket(c)||this.handleClose(m)}}catch(o){this.setState("error",o instanceof Error?o.message:"Connection failed","connection_failed"),this.scheduleReconnect()}}}isStaleSocket(s){return this.ws!==s}teardownSocket(s=1e3,o="Client closed the connection"){const c=this.ws;if(c){this.ws=null,c.onopen=null,c.onmessage=null,c.onerror=null,c.onclose=null;try{(c.readyState===WebSocket.OPEN||c.readyState===WebSocket.CONNECTING)&&c.close(s,o)}catch{}}}disconnect(){this.isManuallyClosed=!0,this.clearTimers(),this.teardownSocket(1e3,"User initiated disconnect"),this.setState("disconnected")}reconnectWith(s){this.updateConfig(s),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()}handleOpen(){this.sendHello(),this.startHeartbeat()}async handleMessage(s){if(typeof s.data=="string")try{const o=JSON.parse(s.data);this.processJsonMessage(o)}catch(o){console.warn("Received unparseable text frame from server:",o)}else if(s.data instanceof ArrayBuffer)this.emit("binaryData",new Uint8Array(s.data));else if(typeof Blob<"u"&&s.data instanceof Blob)try{const o=await s.data.arrayBuffer();this.emit("binaryData",new Uint8Array(o))}catch(o){console.error("Failed to convert Blob to ArrayBuffer:",o)}}processJsonMessage(s){switch(s.type){case"ready":{this.reconnectAttempts=0,this.setState("connected"),this.currentRole=s.role,this.controllerId=s.controllerId,this.hostId=s.hostId,this.assignedClientId=s.clientId,this.emit("ready",s),this.emit("roleChange",s.role,s.controllerId,s.hostId,s.clientId),typeof s.clientCount=="number"&&this.emit("peerCount",s.clientCount);break}case"paired":{this.emit("paired",{token:s.token,deviceId:s.deviceId,hostId:s.hostId,expiresAt:s.expiresAt});break}case"control_state":{this.currentRole=s.role,this.controllerId=s.controllerId,this.emit("controlState",s.role,s.controllerId),this.emit("roleChange",s.role,s.controllerId,this.hostId,this.assignedClientId),typeof s.clientCount=="number"&&this.emit("peerCount",s.clientCount);break}case"host_reconnecting":{this.temporaryFailureCode="host_reconnecting",this.setState("reconnecting","Herdr host is reconnecting",s.code||"host_reconnecting"),this.emit("hostReconnecting",s.code);break}case"session_restarted":{this.setState("reconnecting","Herdr session is restarting","session_restarted"),this.emit("sessionRestarted",s.cols,s.rows,s.terminalPalette,s.hostname);break}case"control_revoked":{this.currentRole="viewer",this.emit("controlRevoked",s.reason),this.emit("roleChange","viewer",this.controllerId,this.hostId,this.assignedClientId);break}case"session_ready":{this.setState("connected"),this.emit("sessionReady",s);break}case"exit":{this.emit("exit",s.code,s.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",s.message);break}case"status":{this.emit("status",s);break}case"error":{s.code==="host_offline"||s.code==="host_reconnecting"||s.code==="host_reconnect_timeout"||s.code==="rate_limited"?(this.temporaryFailureCode=String(s.code),this.setState("reconnecting",s.message,String(s.code))):(s.code==="auth_required"||s.code==="unauthorized"||s.code==="device_revoked"||s.code==="invalid_handshake"||s.code==="too_many_hosts"||s.code===401||s.code===403)&&(this.authFailureDetail=s.message,this.authFailureCode=String(s.code),this.setState("error",s.message,this.authFailureCode)),this.emit("error",{code:s.code,message:s.message});break}case"pong":{if(this.pingTimestamp){const o=Math.max(0,performance.now()-this.pingTimestamp);this.pingTimestamp=null,this.emit("rttUpdate",Math.round(o))}break}}}handleError(s){console.error("WebSocket error:",s),this.emit("error",{code:"WS_ERROR",message:"WebSocket connection error"})}handleClose(s){if(this.clearTimers(),this.ws=null,this.authFailureDetail){this.setState("error",this.authFailureDetail,this.authFailureCode??void 0);return}if(s.code===1008&&this.temporaryFailureCode){this.setState("reconnecting",s.reason||"The relay is temporarily unavailable",this.temporaryFailureCode),this.scheduleReconnect();return}if(s.code===1008){this.setState("error",s.reason||"The relay rejected the connection",String(s.code));return}!this.isManuallyClosed&&this.config.autoReconnect?(this.setState("reconnecting",`Connection closed (${s.code}). Retrying...`,"connection_closed"),this.scheduleReconnect()):this.setState("disconnected",`Closed: ${s.reason||s.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 s=this.config.reconnectIntervalMs||2e3,c=Math.min(3e4,Math.floor(s*Math.pow(1.5,this.reconnectAttempts-1)+Math.random()*500));this.reconnectTimer=setTimeout(()=>{this.connect()},c)}startHeartbeat(){this.pingTimer&&clearInterval(this.pingTimer);const s=this.config.pingIntervalMs||1e4;this.pingTimer=setInterval(()=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.sendPing()},s)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=null)}sendHello(){const s={type:"hello",protocol:1,clientId:this.config.clientId,cols:this.terminalCols,rows:this.terminalRows,capabilities:["host_handoff"]};this.config.token&&(s.token=this.config.token),this.config.pairCode&&(s.pairCode=this.config.pairCode),this.sendJson(s)}claimControl(s=!1){const o={type:"claim_control",...s?{force:!0}:{}};this.sendJson(o)}releaseControl(){const s={type:"release_control"};this.sendJson(s)}sendResize(s,o){this.terminalCols=s,this.terminalRows=o;const c={type:"resize",cols:s,rows:o};this.sendJson(c)}sendPing(){this.pingTimestamp=performance.now();const s={type:"ping"};this.sendJson(s)}sendJson(s){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(s))}sendBinary(s){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(s)}sendText(s){const o=kh(s);this.sendBinary(o)}resolveWsUrl(s){if(/^wss?:\/\//i.test(s))return s;if(/^https?:\/\//i.test(s)){const o=new URL(s);return o.protocol=o.protocol==="https:"?"wss:":"ws:",(!o.pathname||o.pathname==="/")&&(o.pathname="/ws/client"),o.toString()}if(typeof window<"u"&&window.location){const c=window.location.protocol==="https:"?"wss:":"ws:",m=window.location.host,f=s.startsWith("/")?s:`/${s}`;return`${c}//${m}${f}`}return"ws://127.0.0.1:8787/ws/client"}}const Oh=27,Lh=91,Wg=60,nh=59,Uh=77,Bh=48,Ig=57,$g=64,Pg=-30,_c=32,lh=255;function Hh(r){return Number.isInteger(r)&&(r&Pg)===$g}function ey(r){return r>=Bh&&r<=Ig}function Dc(r,s){let o=s,c=0;for(;o<r.length&&ey(r[o]);){if(c=c*10+(r[o]-Bh),c>65535)return null;o+=1}return o===s?null:{value:c,next:o}}function ty(r,s){if(r[s]!==Oh||r[s+1]!==Lh||r[s+2]!==Wg)return-1;const o=Dc(r,s+3);if(!o||!Hh(o.value)||r[o.next]!==nh)return-1;const c=Dc(r,o.next+1);if(!c||r[c.next]!==nh)return-1;const m=Dc(r,c.next+1);return!m||r[m.next]!==Uh?-1:m.next+1}function ny(r,s){if(r[s]!==Oh||r[s+1]!==Lh||r[s+2]!==Uh||s+6>r.length)return-1;const o=r[s+3]-_c,c=r[s+4],m=r[s+5];return!Hh(o)||c<_c||c>lh||m<_c||m>lh?-1:s+6}function Bc(r){if(!r)return!1;const s=r instanceof Uint8Array?r:new Uint8Array(r);if(s.length===0)return!1;let o=0;for(;o<s.length;){const c=ty(s,o);if(c>o){o=c;continue}const m=ny(s,o);if(m>o){o=m;continue}return!1}return!0}const ly=10,ay=24,po=15,Vc=13,Zc=640;function iy(){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 La()<Zc}function La(){return typeof window>"u"?1024:window.visualViewport&&typeof window.visualViewport.width=="number"&&window.visualViewport.width>0?window.visualViewport.width:window.innerWidth||1024}function kc(){return typeof window>"u"?768:window.visualViewport&&typeof window.visualViewport.height=="number"&&window.visualViewport.height>0?window.visualViewport.height:window.innerHeight||768}function uo(r,s=po){const o=typeof r=="number"?r:Number(r);return!Number.isFinite(o)||o<=0?s:Math.min(ay,Math.max(ly,Math.round(o)))}function ah(r,s=La()){if(s<Zc){const c=uo(r,Vc);return Math.min(15,Math.max(12,c))}return uo(r,po)}const Kh=[{id:"esc",label:"ESC",code:de.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:de.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:de.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:de.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:de.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:de.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{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:"enter",label:"Enter",code:de.ENTER,type:"key",enabled:!0,title:"Enter / Return"}],sy=[{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:de.ESC,type:"key",enabled:!0,title:"Escape"},{id:"tab",label:"TAB",code:de.TAB,type:"key",enabled:!0,title:"Tab"},{id:"enter",label:"Enter",code:de.ENTER,type:"key",enabled:!0,title:"Enter / Return"},{id:"backspace",label:"⌫",code:de.BACKSPACE,type:"key",enabled:!0,title:"Backspace"},{id:"delete",label:"Del",code:de.DELETE,type:"key",enabled:!0,title:"Delete"},{id:"left",label:"←",code:de.LEFT,type:"key",enabled:!0,title:"Arrow Left"},{id:"up",label:"↑",code:de.UP,type:"key",enabled:!0,title:"Arrow Up"},{id:"down",label:"↓",code:de.DOWN,type:"key",enabled:!0,title:"Arrow Down"},{id:"right",label:"→",code:de.RIGHT,type:"key",enabled:!0,title:"Arrow Right"},{id:"home",label:"Home",code:de.HOME,type:"key",enabled:!0,title:"Home"},{id:"end",label:"End",code:de.END,type:"key",enabled:!0,title:"End"},{id:"page_up",label:"PgUp",code:de.PAGE_UP,type:"key",enabled:!0,title:"Page Up"},{id:"page_down",label:"PgDn",code:de.PAGE_DOWN,type:"key",enabled:!0,title:"Page Down"},{id:"insert",label:"Ins",code:de.INSERT,type:"key",enabled:!0,title:"Insert"},{id:"ctrl_c",label:"^C",code:de.CTRL_C,type:"chord",enabled:!0,title:"Ctrl+C (SIGINT)"},{id:"ctrl_d",label:"^D",code:de.CTRL_D,type:"chord",enabled:!0,title:"Ctrl+D (EOF/Exit)"},{id:"ctrl_z",label:"^Z",code:de.CTRL_Z,type:"chord",enabled:!0,title:"Ctrl+Z (SIGTSTP)"},{id:"ctrl_l",label:"^L",code:de.CTRL_L,type:"chord",enabled:!0,title:"Ctrl+L (Clear Screen)"},{id:"ctrl_a",label:"^A",code:de.CTRL_A,type:"chord",enabled:!0,title:"Ctrl+A (Beginning of Line)"},{id:"ctrl_e",label:"^E",code:de.CTRL_E,type:"chord",enabled:!0,title:"Ctrl+E (End of Line)"},{id:"ctrl_k",label:"^K",code:de.CTRL_K,type:"chord",enabled:!0,title:"Ctrl+K (Kill to End)"},{id:"ctrl_r",label:"^R",code:de.CTRL_R,type:"chord",enabled:!0,title:"Ctrl+R (Reverse Search)"},{id:"f1",label:"F1",code:de.F1,type:"fn",enabled:!0,title:"F1"},{id:"f2",label:"F2",code:de.F2,type:"fn",enabled:!0,title:"F2"},{id:"f3",label:"F3",code:de.F3,type:"fn",enabled:!0,title:"F3"},{id:"f4",label:"F4",code:de.F4,type:"fn",enabled:!0,title:"F4"},{id:"f5",label:"F5",code:de.F5,type:"fn",enabled:!0,title:"F5"},{id:"f6",label:"F6",code:de.F6,type:"fn",enabled:!0,title:"F6"},{id:"f7",label:"F7",code:de.F7,type:"fn",enabled:!0,title:"F7"},{id:"f8",label:"F8",code:de.F8,type:"fn",enabled:!0,title:"F8"},{id:"f9",label:"F9",code:de.F9,type:"fn",enabled:!0,title:"F9"},{id:"f10",label:"F10",code:de.F10,type:"fn",enabled:!0,title:"F10"},{id:"f11",label:"F11",code:de.F11,type:"fn",enabled:!0,title:"F11"},{id:"f12",label:"F12",code:de.F12,type:"fn",enabled:!0,title:"F12"},{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 Gi(){return JSON.parse(JSON.stringify(Kh))}const ih=["esc","tab","ctrl","alt","left","up","down","right","enter","drawer_chords","drawer_symbols","drawer_fn"];function oy(r){return r.length!==ih.length?!1:r.every((s,o)=>s.id===ih[o]&&s.enabled!==!1)}function ry(r){if(!Array.isArray(r)||r.length===0)return Gi();const s=r.filter(o=>typeof o=="object"&&o!==null&&typeof o.id=="string"&&typeof o.label=="string"&&typeof o.code=="string");return oy(s)?Gi():s}function Hc(r,s){if(s){const o=`keyTitles.${r.id}`,c=s(o);if(c&&c!==o)return c}return r.title||r.label}const Kc='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',sh="JetBrains Mono, Menlo, Monaco, Consolas, monospace",Ua="herdr_remote_settings_v1",Ki="herdr_remote_session_view_v1",Yh=64,qi=4096,Yc={local:{},session:{}};function fo(r,s){if(typeof window>"u")return Yc[r][s]||null;try{return(r==="local"?window.localStorage:window.sessionStorage).getItem(s)}catch{return Yc[r][s]||null}}function Jl(r,s,o){if(Yc[r][s]=o,!(typeof window>"u"))try{(r==="local"?window.localStorage:window.sessionStorage).setItem(s,o)}catch(c){console.warn(`Failed to write to ${r}Storage:`,c)}}function cy(){return`client-${Math.random().toString(36).substring(2,8)}`}function Qc(){const r=Math.random().toString(36).substring(2,10);return`profile-${Date.now().toString(36)}-${r}`}function uy(r,s){return(typeof r=="string"?r.trim().slice(0,Yh):"")||s}function mo(r,s){if(!r||typeof r!="object"||Array.isArray(r))return null;const o=r,c=typeof o.wsUrl=="string"?o.wsUrl.trim().slice(0,2048):"",m=typeof o.token=="string"?o.token.slice(0,qi):"",f=typeof o.pairCode=="string"?o.pairCode.trim().toUpperCase().slice(0,32):"";if(!c||!c.startsWith("/")&&!/^(?:wss?|https?):\/\//i.test(c)||!m&&!f)return null;const b=Date.now(),p=typeof o.id=="string"&&o.id.length>0?o.id.slice(0,128):Qc(),x=typeof o.hostname=="string"&&o.hostname.trim()?o.hostname.trim().slice(0,Yh):`Herdr ${s+1}`;return{id:p,displayName:uy(o.displayName,x),wsUrl:c,token:m,...f?{pairCode:f}:{},...typeof o.hostId=="string"&&o.hostId.trim()?{hostId:o.hostId.trim().slice(0,128)}:{},...typeof o.hostname=="string"&&o.hostname.trim()?{hostname:o.hostname.trim().slice(0,128)}:{},...typeof o.deviceId=="string"&&o.deviceId.trim()?{deviceId:o.deviceId.trim().slice(0,128)}:{},autoReconnect:o.autoReconnect!==!1,createdAt:Number.isFinite(o.createdAt)?Number(o.createdAt):b,lastUsedAt:Number.isFinite(o.lastUsedAt)?Number(o.lastUsedAt):b}}function oh(r,s=0){const o=mo({...r,id:r.id||Qc()},s);if(!o)throw new Error("a connection profile requires a relay URL and token or pairing code");return o}function rh(r){let s=r.wsUrl.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"").toLowerCase();if(typeof window<"u")try{const o=new URL(r.wsUrl,window.location.origin);o.protocol=o.protocol==="wss:"?"https:":"http:",o.pathname=o.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"")||"/",o.search="",o.hash="",s=o.toString().replace(/\/$/,"").toLowerCase()}catch{}return`${s}::${r.hostId||""}`}function Gh(){return typeof navigator<"u"&&navigator.language&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en"}function qh(){const r=typeof window<"u"&&window.innerWidth<640;return{wsUrl:"/ws/client",token:"",pairCode:"",clientId:cy(),autoReconnect:!0,profiles:[],activeProfileId:"",fontSize:r?Vc:po,fontFamily:Kc,toolbarVisible:!0,toolbarPosition:"bottom",vibrateOnKeyPress:!0,language:Gh(),virtualKeys:Gi(),adminToken:"",adminTokens:{}}}const dy=["wsUrl","token","pairCode","clientId","autoReconnect","language"],fy=["wsUrl","token","pairCode","autoReconnect"],Fc=["fontSize","fontFamily","toolbarVisible","toolbarPosition","vibrateOnKeyPress","virtualKeys","adminToken","adminTokens"],my=Fc.filter(r=>r!=="adminToken"&&r!=="adminTokens"),ch=["theme","colorMode"];function Gc(r){const s=r;if(!ch.some(m=>s[m]!==void 0))return{data:r,changed:!1};const c={...s};for(const m of ch)delete c[m];return{data:c,changed:!0}}function Xh(r){if(!r||typeof r!="object"||Array.isArray(r))return{};const s={};for(const[o,c]of Object.entries(r).slice(0,32))typeof c!="string"||c.length===0||(s[o.slice(0,512)]=c.slice(0,qi));return s}function Vh(r){var f;const s=[];if((Array.isArray(r.profiles)?r.profiles.slice(0,64):[]).forEach((b,p)=>{const x=mo(b,p);x&&!s.some(T=>T.id===x.id)&&s.push(x)}),s.length===0&&(typeof r.token=="string"&&r.token||typeof r.pairCode=="string"&&r.pairCode)){const b=mo({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);b&&s.push(b)}const c=typeof r.activeProfileId=="string"?r.activeProfileId:"",m=s.some(b=>b.id===c)?c:((f=s[0])==null?void 0:f.id)||"";return{profiles:s,activeProfileId:m}}function Zh(){const r=qh();if(typeof window>"u")return r;let s={};const o=fo("local",Ua);if(o)try{s=JSON.parse(o)}catch(H){console.warn("Failed to parse localStorage settings:",H)}const c=Gc(s);c.changed&&(s=c.data,Jl("local",Ua,JSON.stringify(s)));let m=null;const f=fo("session",Ki);if(f)try{m=JSON.parse(f)}catch(H){console.warn("Failed to parse sessionStorage settings:",H)}if(!m){const H={};for(const z of Fc)s[z]!==void 0&&(H[z]=s[z]);m=H,Jl("session",Ki,JSON.stringify(m))}let b=m.fontFamily??s.fontFamily??r.fontFamily;(!b||b===sh)&&(b=Kc);const p=window.innerWidth<640?Vc:po,x=m.fontSize??s.fontSize??r.fontSize,T=uo(x,p),v=m.virtualKeys??s.virtualKeys??r.virtualKeys,j=ry(v),G=s.language??r.language,U=G==="zh"||G==="en"?G:Gh(),X=Vh(s),V=X.profiles.find(H=>H.id===X.activeProfileId),Y=Gc(m);Y.changed&&(m=Y.data,Jl("session",Ki,JSON.stringify(m)));const Q=m.toolbarVisible??s.toolbarVisible??r.toolbarVisible,ee=m.toolbarPosition??s.toolbarPosition??r.toolbarPosition,W=m.vibrateOnKeyPress??s.vibrateOnKeyPress??r.vibrateOnKeyPress,ce=typeof m.adminToken=="string"?m.adminToken.slice(0,qi):typeof s.adminToken=="string"?s.adminToken.slice(0,qi):r.adminToken,he=Xh(m.adminTokens),K={...r,...s,...m,wsUrl:(V==null?void 0:V.wsUrl)||(typeof s.wsUrl=="string"?s.wsUrl:r.wsUrl),token:(V==null?void 0:V.token)||"",pairCode:(V==null?void 0:V.pairCode)||"",autoReconnect:(V==null?void 0:V.autoReconnect)??r.autoReconnect,profiles:X.profiles,activeProfileId:X.activeProfileId,clientId:typeof s.clientId=="string"&&s.clientId.trim()?s.clientId.trim().slice(0,128):r.clientId,fontFamily:b,fontSize:T,toolbarVisible:Q,toolbarPosition:ee,vibrateOnKeyPress:W,virtualKeys:j,language:U,adminToken:ce,adminTokens:he};return s.fontFamily===sh&&(s.fontFamily=Kc,Jl("local",Ua,JSON.stringify(s))),K}function El(r){var G;const o={...Zh(),...r};o.adminTokens=Xh(o.adminTokens),typeof o.adminToken=="string"&&(o.adminToken=o.adminToken.slice(0,qi)),r.fontSize!==void 0&&(o.fontSize=uo(r.fontSize));const c=Vh(o);let m=c.profiles,f=c.activeProfileId;if(fy.some(U=>r[U]!==void 0)){const U=m.findIndex(Y=>Y.id===f),X=U>=0?{...m[U]}:{id:Qc(),displayName:`Herdr ${m.length+1}`,wsUrl:o.wsUrl,token:"",autoReconnect:!0,createdAt:Date.now(),lastUsedAt:Date.now()};X.wsUrl=o.wsUrl,X.token=o.token,X.pairCode=o.pairCode||void 0,X.autoReconnect=o.autoReconnect,X.lastUsedAt=Date.now();const V=mo(X,Math.max(U,0));V?U>=0?m[U]=V:(m.push(V),f=V.id):U>=0&&(m=m.filter(Y=>Y.id!==f),f=((G=m[0])==null?void 0:G.id)||"")}m.length>0&&!m.some(U=>U.id===f)&&(f=m[0].id);const p=m.find(U=>U.id===f);o.profiles=m,o.activeProfileId=f,o.wsUrl=(p==null?void 0:p.wsUrl)||o.wsUrl||"/ws/client",o.token=(p==null?void 0:p.token)||"",o.pairCode=(p==null?void 0:p.pairCode)||"",o.autoReconnect=(p==null?void 0:p.autoReconnect)??o.autoReconnect;const x=fo("local",Ua);let T={};if(x)try{T=JSON.parse(x)}catch{}T=Gc(T).data;for(const U of dy)o[U]!==void 0&&(T[U]=o[U]);T.profiles=m,T.activeProfileId=f,Jl("local",Ua,JSON.stringify(T));const v=fo("session",Ki);let j={};if(v)try{j=JSON.parse(v)}catch{}for(const U of Fc)o[U]!==void 0&&(j[U]=o[U]);Jl("session",Ki,JSON.stringify(j));for(const U of my)o[U]!==void 0&&(T[U]=o[U]);return Jl("local",Ua,JSON.stringify(T)),o}const hy={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",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.",touchKeyToolbar:"Touch Key Toolbar",touchKeyToolbarDesc:"Show modifier and navigation keys",touchHaptics:"Haptic Feedback",touchHapticsDesc:"Vibrate on key press",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."},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"},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",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_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_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."},fontPresets:{system:"System Default",apple:"SF Mono / Menlo",windows:"Consolas",linux:"Liberation Mono",courier:"Courier New",firacode:"Fira Code"}},py={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:"虚拟按键",fontFamilyLabel:"等宽字体",fontSizeLabel:"终端字号 ({size}px)",fontSizeCompact:"10px (紧凑)",fontSizeDefault:"15px (默认)",fontSizeLarge:"24px (大字号)",mobileFontNote:"小屏设备自动适配字号,保持 80 列完整显示。",colorPassthroughNote:"终端配色与光标样式透传自宿主环境。",touchKeyToolbar:"底部触控按键条",touchKeyToolbarDesc:"显示移动端修饰键与方向键工具栏",touchHaptics:"触控振动反馈",touchHapticsDesc:"移动端按键时轻微震动",languageLabel:"显示语言",languageDesc:"选择 English 或 简体中文",resetDefaults:"恢复默认设置",resetDefaultsToast:"设置已恢复默认",windowZoomSharedNote:"当前宿主未启用视图隔离,字号调整仅影响本地窗口。",fontSizeZoomHelp:"仅调节当前窗口字号,不影响其他窗口。"},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:"回车"},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",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_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_failed:"无法建立到 relay 的连接。",host_reconnecting:"Herdr 主机正在重连。",host_reconnect_timeout:"Herdr 主机未能及时恢复连接。",host_replaced:"Herdr 主机连接已被替换。",slow_client:"由于浏览器处理速度过慢,连接已关闭。",client_send_failed:"Relay 无法向此浏览器发送数据。",too_many_hosts:"此 relay 已达到主机数量上限。"},fontPresets:{system:"系统默认",apple:"Apple SF Mono / Menlo",windows:"Windows Consolas",linux:"Linux Liberation Mono",courier:"Courier New",firacode:"Fira Code"}},Oc={en:hy,zh:py};function Jc(r,s,o){const c=Oc[r]||Oc.en,m=s.split(".");let f=c;for(const b of m)if(f&&typeof f=="object"&&b in f)f=f[b];else{let p=Oc.en;for(const x of m)if(p&&typeof p=="object"&&x in p)p=p[x];else return s;f=p;break}if(typeof f!="string")return s;if(o){let b=f;for(const[p,x]of Object.entries(o))b=b.replaceAll(`{${p}}`,String(x));return b}return f}const uh="#11111b",dh=[{id:"system",name:"System Default (Recommended)",font:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},{id:"apple",name:"Apple SF Mono / Menlo",font:"SFMono-Regular, Menlo, Monaco, monospace"},{id:"windows",name:"Windows Consolas",font:'Consolas, "Lucida Console", monospace'},{id:"linux",name:"Linux Liberation Mono",font:'"Liberation Mono", "DejaVu Sans Mono", monospace'},{id:"courier",name:"Courier New",font:'"Courier New", Courier, monospace'},{id:"firacode",name:"Fira Code (Ligatures)",font:'"Fira Code", monospace'}];function by(r){if(!r)return null;const s={};return r.background&&(s.background=r.background,s.cursorAccent=r.background),r.foreground&&(s.foreground=r.foreground),r.cursor&&(s.cursor=r.cursor),r.ansi&&Object.assign(s,r.ansi),Object.keys(s).length>0?s:null}function Qh(){if(typeof document>"u")return;const r=document.querySelector('meta[name="theme-color"]');document.documentElement.style.colorScheme="dark",r==null||r.setAttribute("content",uh),document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),document.body.classList.add("dark"),document.body.classList.remove("light"),document.body.style.backgroundColor=uh}const gy=4e3,yy=3,vy=4096,xy=8*1024*1024,Fh=w.createContext(null);function Oa(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 Sy=({children:r})=>{const[s,o]=w.useState(Zh),[c,m]=w.useState("disconnected"),[f,b]=w.useState(),[p,x]=w.useState(),[T,v]=w.useState("viewer"),[j,G]=w.useState(),[U,X]=w.useState(),[V,Y]=w.useState(),[Q,ee]=w.useState(null),[W,ce]=w.useState(),[he,K]=w.useState(null),[H,z]=w.useState(1),[re,_e]=w.useState(0),[Te,me]=w.useState(null),[q,se]=w.useState(null),[ve,E]=w.useState({cols:80,rows:24}),[L,Z]=w.useState([]);w.useEffect(()=>{Qh()},[]);const pe=w.useRef(s);pe.current=s;const k=w.useRef(null),We=w.useRef(!1),Ue=w.useRef(ve);Ue.current=ve;const xe=w.useCallback((_,B)=>Jc(s.language,_,B),[s.language]),Se=w.useRef(xe);Se.current=xe;const De=w.useRef(null),Ee=w.useRef([]),ct=w.useRef(0),ft=w.useCallback(_=>{for(Ee.current.push(_),ct.current+=_.byteLength;Ee.current.length>vy||ct.current>xy;){const B=Ee.current.shift();if(!B)break;ct.current-=B.byteLength}},[]),Ye=w.useCallback(_=>{const B=De.current;if(B)try{B(_);return}catch(te){console.debug("Terminal output sink threw, buffering chunk instead:",te)}ft(_)},[ft]),Ut=w.useRef(Ye);Ut.current=Ye;const ne=w.useCallback(_=>{De.current=_;const B=Ee.current;Ee.current=[],ct.current=0;for(let te=0;te<B.length;te++)try{_(B[te])}catch(Ne){console.debug("Terminal sink threw while flushing, re-buffering the tail:",Ne);for(let je=te;je<B.length;je++)ft(B[je]);break}return()=>{De.current===_&&(De.current=null)}},[ft]),ye=w.useCallback(()=>Ee.current.length,[]),Be=w.useCallback(()=>{Ee.current=[],ct.current=0},[]),ke=w.useCallback((_=!0)=>{v("viewer"),G(void 0),X(void 0),Y(void 0),ee(null),ce(void 0),K(null),z(1),me(null),Be(),_&&_e(B=>B+1)},[Be]),kt=w.useRef([]),ie=w.useRef(new Map),Ot=w.useCallback(_=>{kt.current=_,Z(_)},[]),Yt=w.useCallback(_=>{const B=ie.current.get(_);B&&(clearTimeout(B),ie.current.delete(_)),Ot(kt.current.filter(te=>te.id!==_))},[Ot]),Bt=w.useRef(Yt);Bt.current=Yt;const Ie=w.useCallback((_,B)=>{const te=Date.now(),Ne=kt.current,je=Ne.find(St=>St.type===_&&St.message===B),qe=je?je.id:`${te}-${Math.random().toString(36).substring(2,6)}`;let Qe;if(je)Qe=Ne.map(St=>St.id===qe?{...St,count:St.count+1,timestamp:te}:St);else for(Qe=[...Ne,{id:qe,type:_,message:B,timestamp:te,count:1}];Qe.length>yy;){const[St,...zl]=Qe,nl=ie.current.get(St.id);nl&&(clearTimeout(nl),ie.current.delete(St.id)),Qe=zl}Ot(Qe);const Lt=ie.current.get(qe);Lt&&clearTimeout(Lt),ie.current.set(qe,setTimeout(()=>Bt.current(qe),gy))},[Ot]),ln=w.useCallback(_=>{Bt.current(_)},[]),an=w.useRef(!0);w.useEffect(()=>{T==="controller"&&(an.current=!0)},[T]);const mt=w.useCallback(()=>{an.current&&(an.current=!1,Ie("warning",Se.current("toasts.viewerModeWarning")))},[Ie]);w.useEffect(()=>{const _=ie.current;return()=>{for(const B of _.values())clearTimeout(B);_.clear()}},[]);const I=w.useCallback(_=>{const B=El(_);pe.current=B,o(B)},[]),we=w.useCallback(_=>{I({language:_})},[I]),fe=w.useCallback(_=>{pe.current=_,o(_)},[]),Ge=w.useCallback(_=>{var je;const B=pe.current,te=oh({..._,wsUrl:_.wsUrl||"/ws/client",token:_.token||"",displayName:_.displayName||`Herdr ${B.profiles.length+1}`,autoReconnect:_.autoReconnect!==!1},B.profiles.length),Ne=El({profiles:[...B.profiles,te],activeProfileId:te.id,wsUrl:te.wsUrl,token:te.token,pairCode:te.pairCode||"",autoReconnect:te.autoReconnect});fe(Ne),ke(),(je=k.current)==null||je.reconnectWith(Oa(Ne))},[fe,ke]),Jt=w.useCallback(_=>{var je;const B=pe.current,te=B.profiles.find(qe=>qe.id===_);if(!te||te.id===B.activeProfileId)return;const Ne=El({activeProfileId:te.id,wsUrl:te.wsUrl,token:te.token,pairCode:te.pairCode||"",autoReconnect:te.autoReconnect,profiles:B.profiles.map(qe=>qe.id===te.id?{...qe,lastUsedAt:Date.now()}:qe)});fe(Ne),ke(),(je=k.current)==null||je.reconnectWith(Oa(Ne))},[fe,ke]),kn=w.useCallback((_,B)=>{const te=pe.current;if(!te.profiles.find(Qe=>Qe.id===_))return;const je=B.trim().slice(0,64);if(!je)return;const qe=El({profiles:te.profiles.map(Qe=>Qe.id===_?{...Qe,displayName:je}:Qe)});fe(qe)},[fe]),Ct=w.useCallback(_=>{var qe;const B=pe.current;if(!B.profiles.some(Qe=>Qe.id===_))return;const te=B.profiles.filter(Qe=>Qe.id!==_),Ne=te.find(Qe=>Qe.id===B.activeProfileId)||te[0],je=El(Ne?{profiles:te,activeProfileId:Ne.id,wsUrl:Ne.wsUrl,token:Ne.token,pairCode:Ne.pairCode||"",autoReconnect:Ne.autoReconnect}:{profiles:[],activeProfileId:"",wsUrl:"/ws/client",token:"",pairCode:""});fe(je),_===B.activeProfileId&&(ke(),(qe=k.current)==null||qe.reconnectWith(Oa(je)))},[fe,ke]),jn=w.useCallback(_=>{const B=pe.current,te=B.profiles.find(Tn=>Tn.id===B.activeProfileId),Ne=_.hostId?rh({wsUrl:B.wsUrl,hostId:_.hostId}):null,je=Ne?B.profiles.findIndex(Tn=>rh(Tn)===Ne):-1,qe=je>=0?je:Math.max(0,B.profiles.findIndex(Tn=>Tn.id===B.activeProfileId)),Lt={...B.profiles[qe]||te||oh({wsUrl:B.wsUrl||"/ws/client",token:"",pairCode:B.pairCode||"PENDING",displayName:`Herdr ${B.profiles.length+1}`},B.profiles.length),token:_.token,pairCode:void 0,..._.hostId?{hostId:_.hostId}:{},..._.deviceId?{deviceId:_.deviceId}:{},lastUsedAt:Date.now()};let St=[...B.profiles];qe>=0&&qe<St.length?St[qe]=Lt:St.push(Lt);const zl=te==null?void 0:te.id;St=St.filter((Tn,Ya)=>Ya===qe||Tn.id===Lt.id?!0:!(je>=0&&zl&&Tn.id===zl));const nl=El({profiles:St,activeProfileId:Lt.id,wsUrl:Lt.wsUrl,token:Lt.token,pairCode:"",autoReconnect:Lt.autoReconnect});return fe(nl),nl},[fe]),xn=w.useCallback(_=>{const B=pe.current,te=B.profiles.find(Qe=>Qe.id===B.activeProfileId);if(!te||!_.hostId&&!_.hostname)return;const Ne=/^Herdr \d+$/.test(te.displayName),je={...te,..._.hostId?{hostId:_.hostId}:{},..._.hostname?{hostname:_.hostname}:{},..._.hostname&&Ne?{displayName:_.hostname}:{}},qe=El({profiles:B.profiles.map(Qe=>Qe.id===te.id?je:Qe)});fe(qe)},[fe]);if(!k.current){const _=new Jg(Oa(s));k.current=_,_.on("stateChange",(B,te,Ne)=>{m(B),x(Ne);const je=Ne?`serverErrors.${Ne}`:null,qe=je?Se.current(je):null,Qe=qe&&qe!==je?qe:te;b(Qe),B==="connected"?Ie("success",Se.current("toasts.connected")):B==="error"&&Ie("error",Qe||Se.current("toasts.connectionError"))}),_.on("ready",B=>{We.current&&(Be(),_e(te=>te+1)),We.current=!0,v(B.role),G(B.controllerId),X(B.hostId),Y(B.hostname),xn(B),B.clientId&&ce(B.clientId),ee(B.terminalPalette||null)}),_.on("hostReconnecting",B=>{x(B||"host_reconnecting"),b(Se.current(`serverErrors.${B||"host_reconnecting"}`)),v("viewer"),G(void 0),Y(void 0),ee(null),K(null),z(1),me(null),Be()}),_.on("sessionRestarted",(B,te,Ne,je)=>{Be(),Y(je),xn({hostId:_.getHostId(),hostname:je}),ee(Ne||null),_e(qe=>qe+1)}),_.on("roleChange",(B,te,Ne,je)=>{v(B),G(te),Ne&&X(Ne),je&&ce(je)}),_.on("controlGranted",()=>{v("controller"),Ie("success",Se.current("toasts.controlGranted"))}),_.on("controlDenied",B=>{Ie("warning",B||Se.current("toasts.controlDenied"))}),_.on("controlRevoked",B=>{v("viewer"),Ie("warning",B||Se.current("toasts.controlRevoked"))}),_.on("paired",B=>{const te=jn(B);Ie("success",Se.current("toasts.pairedSuccess")),se(Date.now()),_.reconnectWith(Oa(te))}),_.on("exit",(B,te)=>{Ie("info",`${Se.current("toasts.sessionEnded")}${te?`: ${te}`:""}${B!==void 0?` (${B})`:""}`)}),_.on("status",B=>{me(B)}),_.on("error",B=>{Ie("error",`[${B.code}] ${B.message}`)}),_.on("rttUpdate",B=>{K(B)}),_.on("peerCount",B=>{z(Math.max(1,B))}),_.on("sessionReady",()=>{m("connected")}),_.on("binaryData",B=>{Ut.current(B)})}const ae=k.current,be=s.profiles.find(_=>_.id===s.activeProfileId);w.useEffect(()=>{var _;(_=k.current)==null||_.updateConfig(Oa(s))},[s]);const $e=w.useCallback(_=>{k.current&&(_&&k.current.updateConfig(_),k.current.connect(Ue.current))},[]),ot=w.useCallback(()=>{k.current&&k.current.disconnect()},[]),Sn=w.useCallback((_=!1)=>{k.current&&k.current.claimControl(_)},[]),wn=w.useCallback(()=>{var _;(_=k.current)==null||_.releaseControl()},[]),ge=w.useCallback(_=>{if(T!=="controller"){mt();return}k.current&&k.current.sendText(_)},[T,mt]),Nt=w.useCallback(_=>{T!=="controller"&&!Bc(_)||k.current&&k.current.sendBinary(_)},[T]),jt=w.useCallback((_,B)=>{Ue.current={cols:_,rows:B},E({cols:_,rows:B}),k.current&&k.current.sendResize(_,B)},[]);return u.jsx(Fh.Provider,{value:{connectionState:c,stateDetail:f,stateCode:p,role:T,controllerId:j,hostId:U,hostname:V,assignedClientId:W,profiles:s.profiles,activeProfileId:s.activeProfileId,activeProfile:be,isController:T==="controller",sharedWindowCount:H,terminalResetVersion:re,rttMs:he,statusPayload:Te,lastPairedAt:q,settings:s,hostPalette:Q,terminalDimensions:ve,toasts:L,adapter:ae,language:s.language,t:xe,setLanguage:we,connect:$e,disconnect:ot,switchProfile:Jt,addProfileAndConnect:Ge,renameProfile:kn,removeProfile:Ct,claimControl:Sn,releaseControl:wn,sendKey:ge,sendBinary:Nt,sendResize:jt,updateSettings:I,addToast:Ie,removeToast:ln,warnViewerMode:mt,subscribeToOutput:ne,getPendingOutputChunkCount:ye},children:r})};function bt(){const r=w.useContext(Fh);if(!r)throw new Error("useTerminal must be used within a TerminalProvider");return r}function Jh(r){var s,o,c="";if(typeof r=="string"||typeof r=="number")c+=r;else if(typeof r=="object")if(Array.isArray(r)){var m=r.length;for(s=0;s<m;s++)r[s]&&(o=Jh(r[s]))&&(c&&(c+=" "),c+=o)}else for(o in r)r[o]&&(c&&(c+=" "),c+=o);return c}function wy(){for(var r,s,o=0,c="",m=arguments.length;o<m;o++)(r=arguments[o])&&(s=Jh(r))&&(c&&(c+=" "),c+=s);return c}const Ty=(r,s)=>{const o=new Array(r.length+s.length);for(let c=0;c<r.length;c++)o[c]=r[c];for(let c=0;c<s.length;c++)o[r.length+c]=s[c];return o},Cy=(r,s)=>({classGroupId:r,validator:s}),Wh=(r=new Map,s=null,o)=>({nextPart:r,validators:s,classGroupId:o}),ho="-",fh=[],Ny="arbitrary..",Ay=r=>{const s=jy(r),{conflictingClassGroups:o,conflictingClassGroupModifiers:c}=r;return{getClassGroupId:b=>{if(b.startsWith("[")&&b.endsWith("]"))return Ey(b);const p=b.split(ho),x=p[0]===""&&p.length>1?1:0;return Ih(p,x,s)},getConflictingClassGroupIds:(b,p)=>{if(p){const x=c[b],T=o[b];return x?T?Ty(T,x):x:T||fh}return o[b]||fh}}},Ih=(r,s,o)=>{if(r.length-s===0)return o.classGroupId;const m=r[s],f=o.nextPart.get(m);if(f){const T=Ih(r,s+1,f);if(T)return T}const b=o.validators;if(b===null)return;const p=s===0?r.join(ho):r.slice(s).join(ho),x=b.length;for(let T=0;T<x;T++){const v=b[T];if(v.validator(p))return v.classGroupId}},Ey=r=>r.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const s=r.slice(1,-1),o=s.indexOf(":"),c=s.slice(0,o);return c?Ny+c:void 0})(),jy=r=>{const{theme:s,classGroups:o}=r;return Ry(o,s)},Ry=(r,s)=>{const o=Wh();for(const c in r){const m=r[c];Wc(m,o,c,s)}return o},Wc=(r,s,o,c)=>{const m=r.length;for(let f=0;f<m;f++){const b=r[f];zy(b,s,o,c)}},zy=(r,s,o,c)=>{if(typeof r=="string"){My(r,s,o);return}if(typeof r=="function"){_y(r,s,o,c);return}Dy(r,s,o,c)},My=(r,s,o)=>{const c=r===""?s:$h(s,r);c.classGroupId=o},_y=(r,s,o,c)=>{if(ky(r)){Wc(r(c),s,o,c);return}s.validators===null&&(s.validators=[]),s.validators.push(Cy(o,r))},Dy=(r,s,o,c)=>{const m=Object.entries(r),f=m.length;for(let b=0;b<f;b++){const[p,x]=m[b];Wc(x,$h(s,p),o,c)}},$h=(r,s)=>{let o=r;const c=s.split(ho),m=c.length;for(let f=0;f<m;f++){const b=c[f];let p=o.nextPart.get(b);p||(p=Wh(),o.nextPart.set(b,p)),o=p}return o},ky=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,Oy=r=>{if(r<1)return{get:()=>{},set:()=>{}};let s=0,o=Object.create(null),c=Object.create(null);const m=(f,b)=>{o[f]=b,s++,s>r&&(s=0,c=o,o=Object.create(null))};return{get(f){let b=o[f];if(b!==void 0)return b;if((b=c[f])!==void 0)return m(f,b),b},set(f,b){f in o?o[f]=b:m(f,b)}}},qc="!",mh=":",Ly=[],hh=(r,s,o,c,m)=>({modifiers:r,hasImportantModifier:s,baseClassName:o,maybePostfixModifierPosition:c,isExternal:m}),Uy=r=>{const{prefix:s,experimentalParseClassName:o}=r;let c=m=>{const f=[];let b=0,p=0,x=0,T;const v=m.length;for(let V=0;V<v;V++){const Y=m[V];if(b===0&&p===0){if(Y===mh){f.push(m.slice(x,V)),x=V+1;continue}if(Y==="/"){T=V;continue}}Y==="["?b++:Y==="]"?b--:Y==="("?p++:Y===")"&&p--}const j=f.length===0?m:m.slice(x);let G=j,U=!1;j.endsWith(qc)?(G=j.slice(0,-1),U=!0):j.startsWith(qc)&&(G=j.slice(1),U=!0);const X=T&&T>x?T-x:void 0;return hh(f,U,G,X)};if(s){const m=s+mh,f=c;c=b=>b.startsWith(m)?f(b.slice(m.length)):hh(Ly,!1,b,void 0,!0)}if(o){const m=c;c=f=>o({className:f,parseClassName:m})}return c},By=r=>{const s=new Map;return r.orderSensitiveModifiers.forEach((o,c)=>{s.set(o,1e6+c)}),o=>{const c=[];let m=[];for(let f=0;f<o.length;f++){const b=o[f],p=b[0]==="[",x=s.has(b);p||x?(m.length>0&&(m.sort(),c.push(...m),m=[]),c.push(b)):m.push(b)}return m.length>0&&(m.sort(),c.push(...m)),c}},Hy=r=>({cache:Oy(r.cacheSize),parseClassName:Uy(r),sortModifiers:By(r),postfixLookupClassGroupIds:Ky(r),...Ay(r)}),Ky=r=>{const s=Object.create(null),o=r.postfixLookupClassGroups;if(o)for(let c=0;c<o.length;c++)s[o[c]]=!0;return s},Yy=/\s+/,Gy=(r,s)=>{const{parseClassName:o,getClassGroupId:c,getConflictingClassGroupIds:m,sortModifiers:f,postfixLookupClassGroupIds:b}=s,p=[],x=r.trim().split(Yy);let T="";for(let v=x.length-1;v>=0;v-=1){const j=x[v],{isExternal:G,modifiers:U,hasImportantModifier:X,baseClassName:V,maybePostfixModifierPosition:Y}=o(j);if(G){T=j+(T.length>0?" "+T:T);continue}let Q=!!Y,ee;if(Q){const H=V.substring(0,Y);ee=c(H);const z=ee&&b[ee]?c(V):void 0;z&&z!==ee&&(ee=z,Q=!1)}else ee=c(V);if(!ee){if(!Q){T=j+(T.length>0?" "+T:T);continue}if(ee=c(V),!ee){T=j+(T.length>0?" "+T:T);continue}Q=!1}const W=U.length===0?"":U.length===1?U[0]:f(U).join(":"),ce=X?W+qc:W,he=ce+ee;if(p.indexOf(he)>-1)continue;p.push(he);const K=m(ee,Q);for(let H=0;H<K.length;++H){const z=K[H];p.push(ce+z)}T=j+(T.length>0?" "+T:T)}return T},qy=(...r)=>{let s=0,o,c,m="";for(;s<r.length;)(o=r[s++])&&(c=Ph(o))&&(m&&(m+=" "),m+=c);return m},Ph=r=>{if(typeof r=="string")return r;let s,o="";for(let c=0;c<r.length;c++)r[c]&&(s=Ph(r[c]))&&(o&&(o+=" "),o+=s);return o},Xy=(r,...s)=>{let o,c,m,f;const b=x=>{const T=s.reduce((v,j)=>j(v),r());return o=Hy(T),c=o.cache.get,m=o.cache.set,f=p,p(x)},p=x=>{const T=c(x);if(T)return T;const v=Gy(x,o);return m(x,v),v};return f=b,(...x)=>f(qy(...x))},Vy=[],Tt=r=>{const s=o=>o[r]||Vy;return s.isThemeGetter=!0,s},ep=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,tp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zy=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Qy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fy=/\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$/,Jy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Iy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jl=r=>Zy.test(r),Re=r=>!!r&&!Number.isNaN(Number(r)),Dn=r=>!!r&&Number.isInteger(Number(r)),Lc=r=>r.endsWith("%")&&Re(r.slice(0,-1)),Pn=r=>Qy.test(r),np=()=>!0,$y=r=>Fy.test(r)&&!Jy.test(r),Ic=()=>!1,Py=r=>Wy.test(r),ev=r=>Iy.test(r),tv=r=>!J(r)&&!$(r),nv=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)),lv=r=>Rl(r,ip,Ic),J=r=>ep.test(r),Fl=r=>Rl(r,sp,$y),ph=r=>Rl(r,dv,Re),av=r=>Rl(r,rp,np),iv=r=>Rl(r,op,Ic),bh=r=>Rl(r,lp,Ic),sv=r=>Rl(r,ap,ev),lo=r=>Rl(r,cp,Py),$=r=>tp.test(r),Di=r=>Wl(r,sp),ov=r=>Wl(r,op),gh=r=>Wl(r,lp),rv=r=>Wl(r,ip),cv=r=>Wl(r,ap),ao=r=>Wl(r,cp,!0),uv=r=>Wl(r,rp,!0),Rl=(r,s,o)=>{const c=ep.exec(r);return c?c[1]?s(c[1]):o(c[2]):!1},Wl=(r,s,o=!1)=>{const c=tp.exec(r);return c?c[1]?s(c[1]):o:!1},lp=r=>r==="position"||r==="percentage",ap=r=>r==="image"||r==="url",ip=r=>r==="length"||r==="size"||r==="bg-size",sp=r=>r==="length",dv=r=>r==="number",op=r=>r==="family-name",rp=r=>r==="number"||r==="weight",cp=r=>r==="shadow",fv=()=>{const r=Tt("color"),s=Tt("font"),o=Tt("text"),c=Tt("font-weight"),m=Tt("tracking"),f=Tt("leading"),b=Tt("breakpoint"),p=Tt("container"),x=Tt("spacing"),T=Tt("radius"),v=Tt("shadow"),j=Tt("inset-shadow"),G=Tt("text-shadow"),U=Tt("drop-shadow"),X=Tt("blur"),V=Tt("perspective"),Y=Tt("aspect"),Q=Tt("ease"),ee=Tt("animate"),W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ce=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],he=()=>[...ce(),$,J],K=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],z=()=>[$,J,x],re=()=>[jl,"full","auto",...z()],_e=()=>[Dn,"none","subgrid",$,J],Te=()=>["auto",{span:["full",Dn,$,J]},Dn,$,J],me=()=>[Dn,"auto",$,J],q=()=>["auto","min","max","fr",$,J],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ve=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...z()],L=()=>[jl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],Z=()=>[jl,"screen","full","dvw","lvw","svw","min","max","fit",...z()],pe=()=>[jl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],k=()=>[r,$,J],We=()=>[...ce(),gh,bh,{position:[$,J]}],Ue=()=>["no-repeat",{repeat:["","x","y","space","round"]}],xe=()=>["auto","cover","contain",rv,lv,{size:[$,J]}],Se=()=>[Lc,Di,Fl],De=()=>["","none","full",T,$,J],Ee=()=>["",Re,Di,Fl],ct=()=>["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"],Ye=()=>[Re,Lc,gh,bh],Ut=()=>["","none",X,$,J],ne=()=>["none",Re,$,J],ye=()=>["none",Re,$,J],Be=()=>[Re,$,J],ke=()=>[jl,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pn],breakpoint:[Pn],color:[np],container:[Pn],"drop-shadow":[Pn],ease:["in","out","in-out"],font:[tv],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pn],shadow:[Pn],spacing:["px",Re],text:[Pn],"text-shadow":[Pn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",jl,J,$,Y]}],container:["container"],"container-type":[{"@container":["","normal","size",$,J]}],"container-named":[nv],columns:[{columns:[Re,J,$,p]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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:he()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[Dn,"auto",$,J]}],basis:[{basis:[jl,"full","auto",p,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,jl,"auto","initial","none",J]}],grow:[{grow:["",Re,$,J]}],shrink:[{shrink:["",Re,$,J]}],order:[{order:[Dn,"first","last","none",$,J]}],"grid-cols":[{"grid-cols":_e()}],"col-start-end":[{col:Te()}],"col-start":[{"col-start":me()}],"col-end":[{"col-end":me()}],"grid-rows":[{"grid-rows":_e()}],"row-start-end":[{row:Te()}],"row-start":[{"row-start":me()}],"row-end":[{"row-end":me()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...ve(),"normal"]}],"justify-self":[{"justify-self":["auto",...ve()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...ve(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ve(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...ve(),"baseline"]}],"place-self":[{"place-self":["auto",...ve()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...pe()]}],"min-block-size":[{"min-block":["auto",...pe()]}],"max-block-size":[{"max-block":["none",...pe()]}],w:[{w:[p,"screen",...L()]}],"min-w":[{"min-w":[p,"screen","none",...L()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[b]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",o,Di,Fl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[c,uv,av]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lc,J]}],"font-family":[{font:[ov,iv,s]}],"font-features":[{"font-features":[J]}],"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:[m,$,J]}],"line-clamp":[{"line-clamp":[Re,"none",$,ph]}],leading:[{leading:[f,...z()]}],"list-image":[{"list-image":["none",$,J]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$,J]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ct(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",$,Fl]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[Re,"auto",$,J]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"tab-size":[{tab:[Dn,$,J]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$,J]}],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",$,J]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:We()}],"bg-repeat":[{bg:Ue()}],"bg-size":[{bg:xe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Dn,$,J],radial:["",$,J],conic:[Dn,$,J]},cv,sv]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:Se()}],"gradient-via-pos":[{via:Se()}],"gradient-to-pos":[{to:Se()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:De()}],"rounded-s":[{"rounded-s":De()}],"rounded-e":[{"rounded-e":De()}],"rounded-t":[{"rounded-t":De()}],"rounded-r":[{"rounded-r":De()}],"rounded-b":[{"rounded-b":De()}],"rounded-l":[{"rounded-l":De()}],"rounded-ss":[{"rounded-ss":De()}],"rounded-se":[{"rounded-se":De()}],"rounded-ee":[{"rounded-ee":De()}],"rounded-es":[{"rounded-es":De()}],"rounded-tl":[{"rounded-tl":De()}],"rounded-tr":[{"rounded-tr":De()}],"rounded-br":[{"rounded-br":De()}],"rounded-bl":[{"rounded-bl":De()}],"border-w":[{border:Ee()}],"border-w-x":[{"border-x":Ee()}],"border-w-y":[{"border-y":Ee()}],"border-w-s":[{"border-s":Ee()}],"border-w-e":[{"border-e":Ee()}],"border-w-bs":[{"border-bs":Ee()}],"border-w-be":[{"border-be":Ee()}],"border-w-t":[{"border-t":Ee()}],"border-w-r":[{"border-r":Ee()}],"border-w-b":[{"border-b":Ee()}],"border-w-l":[{"border-l":Ee()}],"divide-x":[{"divide-x":Ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ct(),"hidden","none"]}],"divide-style":[{divide:[...ct(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...ct(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,$,J]}],"outline-w":[{outline:["",Re,Di,Fl]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",v,ao,lo]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",j,ao,lo]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:Ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[Re,Fl]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":Ee()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",G,ao,lo]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[Re,$,J]}],"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":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ye()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":Ye()}],"mask-image-t-to-pos":[{"mask-t-to":Ye()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":Ye()}],"mask-image-r-to-pos":[{"mask-r-to":Ye()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":Ye()}],"mask-image-b-to-pos":[{"mask-b-to":Ye()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":Ye()}],"mask-image-l-to-pos":[{"mask-l-to":Ye()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":Ye()}],"mask-image-x-to-pos":[{"mask-x-to":Ye()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":Ye()}],"mask-image-y-to-pos":[{"mask-y-to":Ye()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[$,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ye()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"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":ce()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ye()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:We()}],"mask-repeat":[{mask:Ue()}],"mask-size":[{mask:xe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$,J]}],filter:[{filter:["","none",$,J]}],blur:[{blur:Ut()}],brightness:[{brightness:[Re,$,J]}],contrast:[{contrast:[Re,$,J]}],"drop-shadow":[{"drop-shadow":["","none",U,ao,lo]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",Re,$,J]}],"hue-rotate":[{"hue-rotate":[Re,$,J]}],invert:[{invert:["",Re,$,J]}],saturate:[{saturate:[Re,$,J]}],sepia:[{sepia:["",Re,$,J]}],"backdrop-filter":[{"backdrop-filter":["","none",$,J]}],"backdrop-blur":[{"backdrop-blur":Ut()}],"backdrop-brightness":[{"backdrop-brightness":[Re,$,J]}],"backdrop-contrast":[{"backdrop-contrast":[Re,$,J]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,$,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,$,J]}],"backdrop-invert":[{"backdrop-invert":["",Re,$,J]}],"backdrop-opacity":[{"backdrop-opacity":[Re,$,J]}],"backdrop-saturate":[{"backdrop-saturate":[Re,$,J]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,$,J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$,J]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",$,J]}],ease:[{ease:["linear","initial",Q,$,J]}],delay:[{delay:[Re,$,J]}],animate:[{animate:["none",ee,$,J]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[V,$,J]}],"perspective-origin":[{"perspective-origin":he()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[$,J,"","none","gpu","cpu"]}],"transform-origin":[{origin:he()}],"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:[Dn,$,J]}],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"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",$,J]}],"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":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",$,J]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[Re,Di,Fl,ph]}],stroke:[{stroke:["none",...k()]}],"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"]}},mv=Xy(fv);function F(...r){return mv(wy(r))}var hv=Dh();const Xe={cursor:"▸",on:"●",off:"○",dot:"·",check:"✓",cross:"✗",warn:"!",arrowRight:"→",arrowLeft:"←",chevronDown:"▾",chevronRight:"▸",ellipsis:"…",meterFull:"█",meterEmpty:"░",tabDivider:"│"},bn={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"}},Xi={ok:bn.ok.text,warn:bn.warn.text,bad:bn.bad.text,idle:bn.idle.text,accent:bn.accent.text,alt:bn.alt.text,info:bn.info.text},vn=({level:r,className:s})=>u.jsx("span",{"aria-hidden":"true",className:F("select-none leading-none",Xi[r],s),children:r==="idle"?Xe.off:Xe.on}),up=({className:r})=>u.jsx("span",{"aria-hidden":"true",className:F("select-none text-tui-faint",r),children:Xe.dot}),Kt=({title:r,aside:s,tone:o="accent",className:c,bodyClassName:m,children:f,...b})=>u.jsxs("fieldset",{className:F("tui-panel tui-block relative min-w-0 border border-tui-border bg-tui-base",r?"px-3 pb-3 pt-1":"p-3",c),...b,children:[r?u.jsx("legend",{className:F("flex items-center gap-2 text-tui font-bold",Xi[o]),children:u.jsx("span",{children:r})}):null,s?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:s}):null,u.jsx("div",{className:F("min-w-0",m),children:f})]}),En=({label:r,labelWidth:s=16,className:o,children:c})=>u.jsxs("div",{className:F("flex items-baseline gap-2 text-tui",o),children:[u.jsx("span",{className:"shrink-0 truncate text-tui-muted",style:{width:`${s}ch`},title:typeof r=="string"?r:void 0,children:r}),u.jsx("span",{className:"min-w-0 flex-1 text-tui-text",children:c})]}),Ba=({className:r,label:s})=>s?u.jsxs("div",{className:F("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:s}),u.jsx("span",{className:"h-px flex-1 bg-tui-border-dim","aria-hidden":"true"})]}):u.jsx("div",{className:F("h-px w-full bg-tui-border-dim",r),"aria-hidden":"true"}),pv={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"},Ke=({variant:r="default",brackets:s=!0,glyph:o,block:c=!1,className:m,children:f,type:b="button",...p})=>u.jsxs("button",{type:b,className:F("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",pv[r],c&&"w-full",m),...p,children:[s?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"["}):null,o?u.jsx("span",{"aria-hidden":"true",className:"leading-none",children:o}):null,u.jsx("span",{className:"truncate",children:f}),s?u.jsx("span",{"aria-hidden":"true",className:"opacity-60",children:"]"}):null]}),bo=({tone:r="accent",dot:s=!1,className:o,children:c})=>u.jsxs("span",{className:F("inline-flex select-none items-center gap-1 whitespace-nowrap text-tui font-bold uppercase",Xi[r],o),children:[s?u.jsx(vn,{level:r}):null,c]}),$c=({tabs:r,activeId:s,onSelect:o,ariaLabel:c,className:m,labelClassName:f})=>u.jsx("nav",{className:F("flex items-center gap-2",m),"aria-label":c,children:r.map((b,p)=>{const x=b.id===s;return u.jsxs(tl.Fragment,{children:[p>0?u.jsx("span",{"aria-hidden":"true",className:"select-none text-tui-border",children:Xe.tabDivider}):null,u.jsxs("button",{type:"button",onClick:()=>o(b.id),"aria-current":x?"page":void 0,"aria-label":b.ariaLabel??b.label,title:b.title,className:F("tui-focusable select-none whitespace-nowrap border-b px-0.5 pb-0.5 text-tui transition-colors",x?"border-tui-accent font-bold text-tui-accent":"border-transparent text-tui-muted hover:border-tui-border-bright hover:text-tui-text"),children:[b.index!==void 0?u.jsx("span",{"aria-hidden":"true",className:F("text-tui-faint",x&&"text-tui-accent"),children:b.index}):null,u.jsx("span",{"aria-hidden":"true",className:F("ml-1",f),children:b.label})]})]},b.id)})}),dp=({hints:r,className:s})=>u.jsx("div",{className:F("flex flex-wrap items-center gap-x-3 gap-y-0.5 text-tui-sm text-tui-faint",s),children:r.map((o,c)=>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:o.keys}),u.jsx("span",{children:o.action})]},`${o.keys}-${c}`))}),gn=({htmlFor:r,hint:s,className:o,children:c})=>u.jsxs("label",{htmlFor:r,className:F("block text-tui-sm font-bold text-tui-muted",o),children:[c,s?u.jsx("span",{className:"ml-2 font-normal text-tui-faint",children:s}):null]}),yn=tl.forwardRef(({className:r,...s},o)=>u.jsx("input",{ref:o,className:F("tui-input w-full px-2 py-1 text-tui",r),...s}));yn.displayName="Input";const Pc=tl.forwardRef(({className:r,children:s,...o},c)=>u.jsx("select",{ref:c,className:F("tui-input w-full px-2 py-1 text-tui",r),...o,children:s}));Pc.displayName="Select";const Xc=({checked:r,onChange:s,disabled:o=!1,label:c,description:m,className:f,id:b})=>u.jsxs("label",{className:F("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",o&&"cursor-not-allowed opacity-60",f),children:[u.jsx("input",{id:b,type:"checkbox",className:"sr-only",checked:r,disabled:o,onChange:p=>s(p.target.checked)}),u.jsx("span",{"aria-hidden":"true",className:F("mt-px shrink-0 font-bold leading-tight",r?"text-tui-ok":"text-tui-faint",!o&&"group-hover:text-tui-accent"),children:r?"[x]":"[ ]"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:F("block",r?"text-tui-text":"text-tui-muted"),children:c}),m?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:m}):null]})]}),yh=({checked:r,onChange:s,name:o,disabled:c=!1,label:m,description:f,className:b})=>u.jsxs("label",{className:F("group flex cursor-pointer select-none items-start gap-2 py-0.5 text-tui",c&&"cursor-not-allowed opacity-60",b),children:[u.jsx("input",{type:"radio",name:o,className:"sr-only",checked:r,disabled:c,onChange:s}),u.jsx("span",{"aria-hidden":"true",className:F("mt-px shrink-0 font-bold leading-tight",r?"text-tui-accent":"text-tui-faint",!c&&"group-hover:text-tui-accent"),children:r?"(•)":"( )"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:F("block",r?"text-tui-text":"text-tui-muted"),children:m}),f?u.jsx("span",{className:"mt-0.5 block text-tui-sm leading-snug text-tui-faint",children:f}):null]})]}),bv=({value:r,width:s=20,tone:o="accent",className:c})=>{const m=Number.isFinite(r)?Math.min(1,Math.max(0,r)):0,f=Math.round(m*s);return u.jsxs("span",{className:F("inline-flex select-none whitespace-pre font-mono leading-none",c),role:"presentation",children:[u.jsx("span",{className:Xi[o],children:Xe.meterFull.repeat(f)}),u.jsx("span",{className:"text-tui-border",children:Xe.meterEmpty.repeat(Math.max(0,s-f))})]})};function eu({columns:r,items:s,rowKey:o,empty:c,className:m}){return s.length===0?u.jsx("div",{className:F("px-1 py-4 text-center text-tui text-tui-faint",m),children:c}):u.jsx("div",{className:F("w-full overflow-x-auto",m),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:F("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:s.map((f,b)=>u.jsx("tr",{className:"border-b border-tui-border-dim last:border-b-0 hover:bg-tui-selection",children:r.map(p=>u.jsx("td",{className:F("px-2 py-1 align-top text-tui-text",p.align==="right"?"text-right":"text-left",p.className),children:p.render(f,b)},p.key))},o(f,b)))})]})})}const fp=({isOpen:r,onClose:s,title:o,subtitle:c,closeLabel:m,footer:f,hints:b,size:p="md",className:x,children:T})=>{if(!r)return null;const v=p==="sm"?"max-w-md":p==="lg"?"max-w-3xl":"max-w-xl",j=`tui-modal-${o.replace(/\s+/g,"-").toLowerCase()}`,G=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":j,onMouseDown:U=>{U.target===U.currentTarget&&s()},children:u.jsxs("div",{className:F("flex w-full flex-col border border-tui-border bg-tui-base",v,x),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:j,className:"truncate text-tui font-bold text-tui-accent",children:o}),c?u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-sm text-tui-faint",children:c}):u.jsx("span",{className:"flex-1"}),u.jsx(Ke,{variant:"ghost",onClick:s,"aria-label":m,title:m,children:"esc"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:T}),f||b?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:[b?u.jsx(dp,{hints:b}):u.jsx("span",{}),f?u.jsx("div",{className:"flex items-center gap-2",children:f}):null]}):null]})});return typeof document>"u"?G:hv.createPortal(G,document.body)},co=({tone:r="accent",className:s,children:o,action:c})=>{const m=r==="ok"?Xe.check:r==="bad"?Xe.cross:r==="warn"?Xe.warn:"›",f=bn[r].edgeL;return u.jsxs("div",{className:F("flex items-start gap-2 border border-tui-border-dim border-l-2 bg-tui-mantle px-2 py-1.5 text-tui",f,s),children:[u.jsx("span",{"aria-hidden":"true",className:F("shrink-0 font-bold",Xi[r]),children:m}),u.jsx("div",{className:"min-w-0 flex-1 leading-snug text-tui-text",children:o}),c?u.jsx("div",{className:"shrink-0",children:c}):null]})},gv=({active:r=!1,className:s,children:o})=>u.jsx("span",{className:F("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",s),children:o}),vh=({items:r,className:s})=>{const o=r.filter(Boolean);return u.jsx("span",{className:F("flex min-w-0 items-center gap-1.5",s),children:o.map((c,m)=>u.jsxs(tl.Fragment,{children:[m>0?u.jsx(up,{className:"shrink-0"}):null,c]},m))})},mp=({left:r,right:s,className:o})=>u.jsxs("footer",{className:F("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",o),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:s})]}),yv=({name:r,tagline:s,aside:o,tabs:c,activeTabId:m,onSelectTab:f,tabsAriaLabel:b,hints:p,footerAside:x,bodyClassName:T,className:v,children:j})=>u.jsxs("div",{className:F("flex h-full min-h-0 w-full flex-col bg-tui-crust",v),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}),s?u.jsx("span",{className:"hidden truncate text-tui-sm text-tui-faint sm:block",children:s}):null]}),o?u.jsx("span",{className:"flex shrink-0 items-center gap-2",children:o}):null]}),c&&c.length>0&&m!==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($c,{tabs:c,activeId:m,onSelect:f,ariaLabel:b,className:"gap-3"})}):null,u.jsx("div",{className:F("min-h-0 flex-1 overflow-y-auto p-2",T),children:j}),p||x?u.jsx(mp,{left:p?u.jsx(dp,{hints:p}):null,right:x}):null]}),xh=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Ha=({className:r,label:s})=>{const[o,c]=tl.useState(0);return tl.useEffect(()=>{const m=setInterval(()=>c(f=>(f+1)%xh.length),90);return()=>clearInterval(m)},[]),u.jsxs("span",{className:F("inline-flex items-center gap-1.5",r),role:"status",children:[u.jsx("span",{"aria-hidden":"true",className:"text-tui-accent",children:xh[o]}),s?u.jsx("span",{children:s}):null]})},io="tui-focusable select-none border border-transparent px-1.5 text-tui uppercase transition-colors",so="text-tui-muted hover:border-tui-border hover:text-tui-accent",vv="border-tui-accent bg-tui-accent text-tui-crust",xv=({currentView:r,onNavigate:s,showAdminEntry:o=!0,onOpenPairing:c,onOpenSettings:m,onToggleVirtualKeyboard:f,isVirtualKeyboardOpen:b})=>{const{addToast:p,language:x,setLanguage:T,t:v}=bt(),j=()=>{const U=x==="zh"?"en":"zh";T(U),p("info",Jc(U,"toasts.switchedLanguage",{lang:U==="zh"?"简体中文":"English"}))},G=[{id:"terminal",label:v("header.terminalTab"),index:1,ariaLabel:v("header.terminalTab")},...o||r==="admin"?[{id:"admin",label:v("header.adminTab"),index:2,ariaLabel:v("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:v("header.tagline")})]}),u.jsx("span",{"aria-hidden":"true",className:"h-4 w-px shrink-0 bg-tui-border"}),u.jsx($c,{tabs:G,activeId:r,onSelect:U=>s(U),ariaLabel:v("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:j,className:F(io,so),title:v("header.languageToggleTitle"),"aria-label":v("header.languageToggleTitle"),children:v("header.languageShort")}),r==="terminal"&&u.jsx("button",{type:"button",onClick:f,className:F(io,b?vv:so),title:v("header.virtualKeyboardTitle"),"aria-label":v("header.virtualKeyboardTitle"),children:v("header.actionKeyboard")}),u.jsx("button",{type:"button",onClick:c,className:F(io,so),title:v("header.pairingTitle"),"aria-label":v("header.pairingTitle"),children:v("header.actionPairing")}),u.jsx("button",{type:"button",onClick:m,className:F(io,so),title:v("header.settingsTitle"),"aria-label":v("header.settingsTitle"),children:v("header.actionSettings")})]})]})})},oo=({tone:r,glyph:s,message:o,assertive:c=!1,action:m})=>u.jsxs("aside",{className:F("flex w-full items-center justify-between gap-3 border-b bg-tui-mantle px-2 py-0.5 text-tui sm:px-3",bn[r].edgeB),"aria-live":c?"assertive":"polite",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{"aria-hidden":"true",className:F("shrink-0",bn[r].text),children:s}),u.jsx("span",{className:"truncate text-tui-text",children:o})]}),m]}),Sv=()=>{const{connectionState:r,stateDetail:s,connect:o,settings:c,t:m}=bt();return r==="connected"||!c.token&&!c.pairCode&&r==="disconnected"?null:r==="connecting"?u.jsx(oo,{tone:"accent",glyph:u.jsx(Ha,{}),message:m("statusBanner.connecting")}):r==="reconnecting"?u.jsx(oo,{tone:"warn",glyph:u.jsx(Ha,{}),assertive:!0,message:s||m("statusBanner.reconnectingDefault"),action:u.jsx(Ke,{variant:"warn",onClick:()=>o(),className:"shrink-0",children:m("statusBanner.reconnectNow")})}):r==="error"?u.jsx(oo,{tone:"bad",glyph:Xe.cross,assertive:!0,message:s||m("statusBanner.errorDefault"),action:u.jsx(Ke,{variant:"danger",onClick:()=>o(),className:"shrink-0",children:m("common.retry")})}):r==="disconnected"?u.jsx(oo,{tone:"idle",glyph:Xe.off,message:m("statusBanner.disconnected"),action:u.jsx(Ke,{variant:"primary",onClick:()=>o(),className:"shrink-0",children:m("common.connect")})}):null};var wv=Dg(),Tv=kg();const Cv=20,Nv=6,Av=500,Ev=300,Ka=13,hp=.602,pp=1.3;function el(r,s){return Number.isFinite(r)&&r>0?r:s}function Sh(r,s,o){return Math.min(o,Math.max(s,r))}function wh(r){const{width:s,height:o,cellWidth:c,cellHeight:m,minCols:f=Cv,minRows:b=Nv,maxCols:p=Av,maxRows:x=Ev}=r,T=el(c,Ka*hp),v=el(m,Ka*pp);return{cols:Sh(Math.floor(el(s,0)/T),f,p),rows:Sh(Math.floor(el(o,0)/v),b,x)}}function Yi(r,s=Ka){var c,m,f;if(r)try{const b=r._core,p=(f=(m=(c=b==null?void 0:b._renderService)==null?void 0:c.dimensions)==null?void 0:m.css)==null?void 0:f.cell;if(p&&p.width&&p.width>0&&p.height&&p.height>0)return{cellWidth:p.width,cellHeight:p.height,measured:!0}}catch{}const o=el(s,Ka);return{cellWidth:Math.round(o*hp*100)/100,cellHeight:Math.round(o*pp*100)/100,measured:!1}}function jv(r){var c;const s=(c=r==null?void 0:r.querySelector)==null?void 0:c.call(r,".xterm-viewport");if(!s)return 0;const o=(s.offsetWidth||0)-(s.clientWidth||0);return Number.isFinite(o)&&o>0?o:0}function Uc(r,s,o){if(!r)return{width:s,height:o};let c=0,m=0;if(typeof r.getBoundingClientRect=="function"){const f=r.getBoundingClientRect();c=(f==null?void 0:f.width)||0,m=(f==null?void 0:f.height)||0}return{width:el(c,el(r.clientWidth,s)),height:el(m,el(r.clientHeight,o))}}function Rv(r,s,o,c){const m=Number.isFinite(c)&&c>.01?c:1;return{clientX:o.left+(r-o.left)/m,clientY:o.top+(s-o.top)/m}}function ki(r){var s,o;if(!r)return!1;try{const c=r.modes;if(c&&typeof c.mouseTrackingMode=="string"&&c.mouseTrackingMode!=="none")return!0;const m=r._core;if((s=m==null?void 0:m._coreMouseService)!=null&&s.areMouseEventsActive||(o=m==null?void 0:m.coreMouseService)!=null&&o.areMouseEventsActive||m!=null&&m.mouseMode&&m.mouseMode!=="none")return!0}catch{}return!1}function zv(r,s){const o=s.button??0,c=s.buttons??(r==="mouseup"?0:1);return new MouseEvent(r,{bubbles:!0,cancelable:!0,clientX:s.clientX,clientY:s.clientY,screenX:s.clientX,screenY:s.clientY,button:o,buttons:c})}function Th(r,s,o){const c=zv(s,o);return r.dispatchEvent(c)}class Mv{constructor(s){Je(this,"options");Je(this,"state","idle");Je(this,"startX",0);Je(this,"startY",0);Je(this,"lastX",0);Je(this,"lastY",0);Je(this,"activeTarget",null);Je(this,"longPressTimer",null);Je(this,"capturedPointerId",null);Je(this,"captureElement",null);Je(this,"scrollRemainderY",0);this.options={longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18,...s}}getState(){return this.state}setGestureState(s){var o,c;this.state!==s&&(this.state=s,(c=(o=this.options).onGestureStateChange)==null||c.call(o,s))}getActiveBuffer(s){var o;try{return((o=s.buffer)==null?void 0:o.active)||null}catch{return null}}getViewportY(s){var c;const o=(c=this.getActiveBuffer(s))==null?void 0:c.viewportY;return typeof o=="number"&&Number.isFinite(o)?o:null}blurTerminal(s){var o;try{(o=s.blur)==null||o.call(s)}catch{}}getLogicalCoordinates(s,o){const c=this.options.getScale?this.options.getScale():1,m=this.options.getSurfaceElement?this.options.getSurfaceElement():null;if(c!==1&&m&&typeof m.getBoundingClientRect=="function"){const f=m.getBoundingClientRect();return Rv(s,o,f,c)}return{clientX:s,clientY:o}}getViewportElement(s){var m;const o=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(o==null?void 0:o.querySelector(".xterm-viewport"))||((m=s.element)==null?void 0:m.querySelector(".xterm-viewport"))||null}isInputLineHit(s,o){var ee;const c=(ee=o.buffer)==null?void 0:ee.active,m=this.options.getSurfaceElement?this.options.getSurfaceElement():null,f=(m==null?void 0:m.querySelector(".xterm-screen"))||o.element||m,b=Yi(o);if(!f||typeof f.getBoundingClientRect!="function"||b.cellHeight<=0)return!1;const p=f.getBoundingClientRect(),x=this.getLogicalCoordinates(s.clientX,s.clientY),T=p.width>0&&p.height>0;if(![c==null?void 0:c.cursorY,c==null?void 0:c.viewportY,c==null?void 0:c.baseY].every(W=>typeof W=="number"&&Number.isFinite(W)))return!1;const j=c==null?void 0:c.cursorY,G=c==null?void 0:c.viewportY,X=(c==null?void 0:c.baseY)+j-G,V=p.top+X*b.cellHeight,Y=V+b.cellHeight,Q=Number(o.rows);return X>=0&&(!Number.isFinite(Q)||X<Q)&&x.clientY>=V-2&&x.clientY<=Y+2&&(!T||x.clientX>=p.left&&x.clientX<=p.right)}resolveDispatchTarget(s,o){var p;const c=this.options.getSurfaceElement?this.options.getSurfaceElement():null,m=(c==null?void 0:c.querySelector(".xterm-screen"))||o.querySelector(".xterm-screen")||null,f=((p=m==null?void 0:m.closest)==null?void 0:p.call(m,".xterm"))||null;let b=null;return typeof document<"u"&&typeof document.elementFromPoint=="function"&&(b=document.elementFromPoint(s.clientX,s.clientY)),b&&f&&(b===f||f.contains(b))?b:m||c||o}getMouseReport(s,o){const c=this.options.getSurfaceElement?this.options.getSurfaceElement():null,m=(c==null?void 0:c.querySelector(".xterm-screen"))||o.element;if(!m||typeof m.getBoundingClientRect!="function")return null;const f=m.getBoundingClientRect(),b=this.getLogicalCoordinates(s.clientX,s.clientY),p=Yi(o);if(p.cellWidth<=0||p.cellHeight<=0)return null;const x=Math.max(1,f.width||o.cols*p.cellWidth),T=Math.max(1,f.height||o.rows*p.cellHeight),v=Math.max(0,Math.min(x-1,b.clientX-f.left)),j=Math.max(0,Math.min(T-1,b.clientY-f.top)),G=Math.max(0,Math.min(o.cols-1,Math.floor(v/p.cellWidth))),U=Math.max(0,Math.min(o.rows-1,Math.floor(j/p.cellHeight)));return{col:G,row:U,x:Math.floor(v),y:Math.floor(j),button:0,action:0}}getCoreMouseService(s){var c,m;const o=s;return o.coreMouseService||((c=o._core)==null?void 0:c.coreMouseService)||((m=o._core)==null?void 0:m._coreMouseService)||null}getCoreService(s){var c;const o=s;return o.coreService||((c=o._core)==null?void 0:c.coreService)||null}getWheelDispatchTarget(s){const o=this.options.getSurfaceElement?this.options.getSurfaceElement():null;return(o==null?void 0:o.querySelector(".xterm"))||s.element||null}dispatchWheel(s,o,c,m){const f=this.getWheelDispatchTarget(c);if(!f||typeof WheelEvent>"u"||o===0)return!1;const b=this.getLogicalCoordinates(s.clientX,s.clientY),p=o<0?-1:1;let x=0;for(let T=0;T<Math.abs(o);T+=1)try{const v=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:b.clientX,clientY:b.clientY,deltaX:0,deltaY:p,deltaMode:1,ctrlKey:!!(m!=null&&m.ctrlKey),altKey:!!(m!=null&&m.altKey),shiftKey:!!(m!=null&&m.shiftKey)});f.dispatchEvent(v),x+=1}catch{return x>0}return x>0}emitWheel(s,o,c,m){if(o===0)return!1;if(this.dispatchWheel(s,o,c,m))return!0;const f=this.getCoreMouseService(c);if(!(f!=null&&f.triggerMouseEvent))return!1;let b=0;for(let p=0;p<Math.abs(o);p+=1){const x=this.getMouseReport(s,c);x&&(x.button=4,x.action=o<0?0:1,x.ctrl=!!(m!=null&&m.ctrlKey),x.alt=!!(m!=null&&m.altKey),x.shift=!!(m!=null&&m.shiftKey),f.triggerMouseEvent(x)&&(b+=1))}return b>0}scrollAlternateBuffer(s,o,c,m){var b;if(o===0)return"none";const f=ki(c);if(!f&&!this.options.getIsController())return"none";if(this.emitWheel(s,o,c,m))return f?"application-mouse":"application-keys";if(!f){const p=this.getCoreService(c);if(!(p!=null&&p.triggerDataEvent))return"none";const T=`\x1B${!!((b=p.decPrivateModes)!=null&&b.applicationCursorKeys)?"O":"["}${o<0?"A":"B"}`;return p.triggerDataEvent(T.repeat(Math.abs(o)),!0),"application-keys"}return"none"}emitMouse(s,o,c){const m=this.options.getTerminal();if(!m)return;const f=this.getCoreMouseService(m);if(f!=null&&f.triggerMouseEvent){const p=this.getMouseReport(o,m);p&&(p.action=s==="mousedown"?1:s==="mouseup"?0:32,p.ctrl=!!(c!=null&&c.ctrlKey),p.alt=!!(c!=null&&c.altKey),p.shift=!!(c!=null&&c.shiftKey),f.triggerMouseEvent(p));return}if(this.options.allowSyntheticMouseFallback===!1||!this.activeTarget)return;const b=this.getLogicalCoordinates(o.clientX,o.clientY);Th(this.activeTarget,s,{clientX:b.clientX,clientY:b.clientY,button:0,buttons:s==="mouseup"?0:1})}beginGesture(s,o){this.startX=s.clientX,this.startY=s.clientY,this.lastX=s.clientX,this.lastY=s.clientY,this.setGestureState("pending"),this.scrollRemainderY=0,this.activeTarget=this.resolveDispatchTarget(s,o),this.clearLongPressTimer(),this.longPressTimer=setTimeout(()=>{this.state==="pending"&&this.setGestureState("longpress")},this.options.longPressDelayMs)}moveGesture(s,o){var T;if(this.state==="longpress"||this.state==="idle")return;const c=s.clientX-this.startX,m=s.clientY-this.startY,f=Math.hypot(c,m);if(this.state==="scrolling"){this.scrollGesture(s,o);return}const b=this.options.getTerminal(),p=this.options.getIsController(),x=ki(b);if(!(f<=(this.options.dragThresholdPx||8))){if(this.clearLongPressTimer(),Math.abs(m)>=Math.abs(c)||!x||!p){this.setGestureState("scrolling"),b&&this.blurTerminal(b),this.lastX=s.clientX,this.lastY=this.startY,this.scrollRemainderY=0,this.scrollGesture(s,o);return}if(x&&p){this.state==="pending"&&(this.setGestureState("dragging"),this.emitMouse("mousedown",{clientX:this.startX,clientY:this.startY},o)),this.state==="dragging"&&(this.lastX=s.clientX,this.lastY=s.clientY,this.emitMouse("mousemove",s,o),o!=null&&o.cancelable&&((T=o.preventDefault)==null||T.call(o)));return}this.lastX=s.clientX,this.lastY=s.clientY}}scrollGesture(s,o){var X,V,Y;const c=this.options.getTerminal();if(!c)return;const m=s.clientY-this.lastY;this.lastX=s.clientX,this.lastY=s.clientY;const f=Yi(c),b=f.measured?f.cellHeight:this.options.scrollLineHeightPx||f.cellHeight||18;this.scrollRemainderY+=m;const p=Math.trunc(this.scrollRemainderY/b),x=-p;let T=!1,v="none";const j=this.getActiveBuffer(c),G=ki(c);if(x!==0){if((j==null?void 0:j.type)==="alternate")v=this.scrollAlternateBuffer(s,x,c,o),T=v!=="none";else{const Q=this.getViewportY(c);c.scrollLines(x);const ee=this.getViewportY(c);v="buffer",T=Q===null||ee===null||Q!==ee}this.scrollRemainderY-=p*b}const U=this.getViewportElement(c);(V=(X=this.options).onGestureScroll)==null||V.call(X,{deltaY:m,lines:x,viewportY:this.getViewportY(c),scrollTop:(U==null?void 0:U.scrollTop)??null,scrollHeight:(U==null?void 0:U.scrollHeight)??null,clientHeight:(U==null?void 0:U.clientHeight)??null,moved:T,bufferType:(j==null?void 0:j.type)||null,baseY:typeof(j==null?void 0:j.baseY)=="number"?j.baseY:null,cursorY:typeof(j==null?void 0:j.cursorY)=="number"?j.cursorY:null,hasScrollback:typeof(j==null?void 0:j.hasScrollback)=="boolean"?j.hasScrollback:null,mouseTracking:G,scrollMode:v}),o!=null&&o.cancelable&&((Y=o.preventDefault)==null||Y.call(o))}endGesture(s,o){var b,p,x;this.clearLongPressTimer();const c=this.options.getTerminal(),m=this.options.getIsController(),f=ki(c);if(this.state==="pending"){if(f&&m){const v={clientX:this.startX,clientY:this.startY};this.emitMouse("mousedown",v,o),this.emitMouse("mouseup",v,o)}const T={clientX:this.startX,clientY:this.startY};m&&c&&this.isInputLineHit(T,c)&&((p=(b=this.options).onFocus)==null||p.call(b))}else if(this.state==="dragging"&&f&&m){const T=s??{clientX:this.lastX,clientY:this.lastY};this.emitMouse("mouseup",T,o),o!=null&&o.cancelable&&((x=o.preventDefault)==null||x.call(o))}this.reset()}handlePointerDown(s,o){if(s.pointerType==="mouse")return!1;if(!s.isPrimary)return this.releasePointerCapture(),this.reset(),!1;if(s.cancelable&&s.preventDefault(),this.beginGesture(s,o),s.pointerType!=="touch")try{typeof o.setPointerCapture=="function"&&(o.setPointerCapture(s.pointerId),this.capturedPointerId=s.pointerId,this.captureElement=o)}catch{}return!0}handlePointerMove(s){s.pointerType==="mouse"||this.state==="idle"||this.moveGesture(s,s)}handlePointerUp(s){s.pointerType==="mouse"||this.state==="idle"||(this.releasePointerCapture(),this.endGesture(s,s))}handlePointerCancel(s){s&&s.pointerType==="mouse"||(this.releasePointerCapture(),this.cancelGesture())}handleTouchStart(s,o){if(s.touches.length!==1){this.reset();return}s.cancelable&&s.preventDefault(),this.beginGesture(s.touches[0],o)}handleTouchMove(s){s.touches.length===1&&this.moveGesture(s.touches[0],s)}handleTouchEnd(s){s.cancelable&&s.preventDefault(),this.endGesture(null,s)}handleTouchCancel(){this.cancelGesture()}cancelGesture(){this.clearLongPressTimer();const s=this.options.getTerminal(),o=this.options.getIsController(),c=ki(s);if(this.state==="dragging"&&c&&o&&this.activeTarget){const m=this.getLogicalCoordinates(this.lastX,this.lastY);Th(this.activeTarget,"mouseup",{clientX:m.clientX,clientY:m.clientY,button:0,buttons:0})}this.reset()}releasePointerCapture(){const s=this.captureElement,o=this.capturedPointerId;if(this.captureElement=null,this.capturedPointerId=null,!(!s||o===null))try{typeof s.releasePointerCapture=="function"&&(typeof s.hasPointerCapture!="function"||s.hasPointerCapture(o))&&s.releasePointerCapture(o)}catch{}}clearLongPressTimer(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}reset(){this.clearLongPressTimer(),this.releasePointerCapture(),this.setGestureState("idle"),this.activeTarget=null}}var Ch=Og(),_v=Lg();function Dv(r,s){if(s.coarsePointer)return{kind:"dom",dispose:()=>{}};try{const o=new _v.WebglAddon;let c=null;return o.onContextLoss(()=>{var m;try{o.dispose()}catch{}try{c=new Ch.CanvasAddon,r.loadAddon(c)}catch(f){console.debug("Canvas fallback failed after WebGL context loss:",f)}(m=s.onRendererSwapped)==null||m.call(s)}),r.loadAddon(o),{kind:"webgl",dispose:()=>{for(const m of[c,o])try{m==null||m.dispose()}catch{}}}}catch(o){console.debug("WebGL renderer unavailable, falling back to canvas:",o)}try{const o=new Ch.CanvasAddon;return r.loadAddon(o),{kind:"canvas",dispose:()=>{try{o.dispose()}catch{}}}}catch(o){console.debug("Canvas renderer unavailable, using the DOM renderer:",o)}return{kind:"dom",dispose:()=>{}}}function Nh(r,s){const o=typeof window<"u"?window:void 0,c=o&&typeof o.devicePixelRatio=="number"&&o.devicePixelRatio>0?o.devicePixelRatio:1,m=o&&o.visualViewport&&typeof o.visualViewport.scale=="number"&&o.visualViewport.scale>0?o.visualViewport.scale:1,f=Math.max(0,r.width),b=Math.max(0,r.height),p=Math.round(f*c*100)/100,x=Math.round(b*c*100)/100;return{dpr:c,scale:m,cssWidth:f,cssHeight:b,physicalWidth:p,physicalHeight:x}}function kv(r){const{lastSnapshot:s,currentSnapshot:o,physicalTolerancePx:c=6}=r;if(!s)return{shouldIgnore:!1,isVisualZoom:!1,reason:"initial"};const m=Math.abs(o.scale-s.scale)>.01,f=Math.abs(o.scale-1)>.01;if(m||f)return{shouldIgnore:!0,isVisualZoom:!0,reason:"visual_pinch_zoom"};if(Math.abs(o.dpr-s.dpr)>.01){const T=Math.abs(o.physicalWidth-s.physicalWidth),v=Math.abs(o.physicalHeight-s.physicalHeight);if(T<=c&&v<=c)return{shouldIgnore:!0,isVisualZoom:!0,reason:"dpr_zoom"}}const p=Math.abs(o.cssWidth-s.cssWidth),x=Math.abs(o.cssHeight-s.cssHeight);return p<1&&x<1?{shouldIgnore:!0,isVisualZoom:!1,reason:"no_box_change"}:{shouldIgnore:!1,isVisualZoom:!1,reason:"genuine_resize"}}const Ov=250,Lv=({onTerminalFocus:r,isActive:s=!0})=>{const o=w.useRef(null),c=w.useRef(null),m=w.useRef(null),f=w.useRef(null),b=w.useRef(1),p=w.useRef({cols:0,rows:0}),x=w.useRef(null),T=w.useRef(null),v=w.useRef(null),j=w.useRef(null),G=w.useRef({width:0,height:0}),U=w.useRef(null),X=iy(),V=X||typeof navigator<"u"&&navigator.maxTouchPoints>0||typeof window<"u"&&"ontouchstart"in window,Y=typeof window<"u"&&new URLSearchParams(window.location.search).get("debug")==="1",[Q,ee]=w.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}),{isController:W,connectionState:ce,settings:he,hostPalette:K,terminalResetVersion:H,sendResize:z,sendBinary:re,addToast:_e,warnViewerMode:Te,connect:me,subscribeToOutput:q,t:se}=bt(),ve=tl.useMemo(()=>by(K),[K]),E=w.useRef(ve);E.current=ve;const L=w.useRef(W);L.current=W;const Z=w.useRef(re);Z.current=re;const pe=w.useRef(_e);pe.current=_e;const k=w.useRef(Te);k.current=Te;const We=w.useRef(z);We.current=z;const Ue=w.useRef(s);Ue.current=s;const xe=w.useRef(se);xe.current=se;const Se=w.useCallback((ne,ye)=>{!Number.isFinite(ne)||!Number.isFinite(ye)||ne<=0||ye<=0||ne===p.current.cols&&ye===p.current.rows||(x.current={cols:ne,rows:ye},!T.current&&(T.current=setTimeout(()=>{T.current=null;const Be=x.current;x.current=null,Be&&(Be.cols===p.current.cols&&Be.rows===p.current.rows||(p.current=Be,We.current(Be.cols,Be.rows)))},Ov)))},[]),De=w.useCallback((ne=!1)=>{const ye=f.current,Be=o.current,ke=m.current,kt=c.current;if(!ye||!Be||!ke||!kt)return;const ie=Uc(Be,La(),kc());if(ie.width<=0||ie.height<=0)return;kt.style.width="100%",kt.style.height="100%",ke.style.width="100%",ke.style.height="100%",ke.style.transform="none",ke.style.transformOrigin="top left",b.current=1;const Ot=Nh(ie),Yt=kv({lastSnapshot:U.current,currentSnapshot:Ot});if(Yt.isVisualZoom&&!ne){U.current=Ot;try{ye.refresh(0,Math.max(0,ye.rows-1))}catch{}return}if(Yt.shouldIgnore&&!ne)return;U.current=Ot;const Bt=Yi(ye,Ka),Ie=wh({width:ie.width-jv(ke),height:ie.height,cellWidth:Bt.cellWidth,cellHeight:Bt.cellHeight}),ln=Math.abs(ie.width-G.current.width)>1||Math.abs(ie.height-G.current.height)>1;if(ye.cols!==Ie.cols||ye.rows!==Ie.rows)try{ye.resize(Ie.cols,Ie.rows)}catch(mt){console.debug("Error resizing terminal grid:",mt)}const an=Ie.cols!==p.current.cols||Ie.rows!==p.current.rows;Ue.current&&(ln||ne||an)&&(G.current={width:ie.width,height:ie.height},Se(Ie.cols,Ie.rows));try{ye.refresh(0,Math.max(0,ye.rows-1))}catch{}},[Se]),Ee=w.useRef(De);Ee.current=De;const ct=w.useCallback(()=>{if(v.current===null){if(typeof requestAnimationFrame!="function"){Ee.current();return}v.current=requestAnimationFrame(()=>{v.current=null,Ee.current()})}},[]),ft=w.useCallback((ne=30)=>{j.current!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(j.current),j.current=null);let ye=0;const Be=()=>{j.current=null,ye++;const ke=ye>=ne;Ee.current(!0),!ke&&ye<2&&typeof requestAnimationFrame=="function"&&(j.current=requestAnimationFrame(Be))};typeof requestAnimationFrame=="function"?j.current=requestAnimationFrame(Be):Be()},[]);w.useEffect(()=>{if(!o.current||!m.current)return;const ne=o.current,ye=Uc(ne,La(),kc()),Be=Yi(null,Ka),ke=wh({width:ye.width,height:ye.height,cellWidth:Be.cellWidth,cellHeight:Be.cellHeight});We.current(ke.cols,ke.rows),G.current={width:ye.width,height:ye.height},U.current=Nh(ye);const kt=ah(he.fontSize,ye.width),ie=new wv.Terminal({fontSize:kt,fontFamily:he.fontFamily,lineHeight:1.15,...E.current?{theme:{...E.current}}:{},allowProposedApi:!0,convertEol:!0,scrollback:5e3,cols:ke.cols,rows:ke.rows,screenReaderMode:!1});try{const ae=new Tv.Unicode11Addon;ie.loadAddon(ae),ie.unicode.activeVersion="11"}catch(ae){console.debug("Unicode11 addon unavailable, using default width table:",ae)}ie.open(m.current),f.current=ie,X&&ie.textarea&&(ie.textarea.readOnly=!1,ie.textarea.tabIndex=0,ie.textarea.inputMode="text");let Ot=()=>{};if(Y&&ie.textarea){const ae=()=>{ee(be=>({...be,focused:document.activeElement===ie.textarea}))};ie.textarea.addEventListener("focus",ae),ie.textarea.addEventListener("blur",ae),Ot=()=>{var be,$e;(be=ie.textarea)==null||be.removeEventListener("focus",ae),($e=ie.textarea)==null||$e.removeEventListener("blur",ae)},ae()}const Yt=Dv(ie,{coarsePointer:X,onRendererSwapped:()=>{try{ie.refresh(0,Math.max(0,ie.rows-1))}catch{}}});ne&&(ne.dataset.renderer=Yt.kind);const Bt=xe.current("terminal.bannerTitle"),Ie=xe.current("terminal.bannerSubtitle");if(ie.writeln(" ___ ___ .___ "),ie.writeln(` / | \\ ____ _______| _/______ \x1B[1m${Bt}\x1B[0m`),ie.writeln(`/ ~ \\/ __ \\\\_ __ \\ __/ ___/ \x1B[2m${Ie}\x1B[0m`),ie.writeln("\\ Y / ___/ | | \\/|_ \\___ \\ "),ie.writeln(" \\___|_ / \\___ >|__| /___/____ >"),ie.writeln(" \\/ \\/ \\/ "),ie.writeln(""),!X)try{ie.focus()}catch{}const ln=ie.onData(ae=>{const be=kh(ae);if(!L.current&&!Bc(be)){k.current();return}Z.current(be)}),an=ie.onBinary(ae=>{const be=new Uint8Array(ae.length);for(let $e=0;$e<ae.length;$e++)be[$e]=ae.charCodeAt($e)&255;!L.current&&!Bc(be)||Z.current(be)}),mt=new Mv({getTerminal:()=>f.current,getIsController:()=>L.current,getScale:()=>b.current,getSurfaceElement:()=>m.current,allowSyntheticMouseFallback:!1,onFocus:()=>{try{ie.focus()}catch{}Y&&ee(ae=>({...ae,focused:document.activeElement===ie.textarea})),r==null||r()},onGestureStateChange:ae=>{Y&&ee(be=>({...be,state:ae}))},onGestureScroll:({deltaY:ae,lines:be,viewportY:$e,scrollTop:ot,scrollHeight:Sn,clientHeight:wn,moved:ge,bufferType:Nt,baseY:jt,cursorY:_,hasScrollback:B,mouseTracking:te,scrollMode:Ne})=>{Y&&ee(je=>({...je,deltaY:ae,lines:be,viewportY:$e,scrollTop:ot,scrollHeight:Sn,clientHeight:wn,moved:ge,focused:document.activeElement===ie.textarea,bufferType:Nt,baseY:jt,cursorY:_,hasScrollback:B,mouseTracking:te,scrollMode:Ne,scrollCalls:je.scrollCalls+(be!==0?1:0),lastScrollLines:be}))},longPressDelayMs:500,dragThresholdPx:8,scrollLineHeightPx:18}),I=typeof window<"u"&&"PointerEvent"in window,we=typeof TouchEvent<"u",fe=[],Ge=(ae,be=!1)=>{const $e=ae.target;return $e instanceof Node&&ne.contains($e)||be&&mt.getState()!=="idle"};if(I){const ae={passive:!1,capture:!0},be=ge=>{Y&&ee(Nt=>({...Nt,pointerEvents:Nt.pointerEvents+1,lastInputEvent:ge}))},$e=ge=>{if(!Ge(ge))return;be("pointerdown"),mt.handlePointerDown(ge,ne)&&ge.stopPropagation()},ot=ge=>{Ge(ge,!0)&&(be("pointermove"),mt.handlePointerMove(ge),ge.pointerType!=="mouse"&&ge.stopPropagation())},Sn=ge=>{Ge(ge,!0)&&(be("pointerup"),mt.handlePointerUp(ge),ge.pointerType!=="mouse"&&ge.stopPropagation())},wn=ge=>{Ge(ge,!0)&&(be("pointercancel"),mt.handlePointerCancel(ge),ge.pointerType!=="mouse"&&ge.stopPropagation())};if(document.addEventListener("pointerdown",$e,ae),document.addEventListener("pointermove",ot,ae),document.addEventListener("pointerup",Sn,ae),document.addEventListener("pointercancel",wn,ae),fe.push(()=>{document.removeEventListener("pointerdown",$e,ae),document.removeEventListener("pointermove",ot,ae),document.removeEventListener("pointerup",Sn,ae),document.removeEventListener("pointercancel",wn,ae)}),we){const ge=jt=>{Ge(jt,!0)&&(Y&&ee(_=>({..._,touchEvents:_.touchEvents+1})),jt.cancelable&&jt.preventDefault(),jt.stopPropagation())},Nt=["touchstart","touchmove","touchend","touchcancel"];for(const jt of Nt)document.addEventListener(jt,ge,ae);fe.push(()=>{for(const jt of Nt)document.removeEventListener(jt,ge,ae)})}}else{const ae={passive:!1,capture:!0},be=ge=>{Y&&ee(Nt=>({...Nt,touchEvents:Nt.touchEvents+1,lastInputEvent:ge}))},$e=ge=>{Ge(ge)&&(be("touchstart"),ge.touches.length===1&&ge.stopPropagation(),mt.handleTouchStart(ge,ne))},ot=ge=>{Ge(ge,!0)&&(be("touchmove"),ge.touches.length===1&&ge.stopPropagation(),mt.handleTouchMove(ge))},Sn=ge=>{Ge(ge,!0)&&(be("touchend"),ge.stopPropagation(),mt.handleTouchEnd(ge))},wn=ge=>{Ge(ge,!0)&&(be("touchcancel"),ge.stopPropagation(),mt.handleTouchCancel())};document.addEventListener("touchstart",$e,ae),document.addEventListener("touchmove",ot,ae),document.addEventListener("touchend",Sn,ae),document.addEventListener("touchcancel",wn,ae),fe.push(()=>{document.removeEventListener("touchstart",$e,ae),document.removeEventListener("touchmove",ot,ae),document.removeEventListener("touchend",Sn,ae),document.removeEventListener("touchcancel",wn,ae)})}const Jt=ae=>{ae.preventDefault()};ne.addEventListener("contextmenu",Jt),fe.push(()=>{ne.removeEventListener("contextmenu",Jt)});const kn=new ResizeObserver(()=>{ct()});kn.observe(ne);const Ct=()=>{ct()},jn=()=>{var ae,be;if(document.visibilityState==="visible"){ft(10);try{(be=f.current)==null||be.refresh(0,Math.max(0,(((ae=f.current)==null?void 0:ae.rows)||1)-1))}catch{}}};window.addEventListener("resize",Ct),window.addEventListener("orientationchange",Ct),document.addEventListener("visibilitychange",jn),window.addEventListener("pageshow",jn);const xn=()=>{ct()};return typeof window<"u"&&window.visualViewport&&(window.visualViewport.addEventListener("resize",xn),window.visualViewport.addEventListener("scroll",xn)),()=>{ln.dispose(),an.dispose(),mt.handlePointerCancel();for(const ae of fe)ae();kn.disconnect(),window.removeEventListener("resize",Ct),window.removeEventListener("orientationchange",Ct),document.removeEventListener("visibilitychange",jn),window.removeEventListener("pageshow",jn),typeof window<"u"&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",xn),window.visualViewport.removeEventListener("scroll",xn)),T.current&&(clearTimeout(T.current),T.current=null),v.current!==null&&(cancelAnimationFrame(v.current),v.current=null),j.current!==null&&(cancelAnimationFrame(j.current),j.current=null),Ot(),Yt.dispose(),ie.dispose(),f.current=null}},[]),w.useEffect(()=>{const ne=f.current;if(!ne)return;const ye=Uc(o.current,La(),kc());ne.options.fontSize=ah(he.fontSize,ye.width),ne.options.fontFamily=he.fontFamily;try{ne.refresh(0,Math.max(0,ne.rows-1))}catch{}ft(10)},[he.fontSize,he.fontFamily]);const Ye=w.useRef(H);w.useEffect(()=>{var ye;if(Ye.current===H)return;Ye.current=H;const ne=f.current;if(ne)try{(ye=ne.reset)==null||ye.call(ne),ne.clear(),ne.refresh(0,Math.max(0,ne.rows-1))}catch{}},[H]),w.useEffect(()=>{const ne=f.current;if(!(!ne||!ve)){ne.options.theme={...ve};try{ne.refresh(0,Math.max(0,ne.rows-1))}catch{}}},[ve]),w.useEffect(()=>q(ye=>{const Be=f.current;if(!Be)throw new Error("terminal not ready");Be.write(ye)}),[q]),w.useEffect(()=>{if(!s)return;ft(10);const ne=f.current;if(ne){try{ne.refresh(0,Math.max(0,ne.rows-1))}catch{}if(!X)try{ne.focus()}catch{}}},[s,X,ft]),w.useEffect(()=>{ce==="disconnected"&&me()},[]);const Ut=ne=>{ne.preventDefault()};return u.jsxs("main",{className:"flex-1 w-full min-w-0 min-h-0 overflow-hidden relative flex flex-col",onContextMenu:Ut,"aria-label":se("terminal.windowAriaLabel"),children:[u.jsx("div",{id:"terminal-container",ref:o,className:"absolute inset-0 overflow-hidden cursor-text",style:{touchAction:V?"none":"auto"},tabIndex:0,onContextMenu:Ut,"aria-label":se("terminal.bufferAriaLabel"),role:"region",children:u.jsx("div",{id:"terminal-frame",ref:c,className:"relative overflow-hidden",style:{width:"100%",height:"100%"},children:u.jsx("div",{id:"terminal-surface",ref:m,className:"absolute top-0 left-0",style:{transformOrigin:"top left",width:"100%",height:"100%"}})})}),Y&&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: ${Q.state}
34
+ `,`deltaY: ${Q.deltaY} lines: ${Q.lines}
35
+ `,`viewportY: ${Q.viewportY??"-"} focus: ${Q.focused}
36
+ `,`buffer: ${Q.bufferType??"-"} base: ${Q.baseY??"-"} cursor: ${Q.cursorY??"-"} scrollback: ${Q.hasScrollback??"-"}
37
+ `,`scroll: ${Q.scrollTop??"-"} / ${Q.scrollHeight??"-"} (h ${Q.clientHeight??"-"}) moved: ${Q.moved}
38
+ `,`mode: ${Q.scrollMode} calls: ${Q.scrollCalls} lines: ${Q.lastScrollLines??"-"} mouse: ${Q.mouseTracking}
39
+ `,`event: ${Q.lastInputEvent||"-"} pointer: ${Q.pointerEvents} touch: ${Q.touchEvents}`]})]})},Uv=({onPairedSuccess:r})=>{const{settings:s,updateSettings:o,connect:c,connectionState:m,stateDetail:f,addToast:b,t:p}=bt(),[x,T]=w.useState(""),[v,j]=w.useState(null),[G,U]=w.useState(!1),[X,V]=w.useState(s.wsUrl||"/ws/client"),[Y,Q]=w.useState(s.token||""),[ee,W]=w.useState(s.clientId||""),ce="node bin/service.js pair",he="node bin/config-tui.js",K="herdr plugin pane open --plugin herdr.remote.web --entrypoint config --placement zoomed --focus",H=Te=>{navigator.clipboard.writeText(Te).then(()=>{j(Te),b("success",p("toasts.commandCopied")),setTimeout(()=>j(null),2e3)})},z=Te=>{Te.preventDefault();const me=x.trim().toUpperCase();if(!me&&!Y.trim()){b("warning",p("toasts.connectionError"));return}const q={pairCode:me,wsUrl:X.trim()||"/ws/client",clientId:ee.trim()||s.clientId};Y.trim()&&(q.token=Y.trim()),o(q),c({pairCode:me||void 0,token:Y.trim()||void 0,wsUrl:X.trim()||"/ws/client",clientId:ee.trim()||s.clientId}),r&&r()},re=m==="connecting"||m==="reconnecting",_e=({n:Te})=>u.jsxs("span",{"aria-hidden":"true",className:"shrink-0 font-bold text-tui-accent",children:["[",Te,"]"]});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:p("onboarding.title")}),u.jsx("span",{className:"text-tui uppercase text-tui-warn",children:p("onboarding.firstTimeSetup")})]}),u.jsx("p",{className:"mt-0.5 text-tui leading-snug text-tui-muted",children:p("onboarding.description")})]}),m==="error"&&u.jsxs(co,{tone:"warn",action:u.jsx(Ke,{variant:"warn",onClick:()=>c(),children:p("common.retry")}),children:[u.jsx("span",{className:"block font-bold",children:p("onboarding.authRequired")}),u.jsx("span",{className:"block text-tui-muted",children:f||p("onboarding.authRequiredDesc")})]}),u.jsxs("form",{onSubmit:z,className:"grid gap-3",children:[u.jsx(Kt,{title:p("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(_e,{n:1}),u.jsx("span",{className:"leading-snug",children:p("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:ce}),u.jsx(Ke,{onClick:()=>H(ce),glyph:v===ce?Xe.check:"⧉",className:F("shrink-0",v===ce&&"border-tui-ok text-tui-ok"),children:p(v===ce?"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:p("onboarding.step1CopyPlugin")}),u.jsx("button",{type:"button",onClick:()=>H(K),className:"tui-focusable shrink-0 text-tui-accent underline-offset-2 hover:underline",children:p(v===K?"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:p("onboarding.step1TuiNote")}),u.jsx("code",{onClick:()=>H(he),className:"shrink-0 cursor-pointer border border-tui-border-dim px-1 text-tui-muted hover:border-tui-accent hover:text-tui-accent",title:p("common.clickToCopy"),children:he})]})]})]})}),u.jsx(Kt,{title:p("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(_e,{n:2}),u.jsx(yn,{type:"text",value:x,onChange:Te=>T(Te.target.value.toUpperCase()),placeholder:p("onboarding.step2Placeholder"),maxLength:12,autoFocus:!0,"aria-label":p("onboarding.step2Title"),className:"font-bold uppercase"})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("onboarding.step2Note")})]})}),u.jsx(Ke,{variant:"primary",type:"submit",block:!0,disabled:re,className:"py-1.5",children:re?u.jsx(Ha,{label:p("onboarding.connectingAndPairing")}):p("onboarding.connectAndPair")}),u.jsxs("div",{className:"border border-tui-border bg-tui-base",children:[u.jsxs("button",{type:"button",onClick:()=>U(!G),"aria-expanded":G,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:G?Xe.chevronDown:Xe.chevronRight}),u.jsx("span",{className:"uppercase",children:p("onboarding.advancedTitle")})]}),G&&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(gn,{htmlFor:"onboarding-token",children:p("onboarding.manualTokenLabel")}),u.jsx(yn,{id:"onboarding-token",type:"password",value:Y,onChange:Te=>Q(Te.target.value),placeholder:p("onboarding.manualTokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"onboarding-ws",children:p("onboarding.wsEndpointLabel")}),u.jsx(yn,{id:"onboarding-ws",type:"text",value:X,onChange:Te=>V(Te.target.value),placeholder:p("onboarding.wsEndpointPlaceholder")})]}),u.jsx(Ba,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"onboarding-client-id",children:p("onboarding.clientIdLabel")}),u.jsx(yn,{id:"onboarding-client-id",type:"text",value:ee,onChange:Te=>W(Te.target.value)})]})]})]})]})]})})},Oi="tui-focusable inline-flex shrink-0 select-none items-center justify-center border text-tui font-medium transition-colors",ro="border-tui-border bg-tui-surface text-tui-text hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",Bv="border-tui-accent bg-tui-accent text-tui-crust font-bold",Hv="border-tui-ok bg-transparent text-tui-ok hover:bg-tui-ok hover:text-tui-crust font-bold",Kv=({compact:r=!1})=>{const{sendKey:s,settings:o,updateSettings:c,isController:m,warnViewerMode:f,t:b}=bt(),p="h-9 min-w-[2.25rem] px-2",x="h-9 w-9",T="h-9 px-2",[v,j]=w.useState(!1),[G,U]=w.useState(!1),[X,V]=w.useState(!1),[Y,Q]=w.useState(!1),[ee,W]=w.useState(!1),[ce,he]=w.useState(!1),K=w.useCallback(()=>{if(o.vibrateOnKeyPress&&typeof navigator<"u"&&navigator.vibrate)try{navigator.vibrate(8)}catch{}},[o.vibrateOnKeyPress]),H=w.useCallback((q,se=!1)=>{if(K(),!m){f();return}let ve=q;se&&(v||G||X)&&(ve=Fg(q,{ctrl:v,alt:G,shift:X})),s(ve),v&&j(!1),G&&U(!1),X&&V(!1)},[m,v,G,X,s,f,K,b]);if(!o.toolbarVisible)return u.jsx("div",{"data-testid":"key-toolbar-collapsed",className:"z-20 flex shrink-0 justify-center border-t border-tui-border bg-tui-mantle pb-[max(env(safe-area-inset-bottom,0px),0.125rem)]",children:u.jsxs("button",{type:"button",onClick:()=>c({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:b("virtualKeyboard.expandToolbar"),"aria-label":b("virtualKeyboard.expandToolbar"),"aria-expanded":!1,children:[u.jsx("span",{"aria-hidden":"true",children:"▴"}),u.jsx("span",{"aria-hidden":"true",children:b("common.keyBar")})]})});const z=o.virtualKeys&&o.virtualKeys.length>0?o.virtualKeys.filter(q=>q.enabled):Kh,re=q=>q.id==="left"?u.jsx("span",{"aria-hidden":"true",children:"←"}):q.id==="up"?u.jsx("span",{"aria-hidden":"true",children:"↑"}):q.id==="down"?u.jsx("span",{"aria-hidden":"true",children:"↓"}):q.id==="right"?u.jsx("span",{"aria-hidden":"true",children:"→"}):q.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:b("virtualKeyboard.keyEnter")})]}):q.id==="drawer_chords"?u.jsx("span",{children:"^C"}):q.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:Y?"▾":"▴"})]}):u.jsx("span",{children:q.label}),_e=q=>{if(K(),q.type==="modifier"){q.modifierType==="ctrl"?j(!v):q.modifierType==="alt"?U(!G):q.modifierType==="shift"?V(!X):q.modifierType==="meta"&&H(de.ESC);return}if(q.type==="drawer"){q.drawerType==="fn"?(Q(!Y),W(!1),he(!1)):q.drawerType==="chords"?(he(!ce),Q(!1),W(!1)):q.drawerType==="symbols"&&(W(!ee),Q(!1),he(!1));return}H(q.code,q.isPlainChar||q.type==="symbol")},Te=q=>{if(q.type==="modifier"){if(q.modifierType==="ctrl")return v;if(q.modifierType==="alt")return G;if(q.modifierType==="shift")return X}if(q.type==="drawer"){if(q.drawerType==="fn")return Y;if(q.drawerType==="chords")return ce;if(q.drawerType==="symbols")return ee}return!1},me=(q,se,ve,E,L="default")=>u.jsxs("button",{type:"button",onClick:()=>H(q),className:F(Oi,"h-8 gap-1.5 px-2",L==="bad"?"border-tui-bad text-tui-bad hover:bg-tui-bad hover:text-tui-crust":L==="warn"?"border-tui-warn text-tui-warn hover:bg-tui-warn hover:text-tui-crust":ro),title:ve,children:[u.jsx("span",{className:"font-bold",children:se}),u.jsx("span",{className:"text-tui-sm opacity-70",children:E})]});return u.jsxs("div",{"data-testid":"key-toolbar",className:F("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":b("virtualKeyboard.touchKeyboardShortcuts"),children:[Y&&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(q=>{const se=`F${q}`;return u.jsxs("button",{type:"button",onClick:()=>H(de[se]),className:F(Oi,ro,"h-8"),children:["F",q]},se)})}),ce&&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:[me(de.CTRL_C,"^C",b("virtualKeyboard.ctrlCTitle"),b("virtualKeyboard.badgeSigint"),"bad"),me(de.CTRL_D,"^D",b("virtualKeyboard.ctrlDTitle"),b("virtualKeyboard.badgeEof")),me(de.CTRL_Z,"^Z",b("virtualKeyboard.ctrlZTitle"),b("virtualKeyboard.badgeTstp"),"warn"),me(de.CTRL_L,"^L",b("virtualKeyboard.ctrlLTitle"),b("virtualKeyboard.badgeClear")),me(de.CTRL_R,"^R",b("virtualKeyboard.ctrlRTitle"),b("virtualKeyboard.badgeSearch")),me(de.CTRL_A,"^A",b("virtualKeyboard.ctrlATitle"),b("virtualKeyboard.badgeStart")),me(de.CTRL_E,"^E",b("virtualKeyboard.ctrlETitle"),b("virtualKeyboard.badgeEnd")),me(de.CTRL_K,"^K",b("virtualKeyboard.ctrlKTitle"),b("virtualKeyboard.badgeKill"))]}),ee&&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(q=>u.jsx("button",{type:"button",onClick:()=>H(q,!0),className:F(Oi,ro,"h-8 w-8 font-bold"),children:q},q))}),u.jsxs("div",{"data-testid":"key-toolbar-row",className:F("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:()=>c({toolbarVisible:!1}),className:F(Oi,x,"mr-1 border-tui-border-dim bg-transparent text-tui-faint hover:border-tui-border hover:text-tui-text"),title:b("virtualKeyboard.collapseToolbar"),"aria-label":b("virtualKeyboard.collapseToolbar"),"aria-expanded":!0,children:u.jsx("span",{"aria-hidden":"true",children:"▾"})}),z.map(q=>{const se=Te(q),ve=q.id==="enter",E=["left","up","down","right"].includes(q.id),L=q.type==="drawer",Z=Hc(q,b);return u.jsx("button",{type:"button",onClick:()=>_e(q),className:F(Oi,E?x:L?T:p,ve?Hv:se?Bv:ro),title:Z,"aria-label":Z,"aria-pressed":se,children:re(q)},q.id)})]})]})},Yv=["ls -la","clear","git status","pwd","top","exit","cat"],Gv=({isOpen:r,onClose:s})=>{const{sendKey:o,isController:c,warnViewerMode:m,t:f}=bt(),[b,p]=w.useState("");if(!r)return null;const x=v=>{if(v&&v.preventDefault(),!c){m();return}b.length>0?(o(b+"\r"),p("")):o("\r")},T=v=>{if(!c){m();return}o(v+"\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(Ke,{variant:"ghost",onClick:s,"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:Yv.map(v=>u.jsx("button",{type:"button",onClick:()=>T(v),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:v},v))}),u.jsxs("form",{onSubmit:x,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(yn,{id:"virtual-keyboard-input",name:"terminal-input",type:"text",value:b,onChange:v=>p(v.target.value),placeholder:f("virtualKeyboard.placeholder"),inputMode:"text",enterKeyHint:"send",autoComplete:"off",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,className:"select-text pr-7"}),b.length>0&&u.jsx("button",{type:"button",onClick:()=>p(""),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(Ke,{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 go(r,s){const o=(c,m)=>s?s(c):m;switch(r){case"connected":return{label:o("connection.live","Live"),level:"ok",needsAttention:!1};case"connecting":return{label:o("connection.connecting","Connecting"),level:"warn",needsAttention:!0};case"reconnecting":return{label:o("connection.reconnecting","Reconnecting"),level:"warn",needsAttention:!0,actionLabel:o("connection.reconnectNow","Reconnect now")};case"error":return{label:o("connection.error","Error"),level:"bad",needsAttention:!0,actionLabel:o("connection.retry","Retry")};default:return{label:o("connection.offline","Offline"),level:"idle",needsAttention:!0,actionLabel:o("connection.connect","Connect")}}}const qv={connected:"ok",connecting:"warn",reconnecting:"warn",error:"bad",disconnected:"idle"},Xv=({isOpen:r,onClose:s,isAddMode:o=!1})=>{const{settings:c,updateSettings:m,connect:f,disconnect:b,connectionState:p,hostId:x,addToast:T,t:v,activeProfile:j,activeProfileId:G,addProfileAndConnect:U,renameProfile:X}=bt(),[V,Y]=w.useState(c.wsUrl),[Q,ee]=w.useState(c.token),[W,ce]=w.useState(c.pairCode),[he,K]=w.useState(c.clientId),[H,z]=w.useState((j==null?void 0:j.displayName)||""),[re,_e]=w.useState(c.autoReconnect),[Te,me]=w.useState(!1);if(w.useEffect(()=>{r&&(Y(c.wsUrl),ee(o?"":c.token),ce(o?"":c.pairCode),K(c.clientId),z(o?"":(j==null?void 0:j.displayName)||""),_e(c.autoReconnect))},[r,o,c,j]),!r)return null;const q=L=>{L.preventDefault();const Z={wsUrl:V.trim()||"/ws/client",token:Q.trim(),pairCode:W.trim().toUpperCase(),clientId:he.trim()||c.clientId,autoReconnect:re};if(!Z.token&&!Z.pairCode){T("warning",v("pairing.credentialsRequired"));return}o?U({...Z,displayName:H.trim()||void 0}):(m(Z),G&&H.trim()&&X(G,H),b(),f({wsUrl:Z.wsUrl,token:Z.token||void 0,pairCode:Z.pairCode||void 0,clientId:Z.clientId,autoReconnect:re})),s()},se=()=>{const L=`client-${Math.random().toString(36).substring(2,8)}`;K(L)},ve=()=>{const L=new URL(window.location.href);L.search="",W.trim()&&L.searchParams.set("pairCode",W.trim().toUpperCase()),navigator.clipboard.writeText(L.toString()).then(()=>{me(!0),T("success",v("toasts.pairingLinkCopied")),setTimeout(()=>me(!1),2e3)})},E=qv[p]??"idle";return u.jsxs(fp,{isOpen:r,onClose:s,title:v(o?"pairing.addTitle":"pairing.title"),subtitle:v("pairing.subtitle"),closeLabel:v("common.closeDialog"),hints:[{keys:"esc",action:v("common.close")},{keys:"⏎",action:v("pairing.saveAndConnect")}],footer:u.jsxs(u.Fragment,{children:[p==="connected"&&u.jsx(Ke,{variant:"danger",onClick:()=>{b(),s()},children:v("common.disconnect")}),u.jsx(Ke,{variant:"primary",type:"submit",form:"pairing-form",children:v("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(vn,{level:E}),u.jsx("span",{className:"text-tui-muted",children:v("common.status")}),u.jsx("span",{className:F(E==="ok"?"text-tui-ok":E==="bad"?"text-tui-bad":E==="warn"?"text-tui-warn":"text-tui-faint"),children:go(p,v).label})]}),x&&u.jsxs("span",{className:"flex items-center gap-1.5 text-tui-muted",children:[v("common.host")," ",u.jsx("span",{className:"text-tui-text",children:x})]})]}),u.jsxs("form",{id:"pairing-form",onSubmit:q,className:"space-y-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"pairing-name",children:v("pairing.displayNameLabel")}),u.jsx(yn,{id:"pairing-name",type:"text",value:H,onChange:L=>z(L.target.value),placeholder:v("pairing.displayNamePlaceholder"),maxLength:64,autoComplete:"off"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:v("pairing.displayNameHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"pairing-code",hint:v("pairing.pairCodeNote"),children:v("pairing.pairCodeLabel")}),u.jsx(yn,{id:"pairing-code",type:"text",value:W,onChange:L=>ce(L.target.value.toUpperCase()),placeholder:v("pairing.pairCodePlaceholder"),maxLength:12,className:"uppercase"}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:v("pairing.pairCodeHelp")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"pairing-token",hint:v("pairing.tokenNote"),children:v("pairing.tokenLabel")}),u.jsx(yn,{id:"pairing-token",type:"password",value:Q,onChange:L=>ee(L.target.value),placeholder:v("pairing.tokenPlaceholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"pairing-ws",children:v("pairing.wsUrlLabel")}),u.jsx(yn,{id:"pairing-ws",type:"text",value:V,onChange:L=>Y(L.target.value),placeholder:v("pairing.wsUrlPlaceholder")}),u.jsx("p",{className:"text-tui-sm text-tui-faint",children:v("pairing.wsUrlDefaultNote")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"pairing-client-id",children:v("pairing.clientIdLabel")}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(yn,{id:"pairing-client-id",type:"text",value:he,onChange:L=>K(L.target.value),className:"flex-1"}),u.jsx(Ke,{onClick:se,title:v("pairing.regenerateClientIdTitle"),className:"shrink-0",children:v("pairing.newIdButton")})]})]}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Xc,{checked:re,onChange:_e,label:v("pairing.autoReconnectLabel"),description:v("pairing.autoReconnectDesc")})}),u.jsx("div",{className:"border-t border-tui-border-dim pt-2",children:u.jsx(Ke,{onClick:ve,block:!0,glyph:Te?Xe.check:"⧉",className:F(Te&&"border-tui-ok text-tui-ok"),children:v("pairing.copyDirectLink")})})]})]})},Vv=({isOpen:r,onClose:s})=>{const{settings:o,updateSettings:c,addToast:m,language:f,setLanguage:b,t:p}=bt(),[x,T]=w.useState("appearance"),[v,j]=w.useState(!1);if(!r)return null;const G=dh.find(K=>K.font===o.fontFamily),U=o.virtualKeys&&o.virtualKeys.length>0?o.virtualKeys:Gi(),X=()=>{const K=qh();c({fontSize:K.fontSize,fontFamily:K.fontFamily,toolbarVisible:K.toolbarVisible,vibrateOnKeyPress:K.vibrateOnKeyPress,language:K.language,virtualKeys:K.virtualKeys}),m("info",p("settings.resetDefaultsToast"))},V=K=>{const H=U.map(z=>z.id===K?{...z,enabled:!z.enabled}:z);c({virtualKeys:H})},Y=(K,H)=>{const z=H==="up"?K-1:K+1;if(z<0||z>=U.length)return;const re=[...U],_e=re[K];re[K]=re[z],re[z]=_e,c({virtualKeys:re})},Q=K=>{if(U.some(z=>z.id===K.id)){const z=U.map(re=>re.id===K.id?{...re,enabled:!0}:re);c({virtualKeys:z})}else{const z=[...U,{...K,enabled:!0}];c({virtualKeys:z})}j(!1)},ee=K=>{const H=U.filter(z=>z.id!==K);c({virtualKeys:H})},W=()=>{c({virtualKeys:Gi()}),m("info",p("toasts.keyLayoutReset"))},ce=10,he=24;return u.jsxs(fp,{isOpen:r,onClose:s,title:p("settings.title"),subtitle:p("settings.subtitle"),closeLabel:p("common.closeDialog"),size:"lg",hints:[{keys:"esc",action:p("common.close")}],footer:u.jsxs(u.Fragment,{children:[u.jsx(Ke,{variant:"ghost",onClick:X,children:p("settings.resetDefaults")}),u.jsx(Ke,{variant:"primary",onClick:s,children:p("common.done")})]}),children:[u.jsx($c,{tabs:[{id:"appearance",label:p("settings.tabAppearance"),index:1},{id:"virtualKeys",label:p("settings.tabVirtualKeys"),index:2}],activeId:x,onSelect:K=>T(K),className:"mb-3 border-b border-tui-border-dim pb-1"}),x==="appearance"&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{children:p("settings.languageLabel")}),u.jsxs("div",{className:"grid gap-0.5 sm:grid-cols-2",children:[u.jsx(yh,{name:"ui-language",checked:f==="zh",onChange:()=>b("zh"),label:"简体中文"}),u.jsx(yh,{name:"ui-language",checked:f==="en",onChange:()=>b("en"),label:"English"})]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"terminal-font-select",children:p("settings.fontFamilyLabel")}),u.jsxs(Pc,{id:"terminal-font-select",value:o.fontFamily,onChange:K=>c({fontFamily:K.target.value}),"aria-label":p("settings.fontFamilyLabel"),children:[!G&&u.jsx("option",{value:o.fontFamily,children:o.fontFamily}),dh.map(K=>u.jsx("option",{value:K.font,children:p(`fontPresets.${K.id}`)||K.name},K.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:o.fontFamily,fontSize:`${o.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(gn,{htmlFor:"terminal-font-size",children:p("settings.fontSizeLabel",{size:o.fontSize})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(bv,{value:(o.fontSize-ce)/(he-ce),width:24,className:"hidden shrink-0 sm:inline-flex"}),u.jsx("input",{id:"terminal-font-size",type:"range",min:ce,max:he,step:1,value:o.fontSize,onChange:K=>c({fontSize:Number(K.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:p("settings.fontSizeCompact")}),u.jsx("span",{children:p("settings.fontSizeDefault")}),u.jsx("span",{children:p("settings.fontSizeLarge")})]}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("settings.mobileFontNote")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("settings.windowZoomSharedNote")})]}),u.jsx(Ba,{}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Xc,{checked:o.toolbarVisible,onChange:K=>c({toolbarVisible:K}),label:p("settings.touchKeyToolbar"),description:p("settings.touchKeyToolbarDesc")}),u.jsx(Xc,{checked:o.vibrateOnKeyPress,onChange:K=>c({vibrateOnKeyPress:K}),label:p("settings.touchHaptics"),description:p("settings.touchHapticsDesc")})]}),u.jsx(Ba,{}),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}),p("settings.colorPassthroughNote")]})]}),x==="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:p("virtualKeyboard.customizeTitle")}),u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:p("virtualKeyboard.customizeDesc")})]}),u.jsx(Ke,{variant:"ghost",onClick:W,className:"shrink-0",children:p("virtualKeyboard.resetLayout")})]}),u.jsx("div",{className:"max-h-72 overflow-y-auto border border-tui-border bg-tui-mantle",children:U.map((K,H)=>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:K.enabled,onChange:()=>V(K.id),className:"sr-only",id:`toggle-${K.id}`}),u.jsx("label",{htmlFor:`toggle-${K.id}`,className:F("shrink-0 cursor-pointer select-none font-bold",K.enabled?"text-tui-ok":"text-tui-faint"),"aria-hidden":"true",children:K.enabled?"[x]":"[ ]"}),u.jsx(gv,{className:F(!K.enabled&&"opacity-50"),children:K.label}),u.jsx("span",{className:"truncate text-tui-sm text-tui-muted",children:Hc(K,p)})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(Ke,{variant:"ghost",brackets:!1,disabled:H===0,onClick:()=>Y(H,"up"),title:p("virtualKeyboard.moveUp"),"aria-label":p("virtualKeyboard.moveUp"),className:"px-1",children:"↑"}),u.jsx(Ke,{variant:"ghost",brackets:!1,disabled:H===U.length-1,onClick:()=>Y(H,"down"),title:p("virtualKeyboard.moveDown"),"aria-label":p("virtualKeyboard.moveDown"),className:"px-1",children:"↓"}),u.jsx(Ke,{variant:"ghost",brackets:!1,onClick:()=>ee(K.id),title:p("virtualKeyboard.deleteKeyTitle"),"aria-label":p("virtualKeyboard.deleteKeyTitle"),className:"px-1 text-tui-bad hover:text-tui-bad",children:Xe.cross})]})]},K.id))}),u.jsx(Ke,{block:!0,glyph:"+",onClick:()=>j(!v),className:"border-dashed",children:p("virtualKeyboard.addKey")}),v&&u.jsxs("div",{className:"space-y-2 border border-tui-border bg-tui-mantle p-2",children:[u.jsx(Ba,{label:p("virtualKeyboard.availableKeys")}),u.jsx("div",{className:"flex max-h-48 flex-wrap gap-1 overflow-y-auto",children:sy.map(K=>{const H=U.some(z=>z.id===K.id);return u.jsxs("button",{type:"button",onClick:()=>Q(K),title:Hc(K,p),className:F("tui-focusable flex select-none items-center gap-1 border px-1.5 py-0.5 text-tui-sm transition-colors",H?"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:K.label}),u.jsx("span",{"aria-hidden":"true",className:H?"text-tui-ok":"text-tui-accent",children:H?Xe.check:"+"})]},K.id)})})]})]})]})},Zv={success:"ok",warning:"warn",error:"bad",info:"accent"},Qv={success:Xe.check,warning:Xe.warn,error:Xe.cross,info:"›"},Fv=()=>{const{toasts:r,removeToast:s,t:o}=bt();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(c=>{const m=Zv[c.type];return u.jsxs("div",{className:F("pointer-events-auto flex items-start gap-2 border border-tui-border border-l-2 bg-tui-base px-2 py-1 text-tui",bn[m].edgeL),role:"alert",children:[u.jsx("span",{"aria-hidden":"true",className:F("shrink-0 font-bold",bn[m].text),children:Qv[c.type]}),u.jsx("div",{className:"min-w-0 flex-1 break-words leading-snug text-tui-text",children:c.message}),c.count>1&&u.jsxs("span",{className:"shrink-0 border border-tui-border-dim px-1 text-tui-sm text-tui-muted","aria-label":`×${c.count}`,children:["×",c.count]}),u.jsx("button",{type:"button",onClick:()=>s(c.id),className:"tui-focusable shrink-0 select-none px-0.5 text-tui-faint transition-colors hover:text-tui-bad","aria-label":o("common.dismissNotification"),children:u.jsx("span",{"aria-hidden":"true",children:Xe.cross})})]},c.id)})})},tu=({onAddProfile:r,mobile:s=!1,statusBar:o=!1})=>{const{profiles:c,activeProfileId:m,activeProfile:f,connectionState:b,switchProfile:p,renameProfile:x,removeProfile:T,t:v}=bt(),[j,G]=w.useState(!1),[U,X]=w.useState(null),[V,Y]=w.useState(""),Q=w.useRef(null);w.useEffect(()=>{if(!j)return;const H=z=>{Q.current&&!Q.current.contains(z.target)&&G(!1)};return document.addEventListener("pointerdown",H),()=>document.removeEventListener("pointerdown",H)},[j]);const ee=(H,z)=>{X(H),Y(z)},W=H=>{const z=V.trim();z&&x(H,z),X(null)},ce=H=>{typeof window<"u"&&!window.confirm(v("profiles.removeConfirm"))||(T(H),X(null))},he=(f==null?void 0:f.displayName)||v("profiles.addHost"),K=b==="connected"?"ok":b==="connecting"||b==="reconnecting"?"warn":b==="error"?"bad":"idle";return u.jsxs("div",{ref:Q,className:F("relative min-w-0",s&&"w-full",o&&"flex-1"),children:[u.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":j,"aria-label":v("profiles.switcherLabel"),onClick:()=>G(H=>!H),className:F("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",o?"min-h-11 w-full max-w-none px-2":s?"min-h-11 w-full px-2":"min-h-[24px] max-w-[18rem] px-1"),children:[u.jsx(vn,{level:K}),u.jsx("span",{className:F("truncate text-tui-text",o&&"min-w-0 flex-1"),children:he}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-faint",children:j?Xe.chevronDown:Xe.chevronRight})]}),j&&u.jsxs("div",{role:"menu","aria-label":v("profiles.switcherLabel"),className:F("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",o?"w-80 max-w-[calc(100vw-1rem)]":s?"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:v("profiles.title")}),c.length===0?u.jsx("p",{className:"px-2 py-2 text-tui-sm text-tui-muted",children:v("profiles.empty")}):c.map(H=>{const z=H.id===m,re=H.id===U;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":z?"true":void 0,onClick:()=>{p(H.id),G(!1)},className:F("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",z?"text-tui-accent":"text-tui-text"),children:[u.jsx("span",{"aria-hidden":"true",className:"w-3 shrink-0",children:z?Xe.cursor:""}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate font-bold",children:H.displayName}),u.jsx("span",{className:"block truncate text-tui-sm text-tui-faint",title:H.hostname||H.hostId,children:H.hostname||H.hostId||H.wsUrl})]}),z&&u.jsx("span",{className:"shrink-0 text-tui-sm text-tui-ok",children:v("profiles.current")})]}),u.jsx("button",{type:"button",role:"menuitem","aria-label":v("profiles.rename"),title:v("profiles.rename"),onClick:()=>ee(H.id,H.displayName),className:"tui-focusable min-h-11 min-w-11 px-2 text-tui-muted hover:text-tui-accent",children:Xe.ellipsis})]}),re&&u.jsxs("div",{className:"flex items-center gap-1 px-2 pb-2",children:[u.jsx("input",{autoFocus:!0,value:V,maxLength:64,onChange:_e=>Y(_e.target.value),onKeyDown:_e=>{_e.key==="Enter"&&W(H.id),_e.key==="Escape"&&X(null)},"aria-label":v("profiles.rename"),className:"tui-input min-w-0 flex-1 px-2 py-1 text-tui"}),u.jsx(Ke,{onClick:()=>W(H.id),variant:"primary",className:"min-h-11",children:v("common.save")}),u.jsx(Ke,{onClick:()=>ce(H.id),variant:"danger",className:"min-h-11",children:v("profiles.remove")})]})]},H.id)}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{G(!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:v("profiles.addHost")})]})]})]})},Jv=({onAddProfile:r=()=>{}})=>{const{connectionState:s,role:o,hostId:c,assignedClientId:m,sharedWindowCount:f,settings:b,rttMs:p,t:x}=bt(),T=go(s,x),v=s==="connected";return u.jsx(mp,{left:u.jsxs(u.Fragment,{children:[u.jsx(tu,{onAddProfile:r}),u.jsx(vh,{items:[u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx(vn,{level:T.level}),u.jsx("span",{className:"text-tui-text",children:T.label})]},"status"),v?u.jsx(bo,{tone:o==="controller"?"ok":"warn",children:x(o==="controller"?"role.sharedControl":"common.viewer")},"role"):null,v&&f>1?u.jsx("span",{className:"text-tui-muted",children:x("role.sharedWindows",{count:f})},"windows"):null,c?u.jsxs("span",{children:[u.jsxs("span",{className:"text-tui-faint",children:[x("common.host"),":"]})," ",u.jsx("span",{className:"text-tui-text",children:c})]},"host"):null,u.jsxs("span",{children:[u.jsx("span",{className:"text-tui-faint",children:x("header.clientIdLabel")})," ",u.jsx("span",{className:"text-tui-text",children:m||b.clientId})]},"client")]})]}),right:u.jsx(vh,{items:[p!==null?u.jsxs("span",{className:"text-tui-muted",children:[x("header.latencyTitle"),": ",u.jsxs("span",{className:"text-tui-text",children:[p,"ms"]})]},"rtt"):null,u.jsx("span",{className:"hidden text-tui-faint sm:inline",children:x("header.tagline")},"mode")]})})},Wv=[[/\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"]],Iv=[[/\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 Ah(r,s){for(const[o,c]of r)if(o.test(s))return c;return null}function nu(r){const s=typeof r=="string"?r.trim():"";if(!s)return{label:"",raw:""};const o=Ah(Wv,s),c=Ah(Iv,s);return o&&c?{label:`${o} · ${c}`,raw:s}:o?{label:o,raw:s}:c?{label:c,raw:s}:{label:s.length>32?`${s.slice(0,32)}…`:s,raw:s}}function Eh(r){if(r===0)return"0 B";const s=1024,o=["B","KB","MB","GB"],c=Math.floor(Math.log(r)/Math.log(s));return`${(r/Math.pow(s,c)).toFixed(1)} ${o[c]}`}const $v=({clients:r})=>{const{t:s}=bt(),o=[{key:"id",header:s("admin.colClientId"),render:c=>u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(vn,{level:"ok"}),u.jsx("span",{className:"font-bold text-tui-text",children:c.id})]})},{key:"role",header:s("admin.colRole"),width:12,render:c=>{const m=c.role==="controller";return u.jsx(bo,{tone:m?"ok":"warn",children:s(m?"common.controller":"common.viewer")})}},{key:"device",header:s("admin.colDevice"),render:c=>{const m=nu(c.userAgent);return m.label?u.jsx("span",{className:"text-tui-muted",title:m.raw,children:m.label}):u.jsx("span",{className:"text-tui-faint",children:s("admin.unknownDevice")})}},{key:"ip",header:s("admin.colIp"),render:c=>u.jsx("span",{className:"text-tui-muted",children:c.ip||"127.0.0.1"})},{key:"connectedAt",header:s("admin.colConnectedAt"),render:c=>u.jsx("span",{className:"text-tui-muted",children:c.connectedAt?new Date(c.connectedAt).toLocaleTimeString():s("admin.startedRecently")})},{key:"traffic",header:s("admin.colTraffic"),align:"right",render:c=>u.jsxs("span",{className:"whitespace-nowrap",children:[u.jsx("span",{className:"text-tui-accent",children:Eh(c.bytesReceived||0)}),u.jsx("span",{"aria-hidden":"true",className:"mx-1 text-tui-faint",children:"/"}),u.jsx("span",{className:"text-tui-ok",children:Eh(c.bytesSent||0)})]})}];return u.jsx(Kt,{title:s("admin.connectedClientsTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(eu,{columns:o,items:r,rowKey:c=>c.id,empty:s("admin.noClients")})})},jh={online:"ok",busy:"ok",reconnecting:"warn",offline:"idle"};function Pv(r=[],s=[]){const o=new Map;for(const f of s){if(!(f!=null&&f.hostId))continue;const b=o.get(f.hostId);b?b.push(f):o.set(f.hostId,[f])}const c=r.map(f=>{const b=o.get(f.id)||[];return{id:f.id,hostname:f.hostname||f.id,status:f.status||"online",connectedDeviceCount:f.connectedDeviceCount??0,pairedDeviceCount:f.pairedDeviceCount??b.length,devices:b,fromRosterOnly:!1}}),m=new Set(c.map(f=>f.id));for(const[f,b]of o)m.has(f)||c.push({id:f,hostname:f,status:"offline",connectedDeviceCount:0,pairedDeviceCount:b.length,devices:b,fromRosterOnly:!0});return c.sort((f,b)=>f.fromRosterOnly!==b.fromRosterOnly?f.fromRosterOnly?1:-1:f.hostname.localeCompare(b.hostname))}const ex=({hosts:r,devices:s})=>{const{t:o}=bt(),c=Pv(r,s),m={online:o("admin.hostStatusOnline"),busy:o("admin.hostStatusBusy"),reconnecting:o("admin.hostStatusReconnecting"),offline:o("admin.hostStatusOffline")};return u.jsx(Kt,{title:o("admin.hostsTitle",{count:c.length}),bodyClassName:"space-y-2",children:c.length===0?u.jsx("p",{className:"px-1 py-2 text-tui text-tui-faint",children:o("admin.noHosts")}):c.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(vn,{level:jh[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(bo,{tone:jh[f.status],children:m[f.status]}),u.jsx("span",{className:"text-tui-accent",children:o("admin.hostConnectedDevices",{count:f.connectedDeviceCount})}),u.jsx("span",{className:"text-tui-muted",children:o("admin.hostPairedDevices",{count:f.pairedDeviceCount})})]})]}),f.devices.length>0?u.jsx("ul",{className:"divide-y divide-tui-border-dim",children:f.devices.map(b=>{const p=nu(b.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:p.raw,children:p.label||o("admin.unknownDevice")}),u.jsx("code",{className:"truncate text-tui-sm text-tui-muted",children:b.deviceId}),u.jsx("span",{className:"ml-auto shrink-0 text-tui-sm text-tui-faint",children:b.lastIp||"—"})]},b.deviceId)})}):u.jsx("p",{className:"px-2 py-1 text-tui-sm text-tui-faint",children:f.pairedDeviceCount>0?o("admin.hostRosterOperatorOnly"):o("admin.noDevices")})]},f.id))})},tx=({ptys:r})=>{const{t:s}=bt(),o=[{key:"id",header:s("admin.colPtyId"),render:c=>u.jsx("span",{className:"font-bold text-tui-accent",children:c.id})},{key:"pid",header:s("admin.colPid"),width:9,render:c=>u.jsx("span",{className:"text-tui-muted",children:c.pid})},{key:"command",header:s("admin.colCommand"),render:c=>u.jsx("code",{className:"border border-tui-border-dim bg-tui-mantle px-1 text-tui-text",children:c.command})},{key:"grid",header:s("admin.colGrid"),width:11,render:c=>u.jsxs("span",{className:"whitespace-nowrap text-tui-muted",children:[c.cols,u.jsx("span",{"aria-hidden":"true",className:"mx-0.5 text-tui-faint",children:"×"}),c.rows]})},{key:"cwd",header:s("admin.colCwd"),className:"max-w-xs truncate",render:c=>u.jsx("span",{className:"text-tui-muted",children:c.cwd||"~"})},{key:"viewers",header:s("admin.colViewers"),align:"right",width:9,render:c=>u.jsx("span",{className:"font-bold text-tui-ok",children:c.activeClients})}];return u.jsx(Kt,{title:s("admin.activePtysTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(eu,{columns:o,items:r,rowKey:c=>c.id,empty:s("admin.noPtys")})})};function nx(r){if(!r)return"—";const s=new Date(r);return Number.isNaN(s.getTime())?"—":s.toLocaleString()}const lx=({devices:r,onRevoke:s})=>{const{t:o}=bt(),[c,m]=w.useState(null),[f,b]=w.useState(null),p=async T=>{if(c!==T){m(T);return}b(T);try{await s(T)}finally{b(null),m(null)}},x=[{key:"device",header:o("admin.colDevice"),render:T=>{const v=nu(T.userAgent);return u.jsx("span",{className:"text-tui-text",title:v.raw,children:v.label||o("admin.unknownDevice")})}},{key:"deviceId",header:o("admin.colDeviceId"),render:T=>u.jsx("span",{className:"text-tui-muted",children:T.deviceId})},{key:"ip",header:o("admin.colIp"),render:T=>u.jsx("span",{className:"text-tui-muted",children:T.lastIp||"—"})},{key:"lastSeen",header:o("admin.colLastSeen"),render:T=>u.jsx("span",{className:"whitespace-nowrap text-tui-muted",children:nx(T.lastSeenAt)})},{key:"actions",header:o("admin.colActions"),align:"right",render:T=>{const v=c===T.deviceId,j=f===T.deviceId;return u.jsx(Ke,{variant:"danger",disabled:j,onClick:()=>void p(T.deviceId),onBlur:()=>m(G=>G===T.deviceId?null:G),"aria-label":o("admin.revokeDevice"),className:v?"bg-tui-bad text-tui-crust":void 0,children:j?u.jsx(Ha,{}):o(v?"admin.revokeConfirm":"admin.revokeDevice")})}}];return u.jsx(Kt,{title:o("admin.pairedDevicesTitle",{count:r.length}),bodyClassName:"-mx-1",children:u.jsx(eu,{columns:x,items:r,rowKey:T=>T.deviceId,empty:o("admin.noDevices")})})};function bp(r){if(typeof window>"u"||!r||r.startsWith("/"))return"";try{const s=new URL(r.replace(/^ws/,"http")),o=s.pathname.replace(/\/ws\/client\/?$/,"").replace(/\/+$/,"");return s.origin===window.location.origin&&!o?"":`${s.origin}${o}`}catch{return""}}function Li(r,s){const o=bp(r);return o?`${o}${s.startsWith("/")?s:`/${s}`}`:s}const ax=({onBackToTerminal:r,onOpenPairing:s})=>{var Ut,ne,ye,Be,ke,kt,ie,Ot,Yt,Bt,Ie,ln,an,mt;const{settings:o,updateSettings:c,addToast:m,t:f}=bt(),b=bp(o.wsUrl)||(typeof window<"u"?window.location.origin:"local"),p=((Ut=o.adminTokens)==null?void 0:Ut[b])||(b===(typeof window<"u"?window.location.origin:"local")?o.adminToken:"")||"",[x,T]=w.useState(null),[v,j]=w.useState(null),[G,U]=w.useState(!1),[X,V]=w.useState(!0),[Y,Q]=w.useState(null),[ee,W]=w.useState(!1),[ce,he]=w.useState(3e3),[K,H]=w.useState(null),[z,re]=w.useState("overview"),[_e,Te]=w.useState(!1),[me,q]=w.useState(p),[se,ve]=w.useState(!!p),E="node bin/service.js pair";w.useEffect(()=>{q(p),ve(!!p),T(null),j(null),U(!1)},[b]);const L=()=>{navigator.clipboard.writeText(E).then(()=>{Te(!0),m("success",f("toasts.commandCopied")),setTimeout(()=>Te(!1),2e3)})};w.useEffect(()=>{let I=!0;V(!0);async function we(){try{const fe=await fetch(Li(o.wsUrl,"/api/info"),{headers:{Accept:"application/json"}});if(fe.ok){const Ge=await fe.json();I&&(j(Ge),U(!0));return}}catch{}if(I){const fe=!!(o.wsUrl&&!o.wsUrl.startsWith("/")&&!o.wsUrl.includes("localhost")&&!o.wsUrl.includes("127.0.0.1")&&typeof window<"u"&&!o.wsUrl.startsWith(window.location.origin.replace("http","ws")));j({ok:!0,version:"0.1.0",protocol:1,relayMode:fe?"remote":"local",adminConfigured:!1,adminPath:"/admin",adminStatusPath:"/api/admin/status"}),U(!0)}}return we(),()=>{I=!1}},[o.wsUrl,b]);const Z=(v==null?void 0:v.relayMode)==="remote",pe=()=>{if(v!=null&&v.adminPath)return v.publicUrl?`${v.publicUrl.replace(/\/$/,"")}${v.adminPath}`:Li(o.wsUrl,v.adminPath);if(x!=null&&x.remoteAdminUrl)return x.remoteAdminUrl;if(o.wsUrl)try{return Li(o.wsUrl,"/admin")}catch{}return"/admin"},k=w.useCallback(async()=>{if(G){if(Z){if(!se&&!me){T(null),V(!1),Q(null),W(!1);return}try{V(!0);const I=Li(o.wsUrl,(v==null?void 0:v.adminStatusPath)||"/api/admin/status"),fe=await fetch(I,{headers:{Accept:"application/json","X-Relay-Admin-Token":me}});if(fe.status===401||fe.status===403){W(!0),Q(f("admin.relayAdminAuthError")),T(null);return}if(!fe.ok)throw new Error(`HTTP ${fe.status}: ${fe.statusText}`);const Ge=await fe.json();T(Ge),Q(null),W(!1),H(new Date)}catch(I){console.warn("GET /api/admin/status request failed:",I),W(!1),Q(I instanceof Error?I.message:"Failed to fetch remote admin status"),T(null)}finally{V(!1)}return}try{V(!0);const I={Accept:"application/json"};o.token&&(I.Authorization=`Bearer ${o.token}`);const we=await fetch("/api/status",{headers:I});if(we.status===401||we.status===403){W(!0),Q(`Authentication failed (HTTP ${we.status}): Access denied. Please configure an authorized token or pair with the host.`),T(null);return}if(!we.ok)throw new Error(`HTTP ${we.status}: ${we.statusText}`);const fe=await we.json();T(fe),Q(null),W(!1),H(new Date)}catch(I){console.warn("GET /api/status request failed:",I),W(!1),Q(I instanceof Error?I.message:"Failed to fetch status"),T(null)}finally{V(!1)}}},[G,Z,se,me,v,o.token,o.wsUrl,b,f]),We=w.useCallback(async I=>{try{if(!(await fetch(Li(o.wsUrl,`/api/admin/devices/${encodeURIComponent(I)}`),{method:"DELETE",headers:{Accept:"application/json","X-Relay-Admin-Token":me}})).ok){Q(f("admin.revokeFailed"));return}await k()}catch{Q(f("admin.revokeFailed"))}},[me,k,o.wsUrl,f]);w.useEffect(()=>{if(!G)return;k();let I=null;const we=()=>{ce>0&&!I&&(I=setInterval(()=>{document.visibilityState==="visible"&&k()},ce))},fe=()=>{I&&(clearInterval(I),I=null)},Ge=()=>{document.visibilityState==="visible"?(k(),we()):fe()};return we(),document.addEventListener("visibilitychange",Ge),()=>{fe(),document.removeEventListener("visibilitychange",Ge)}},[G,k,ce]);const Ue=I=>{I.preventDefault();const we=me.trim();c({adminToken:we,adminTokens:{...o.adminTokens||{},[b]:we}}),ve(!!we)},xe=I=>{const we=Math.max(0,Math.floor(I)),fe=Math.floor(we/86400),Ge=Math.floor(we%86400/3600),Jt=Math.floor(we%3600/60),kn=we%60,Ct=(jn,xn)=>`${jn}${f(`admin.unit${xn}`)}`;return fe>0?[Ct(fe,"Day"),Ct(Ge,"Hour"),Ct(Jt,"Minute")].join(" "):Ge>0?[Ct(Ge,"Hour"),Ct(Jt,"Minute"),Ct(kn,"Second")].join(" "):[Ct(Jt,"Minute"),Ct(kn,"Second")].join(" ")},Se=I=>{if(!I||I===0)return"0 B";const we=1024,fe=["B","KB","MB","GB"],Ge=Math.floor(Math.log(I)/Math.log(we));return`${(I/Math.pow(we,Ge)).toFixed(1)} ${fe[Ge]}`},De=()=>{const I=pe();window.open(I,"_blank","noopener,noreferrer")},Ee=x?x.activeUserCount??((ne=x.clients)==null?void 0:ne.length)??0:0,ct=x?[{id:"overview",label:f("admin.tabOverview"),index:1},{id:"clients",label:f("admin.tabClients",{count:((ye=x.clients)==null?void 0:ye.length)||0}),index:2},{id:"ptys",label:f("admin.tabPtys",{count:((Be=x.ptys)==null?void 0:Be.length)||0}),index:3},...x.devices?[{id:"devices",label:f("admin.tabDevices",{count:x.devices.length}),index:4}]:[]]:[],ft=ct.map(I=>I.id);w.useEffect(()=>{const I=we=>{if(we.ctrlKey||we.altKey||we.metaKey)return;const fe=we.target;if(fe instanceof HTMLInputElement||fe instanceof HTMLTextAreaElement||fe instanceof HTMLSelectElement||fe!=null&&fe.isContentEditable||document.querySelector('[role="dialog"]'))return;if(we.key==="Escape"&&r){we.preventDefault(),r();return}if(we.key.toLowerCase()==="r"){we.preventDefault(),k();return}const Ge=Number.parseInt(we.key,10)-1;Number.isInteger(Ge)&&Ge>=0&&Ge<ft.length&&(we.preventDefault(),re(ft[Ge]))};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[k,ft.join("|")]);const Ye=u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r&&u.jsx(Ke,{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",(v==null?void 0:v.version)||(x==null?void 0:x.version)||"0.1.0"]}),u.jsx(bo,{tone:Z?"alt":"ok",children:f(Z?"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(Pc,{value:ce,onChange:I=>he(Number(I.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(Ke,{variant:"primary",onClick:k,disabled:X,title:f("admin.refreshNow"),children:X?u.jsx(Ha,{}):f("admin.refreshNow")})]});return u.jsxs(yv,{name:f("admin.title"),tagline:f("admin.subtitle"),aside:Ye,tabs:ct,activeTabId:z,onSelectTab:I=>re(I),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:K?u.jsx("span",{className:"text-tui-faint",children:f("admin.updatedAt",{time:K.toLocaleTimeString()})}):null,bodyClassName:"space-y-3 pb-2",children:[!G&&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(Ha,{label:f("admin.loadingStatus")})}),G&&Z&&!se&&u.jsxs(Kt,{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(En,{label:f("admin.remoteRelayEndpoint"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-accent",children:o.wsUrl})}),u.jsx(En,{label:f("admin.remoteRelayAdminUrl"),labelWidth:18,children:u.jsx("code",{className:"break-all text-tui-ok",children:pe()})})]}),u.jsx(Ba,{}),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(Ke,{onClick:()=>ve(!0),children:f("admin.relayAdminLoginBtn")}),u.jsx(Ke,{variant:"primary",onClick:De,glyph:Xe.arrowRight,children:f("admin.openRemoteAdminBtn")})]})]})]}),G&&Z&&se&&!x&&u.jsxs(Kt,{title:f("admin.relayAdminTitle"),bodyClassName:"space-y-2",children:[u.jsx(co,{tone:(v==null?void 0:v.adminConfigured)===!1?"warn":"bad",children:(v==null?void 0:v.adminConfigured)===!1?f("admin.relayAdminNotConfigured"):f("admin.relayAdminAuthError")}),u.jsxs("form",{onSubmit:Ue,className:"space-y-2",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(gn,{htmlFor:"relay-admin-token",children:f("admin.relayAdminTokenLabel")}),u.jsx(yn,{id:"relay-admin-token",type:"password",value:me,onChange:I=>q(I.target.value),placeholder:f("admin.relayAdminTokenPlaceholder")})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ke,{variant:"primary",type:"submit",children:f("admin.relayAdminLoginBtn")}),u.jsx(Ke,{variant:"ghost",onClick:()=>ve(!1),children:f("common.cancel")})]})]})]}),G&&!Z&&ee&&u.jsxs(Kt,{title:f("admin.unauthorizedTitle"),tone:"bad",bodyClassName:"space-y-2",children:[u.jsx(co,{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:E}),u.jsx(Ke,{onClick:L,glyph:_e?Xe.check:"⧉",className:F("shrink-0",_e&&"border-tui-ok text-tui-ok"),children:f(_e?"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:[s&&u.jsx(Ke,{variant:"primary",onClick:s,children:f("admin.enterPairCodeBtn")}),u.jsx(Ke,{onClick:k,children:f("admin.retryFetchBtn")})]})]}),G&&Y&&!ee&&!(!Z&&ee)&&u.jsx(co,{tone:"warn",action:u.jsx(Ke,{variant:"warn",onClick:k,children:f("common.retry")}),children:f("admin.errorConnecting",{error:Y})}),x&&u.jsxs(u.Fragment,{children:[z==="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(Kt,{title:f("admin.accessPanel"),aside:xe(x.uptimeSeconds||0),bodyClassName:"space-y-0.5",children:[u.jsx(En,{label:f("admin.connectedHosts"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(vn,{level:(ke=x.hosts)!=null&&ke.length?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:((kt=x.hosts)==null?void 0:kt.length)||0})]})}),u.jsx(En,{label:f("admin.activeUsers"),labelWidth:14,children:u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx(vn,{level:Ee?"ok":"idle"}),u.jsx("span",{className:"font-bold",children:Ee}),u.jsx("span",{className:"text-tui-faint",children:f("admin.acrossWindows",{count:((ie=x.clients)==null?void 0:ie.length)||0})})]})}),u.jsxs(En,{label:f("admin.activePtys"),labelWidth:14,children:[u.jsx("span",{className:"font-bold",children:((Ot=x.ptys)==null?void 0:Ot.length)||0}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.terminalShells")})]}),u.jsx(En,{label:f("admin.uptime"),labelWidth:14,children:u.jsx("span",{className:"text-tui-muted",children:x.startTime?f("admin.startedAt",{time:new Date(x.startTime).toLocaleTimeString()}):f("admin.startedRecently")})})]}),u.jsxs(Kt,{title:f("admin.throughput"),aside:f("admin.perSecond",{value:Se(((Yt=x.throughput)==null?void 0:Yt.bytesOutPerSec)||0)}),bodyClassName:"space-y-0.5",children:[u.jsxs(En,{label:f("admin.bytesInTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-accent",children:Se(((Bt=x.throughput)==null?void 0:Bt.bytesIn)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.perSecond",{value:Se(((Ie=x.throughput)==null?void 0:Ie.bytesInPerSec)||0)})})]}),u.jsxs(En,{label:f("admin.bytesOutTotal"),labelWidth:13,children:[u.jsx("span",{className:"font-bold text-tui-ok",children:Se(((ln=x.throughput)==null?void 0:ln.bytesOut)||0)}),u.jsx("span",{className:"ml-1.5 text-tui-faint",children:f("admin.perSecond",{value:Se(((an=x.throughput)==null?void 0:an.bytesOutPerSec)||0)})})]}),u.jsx(Ba,{}),u.jsx(En,{label:f("admin.frameRate"),labelWidth:13,children:u.jsx("span",{className:"font-bold",children:f("admin.framesPerSecond",{count:(((mt=x.throughput)==null?void 0:mt.framesOutPerSec)||0).toFixed(0)})})})]})]}),u.jsx(ex,{hosts:x.hosts||[],devices:x.devices})]}),z==="clients"&&u.jsx($v,{clients:x.clients||[]}),z==="ptys"&&u.jsx(tx,{ptys:x.ptys||[]}),z==="devices"&&u.jsx(lx,{devices:x.devices||[],onRevoke:We})]})]})},ix=({compact:r=!1})=>{const{role:s,connectionState:o,sharedWindowCount:c,assignedClientId:m,t:f}=bt();if(!(o==="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(vn,{level:"idle"}),u.jsx("span",{children:f("common.offline")})]});const p=s==="controller",x=c>1,T=u.jsxs("div",{className:F("inline-flex min-w-0 select-none items-center gap-1.5 text-tui uppercase",p?"text-tui-ok":"text-tui-warn"),role:"status","aria-label":f(p?"role.controllerMode":"role.viewerMode"),children:[u.jsx(vn,{level:p?"ok":"warn"}),u.jsx("span",{className:"truncate",children:f(p?"role.sharedControl":"role.viewerReadOnly")}),x?u.jsx("span",{className:"shrink-0 normal-case text-tui-muted",children:f("role.sharedWindows",{count:c})}):null]});return r?T:u.jsxs("div",{className:"flex w-full flex-col gap-1",children:[T,u.jsx("p",{className:"text-tui-sm leading-snug text-tui-faint",children:f("role.sharedControlDesc")}),m?u.jsx(En,{label:f("role.thisWindow"),labelWidth:9,className:"text-tui-sm",children:u.jsx("span",{className:"truncate text-tui-muted",children:m})}):null]})},Ui="tui-focusable group flex h-11 w-full select-none items-center gap-2 border px-2 text-left text-tui transition-colors",Bi="border-tui-border text-tui-muted hover:border-tui-accent hover:text-tui-accent active:bg-tui-selection",sx="border-tui-accent bg-tui-selection text-tui-accent",Hi=({active:r=!1})=>u.jsx("span",{"aria-hidden":"true",className:F("shrink-0",r?"text-tui-accent":"text-tui-faint group-hover:text-tui-accent"),children:Xe.cursor}),ox=({onClose:r,onNavigateAdmin:s,showAdminEntry:o=!0,onOpenPairing:c,onOpenSettings:m,onAddProfile:f=()=>{}})=>{const{connectionState:b,stateDetail:p,rttMs:x,hostId:T,settings:v,updateSettings:j,connect:G,addToast:U,language:X,setLanguage:V,t:Y}=bt(),[Q,ee]=tl.useState(!1),W=go(b,Y),ce=H=>()=>{var re;const z=document.activeElement;(re=z==null?void 0:z.blur)==null||re.call(z),H()},he=()=>{navigator.clipboard.writeText(v.clientId).then(()=>{ee(!0),U("info",Y("toasts.clientIdCopied",{id:v.clientId})),setTimeout(()=>ee(!1),2e3)})},K=()=>{const H=X==="zh"?"en":"zh";V(H),U("info",Jc(H,"toasts.switchedLanguage",{lang:H==="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:Y("mobile.sessionControls")}),u.jsx(Ke,{variant:"ghost",onClick:r,"aria-label":Y("mobile.closeSessionControls"),children:"esc"})]}),u.jsx(Kt,{title:Y("profiles.title"),tone:"accent",bodyClassName:"space-y-1",children:u.jsx(tu,{mobile:!0,onAddProfile:f})}),u.jsxs(Kt,{title:Y("common.status"),tone:W.level==="ok"?"ok":W.level==="bad"?"bad":"warn",bodyClassName:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2","aria-label":Y("mobile.connectionStatusAria"),children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(vn,{level:W.level}),u.jsx("span",{className:"truncate text-tui uppercase text-tui-text",children:W.label}),b==="connected"&&x!==null&&u.jsxs("span",{className:"text-tui-sm text-tui-muted",children:[x,"ms"]})]}),W.actionLabel&&u.jsx(Ke,{variant:"primary",onClick:()=>G(),className:"shrink-0",children:W.actionLabel})]}),W.needsAttention&&p&&u.jsx("p",{className:"text-tui-sm leading-snug text-tui-muted",children:p}),T&&u.jsx(En,{label:Y("common.host"),labelWidth:9,children:T}),u.jsxs("button",{type:"button",onClick:he,className:"tui-focusable flex w-full items-baseline gap-2 text-left text-tui",title:Y("header.copyClientIdTitle"),children:[u.jsx("span",{className:"shrink-0 text-tui-muted",style:{width:"9ch"},children:Y("header.clientIdLabel")}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-tui-text",children:v.clientId}),u.jsx("span",{"aria-hidden":"true",className:F("shrink-0",Q?"text-tui-ok":"text-tui-faint"),children:Q?Xe.check:"⧉"})]})]}),u.jsx(Kt,{title:Y("mobile.inputControl"),tone:"accent","aria-label":Y("mobile.terminalControlAria"),children:u.jsx(ix,{})}),u.jsxs(Kt,{title:Y("mobile.menu"),tone:"accent",bodyClassName:"flex flex-col gap-1",children:[u.jsxs("button",{type:"button",onClick:K,className:F(Ui,Bi),"aria-label":Y("header.languageToggleTitle"),children:[u.jsx(Hi,{}),u.jsx("span",{className:"truncate",children:X==="zh"?"English":"中文"})]}),u.jsxs("button",{type:"button",onClick:ce(m),className:F(Ui,Bi),"aria-label":Y("mobile.settingsAria"),children:[u.jsx(Hi,{}),u.jsx("span",{className:"truncate",children:Y("common.settings")})]}),u.jsxs("button",{type:"button",onClick:ce(c),className:F(Ui,Bi),"aria-label":Y("mobile.pairingAria"),children:[u.jsx(Hi,{}),u.jsx("span",{className:"truncate",children:Y("common.pairing")})]}),o&&u.jsxs("button",{type:"button",onClick:ce(s),className:F(Ui,Bi),"aria-label":Y("mobile.adminAria"),children:[u.jsx(Hi,{}),u.jsx("span",{className:"truncate",children:Y("common.admin")})]}),u.jsxs("button",{type:"button",onClick:()=>j({toolbarVisible:!v.toolbarVisible}),className:F(Ui,v.toolbarVisible?sx:Bi),"aria-label":Y("mobile.keybarAria"),"aria-pressed":v.toolbarVisible,children:[u.jsx(Hi,{active:v.toolbarVisible}),u.jsx("span",{className:"truncate",children:Y("common.keyBar")}),u.jsx("span",{"aria-hidden":"true",className:"ml-auto shrink-0 text-tui-sm",children:v.toolbarVisible?"[x]":"[ ]"})]})]})]})},rx=({onAddProfile:r})=>{const{rttMs:s,t:o}=bt();return u.jsxs("footer",{"data-testid":"mobile-status-bar",role:"status","aria-label":o("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(tu,{statusBar:!0,onAddProfile:r}),u.jsx("span",{"aria-hidden":"true",className:"shrink-0 text-tui-border",children:"│"}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1 px-1 text-tui-muted",title:o("header.latencyTitle"),children:[u.jsx("span",{className:"text-tui-faint",children:"RTT"}),u.jsx("span",{className:F(s===null?"text-tui-faint":"text-tui-text"),children:s===null?"—":`${s}ms`})]})]})},cx=({onNavigateAdmin:r,showAdminEntry:s=!0,onOpenPairing:o,onOpenSettings:c,onAddProfile:m=()=>{}})=>{const{connectionState:f,isController:b,t:p}=bt(),[x,T]=w.useState(!1),v=w.useRef(null),j=w.useCallback(()=>T(!1),[]);w.useEffect(()=>{if(!x)return;const U=X=>{if(!(X.ctrlKey||X.altKey||X.metaKey)&&X.key==="Escape"){const V=X.target;V&&typeof V.closest=="function"&&!!V.closest("#terminal-container")||(X.stopPropagation(),X.preventDefault(),j())}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[x,j]),w.useEffect(()=>{var U;x&&((U=v.current)==null||U.focus({preventScroll:!0}))},[x]);const G=go(f,p);return u.jsxs(u.Fragment,{children:[u.jsxs("div",{"data-testid":"mobile-topbar",role:"toolbar","aria-label":p("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(up,{className:"shrink-0"}),u.jsx(vn,{level:G.level}),u.jsx("span",{className:"truncate uppercase",children:G.label})]}),u.jsxs("button",{type:"button","data-testid":"mobile-chrome-trigger",onClick:()=>T(!0),"aria-label":p("mobile.sessionControls"),"aria-expanded":x,"aria-haspopup":"dialog",className:F("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",G.needsAttention?"border-tui-warn text-tui-warn":b?"border-tui-border text-tui-muted":"border-tui-accent text-tui-accent"),children:[!b&&!G.needsAttention&&u.jsx("span",{className:"max-w-[8rem] truncate",children:p("common.viewer")}),u.jsx("span",{"aria-hidden":"true",className:"text-tui",children:Xe.chevronDown}),u.jsx("span",{"aria-hidden":"true",children:p("mobile.menu")})]})]}),x&&u.jsxs(u.Fragment,{children:[u.jsx("div",{"data-testid":"mobile-sheet-scrim",className:"absolute inset-0 z-40 bg-tui-crust/70",onClick:j,"aria-hidden":"true"}),u.jsx("div",{ref:v,"data-testid":"mobile-control-sheet",role:"dialog","aria-modal":"true","aria-label":p("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(ox,{onClose:j,showAdminEntry:s,onNavigateAdmin:()=>{j(),r()},onOpenPairing:()=>{j(),o()},onOpenSettings:()=>{j(),c()},onAddProfile:()=>{j(),m()}})})]}),u.jsx(rx,{onAddProfile:m})]})},gp="--app-height",yp="--keyboard-inset",ux=80;function dx(){if(typeof window>"u")return{height:768,keyboardInset:0};const r=window.innerHeight||768,s=window.visualViewport;if(s&&typeof s.height=="number"&&s.height>0){const o=r-s.height-(s.offsetTop||0),c=o>=ux?Math.round(o):0;return{height:Math.round(s.height),keyboardInset:c}}return{height:r,keyboardInset:0}}function Rh(r,s=dx()){return r.style.setProperty(gp,`${s.height}px`),r.style.setProperty(yp,`${s.keyboardInset}px`),s}function fx(r=typeof document<"u"?document.documentElement:null){if(!r||typeof window>"u")return()=>{};let s=null;const o=()=>{s=null,Rh(r)},c=()=>{if(s===null){if(typeof requestAnimationFrame!="function"){o();return}s=requestAnimationFrame(o)}};Rh(r);const m=window.visualViewport;return m==null||m.addEventListener("resize",c),m==null||m.addEventListener("scroll",c),window.addEventListener("resize",c),window.addEventListener("orientationchange",c),()=>{s!==null&&typeof cancelAnimationFrame=="function"&&(cancelAnimationFrame(s),s=null),m==null||m.removeEventListener("resize",c),m==null||m.removeEventListener("scroll",c),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),r.style.removeProperty(gp),r.style.removeProperty(yp)}}const mx=900;function zh(){if(typeof window>"u")return!1;const r=La();return r<Zc?!0:r<=mx}function hx(){const[r,s]=w.useState(zh);return w.useEffect(()=>{var m,f;const o=()=>{const b=zh();s(p=>p===b?p:b)};o();let c=null;try{c=typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null}catch{c=null}return(m=c==null?void 0:c.addEventListener)==null||m.call(c,"change",o),window.addEventListener("resize",o),window.addEventListener("orientationchange",o),(f=window.visualViewport)==null||f.addEventListener("resize",o),()=>{var b,p;(b=c==null?void 0:c.removeEventListener)==null||b.call(c,"change",o),window.removeEventListener("resize",o),window.removeEventListener("orientationchange",o),(p=window.visualViewport)==null||p.removeEventListener("resize",o)}},[]),r}function px(r){const s=r.target;if(!s)return!1;if(s.id==="terminal-container"||s.id==="terminal-frame"||s.id==="terminal-surface"||s.classList.contains("xterm-helper-textarea")||s.classList.contains("xterm")||s.closest("#terminal-container")||s.closest(".xterm"))return!0;if(typeof document<"u"&&document.activeElement){const o=document.activeElement;if(o.id==="terminal-container"||o.classList.contains("xterm-helper-textarea")||o.closest("#terminal-container")||o.closest(".xterm"))return!0}return!1}function bx(r,s={}){if(typeof window>"u")return()=>{};const o=c=>{var m;c.ctrlKey||c.altKey||c.metaKey||c.key==="Escape"&&(s.isModalOpen||s.isSheetOpen)&&(px(c)||(c.preventDefault(),c.stopPropagation(),(m=r.onCloseModals)==null||m.call(r)))};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}}function gx(){const[r,s]=w.useState("terminal"),[o,c]=w.useState(!1),[m,f]=w.useState(!1),[b,p]=w.useState(!1),[x,T]=w.useState(!1),{updateSettings:v,settings:j,connectionState:G,stateDetail:U,stateCode:X,lastPairedAt:V}=bt(),Y=hx();w.useEffect(()=>fx(),[]);const[Q,ee]=w.useState(!0);w.useEffect(()=>{let q=!1;return fetch("/api/info",{headers:{Accept:"application/json"}}).then(se=>se.ok?se.json():null).then(se=>{q||!se||ee(!se.isRemoteRelay)}).catch(()=>{}),()=>{q=!0}},[]),w.useEffect(()=>{Qh()},[]),w.useEffect(()=>{const q=o||b||x;if(q)return bx({onCloseModals:()=>{c(!1),p(!1),T(!1)}},{isModalOpen:q})},[o,b,x]),w.useEffect(()=>{const q=()=>{const se=window.location.pathname,ve=window.location.hash;s(se==="/admin"||ve==="#admin"?"admin":"terminal")};q(),window.addEventListener("popstate",q),window.addEventListener("hashchange",q);try{const se=new URL(window.location.href),ve=se.searchParams.get("token"),E=se.searchParams.get("pairCode"),L=se.searchParams.get("ws")||se.searchParams.get("wsUrl"),Z={};ve&&(Z.token=ve),E&&(Z.pairCode=E.toUpperCase()),L&&(Z.wsUrl=L),Object.keys(Z).length>0&&v(Z);let pe=!1;if(se.searchParams.has("token")&&(se.searchParams.delete("token"),pe=!0),se.searchParams.has("pairCode")&&(se.searchParams.delete("pairCode"),pe=!0),pe){const k=se.searchParams.toString(),We=se.pathname+(k?`?${k}`:"")+se.hash;window.history.replaceState({},"",We)}}catch(se){console.warn("Failed to parse URL query params:",se)}return()=>{window.removeEventListener("popstate",q),window.removeEventListener("hashchange",q)}},[]);const W=(q=!1)=>{f(q),c(!0)},ce=()=>{c(!1),f(!1)},he=q=>{s(q),q==="admin"?window.history.pushState({},"","/admin"):window.history.pushState({},"","/")},K=!j.token&&!j.pairCode&&G!=="connected",H=G==="error"&&(["auth_required","unauthorized","device_revoked"].includes(X||"")||/auth|unauthor|forbidden|permission|token|pair/i.test(U||"")),z=K||H,[re,_e]=w.useState(!z);w.useEffect(()=>{z||_e(!0)},[z]),w.useEffect(()=>{V&&(c(!1),_e(!0),s("terminal"))},[V]);const Te=r==="terminal"&&!z,me=q=>({visibility:q?"visible":"hidden",opacity:q?1:0,pointerEvents:q?"auto":"none",zIndex:q?1:0});return u.jsxs("div",{"data-testid":"app-shell",style:Y?{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:q=>{q.preventDefault(),q.stopPropagation()},children:[!Y&&u.jsx(xv,{currentView:r,onNavigate:he,showAdminEntry:Q,onOpenPairing:()=>W(!1),onOpenSettings:()=>p(!0),onToggleVirtualKeyboard:()=>T(!x),isVirtualKeyboardOpen:x}),!Y&&!z&&u.jsx(Sv,{}),u.jsxs("div",{className:"flex-1 min-h-0 w-full overflow-hidden relative",children:[re&&u.jsxs("div",{"data-testid":"terminal-layer",className:`absolute ${Y?"inset-x-0 top-12 bottom-11":"inset-0"} flex flex-col min-h-0 w-full overflow-hidden`,style:me(Te),"aria-hidden":!Te,children:[u.jsx(Lv,{isActive:Te}),!Y&&u.jsx(Gv,{isOpen:x,onClose:()=>T(!1)}),u.jsx(Kv,{compact:Y})]}),r==="terminal"&&z&&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(Uv,{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(ax,{onBackToTerminal:()=>he("terminal"),onOpenPairing:()=>W(!1)})}),Y&&Te&&u.jsx(cx,{onNavigateAdmin:()=>he("admin"),showAdminEntry:Q,onOpenPairing:()=>W(!1),onOpenSettings:()=>p(!0),onAddProfile:()=>W(!0)})]}),!Y&&r!=="admin"&&u.jsx(Jv,{onAddProfile:()=>W(!0)}),u.jsx(Xv,{isOpen:o,isAddMode:m,onClose:ce}),u.jsx(Vv,{isOpen:b,onClose:()=>p(!1)}),u.jsx(Fv,{})]})}function yx(){return u.jsx(Sy,{children:u.jsx(gx,{})})}const vp=document.getElementById("root");if(!vp)throw new Error("Root element not found");Xg.createRoot(vp).render(u.jsx(tl.StrictMode,{children:u.jsx(yx,{})}));