Backend: - New Flask 3 app with service-layer architecture - Pydantic v2 models and unified API response format - psycopg3 connection pool with stored procedure support - 14 services: DB, SSH, K8s, BGD, RMQ (admin + game), realtime, player, economy, guild, world, progression, character, audit, chat - 30+ API endpoints covering players, guilds, economy, world, admin, server, files, director, chat - SSE real-time events for battlegroup, chat, metrics, connection status - SocketIO remote shell (xterm.js compatible) - Settings CRUD, moderation (ban/kick/unban), audit logging - Security: CSRF, rate limiting, CSP, HSTS, read-only SQL enforcement Frontend: - Vite + React 18 + TypeScript + Tailwind CSS - 14 Dune house themes via CSS custom properties - SWR for server state, Axios API client with interceptors - 14 pages: Overview, Player Explorer + Detail, Guild Manager, Vehicles, Buildings, Map Viewer, Accounts, Server Control, Admin Tools (7 tabs), Chat Monitor, Remote Shell, File Browser, Director, Settings - Player Detail with 6 tabs: overview, inventory, vehicles, buildings, progression, actions - Admin Tools: broadcast, economy, world, character, functions, raw query, audit log - Interactive canvas map viewer with zoom/pan/filter - Toast notifications, connection badges, theme switcher Other: - Updated .gitignore for frontend/backend structure - Updated README with new architecture, development guide, and project structure - Legacy app/ templates/ static/ remain untouched
95 lines
614 KiB
JavaScript
95 lines
614 KiB
JavaScript
function Kp(e,t){for(var r=0;r<t.length;r++){const s=t[r];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(s,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Th={exports:{}},Zn={},Lh={exports:{}},re={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var xi=Symbol.for("react.element"),Gp=Symbol.for("react.portal"),Jp=Symbol.for("react.fragment"),Qp=Symbol.for("react.strict_mode"),Yp=Symbol.for("react.profiler"),Zp=Symbol.for("react.provider"),em=Symbol.for("react.context"),tm=Symbol.for("react.forward_ref"),rm=Symbol.for("react.suspense"),sm=Symbol.for("react.memo"),im=Symbol.for("react.lazy"),Ic=Symbol.iterator;function nm(e){return e===null||typeof e!="object"?null:(e=Ic&&e[Ic]||e["@@iterator"],typeof e=="function"?e:null)}var Dh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ah=Object.assign,Oh={};function ws(e,t,r){this.props=e,this.context=t,this.refs=Oh,this.updater=r||Dh}ws.prototype.isReactComponent={};ws.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ws.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nh(){}Nh.prototype=ws.prototype;function Rl(e,t,r){this.props=e,this.context=t,this.refs=Oh,this.updater=r||Dh}var Tl=Rl.prototype=new Nh;Tl.constructor=Rl;Ah(Tl,ws.prototype);Tl.isPureReactComponent=!0;var Fc=Array.isArray,Ph=Object.prototype.hasOwnProperty,Ll={current:null},Bh={key:!0,ref:!0,__self:!0,__source:!0};function jh(e,t,r){var s,i={},o=null,c=null;if(t!=null)for(s in t.ref!==void 0&&(c=t.ref),t.key!==void 0&&(o=""+t.key),t)Ph.call(t,s)&&!Bh.hasOwnProperty(s)&&(i[s]=t[s]);var n=arguments.length-2;if(n===1)i.children=r;else if(1<n){for(var a=Array(n),f=0;f<n;f++)a[f]=arguments[f+2];i.children=a}if(e&&e.defaultProps)for(s in n=e.defaultProps,n)i[s]===void 0&&(i[s]=n[s]);return{$$typeof:xi,type:e,key:o,ref:c,props:i,_owner:Ll.current}}function om(e,t){return{$$typeof:xi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dl(e){return typeof e=="object"&&e!==null&&e.$$typeof===xi}function am(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Hc=/\/+/g;function Eo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?am(""+e.key):t.toString(36)}function ln(e,t,r,s,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var c=!1;if(e===null)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case xi:case Gp:c=!0}}if(c)return c=e,i=i(c),e=s===""?"."+Eo(c,0):s,Fc(i)?(r="",e!=null&&(r=e.replace(Hc,"$&/")+"/"),ln(i,t,r,"",function(f){return f})):i!=null&&(Dl(i)&&(i=om(i,r+(!i.key||c&&c.key===i.key?"":(""+i.key).replace(Hc,"$&/")+"/")+e)),t.push(i)),1;if(c=0,s=s===""?".":s+":",Fc(e))for(var n=0;n<e.length;n++){o=e[n];var a=s+Eo(o,n);c+=ln(o,t,r,a,i)}else if(a=nm(e),typeof a=="function")for(e=a.call(e),n=0;!(o=e.next()).done;)o=o.value,a=s+Eo(o,n++),c+=ln(o,t,r,a,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function ji(e,t,r){if(e==null)return e;var s=[],i=0;return ln(e,s,"","",function(o){return t.call(r,o,i++)}),s}function lm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ze={current:null},cn={transition:null},cm={ReactCurrentDispatcher:Ze,ReactCurrentBatchConfig:cn,ReactCurrentOwner:Ll};function Mh(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:ji,forEach:function(e,t,r){ji(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return ji(e,function(){t++}),t},toArray:function(e){return ji(e,function(t){return t})||[]},only:function(e){if(!Dl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=ws;re.Fragment=Jp;re.Profiler=Yp;re.PureComponent=Rl;re.StrictMode=Qp;re.Suspense=rm;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cm;re.act=Mh;re.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=Ah({},e.props),i=e.key,o=e.ref,c=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,c=Ll.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var n=e.type.defaultProps;for(a in t)Ph.call(t,a)&&!Bh.hasOwnProperty(a)&&(s[a]=t[a]===void 0&&n!==void 0?n[a]:t[a])}var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){n=Array(a);for(var f=0;f<a;f++)n[f]=arguments[f+2];s.children=n}return{$$typeof:xi,type:e.type,key:i,ref:o,props:s,_owner:c}};re.createContext=function(e){return e={$$typeof:em,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Zp,_context:e},e.Consumer=e};re.createElement=jh;re.createFactory=function(e){var t=jh.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:tm,render:e}};re.isValidElement=Dl;re.lazy=function(e){return{$$typeof:im,_payload:{_status:-1,_result:e},_init:lm}};re.memo=function(e,t){return{$$typeof:sm,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=cn.transition;cn.transition={};try{e()}finally{cn.transition=t}};re.unstable_act=Mh;re.useCallback=function(e,t){return Ze.current.useCallback(e,t)};re.useContext=function(e){return Ze.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Ze.current.useDeferredValue(e)};re.useEffect=function(e,t){return Ze.current.useEffect(e,t)};re.useId=function(){return Ze.current.useId()};re.useImperativeHandle=function(e,t,r){return Ze.current.useImperativeHandle(e,t,r)};re.useInsertionEffect=function(e,t){return Ze.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Ze.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Ze.current.useMemo(e,t)};re.useReducer=function(e,t,r){return Ze.current.useReducer(e,t,r)};re.useRef=function(e){return Ze.current.useRef(e)};re.useState=function(e){return Ze.current.useState(e)};re.useSyncExternalStore=function(e,t,r){return Ze.current.useSyncExternalStore(e,t,r)};re.useTransition=function(){return Ze.current.useTransition()};re.version="18.3.1";Lh.exports=re;var M=Lh.exports;const bi=Xp(M),um=Kp({__proto__:null,default:bi},[M]);/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var hm=M,dm=Symbol.for("react.element"),fm=Symbol.for("react.fragment"),pm=Object.prototype.hasOwnProperty,mm=hm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_m={key:!0,ref:!0,__self:!0,__source:!0};function Ih(e,t,r){var s,i={},o=null,c=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(c=t.ref);for(s in t)pm.call(t,s)&&!_m.hasOwnProperty(s)&&(i[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)i[s]===void 0&&(i[s]=t[s]);return{$$typeof:dm,type:e,key:o,ref:c,props:i,_owner:mm.current}}Zn.Fragment=fm;Zn.jsx=Ih;Zn.jsxs=Ih;Th.exports=Zn;var v=Th.exports,da={},Fh={exports:{}},ft={},Hh={exports:{}},Uh={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/(function(e){function t(R,D){var A=R.length;R.push(D);e:for(;0<A;){var B=A-1>>>1,H=R[B];if(0<i(H,D))R[B]=D,R[A]=H,A=B;else break e}}function r(R){return R.length===0?null:R[0]}function s(R){if(R.length===0)return null;var D=R[0],A=R.pop();if(A!==D){R[0]=A;e:for(var B=0,H=R.length,q=H>>>1;B<q;){var G=2*(B+1)-1,X=R[G],te=G+1,T=R[te];if(0>i(X,A))te<H&&0>i(T,X)?(R[B]=T,R[te]=A,B=te):(R[B]=X,R[G]=A,B=G);else if(te<H&&0>i(T,A))R[B]=T,R[te]=A,B=te;else break e}}return D}function i(R,D){var A=R.sortIndex-D.sortIndex;return A!==0?A:R.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,n=c.now();e.unstable_now=function(){return c.now()-n}}var a=[],f=[],m=1,p=null,_=3,S=!1,b=!1,y=!1,u=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(R){for(var D=r(f);D!==null;){if(D.callback===null)s(f);else if(D.startTime<=R)s(f),D.sortIndex=D.expirationTime,t(a,D);else break;D=r(f)}}function g(R){if(y=!1,d(R),!b)if(r(a)!==null)b=!0,W(x);else{var D=r(f);D!==null&&V(g,D.startTime-R)}}function x(R,D){b=!1,y&&(y=!1,h(w),w=-1),S=!0;var A=_;try{for(d(D),p=r(a);p!==null&&(!(p.expirationTime>D)||R&&!N());){var B=p.callback;if(typeof B=="function"){p.callback=null,_=p.priorityLevel;var H=B(p.expirationTime<=D);D=e.unstable_now(),typeof H=="function"?p.callback=H:p===r(a)&&s(a),d(D)}else s(a);p=r(a)}if(p!==null)var q=!0;else{var G=r(f);G!==null&&V(g,G.startTime-D),q=!1}return q}finally{p=null,_=A,S=!1}}var C=!1,k=null,w=-1,E=5,L=-1;function N(){return!(e.unstable_now()-L<E)}function O(){if(k!==null){var R=e.unstable_now();L=R;var D=!0;try{D=k(!0,R)}finally{D?P():(C=!1,k=null)}}else C=!1}var P;if(typeof l=="function")P=function(){l(O)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,z=F.port2;F.port1.onmessage=O,P=function(){z.postMessage(null)}}else P=function(){u(O,0)};function W(R){k=R,C||(C=!0,P())}function V(R,D){w=u(function(){R(e.unstable_now())},D)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){b||S||(b=!0,W(x))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(R){switch(_){case 1:case 2:case 3:var D=3;break;default:D=_}var A=_;_=D;try{return R()}finally{_=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,D){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var A=_;_=R;try{return D()}finally{_=A}},e.unstable_scheduleCallback=function(R,D,A){var B=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?B+A:B):A=B,R){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=A+H,R={id:m++,callback:D,priorityLevel:R,startTime:A,expirationTime:H,sortIndex:-1},A>B?(R.sortIndex=A,t(f,R),r(a)===null&&R===r(f)&&(y?(h(w),w=-1):y=!0,V(g,A-B))):(R.sortIndex=H,t(a,R),b||S||(b=!0,W(x))),R},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(R){var D=_;return function(){var A=_;_=D;try{return R.apply(this,arguments)}finally{_=A}}}})(Uh);Hh.exports=Uh;var gm=Hh.exports;/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var vm=M,dt=gm;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var zh=new Set,ri={};function $r(e,t){ps(e,t),ps(e+"Capture",t)}function ps(e,t){for(ri[e]=t,e=0;e<t.length;e++)zh.add(t[e])}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fa=Object.prototype.hasOwnProperty,ym=/^[: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]*$/,Uc={},zc={};function Sm(e){return fa.call(zc,e)?!0:fa.call(Uc,e)?!1:ym.test(e)?zc[e]=!0:(Uc[e]=!0,!1)}function xm(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bm(e,t,r,s){if(t===null||typeof t>"u"||xm(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function et(e,t,r,s,i,o,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=c}var Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ie[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ie[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ie[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ie[e]=new et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ie[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ie[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ie[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ie[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ie[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Al=/[\-:]([a-z])/g;function Ol(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Al,Ol);Ie[t]=new et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Al,Ol);Ie[t]=new et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Al,Ol);Ie[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ie[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ie[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nl(e,t,r,s){var i=Ie.hasOwnProperty(t)?Ie[t]:null;(i!==null?i.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(bm(t,r,i,s)&&(r=null),s||i===null?Sm(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,s=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var tr=vm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Mi=Symbol.for("react.element"),Gr=Symbol.for("react.portal"),Jr=Symbol.for("react.fragment"),Pl=Symbol.for("react.strict_mode"),pa=Symbol.for("react.profiler"),$h=Symbol.for("react.provider"),Wh=Symbol.for("react.context"),Bl=Symbol.for("react.forward_ref"),ma=Symbol.for("react.suspense"),_a=Symbol.for("react.suspense_list"),jl=Symbol.for("react.memo"),sr=Symbol.for("react.lazy"),Vh=Symbol.for("react.offscreen"),$c=Symbol.iterator;function Ds(e){return e===null||typeof e!="object"?null:(e=$c&&e[$c]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,ko;function zs(e){if(ko===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);ko=t&&t[1]||""}return`
|
||
`+ko+e}var Ro=!1;function To(e,t){if(!e||Ro)return"";Ro=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var s=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){s=f}e.call(t.prototype)}else{try{throw Error()}catch(f){s=f}e()}}catch(f){if(f&&s&&typeof f.stack=="string"){for(var i=f.stack.split(`
|
||
`),o=s.stack.split(`
|
||
`),c=i.length-1,n=o.length-1;1<=c&&0<=n&&i[c]!==o[n];)n--;for(;1<=c&&0<=n;c--,n--)if(i[c]!==o[n]){if(c!==1||n!==1)do if(c--,n--,0>n||i[c]!==o[n]){var a=`
|
||
`+i[c].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=c&&0<=n);break}}}finally{Ro=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?zs(e):""}function wm(e){switch(e.tag){case 5:return zs(e.type);case 16:return zs("Lazy");case 13:return zs("Suspense");case 19:return zs("SuspenseList");case 0:case 2:case 15:return e=To(e.type,!1),e;case 11:return e=To(e.type.render,!1),e;case 1:return e=To(e.type,!0),e;default:return""}}function ga(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jr:return"Fragment";case Gr:return"Portal";case pa:return"Profiler";case Pl:return"StrictMode";case ma:return"Suspense";case _a:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Wh:return(e.displayName||"Context")+".Consumer";case $h:return(e._context.displayName||"Context")+".Provider";case Bl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jl:return t=e.displayName||null,t!==null?t:ga(e.type)||"Memo";case sr:t=e._payload,e=e._init;try{return ga(e(t))}catch{}}return null}function Cm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ga(t);case 8:return t===Pl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Sr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Em(e){var t=qh(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(c){s=""+c,o.call(this,c)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(c){s=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ii(e){e._valueTracker||(e._valueTracker=Em(e))}function Kh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=qh(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function Rn(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}}function va(e,t){var r=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Wc(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=Sr(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xh(e,t){t=t.checked,t!=null&&Nl(e,"checked",t,!1)}function ya(e,t){Xh(e,t);var r=Sr(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Sa(e,t.type,r):t.hasOwnProperty("defaultValue")&&Sa(e,t.type,Sr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Sa(e,t,r){(t!=="number"||Rn(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var $s=Array.isArray;function as(e,t,r,s){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&s&&(e[r].defaultSelected=!0)}else{for(r=""+Sr(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function xa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qc(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(K(92));if($s(r)){if(1<r.length)throw Error(K(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Sr(r)}}function Gh(e,t){var r=Sr(t.value),s=Sr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function Kc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jh(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ba(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fi,Qh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fi=Fi||document.createElement("div"),Fi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function si(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ks={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},km=["Webkit","ms","Moz","O"];Object.keys(Ks).forEach(function(e){km.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ks[t]=Ks[e]})});function Yh(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ks.hasOwnProperty(e)&&Ks[e]?(""+t).trim():t+"px"}function Zh(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,i=Yh(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,i):e[r]=i}}var Rm=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wa(e,t){if(t){if(Rm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Ca(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ea=null;function Ml(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ka=null,ls=null,cs=null;function Xc(e){if(e=Ei(e)){if(typeof ka!="function")throw Error(K(280));var t=e.stateNode;t&&(t=io(t),ka(e.stateNode,e.type,t))}}function ed(e){ls?cs?cs.push(e):cs=[e]:ls=e}function td(){if(ls){var e=ls,t=cs;if(cs=ls=null,Xc(e),t)for(e=0;e<t.length;e++)Xc(t[e])}}function rd(e,t){return e(t)}function sd(){}var Lo=!1;function id(e,t,r){if(Lo)return e(t,r);Lo=!0;try{return rd(e,t,r)}finally{Lo=!1,(ls!==null||cs!==null)&&(sd(),td())}}function ii(e,t){var r=e.stateNode;if(r===null)return null;var s=io(r);if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(K(231,t,typeof r));return r}var Ra=!1;if(Qt)try{var As={};Object.defineProperty(As,"passive",{get:function(){Ra=!0}}),window.addEventListener("test",As,As),window.removeEventListener("test",As,As)}catch{Ra=!1}function Tm(e,t,r,s,i,o,c,n,a){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(m){this.onError(m)}}var Xs=!1,Tn=null,Ln=!1,Ta=null,Lm={onError:function(e){Xs=!0,Tn=e}};function Dm(e,t,r,s,i,o,c,n,a){Xs=!1,Tn=null,Tm.apply(Lm,arguments)}function Am(e,t,r,s,i,o,c,n,a){if(Dm.apply(this,arguments),Xs){if(Xs){var f=Tn;Xs=!1,Tn=null}else throw Error(K(198));Ln||(Ln=!0,Ta=f)}}function Wr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function nd(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 Gc(e){if(Wr(e)!==e)throw Error(K(188))}function Om(e){var t=e.alternate;if(!t){if(t=Wr(e),t===null)throw Error(K(188));return t!==e?null:e}for(var r=e,s=t;;){var i=r.return;if(i===null)break;var o=i.alternate;if(o===null){if(s=i.return,s!==null){r=s;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===r)return Gc(i),e;if(o===s)return Gc(i),t;o=o.sibling}throw Error(K(188))}if(r.return!==s.return)r=i,s=o;else{for(var c=!1,n=i.child;n;){if(n===r){c=!0,r=i,s=o;break}if(n===s){c=!0,s=i,r=o;break}n=n.sibling}if(!c){for(n=o.child;n;){if(n===r){c=!0,r=o,s=i;break}if(n===s){c=!0,s=o,r=i;break}n=n.sibling}if(!c)throw Error(K(189))}}if(r.alternate!==s)throw Error(K(190))}if(r.tag!==3)throw Error(K(188));return r.stateNode.current===r?e:t}function od(e){return e=Om(e),e!==null?ad(e):null}function ad(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ad(e);if(t!==null)return t;e=e.sibling}return null}var ld=dt.unstable_scheduleCallback,Jc=dt.unstable_cancelCallback,Nm=dt.unstable_shouldYield,Pm=dt.unstable_requestPaint,we=dt.unstable_now,Bm=dt.unstable_getCurrentPriorityLevel,Il=dt.unstable_ImmediatePriority,cd=dt.unstable_UserBlockingPriority,Dn=dt.unstable_NormalPriority,jm=dt.unstable_LowPriority,ud=dt.unstable_IdlePriority,eo=null,Ft=null;function Mm(e){if(Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(eo,e,void 0,(e.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:Hm,Im=Math.log,Fm=Math.LN2;function Hm(e){return e>>>=0,e===0?32:31-(Im(e)/Fm|0)|0}var Hi=64,Ui=4194304;function Ws(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function An(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,i=e.suspendedLanes,o=e.pingedLanes,c=r&268435455;if(c!==0){var n=c&~i;n!==0?s=Ws(n):(o&=c,o!==0&&(s=Ws(o)))}else c=r&~i,c!==0?s=Ws(c):o!==0&&(s=Ws(o));if(s===0)return 0;if(t!==0&&t!==s&&!(t&i)&&(i=s&-s,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(s&4&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-Dt(t),i=1<<r,s|=e[r],t&=~i;return s}function Um(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zm(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var c=31-Dt(o),n=1<<c,a=i[c];a===-1?(!(n&r)||n&s)&&(i[c]=Um(n,t)):a<=t&&(e.expiredLanes|=n),o&=~n}}function La(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hd(){var e=Hi;return Hi<<=1,!(Hi&4194240)&&(Hi=64),e}function Do(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function wi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=r}function $m(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Dt(r),o=1<<i;t[i]=0,s[i]=-1,e[i]=-1,r&=~o}}function Fl(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Dt(r),i=1<<s;i&t|e[s]&t&&(e[s]|=t),r&=~i}}var ue=0;function dd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fd,Hl,pd,md,_d,Da=!1,zi=[],ur=null,hr=null,dr=null,ni=new Map,oi=new Map,nr=[],Wm="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 submit".split(" ");function Qc(e,t){switch(e){case"focusin":case"focusout":ur=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oi.delete(t.pointerId)}}function Os(e,t,r,s,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Ei(t),t!==null&&Hl(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vm(e,t,r,s,i){switch(t){case"focusin":return ur=Os(ur,e,t,r,s,i),!0;case"dragenter":return hr=Os(hr,e,t,r,s,i),!0;case"mouseover":return dr=Os(dr,e,t,r,s,i),!0;case"pointerover":var o=i.pointerId;return ni.set(o,Os(ni.get(o)||null,e,t,r,s,i)),!0;case"gotpointercapture":return o=i.pointerId,oi.set(o,Os(oi.get(o)||null,e,t,r,s,i)),!0}return!1}function gd(e){var t=Dr(e.target);if(t!==null){var r=Wr(t);if(r!==null){if(t=r.tag,t===13){if(t=nd(r),t!==null){e.blockedOn=t,_d(e.priority,function(){pd(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function un(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Aa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Ea=s,r.target.dispatchEvent(s),Ea=null}else return t=Ei(r),t!==null&&Hl(t),e.blockedOn=r,!1;t.shift()}return!0}function Yc(e,t,r){un(e)&&r.delete(t)}function qm(){Da=!1,ur!==null&&un(ur)&&(ur=null),hr!==null&&un(hr)&&(hr=null),dr!==null&&un(dr)&&(dr=null),ni.forEach(Yc),oi.forEach(Yc)}function Ns(e,t){e.blockedOn===t&&(e.blockedOn=null,Da||(Da=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,qm)))}function ai(e){function t(i){return Ns(i,e)}if(0<zi.length){Ns(zi[0],e);for(var r=1;r<zi.length;r++){var s=zi[r];s.blockedOn===e&&(s.blockedOn=null)}}for(ur!==null&&Ns(ur,e),hr!==null&&Ns(hr,e),dr!==null&&Ns(dr,e),ni.forEach(t),oi.forEach(t),r=0;r<nr.length;r++)s=nr[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<nr.length&&(r=nr[0],r.blockedOn===null);)gd(r),r.blockedOn===null&&nr.shift()}var us=tr.ReactCurrentBatchConfig,On=!0;function Km(e,t,r,s){var i=ue,o=us.transition;us.transition=null;try{ue=1,Ul(e,t,r,s)}finally{ue=i,us.transition=o}}function Xm(e,t,r,s){var i=ue,o=us.transition;us.transition=null;try{ue=4,Ul(e,t,r,s)}finally{ue=i,us.transition=o}}function Ul(e,t,r,s){if(On){var i=Aa(e,t,r,s);if(i===null)Ho(e,t,s,Nn,r),Qc(e,s);else if(Vm(i,e,t,r,s))s.stopPropagation();else if(Qc(e,s),t&4&&-1<Wm.indexOf(e)){for(;i!==null;){var o=Ei(i);if(o!==null&&fd(o),o=Aa(e,t,r,s),o===null&&Ho(e,t,s,Nn,r),o===i)break;i=o}i!==null&&s.stopPropagation()}else Ho(e,t,s,null,r)}}var Nn=null;function Aa(e,t,r,s){if(Nn=null,e=Ml(s),e=Dr(e),e!==null)if(t=Wr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=nd(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Nn=e,null}function vd(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bm()){case Il:return 1;case cd:return 4;case Dn:case jm:return 16;case ud:return 536870912;default:return 16}default:return 16}}var ar=null,zl=null,hn=null;function yd(){if(hn)return hn;var e,t=zl,r=t.length,s,i="value"in ar?ar.value:ar.textContent,o=i.length;for(e=0;e<r&&t[e]===i[e];e++);var c=r-e;for(s=1;s<=c&&t[r-s]===i[o-s];s++);return hn=i.slice(e,1<s?1-s:void 0)}function dn(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 $i(){return!0}function Zc(){return!1}function pt(e){function t(r,s,i,o,c){this._reactName=r,this._targetInst=i,this.type=s,this.nativeEvent=o,this.target=c,this.currentTarget=null;for(var n in e)e.hasOwnProperty(n)&&(r=e[n],this[n]=r?r(o):o[n]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?$i:Zc,this.isPropagationStopped=Zc,this}return xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=$i)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=$i)},persist:function(){},isPersistent:$i}),t}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=pt(Cs),Ci=xe({},Cs,{view:0,detail:0}),Gm=pt(Ci),Ao,Oo,Ps,to=xe({},Ci,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wl,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!==Ps&&(Ps&&e.type==="mousemove"?(Ao=e.screenX-Ps.screenX,Oo=e.screenY-Ps.screenY):Oo=Ao=0,Ps=e),Ao)},movementY:function(e){return"movementY"in e?e.movementY:Oo}}),eu=pt(to),Jm=xe({},to,{dataTransfer:0}),Qm=pt(Jm),Ym=xe({},Ci,{relatedTarget:0}),No=pt(Ym),Zm=xe({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),e_=pt(Zm),t_=xe({},Cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),r_=pt(t_),s_=xe({},Cs,{data:0}),tu=pt(s_),i_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},n_={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"},o_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function a_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=o_[e])?!!t[e]:!1}function Wl(){return a_}var l_=xe({},Ci,{key:function(e){if(e.key){var t=i_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?n_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wl,charCode:function(e){return e.type==="keypress"?dn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),c_=pt(l_),u_=xe({},to,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ru=pt(u_),h_=xe({},Ci,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wl}),d_=pt(h_),f_=xe({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),p_=pt(f_),m_=xe({},to,{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}),__=pt(m_),g_=[9,13,27,32],Vl=Qt&&"CompositionEvent"in window,Gs=null;Qt&&"documentMode"in document&&(Gs=document.documentMode);var v_=Qt&&"TextEvent"in window&&!Gs,Sd=Qt&&(!Vl||Gs&&8<Gs&&11>=Gs),su=" ",iu=!1;function xd(e,t){switch(e){case"keyup":return g_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qr=!1;function y_(e,t){switch(e){case"compositionend":return bd(t);case"keypress":return t.which!==32?null:(iu=!0,su);case"textInput":return e=t.data,e===su&&iu?null:e;default:return null}}function S_(e,t){if(Qr)return e==="compositionend"||!Vl&&xd(e,t)?(e=yd(),hn=zl=ar=null,Qr=!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 Sd&&t.locale!=="ko"?null:t.data;default:return null}}var x_={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 nu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!x_[e.type]:t==="textarea"}function wd(e,t,r,s){ed(s),t=Pn(t,"onChange"),0<t.length&&(r=new $l("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Js=null,li=null;function b_(e){Pd(e,0)}function ro(e){var t=es(e);if(Kh(t))return e}function w_(e,t){if(e==="change")return t}var Cd=!1;if(Qt){var Po;if(Qt){var Bo="oninput"in document;if(!Bo){var ou=document.createElement("div");ou.setAttribute("oninput","return;"),Bo=typeof ou.oninput=="function"}Po=Bo}else Po=!1;Cd=Po&&(!document.documentMode||9<document.documentMode)}function au(){Js&&(Js.detachEvent("onpropertychange",Ed),li=Js=null)}function Ed(e){if(e.propertyName==="value"&&ro(li)){var t=[];wd(t,li,e,Ml(e)),id(b_,t)}}function C_(e,t,r){e==="focusin"?(au(),Js=t,li=r,Js.attachEvent("onpropertychange",Ed)):e==="focusout"&&au()}function E_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ro(li)}function k_(e,t){if(e==="click")return ro(t)}function R_(e,t){if(e==="input"||e==="change")return ro(t)}function T_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:T_;function ci(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var i=r[s];if(!fa.call(t,i)||!Nt(e[i],t[i]))return!1}return!0}function lu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cu(e,t){var r=lu(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lu(r)}}function kd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rd(){for(var e=window,t=Rn();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Rn(e.document)}return t}function ql(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")}function L_(e){var t=Rd(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&kd(r.ownerDocument.documentElement,r)){if(s!==null&&ql(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(s.start,i);s=s.end===void 0?o:Math.min(s.end,i),!e.extend&&o>s&&(i=s,s=o,o=i),i=cu(r,o);var c=cu(r,s);i&&c&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>s?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var D_=Qt&&"documentMode"in document&&11>=document.documentMode,Yr=null,Oa=null,Qs=null,Na=!1;function uu(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Na||Yr==null||Yr!==Rn(s)||(s=Yr,"selectionStart"in s&&ql(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Qs&&ci(Qs,s)||(Qs=s,s=Pn(Oa,"onSelect"),0<s.length&&(t=new $l("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=Yr)))}function Wi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Zr={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionend:Wi("Transition","TransitionEnd")},jo={},Td={};Qt&&(Td=document.createElement("div").style,"AnimationEvent"in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),"TransitionEvent"in window||delete Zr.transitionend.transition);function so(e){if(jo[e])return jo[e];if(!Zr[e])return e;var t=Zr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Td)return jo[e]=t[r];return e}var Ld=so("animationend"),Dd=so("animationiteration"),Ad=so("animationstart"),Od=so("transitionend"),Nd=new Map,hu="abort auxClick 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(" ");function wr(e,t){Nd.set(e,t),$r(t,[e])}for(var Mo=0;Mo<hu.length;Mo++){var Io=hu[Mo],A_=Io.toLowerCase(),O_=Io[0].toUpperCase()+Io.slice(1);wr(A_,"on"+O_)}wr(Ld,"onAnimationEnd");wr(Dd,"onAnimationIteration");wr(Ad,"onAnimationStart");wr("dblclick","onDoubleClick");wr("focusin","onFocus");wr("focusout","onBlur");wr(Od,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vs="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(" "),N_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vs));function du(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,Am(s,t,void 0,e),e.currentTarget=null}function Pd(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],i=s.event;s=s.listeners;e:{var o=void 0;if(t)for(var c=s.length-1;0<=c;c--){var n=s[c],a=n.instance,f=n.currentTarget;if(n=n.listener,a!==o&&i.isPropagationStopped())break e;du(i,n,f),o=a}else for(c=0;c<s.length;c++){if(n=s[c],a=n.instance,f=n.currentTarget,n=n.listener,a!==o&&i.isPropagationStopped())break e;du(i,n,f),o=a}}}if(Ln)throw e=Ta,Ln=!1,Ta=null,e}function _e(e,t){var r=t[Ia];r===void 0&&(r=t[Ia]=new Set);var s=e+"__bubble";r.has(s)||(Bd(t,e,2,!1),r.add(s))}function Fo(e,t,r){var s=0;t&&(s|=4),Bd(r,e,s,t)}var Vi="_reactListening"+Math.random().toString(36).slice(2);function ui(e){if(!e[Vi]){e[Vi]=!0,zh.forEach(function(r){r!=="selectionchange"&&(N_.has(r)||Fo(r,!1,e),Fo(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Vi]||(t[Vi]=!0,Fo("selectionchange",!1,t))}}function Bd(e,t,r,s){switch(vd(t)){case 1:var i=Km;break;case 4:i=Xm;break;default:i=Ul}r=i.bind(null,t,r,e),i=void 0,!Ra||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Ho(e,t,r,s,i){var o=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var c=s.tag;if(c===3||c===4){var n=s.stateNode.containerInfo;if(n===i||n.nodeType===8&&n.parentNode===i)break;if(c===4)for(c=s.return;c!==null;){var a=c.tag;if((a===3||a===4)&&(a=c.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;c=c.return}for(;n!==null;){if(c=Dr(n),c===null)return;if(a=c.tag,a===5||a===6){s=o=c;continue e}n=n.parentNode}}s=s.return}id(function(){var f=o,m=Ml(r),p=[];e:{var _=Nd.get(e);if(_!==void 0){var S=$l,b=e;switch(e){case"keypress":if(dn(r)===0)break e;case"keydown":case"keyup":S=c_;break;case"focusin":b="focus",S=No;break;case"focusout":b="blur",S=No;break;case"beforeblur":case"afterblur":S=No;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":S=eu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Qm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=d_;break;case Ld:case Dd:case Ad:S=e_;break;case Od:S=p_;break;case"scroll":S=Gm;break;case"wheel":S=__;break;case"copy":case"cut":case"paste":S=r_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=ru}var y=(t&4)!==0,u=!y&&e==="scroll",h=y?_!==null?_+"Capture":null:_;y=[];for(var l=f,d;l!==null;){d=l;var g=d.stateNode;if(d.tag===5&&g!==null&&(d=g,h!==null&&(g=ii(l,h),g!=null&&y.push(hi(l,g,d)))),u)break;l=l.return}0<y.length&&(_=new S(_,b,null,r,m),p.push({event:_,listeners:y}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",_&&r!==Ea&&(b=r.relatedTarget||r.fromElement)&&(Dr(b)||b[Yt]))break e;if((S||_)&&(_=m.window===m?m:(_=m.ownerDocument)?_.defaultView||_.parentWindow:window,S?(b=r.relatedTarget||r.toElement,S=f,b=b?Dr(b):null,b!==null&&(u=Wr(b),b!==u||b.tag!==5&&b.tag!==6)&&(b=null)):(S=null,b=f),S!==b)){if(y=eu,g="onMouseLeave",h="onMouseEnter",l="mouse",(e==="pointerout"||e==="pointerover")&&(y=ru,g="onPointerLeave",h="onPointerEnter",l="pointer"),u=S==null?_:es(S),d=b==null?_:es(b),_=new y(g,l+"leave",S,r,m),_.target=u,_.relatedTarget=d,g=null,Dr(m)===f&&(y=new y(h,l+"enter",b,r,m),y.target=d,y.relatedTarget=u,g=y),u=g,S&&b)t:{for(y=S,h=b,l=0,d=y;d;d=Kr(d))l++;for(d=0,g=h;g;g=Kr(g))d++;for(;0<l-d;)y=Kr(y),l--;for(;0<d-l;)h=Kr(h),d--;for(;l--;){if(y===h||h!==null&&y===h.alternate)break t;y=Kr(y),h=Kr(h)}y=null}else y=null;S!==null&&fu(p,_,S,y,!1),b!==null&&u!==null&&fu(p,u,b,y,!0)}}e:{if(_=f?es(f):window,S=_.nodeName&&_.nodeName.toLowerCase(),S==="select"||S==="input"&&_.type==="file")var x=w_;else if(nu(_))if(Cd)x=R_;else{x=E_;var C=C_}else(S=_.nodeName)&&S.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(x=k_);if(x&&(x=x(e,f))){wd(p,x,r,m);break e}C&&C(e,_,f),e==="focusout"&&(C=_._wrapperState)&&C.controlled&&_.type==="number"&&Sa(_,"number",_.value)}switch(C=f?es(f):window,e){case"focusin":(nu(C)||C.contentEditable==="true")&&(Yr=C,Oa=f,Qs=null);break;case"focusout":Qs=Oa=Yr=null;break;case"mousedown":Na=!0;break;case"contextmenu":case"mouseup":case"dragend":Na=!1,uu(p,r,m);break;case"selectionchange":if(D_)break;case"keydown":case"keyup":uu(p,r,m)}var k;if(Vl)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Qr?xd(e,r)&&(w="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(w="onCompositionStart");w&&(Sd&&r.locale!=="ko"&&(Qr||w!=="onCompositionStart"?w==="onCompositionEnd"&&Qr&&(k=yd()):(ar=m,zl="value"in ar?ar.value:ar.textContent,Qr=!0)),C=Pn(f,w),0<C.length&&(w=new tu(w,e,null,r,m),p.push({event:w,listeners:C}),k?w.data=k:(k=bd(r),k!==null&&(w.data=k)))),(k=v_?y_(e,r):S_(e,r))&&(f=Pn(f,"onBeforeInput"),0<f.length&&(m=new tu("onBeforeInput","beforeinput",null,r,m),p.push({event:m,listeners:f}),m.data=k))}Pd(p,t)})}function hi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Pn(e,t){for(var r=t+"Capture",s=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=ii(e,r),o!=null&&s.unshift(hi(e,o,i)),o=ii(e,t),o!=null&&s.push(hi(e,o,i))),e=e.return}return s}function Kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fu(e,t,r,s,i){for(var o=t._reactName,c=[];r!==null&&r!==s;){var n=r,a=n.alternate,f=n.stateNode;if(a!==null&&a===s)break;n.tag===5&&f!==null&&(n=f,i?(a=ii(r,o),a!=null&&c.unshift(hi(r,a,n))):i||(a=ii(r,o),a!=null&&c.push(hi(r,a,n)))),r=r.return}c.length!==0&&e.push({event:t,listeners:c})}var P_=/\r\n?/g,B_=/\u0000|\uFFFD/g;function pu(e){return(typeof e=="string"?e:""+e).replace(P_,`
|
||
`).replace(B_,"")}function qi(e,t,r){if(t=pu(t),pu(e)!==t&&r)throw Error(K(425))}function Bn(){}var Pa=null,Ba=null;function ja(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ma=typeof setTimeout=="function"?setTimeout:void 0,j_=typeof clearTimeout=="function"?clearTimeout:void 0,mu=typeof Promise=="function"?Promise:void 0,M_=typeof queueMicrotask=="function"?queueMicrotask:typeof mu<"u"?function(e){return mu.resolve(null).then(e).catch(I_)}:Ma;function I_(e){setTimeout(function(){throw e})}function Uo(e,t){var r=t,s=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(s===0){e.removeChild(i),ai(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=i}while(r);ai(t)}function fr(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==="$?")break;if(t==="/$")return null}}return e}function _u(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Es=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Es,di="__reactProps$"+Es,Yt="__reactContainer$"+Es,Ia="__reactEvents$"+Es,F_="__reactListeners$"+Es,H_="__reactHandles$"+Es;function Dr(e){var t=e[Mt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yt]||r[Mt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=_u(e);e!==null;){if(r=e[Mt])return r;e=_u(e)}return t}e=r,r=e.parentNode}return null}function Ei(e){return e=e[Mt]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function io(e){return e[di]||null}var Fa=[],ts=-1;function Cr(e){return{current:e}}function ge(e){0>ts||(e.current=Fa[ts],Fa[ts]=null,ts--)}function de(e,t){ts++,Fa[ts]=e.current,e.current=t}var xr={},Ge=Cr(xr),it=Cr(!1),Mr=xr;function ms(e,t){var r=e.type.contextTypes;if(!r)return xr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=t[o];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function nt(e){return e=e.childContextTypes,e!=null}function jn(){ge(it),ge(Ge)}function gu(e,t,r){if(Ge.current!==xr)throw Error(K(168));de(Ge,t),de(it,r)}function jd(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var i in s)if(!(i in t))throw Error(K(108,Cm(e)||"Unknown",i));return xe({},r,s)}function Mn(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xr,Mr=Ge.current,de(Ge,e),de(it,it.current),!0}function vu(e,t,r){var s=e.stateNode;if(!s)throw Error(K(169));r?(e=jd(e,t,Mr),s.__reactInternalMemoizedMergedChildContext=e,ge(it),ge(Ge),de(Ge,e)):ge(it),de(it,r)}var Vt=null,no=!1,zo=!1;function Md(e){Vt===null?Vt=[e]:Vt.push(e)}function U_(e){no=!0,Md(e)}function Er(){if(!zo&&Vt!==null){zo=!0;var e=0,t=ue;try{var r=Vt;for(ue=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Vt=null,no=!1}catch(i){throw Vt!==null&&(Vt=Vt.slice(e+1)),ld(Il,Er),i}finally{ue=t,zo=!1}}return null}var rs=[],ss=0,In=null,Fn=0,_t=[],gt=0,Ir=null,Kt=1,Xt="";function Tr(e,t){rs[ss++]=Fn,rs[ss++]=In,In=e,Fn=t}function Id(e,t,r){_t[gt++]=Kt,_t[gt++]=Xt,_t[gt++]=Ir,Ir=e;var s=Kt;e=Xt;var i=32-Dt(s)-1;s&=~(1<<i),r+=1;var o=32-Dt(t)+i;if(30<o){var c=i-i%5;o=(s&(1<<c)-1).toString(32),s>>=c,i-=c,Kt=1<<32-Dt(t)+i|r<<i|s,Xt=o+e}else Kt=1<<o|r<<i|s,Xt=e}function Kl(e){e.return!==null&&(Tr(e,1),Id(e,1,0))}function Xl(e){for(;e===In;)In=rs[--ss],rs[ss]=null,Fn=rs[--ss],rs[ss]=null;for(;e===Ir;)Ir=_t[--gt],_t[gt]=null,Xt=_t[--gt],_t[gt]=null,Kt=_t[--gt],_t[gt]=null}var ht=null,ut=null,ve=!1,Lt=null;function Fd(e,t){var r=yt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function yu(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ht=e,ut=fr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ht=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ir!==null?{id:Kt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=yt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ht=e,ut=null,!0):!1;default:return!1}}function Ha(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ua(e){if(ve){var t=ut;if(t){var r=t;if(!yu(e,t)){if(Ha(e))throw Error(K(418));t=fr(r.nextSibling);var s=ht;t&&yu(e,t)?Fd(s,r):(e.flags=e.flags&-4097|2,ve=!1,ht=e)}}else{if(Ha(e))throw Error(K(418));e.flags=e.flags&-4097|2,ve=!1,ht=e}}}function Su(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function Ki(e){if(e!==ht)return!1;if(!ve)return Su(e),ve=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ja(e.type,e.memoizedProps)),t&&(t=ut)){if(Ha(e))throw Hd(),Error(K(418));for(;t;)Fd(e,t),t=fr(t.nextSibling)}if(Su(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){ut=fr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ht?fr(e.stateNode.nextSibling):null;return!0}function Hd(){for(var e=ut;e;)e=fr(e.nextSibling)}function _s(){ut=ht=null,ve=!1}function Gl(e){Lt===null?Lt=[e]:Lt.push(e)}var z_=tr.ReactCurrentBatchConfig;function Bs(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(K(309));var s=r.stateNode}if(!s)throw Error(K(147,e));var i=s,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(c){var n=i.refs;c===null?delete n[o]:n[o]=c},t._stringRef=o,t)}if(typeof e!="string")throw Error(K(284));if(!r._owner)throw Error(K(290,e))}return e}function Xi(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xu(e){var t=e._init;return t(e._payload)}function Ud(e){function t(h,l){if(e){var d=h.deletions;d===null?(h.deletions=[l],h.flags|=16):d.push(l)}}function r(h,l){if(!e)return null;for(;l!==null;)t(h,l),l=l.sibling;return null}function s(h,l){for(h=new Map;l!==null;)l.key!==null?h.set(l.key,l):h.set(l.index,l),l=l.sibling;return h}function i(h,l){return h=gr(h,l),h.index=0,h.sibling=null,h}function o(h,l,d){return h.index=d,e?(d=h.alternate,d!==null?(d=d.index,d<l?(h.flags|=2,l):d):(h.flags|=2,l)):(h.flags|=1048576,l)}function c(h){return e&&h.alternate===null&&(h.flags|=2),h}function n(h,l,d,g){return l===null||l.tag!==6?(l=Go(d,h.mode,g),l.return=h,l):(l=i(l,d),l.return=h,l)}function a(h,l,d,g){var x=d.type;return x===Jr?m(h,l,d.props.children,g,d.key):l!==null&&(l.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===sr&&xu(x)===l.type)?(g=i(l,d.props),g.ref=Bs(h,l,d),g.return=h,g):(g=yn(d.type,d.key,d.props,null,h.mode,g),g.ref=Bs(h,l,d),g.return=h,g)}function f(h,l,d,g){return l===null||l.tag!==4||l.stateNode.containerInfo!==d.containerInfo||l.stateNode.implementation!==d.implementation?(l=Jo(d,h.mode,g),l.return=h,l):(l=i(l,d.children||[]),l.return=h,l)}function m(h,l,d,g,x){return l===null||l.tag!==7?(l=Br(d,h.mode,g,x),l.return=h,l):(l=i(l,d),l.return=h,l)}function p(h,l,d){if(typeof l=="string"&&l!==""||typeof l=="number")return l=Go(""+l,h.mode,d),l.return=h,l;if(typeof l=="object"&&l!==null){switch(l.$$typeof){case Mi:return d=yn(l.type,l.key,l.props,null,h.mode,d),d.ref=Bs(h,null,l),d.return=h,d;case Gr:return l=Jo(l,h.mode,d),l.return=h,l;case sr:var g=l._init;return p(h,g(l._payload),d)}if($s(l)||Ds(l))return l=Br(l,h.mode,d,null),l.return=h,l;Xi(h,l)}return null}function _(h,l,d,g){var x=l!==null?l.key:null;if(typeof d=="string"&&d!==""||typeof d=="number")return x!==null?null:n(h,l,""+d,g);if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Mi:return d.key===x?a(h,l,d,g):null;case Gr:return d.key===x?f(h,l,d,g):null;case sr:return x=d._init,_(h,l,x(d._payload),g)}if($s(d)||Ds(d))return x!==null?null:m(h,l,d,g,null);Xi(h,d)}return null}function S(h,l,d,g,x){if(typeof g=="string"&&g!==""||typeof g=="number")return h=h.get(d)||null,n(l,h,""+g,x);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Mi:return h=h.get(g.key===null?d:g.key)||null,a(l,h,g,x);case Gr:return h=h.get(g.key===null?d:g.key)||null,f(l,h,g,x);case sr:var C=g._init;return S(h,l,d,C(g._payload),x)}if($s(g)||Ds(g))return h=h.get(d)||null,m(l,h,g,x,null);Xi(l,g)}return null}function b(h,l,d,g){for(var x=null,C=null,k=l,w=l=0,E=null;k!==null&&w<d.length;w++){k.index>w?(E=k,k=null):E=k.sibling;var L=_(h,k,d[w],g);if(L===null){k===null&&(k=E);break}e&&k&&L.alternate===null&&t(h,k),l=o(L,l,w),C===null?x=L:C.sibling=L,C=L,k=E}if(w===d.length)return r(h,k),ve&&Tr(h,w),x;if(k===null){for(;w<d.length;w++)k=p(h,d[w],g),k!==null&&(l=o(k,l,w),C===null?x=k:C.sibling=k,C=k);return ve&&Tr(h,w),x}for(k=s(h,k);w<d.length;w++)E=S(k,h,w,d[w],g),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?w:E.key),l=o(E,l,w),C===null?x=E:C.sibling=E,C=E);return e&&k.forEach(function(N){return t(h,N)}),ve&&Tr(h,w),x}function y(h,l,d,g){var x=Ds(d);if(typeof x!="function")throw Error(K(150));if(d=x.call(d),d==null)throw Error(K(151));for(var C=x=null,k=l,w=l=0,E=null,L=d.next();k!==null&&!L.done;w++,L=d.next()){k.index>w?(E=k,k=null):E=k.sibling;var N=_(h,k,L.value,g);if(N===null){k===null&&(k=E);break}e&&k&&N.alternate===null&&t(h,k),l=o(N,l,w),C===null?x=N:C.sibling=N,C=N,k=E}if(L.done)return r(h,k),ve&&Tr(h,w),x;if(k===null){for(;!L.done;w++,L=d.next())L=p(h,L.value,g),L!==null&&(l=o(L,l,w),C===null?x=L:C.sibling=L,C=L);return ve&&Tr(h,w),x}for(k=s(h,k);!L.done;w++,L=d.next())L=S(k,h,w,L.value,g),L!==null&&(e&&L.alternate!==null&&k.delete(L.key===null?w:L.key),l=o(L,l,w),C===null?x=L:C.sibling=L,C=L);return e&&k.forEach(function(O){return t(h,O)}),ve&&Tr(h,w),x}function u(h,l,d,g){if(typeof d=="object"&&d!==null&&d.type===Jr&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Mi:e:{for(var x=d.key,C=l;C!==null;){if(C.key===x){if(x=d.type,x===Jr){if(C.tag===7){r(h,C.sibling),l=i(C,d.props.children),l.return=h,h=l;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===sr&&xu(x)===C.type){r(h,C.sibling),l=i(C,d.props),l.ref=Bs(h,C,d),l.return=h,h=l;break e}r(h,C);break}else t(h,C);C=C.sibling}d.type===Jr?(l=Br(d.props.children,h.mode,g,d.key),l.return=h,h=l):(g=yn(d.type,d.key,d.props,null,h.mode,g),g.ref=Bs(h,l,d),g.return=h,h=g)}return c(h);case Gr:e:{for(C=d.key;l!==null;){if(l.key===C)if(l.tag===4&&l.stateNode.containerInfo===d.containerInfo&&l.stateNode.implementation===d.implementation){r(h,l.sibling),l=i(l,d.children||[]),l.return=h,h=l;break e}else{r(h,l);break}else t(h,l);l=l.sibling}l=Jo(d,h.mode,g),l.return=h,h=l}return c(h);case sr:return C=d._init,u(h,l,C(d._payload),g)}if($s(d))return b(h,l,d,g);if(Ds(d))return y(h,l,d,g);Xi(h,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,l!==null&&l.tag===6?(r(h,l.sibling),l=i(l,d),l.return=h,h=l):(r(h,l),l=Go(d,h.mode,g),l.return=h,h=l),c(h)):r(h,l)}return u}var gs=Ud(!0),zd=Ud(!1),Hn=Cr(null),Un=null,is=null,Jl=null;function Ql(){Jl=is=Un=null}function Yl(e){var t=Hn.current;ge(Hn),e._currentValue=t}function za(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function hs(e,t){Un=e,Jl=is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(st=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(Jl!==e)if(e={context:e,memoizedValue:t,next:null},is===null){if(Un===null)throw Error(K(308));is=e,Un.dependencies={lanes:0,firstContext:e}}else is=is.next=e;return t}var Ar=null;function Zl(e){Ar===null?Ar=[e]:Ar.push(e)}function $d(e,t,r,s){var i=t.interleaved;return i===null?(r.next=r,Zl(t)):(r.next=i.next,i.next=r),t.interleaved=r,Zt(e,s)}function Zt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ir=!1;function ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,ae&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,Zt(e,r)}return i=s.interleaved,i===null?(t.next=t,Zl(s)):(t.next=i.next,i.next=t),s.interleaved=t,Zt(e,r)}function fn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Fl(e,r)}}function bu(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var i=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var c={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?i=o=c:o=o.next=c,r=r.next}while(r!==null);o===null?i=o=t:o=o.next=t}else i=o=t;r={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function zn(e,t,r,s){var i=e.updateQueue;ir=!1;var o=i.firstBaseUpdate,c=i.lastBaseUpdate,n=i.shared.pending;if(n!==null){i.shared.pending=null;var a=n,f=a.next;a.next=null,c===null?o=f:c.next=f,c=a;var m=e.alternate;m!==null&&(m=m.updateQueue,n=m.lastBaseUpdate,n!==c&&(n===null?m.firstBaseUpdate=f:n.next=f,m.lastBaseUpdate=a))}if(o!==null){var p=i.baseState;c=0,m=f=a=null,n=o;do{var _=n.lane,S=n.eventTime;if((s&_)===_){m!==null&&(m=m.next={eventTime:S,lane:0,tag:n.tag,payload:n.payload,callback:n.callback,next:null});e:{var b=e,y=n;switch(_=t,S=r,y.tag){case 1:if(b=y.payload,typeof b=="function"){p=b.call(S,p,_);break e}p=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=y.payload,_=typeof b=="function"?b.call(S,p,_):b,_==null)break e;p=xe({},p,_);break e;case 2:ir=!0}}n.callback!==null&&n.lane!==0&&(e.flags|=64,_=i.effects,_===null?i.effects=[n]:_.push(n))}else S={eventTime:S,lane:_,tag:n.tag,payload:n.payload,callback:n.callback,next:null},m===null?(f=m=S,a=p):m=m.next=S,c|=_;if(n=n.next,n===null){if(n=i.shared.pending,n===null)break;_=n,n=_.next,_.next=null,i.lastBaseUpdate=_,i.shared.pending=null}}while(!0);if(m===null&&(a=p),i.baseState=a,i.firstBaseUpdate=f,i.lastBaseUpdate=m,t=i.shared.interleaved,t!==null){i=t;do c|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Hr|=c,e.lanes=c,e.memoizedState=p}}function wu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],i=s.callback;if(i!==null){if(s.callback=null,s=r,typeof i!="function")throw Error(K(191,i));i.call(s)}}}var ki={},Ht=Cr(ki),fi=Cr(ki),pi=Cr(ki);function Or(e){if(e===ki)throw Error(K(174));return e}function tc(e,t){switch(de(pi,t),de(fi,e),de(Ht,ki),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ba(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ba(t,e)}ge(Ht),de(Ht,t)}function vs(){ge(Ht),ge(fi),ge(pi)}function Vd(e){Or(pi.current);var t=Or(Ht.current),r=ba(t,e.type);t!==r&&(de(fi,e),de(Ht,r))}function rc(e){fi.current===e&&(ge(Ht),ge(fi))}var ye=Cr(0);function $n(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 $o=[];function sc(){for(var e=0;e<$o.length;e++)$o[e]._workInProgressVersionPrimary=null;$o.length=0}var pn=tr.ReactCurrentDispatcher,Wo=tr.ReactCurrentBatchConfig,Fr=0,Se=null,Te=null,Ae=null,Wn=!1,Ys=!1,mi=0,$_=0;function ze(){throw Error(K(321))}function ic(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Nt(e[r],t[r]))return!1;return!0}function nc(e,t,r,s,i,o){if(Fr=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,pn.current=e===null||e.memoizedState===null?K_:X_,e=r(s,i),Ys){o=0;do{if(Ys=!1,mi=0,25<=o)throw Error(K(301));o+=1,Ae=Te=null,t.updateQueue=null,pn.current=G_,e=r(s,i)}while(Ys)}if(pn.current=Vn,t=Te!==null&&Te.next!==null,Fr=0,Ae=Te=Se=null,Wn=!1,t)throw Error(K(300));return e}function oc(){var e=mi!==0;return mi=0,e}function jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?Se.memoizedState=Ae=e:Ae=Ae.next=e,Ae}function bt(){if(Te===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Ae===null?Se.memoizedState:Ae.next;if(t!==null)Ae=t,Te=e;else{if(e===null)throw Error(K(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Ae===null?Se.memoizedState=Ae=e:Ae=Ae.next=e}return Ae}function _i(e,t){return typeof t=="function"?t(e):t}function Vo(e){var t=bt(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var s=Te,i=s.baseQueue,o=r.pending;if(o!==null){if(i!==null){var c=i.next;i.next=o.next,o.next=c}s.baseQueue=i=o,r.pending=null}if(i!==null){o=i.next,s=s.baseState;var n=c=null,a=null,f=o;do{var m=f.lane;if((Fr&m)===m)a!==null&&(a=a.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),s=f.hasEagerState?f.eagerState:e(s,f.action);else{var p={lane:m,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};a===null?(n=a=p,c=s):a=a.next=p,Se.lanes|=m,Hr|=m}f=f.next}while(f!==null&&f!==o);a===null?c=s:a.next=n,Nt(s,t.memoizedState)||(st=!0),t.memoizedState=s,t.baseState=c,t.baseQueue=a,r.lastRenderedState=s}if(e=r.interleaved,e!==null){i=e;do o=i.lane,Se.lanes|=o,Hr|=o,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function qo(e){var t=bt(),r=t.queue;if(r===null)throw Error(K(311));r.lastRenderedReducer=e;var s=r.dispatch,i=r.pending,o=t.memoizedState;if(i!==null){r.pending=null;var c=i=i.next;do o=e(o,c.action),c=c.next;while(c!==i);Nt(o,t.memoizedState)||(st=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,s]}function qd(){}function Kd(e,t){var r=Se,s=bt(),i=t(),o=!Nt(s.memoizedState,i);if(o&&(s.memoizedState=i,st=!0),s=s.queue,ac(Jd.bind(null,r,s,e),[e]),s.getSnapshot!==t||o||Ae!==null&&Ae.memoizedState.tag&1){if(r.flags|=2048,gi(9,Gd.bind(null,r,s,i,t),void 0,null),Oe===null)throw Error(K(349));Fr&30||Xd(r,t,i)}return i}function Xd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Gd(e,t,r,s){t.value=r,t.getSnapshot=s,Qd(t)&&Yd(e)}function Jd(e,t,r){return r(function(){Qd(t)&&Yd(e)})}function Qd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nt(e,r)}catch{return!0}}function Yd(e){var t=Zt(e,1);t!==null&&At(t,e,1,-1)}function Cu(e){var t=jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:e},t.queue=e,e=e.dispatch=q_.bind(null,Se,e),[t.memoizedState,e]}function gi(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Zd(){return bt().memoizedState}function mn(e,t,r,s){var i=jt();Se.flags|=e,i.memoizedState=gi(1|t,r,void 0,s===void 0?null:s)}function oo(e,t,r,s){var i=bt();s=s===void 0?null:s;var o=void 0;if(Te!==null){var c=Te.memoizedState;if(o=c.destroy,s!==null&&ic(s,c.deps)){i.memoizedState=gi(t,r,o,s);return}}Se.flags|=e,i.memoizedState=gi(1|t,r,o,s)}function Eu(e,t){return mn(8390656,8,e,t)}function ac(e,t){return oo(2048,8,e,t)}function ef(e,t){return oo(4,2,e,t)}function tf(e,t){return oo(4,4,e,t)}function rf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sf(e,t,r){return r=r!=null?r.concat([e]):null,oo(4,4,rf.bind(null,t,e),r)}function lc(){}function nf(e,t){var r=bt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&ic(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function of(e,t){var r=bt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&ic(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function af(e,t,r){return Fr&21?(Nt(r,t)||(r=hd(),Se.lanes|=r,Hr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,st=!0),e.memoizedState=r)}function W_(e,t){var r=ue;ue=r!==0&&4>r?r:4,e(!0);var s=Wo.transition;Wo.transition={};try{e(!1),t()}finally{ue=r,Wo.transition=s}}function lf(){return bt().memoizedState}function V_(e,t,r){var s=_r(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},cf(e))uf(t,r);else if(r=$d(e,t,r,s),r!==null){var i=Qe();At(r,e,s,i),hf(r,t,s)}}function q_(e,t,r){var s=_r(e),i={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(cf(e))uf(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var c=t.lastRenderedState,n=o(c,r);if(i.hasEagerState=!0,i.eagerState=n,Nt(n,c)){var a=t.interleaved;a===null?(i.next=i,Zl(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}r=$d(e,t,i,s),r!==null&&(i=Qe(),At(r,e,s,i),hf(r,t,s))}}function cf(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function uf(e,t){Ys=Wn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function hf(e,t,r){if(r&4194240){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Fl(e,r)}}var Vn={readContext:xt,useCallback:ze,useContext:ze,useEffect:ze,useImperativeHandle:ze,useInsertionEffect:ze,useLayoutEffect:ze,useMemo:ze,useReducer:ze,useRef:ze,useState:ze,useDebugValue:ze,useDeferredValue:ze,useTransition:ze,useMutableSource:ze,useSyncExternalStore:ze,useId:ze,unstable_isNewReconciler:!1},K_={readContext:xt,useCallback:function(e,t){return jt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:Eu,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mn(4194308,4,rf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mn(4194308,4,e,t)},useInsertionEffect:function(e,t){return mn(4,2,e,t)},useMemo:function(e,t){var r=jt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=jt();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=V_.bind(null,Se,e),[s.memoizedState,e]},useRef:function(e){var t=jt();return e={current:e},t.memoizedState=e},useState:Cu,useDebugValue:lc,useDeferredValue:function(e){return jt().memoizedState=e},useTransition:function(){var e=Cu(!1),t=e[0];return e=W_.bind(null,e[1]),jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=Se,i=jt();if(ve){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),Oe===null)throw Error(K(349));Fr&30||Xd(s,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,Eu(Jd.bind(null,s,o,e),[e]),s.flags|=2048,gi(9,Gd.bind(null,s,o,r,t),void 0,null),r},useId:function(){var e=jt(),t=Oe.identifierPrefix;if(ve){var r=Xt,s=Kt;r=(s&~(1<<32-Dt(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=mi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=$_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},X_={readContext:xt,useCallback:nf,useContext:xt,useEffect:ac,useImperativeHandle:sf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:of,useReducer:Vo,useRef:Zd,useState:function(){return Vo(_i)},useDebugValue:lc,useDeferredValue:function(e){var t=bt();return af(t,Te.memoizedState,e)},useTransition:function(){var e=Vo(_i)[0],t=bt().memoizedState;return[e,t]},useMutableSource:qd,useSyncExternalStore:Kd,useId:lf,unstable_isNewReconciler:!1},G_={readContext:xt,useCallback:nf,useContext:xt,useEffect:ac,useImperativeHandle:sf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:of,useReducer:qo,useRef:Zd,useState:function(){return qo(_i)},useDebugValue:lc,useDeferredValue:function(e){var t=bt();return Te===null?t.memoizedState=e:af(t,Te.memoizedState,e)},useTransition:function(){var e=qo(_i)[0],t=bt().memoizedState;return[e,t]},useMutableSource:qd,useSyncExternalStore:Kd,useId:lf,unstable_isNewReconciler:!1};function kt(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function $a(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:xe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ao={isMounted:function(e){return(e=e._reactInternals)?Wr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=Qe(),i=_r(e),o=Jt(s,i);o.payload=t,r!=null&&(o.callback=r),t=pr(e,o,i),t!==null&&(At(t,e,i,s),fn(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=Qe(),i=_r(e),o=Jt(s,i);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=pr(e,o,i),t!==null&&(At(t,e,i,s),fn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qe(),s=_r(e),i=Jt(r,s);i.tag=2,t!=null&&(i.callback=t),t=pr(e,i,s),t!==null&&(At(t,e,s,r),fn(t,e,s))}};function ku(e,t,r,s,i,o,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,o,c):t.prototype&&t.prototype.isPureReactComponent?!ci(r,s)||!ci(i,o):!0}function df(e,t,r){var s=!1,i=xr,o=t.contextType;return typeof o=="object"&&o!==null?o=xt(o):(i=nt(t)?Mr:Ge.current,s=t.contextTypes,o=(s=s!=null)?ms(e,i):xr),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ao,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Ru(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&ao.enqueueReplaceState(t,t.state,null)}function Wa(e,t,r,s){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},ec(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=xt(o):(o=nt(t)?Mr:Ge.current,i.context=ms(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&($a(e,t,o,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&ao.enqueueReplaceState(i,i.state,null),zn(e,r,i,s),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,t){try{var r="",s=t;do r+=wm(s),s=s.return;while(s);var i=r}catch(o){i=`
|
||
Error generating stack: `+o.message+`
|
||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Ko(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Va(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var J_=typeof WeakMap=="function"?WeakMap:Map;function ff(e,t,r){r=Jt(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){Kn||(Kn=!0,tl=s),Va(e,t)},r}function pf(e,t,r){r=Jt(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var i=t.value;r.payload=function(){return s(i)},r.callback=function(){Va(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){Va(e,t),typeof s!="function"&&(mr===null?mr=new Set([this]):mr.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),r}function Tu(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new J_;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(r)||(i.add(r),e=ug.bind(null,e,t,r),t.then(e,e))}function Lu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Du(e,t,r,s,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Jt(-1,1),t.tag=2,pr(r,t,1))),r.lanes|=1),e)}var Q_=tr.ReactCurrentOwner,st=!1;function Je(e,t,r,s){t.child=e===null?zd(t,null,r,s):gs(t,e.child,r,s)}function Au(e,t,r,s,i){r=r.render;var o=t.ref;return hs(t,i),s=nc(e,t,r,s,o,i),r=oc(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,er(e,t,i)):(ve&&r&&Kl(t),t.flags|=1,Je(e,t,s,i),t.child)}function Ou(e,t,r,s,i){if(e===null){var o=r.type;return typeof o=="function"&&!_c(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,mf(e,t,o,s,i)):(e=yn(r.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var c=o.memoizedProps;if(r=r.compare,r=r!==null?r:ci,r(c,s)&&e.ref===t.ref)return er(e,t,i)}return t.flags|=1,e=gr(o,s),e.ref=t.ref,e.return=t,t.child=e}function mf(e,t,r,s,i){if(e!==null){var o=e.memoizedProps;if(ci(o,s)&&e.ref===t.ref)if(st=!1,t.pendingProps=s=o,(e.lanes&i)!==0)e.flags&131072&&(st=!0);else return t.lanes=e.lanes,er(e,t,i)}return qa(e,t,r,s,i)}function _f(e,t,r){var s=t.pendingProps,i=s.children,o=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},de(os,lt),lt|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,de(os,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=o!==null?o.baseLanes:r,de(os,lt),lt|=s}else o!==null?(s=o.baseLanes|r,t.memoizedState=null):s=r,de(os,lt),lt|=s;return Je(e,t,i,r),t.child}function gf(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function qa(e,t,r,s,i){var o=nt(r)?Mr:Ge.current;return o=ms(t,o),hs(t,i),r=nc(e,t,r,s,o,i),s=oc(),e!==null&&!st?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,er(e,t,i)):(ve&&s&&Kl(t),t.flags|=1,Je(e,t,r,i),t.child)}function Nu(e,t,r,s,i){if(nt(r)){var o=!0;Mn(t)}else o=!1;if(hs(t,i),t.stateNode===null)_n(e,t),df(t,r,s),Wa(t,r,s,i),s=!0;else if(e===null){var c=t.stateNode,n=t.memoizedProps;c.props=n;var a=c.context,f=r.contextType;typeof f=="object"&&f!==null?f=xt(f):(f=nt(r)?Mr:Ge.current,f=ms(t,f));var m=r.getDerivedStateFromProps,p=typeof m=="function"||typeof c.getSnapshotBeforeUpdate=="function";p||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(n!==s||a!==f)&&Ru(t,c,s,f),ir=!1;var _=t.memoizedState;c.state=_,zn(t,s,c,i),a=t.memoizedState,n!==s||_!==a||it.current||ir?(typeof m=="function"&&($a(t,r,m,s),a=t.memoizedState),(n=ir||ku(t,r,n,s,_,a,f))?(p||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=a),c.props=s,c.state=a,c.context=f,s=n):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{c=t.stateNode,Wd(e,t),n=t.memoizedProps,f=t.type===t.elementType?n:kt(t.type,n),c.props=f,p=t.pendingProps,_=c.context,a=r.contextType,typeof a=="object"&&a!==null?a=xt(a):(a=nt(r)?Mr:Ge.current,a=ms(t,a));var S=r.getDerivedStateFromProps;(m=typeof S=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(n!==p||_!==a)&&Ru(t,c,s,a),ir=!1,_=t.memoizedState,c.state=_,zn(t,s,c,i);var b=t.memoizedState;n!==p||_!==b||it.current||ir?(typeof S=="function"&&($a(t,r,S,s),b=t.memoizedState),(f=ir||ku(t,r,f,s,_,b,a)||!1)?(m||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(s,b,a),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(s,b,a)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=b),c.props=s,c.state=b,c.context=a,s=f):(typeof c.componentDidUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||n===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),s=!1)}return Ka(e,t,r,s,o,i)}function Ka(e,t,r,s,i,o){gf(e,t);var c=(t.flags&128)!==0;if(!s&&!c)return i&&vu(t,r,!1),er(e,t,o);s=t.stateNode,Q_.current=t;var n=c&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&c?(t.child=gs(t,e.child,null,o),t.child=gs(t,null,n,o)):Je(e,t,n,o),t.memoizedState=s.state,i&&vu(t,r,!0),t.child}function vf(e){var t=e.stateNode;t.pendingContext?gu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gu(e,t.context,!1),tc(e,t.containerInfo)}function Pu(e,t,r,s,i){return _s(),Gl(i),t.flags|=256,Je(e,t,r,s),t.child}var Xa={dehydrated:null,treeContext:null,retryLane:0};function Ga(e){return{baseLanes:e,cachePool:null,transitions:null}}function yf(e,t,r){var s=t.pendingProps,i=ye.current,o=!1,c=(t.flags&128)!==0,n;if((n=c)||(n=e!==null&&e.memoizedState===null?!1:(i&2)!==0),n?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),de(ye,i&1),e===null)return Ua(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(c=s.children,e=s.fallback,o?(s=t.mode,o=t.child,c={mode:"hidden",children:c},!(s&1)&&o!==null?(o.childLanes=0,o.pendingProps=c):o=uo(c,s,0,null),e=Br(e,s,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Ga(r),t.memoizedState=Xa,e):cc(t,c));if(i=e.memoizedState,i!==null&&(n=i.dehydrated,n!==null))return Y_(e,t,c,s,n,i,r);if(o){o=s.fallback,c=t.mode,i=e.child,n=i.sibling;var a={mode:"hidden",children:s.children};return!(c&1)&&t.child!==i?(s=t.child,s.childLanes=0,s.pendingProps=a,t.deletions=null):(s=gr(i,a),s.subtreeFlags=i.subtreeFlags&14680064),n!==null?o=gr(n,o):(o=Br(o,c,r,null),o.flags|=2),o.return=t,s.return=t,s.sibling=o,t.child=s,s=o,o=t.child,c=e.child.memoizedState,c=c===null?Ga(r):{baseLanes:c.baseLanes|r,cachePool:null,transitions:c.transitions},o.memoizedState=c,o.childLanes=e.childLanes&~r,t.memoizedState=Xa,s}return o=e.child,e=o.sibling,s=gr(o,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function cc(e,t){return t=uo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Gi(e,t,r,s){return s!==null&&Gl(s),gs(t,e.child,null,r),e=cc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Y_(e,t,r,s,i,o,c){if(r)return t.flags&256?(t.flags&=-257,s=Ko(Error(K(422))),Gi(e,t,c,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=s.fallback,i=t.mode,s=uo({mode:"visible",children:s.children},i,0,null),o=Br(o,i,c,null),o.flags|=2,s.return=t,o.return=t,s.sibling=o,t.child=s,t.mode&1&&gs(t,e.child,null,c),t.child.memoizedState=Ga(c),t.memoizedState=Xa,o);if(!(t.mode&1))return Gi(e,t,c,null);if(i.data==="$!"){if(s=i.nextSibling&&i.nextSibling.dataset,s)var n=s.dgst;return s=n,o=Error(K(419)),s=Ko(o,s,void 0),Gi(e,t,c,s)}if(n=(c&e.childLanes)!==0,st||n){if(s=Oe,s!==null){switch(c&-c){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(s.suspendedLanes|c)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Zt(e,i),At(s,e,i,-1))}return mc(),s=Ko(Error(K(421))),Gi(e,t,c,s)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=hg.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,ut=fr(i.nextSibling),ht=t,ve=!0,Lt=null,e!==null&&(_t[gt++]=Kt,_t[gt++]=Xt,_t[gt++]=Ir,Kt=e.id,Xt=e.overflow,Ir=t),t=cc(t,s.children),t.flags|=4096,t)}function Bu(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),za(e.return,t,r)}function Xo(e,t,r,s,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=r,o.tailMode=i)}function Sf(e,t,r){var s=t.pendingProps,i=s.revealOrder,o=s.tail;if(Je(e,t,s.children,r),s=ye.current,s&2)s=s&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bu(e,r,t);else if(e.tag===19)Bu(e,r,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}s&=1}if(de(ye,s),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&$n(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Xo(t,!1,i,r,o);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&$n(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Xo(t,!0,r,null,o);break;case"together":Xo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _n(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function er(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Hr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=gr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=gr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Z_(e,t,r){switch(t.tag){case 3:vf(t),_s();break;case 5:Vd(t);break;case 1:nt(t.type)&&Mn(t);break;case 4:tc(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,i=t.memoizedProps.value;de(Hn,s._currentValue),s._currentValue=i;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(de(ye,ye.current&1),t.flags|=128,null):r&t.child.childLanes?yf(e,t,r):(de(ye,ye.current&1),e=er(e,t,r),e!==null?e.sibling:null);de(ye,ye.current&1);break;case 19:if(s=(r&t.childLanes)!==0,e.flags&128){if(s)return Sf(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(ye,ye.current),s)break;return null;case 22:case 23:return t.lanes=0,_f(e,t,r)}return er(e,t,r)}var xf,Ja,bf,wf;xf=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ja=function(){};bf=function(e,t,r,s){var i=e.memoizedProps;if(i!==s){e=t.stateNode,Or(Ht.current);var o=null;switch(r){case"input":i=va(e,i),s=va(e,s),o=[];break;case"select":i=xe({},i,{value:void 0}),s=xe({},s,{value:void 0}),o=[];break;case"textarea":i=xa(e,i),s=xa(e,s),o=[];break;default:typeof i.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Bn)}wa(r,s);var c;r=null;for(f in i)if(!s.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var n=i[f];for(c in n)n.hasOwnProperty(c)&&(r||(r={}),r[c]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ri.hasOwnProperty(f)?o||(o=[]):(o=o||[]).push(f,null));for(f in s){var a=s[f];if(n=i!=null?i[f]:void 0,s.hasOwnProperty(f)&&a!==n&&(a!=null||n!=null))if(f==="style")if(n){for(c in n)!n.hasOwnProperty(c)||a&&a.hasOwnProperty(c)||(r||(r={}),r[c]="");for(c in a)a.hasOwnProperty(c)&&n[c]!==a[c]&&(r||(r={}),r[c]=a[c])}else r||(o||(o=[]),o.push(f,r)),r=a;else f==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,n=n?n.__html:void 0,a!=null&&n!==a&&(o=o||[]).push(f,a)):f==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(f,""+a):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(ri.hasOwnProperty(f)?(a!=null&&f==="onScroll"&&_e("scroll",e),o||n===a||(o=[])):(o=o||[]).push(f,a))}r&&(o=o||[]).push("style",r);var f=o;(t.updateQueue=f)&&(t.flags|=4)}};wf=function(e,t,r,s){r!==s&&(t.flags|=4)};function js(e,t){if(!ve)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,s|=i.subtreeFlags&14680064,s|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function eg(e,t,r){var s=t.pendingProps;switch(Xl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return nt(t.type)&&jn(),$e(t),null;case 3:return s=t.stateNode,vs(),ge(it),ge(Ge),sc(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Lt!==null&&(il(Lt),Lt=null))),Ja(e,t),$e(t),null;case 5:rc(t);var i=Or(pi.current);if(r=t.type,e!==null&&t.stateNode!=null)bf(e,t,r,s,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(K(166));return $e(t),null}if(e=Or(Ht.current),Ki(t)){s=t.stateNode,r=t.type;var o=t.memoizedProps;switch(s[Mt]=t,s[di]=o,e=(t.mode&1)!==0,r){case"dialog":_e("cancel",s),_e("close",s);break;case"iframe":case"object":case"embed":_e("load",s);break;case"video":case"audio":for(i=0;i<Vs.length;i++)_e(Vs[i],s);break;case"source":_e("error",s);break;case"img":case"image":case"link":_e("error",s),_e("load",s);break;case"details":_e("toggle",s);break;case"input":Wc(s,o),_e("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!o.multiple},_e("invalid",s);break;case"textarea":qc(s,o),_e("invalid",s)}wa(r,o),i=null;for(var c in o)if(o.hasOwnProperty(c)){var n=o[c];c==="children"?typeof n=="string"?s.textContent!==n&&(o.suppressHydrationWarning!==!0&&qi(s.textContent,n,e),i=["children",n]):typeof n=="number"&&s.textContent!==""+n&&(o.suppressHydrationWarning!==!0&&qi(s.textContent,n,e),i=["children",""+n]):ri.hasOwnProperty(c)&&n!=null&&c==="onScroll"&&_e("scroll",s)}switch(r){case"input":Ii(s),Vc(s,o,!0);break;case"textarea":Ii(s),Kc(s);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(s.onclick=Bn)}s=i,t.updateQueue=s,s!==null&&(t.flags|=4)}else{c=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jh(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=c.createElement(r,{is:s.is}):(e=c.createElement(r),r==="select"&&(c=e,s.multiple?c.multiple=!0:s.size&&(c.size=s.size))):e=c.createElementNS(e,r),e[Mt]=t,e[di]=s,xf(e,t,!1,!1),t.stateNode=e;e:{switch(c=Ca(r,s),r){case"dialog":_e("cancel",e),_e("close",e),i=s;break;case"iframe":case"object":case"embed":_e("load",e),i=s;break;case"video":case"audio":for(i=0;i<Vs.length;i++)_e(Vs[i],e);i=s;break;case"source":_e("error",e),i=s;break;case"img":case"image":case"link":_e("error",e),_e("load",e),i=s;break;case"details":_e("toggle",e),i=s;break;case"input":Wc(e,s),i=va(e,s),_e("invalid",e);break;case"option":i=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},i=xe({},s,{value:void 0}),_e("invalid",e);break;case"textarea":qc(e,s),i=xa(e,s),_e("invalid",e);break;default:i=s}wa(r,i),n=i;for(o in n)if(n.hasOwnProperty(o)){var a=n[o];o==="style"?Zh(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Qh(e,a)):o==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&si(e,a):typeof a=="number"&&si(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ri.hasOwnProperty(o)?a!=null&&o==="onScroll"&&_e("scroll",e):a!=null&&Nl(e,o,a,c))}switch(r){case"input":Ii(e),Vc(e,s,!1);break;case"textarea":Ii(e),Kc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Sr(s.value));break;case"select":e.multiple=!!s.multiple,o=s.value,o!=null?as(e,!!s.multiple,o,!1):s.defaultValue!=null&&as(e,!!s.multiple,s.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Bn)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $e(t),null;case 6:if(e&&t.stateNode!=null)wf(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(K(166));if(r=Or(pi.current),Or(Ht.current),Ki(t)){if(s=t.stateNode,r=t.memoizedProps,s[Mt]=t,(o=s.nodeValue!==r)&&(e=ht,e!==null))switch(e.tag){case 3:qi(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&qi(s.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[Mt]=t,t.stateNode=s}return $e(t),null;case 13:if(ge(ye),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ve&&ut!==null&&t.mode&1&&!(t.flags&128))Hd(),_s(),t.flags|=98560,o=!1;else if(o=Ki(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(K(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(K(317));o[Mt]=t}else _s(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),o=!1}else Lt!==null&&(il(Lt),Lt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ye.current&1?Le===0&&(Le=3):mc())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return vs(),Ja(e,t),e===null&&ui(t.stateNode.containerInfo),$e(t),null;case 10:return Yl(t.type._context),$e(t),null;case 17:return nt(t.type)&&jn(),$e(t),null;case 19:if(ge(ye),o=t.memoizedState,o===null)return $e(t),null;if(s=(t.flags&128)!==0,c=o.rendering,c===null)if(s)js(o,!1);else{if(Le!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=$n(e),c!==null){for(t.flags|=128,js(o,!1),s=c.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)o=r,e=s,o.flags&=14680066,c=o.alternate,c===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return de(ye,ye.current&1|2),t.child}e=e.sibling}o.tail!==null&&we()>Ss&&(t.flags|=128,s=!0,js(o,!1),t.lanes=4194304)}else{if(!s)if(e=$n(c),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),js(o,!0),o.tail===null&&o.tailMode==="hidden"&&!c.alternate&&!ve)return $e(t),null}else 2*we()-o.renderingStartTime>Ss&&r!==1073741824&&(t.flags|=128,s=!0,js(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(r=o.last,r!==null?r.sibling=c:t.child=c,o.last=c)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=we(),t.sibling=null,r=ye.current,de(ye,s?r&1|2:r&1),t):($e(t),null);case 22:case 23:return pc(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?lt&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function tg(e,t){switch(Xl(t),t.tag){case 1:return nt(t.type)&&jn(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(),ge(it),ge(Ge),sc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return rc(t),null;case 13:if(ge(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));_s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(ye),null;case 4:return vs(),null;case 10:return Yl(t.type._context),null;case 22:case 23:return pc(),null;case 24:return null;default:return null}}var Ji=!1,qe=!1,rg=typeof WeakSet=="function"?WeakSet:Set,Q=null;function ns(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){be(e,t,s)}else r.current=null}function Qa(e,t,r){try{r()}catch(s){be(e,t,s)}}var ju=!1;function sg(e,t){if(Pa=On,e=Rd(),ql(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var i=s.anchorOffset,o=s.focusNode;s=s.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var c=0,n=-1,a=-1,f=0,m=0,p=e,_=null;t:for(;;){for(var S;p!==r||i!==0&&p.nodeType!==3||(n=c+i),p!==o||s!==0&&p.nodeType!==3||(a=c+s),p.nodeType===3&&(c+=p.nodeValue.length),(S=p.firstChild)!==null;)_=p,p=S;for(;;){if(p===e)break t;if(_===r&&++f===i&&(n=c),_===o&&++m===s&&(a=c),(S=p.nextSibling)!==null)break;p=_,_=p.parentNode}p=S}r=n===-1||a===-1?null:{start:n,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ba={focusedElem:e,selectionRange:r},On=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var y=b.memoizedProps,u=b.memoizedState,h=t.stateNode,l=h.getSnapshotBeforeUpdate(t.elementType===t.type?y:kt(t.type,y),u);h.__reactInternalSnapshotBeforeUpdate=l}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(g){be(t,t.return,g)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return b=ju,ju=!1,b}function Zs(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Qa(t,r,o)}i=i.next}while(i!==s)}}function lo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function Ya(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Cf(e){var t=e.alternate;t!==null&&(e.alternate=null,Cf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mt],delete t[di],delete t[Ia],delete t[F_],delete t[H_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ef(e){return e.tag===5||e.tag===3||e.tag===4}function Mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ef(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.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 Za(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Bn));else if(s!==4&&(e=e.child,e!==null))for(Za(e,t,r),e=e.sibling;e!==null;)Za(e,t,r),e=e.sibling}function el(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(el(e,t,r),e=e.sibling;e!==null;)el(e,t,r),e=e.sibling}var je=null,Rt=!1;function rr(e,t,r){for(r=r.child;r!==null;)kf(e,t,r),r=r.sibling}function kf(e,t,r){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(eo,r)}catch{}switch(r.tag){case 5:qe||ns(r,t);case 6:var s=je,i=Rt;je=null,rr(e,t,r),je=s,Rt=i,je!==null&&(Rt?(e=je,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):je.removeChild(r.stateNode));break;case 18:je!==null&&(Rt?(e=je,r=r.stateNode,e.nodeType===8?Uo(e.parentNode,r):e.nodeType===1&&Uo(e,r),ai(e)):Uo(je,r.stateNode));break;case 4:s=je,i=Rt,je=r.stateNode.containerInfo,Rt=!0,rr(e,t,r),je=s,Rt=i;break;case 0:case 11:case 14:case 15:if(!qe&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){i=s=s.next;do{var o=i,c=o.destroy;o=o.tag,c!==void 0&&(o&2||o&4)&&Qa(r,t,c),i=i.next}while(i!==s)}rr(e,t,r);break;case 1:if(!qe&&(ns(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(n){be(r,t,n)}rr(e,t,r);break;case 21:rr(e,t,r);break;case 22:r.mode&1?(qe=(s=qe)||r.memoizedState!==null,rr(e,t,r),qe=s):rr(e,t,r);break;default:rr(e,t,r)}}function Iu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new rg),t.forEach(function(s){var i=dg.bind(null,e,s);r.has(s)||(r.add(s),s.then(i,i))})}}function Et(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var i=r[s];try{var o=e,c=t,n=c;e:for(;n!==null;){switch(n.tag){case 5:je=n.stateNode,Rt=!1;break e;case 3:je=n.stateNode.containerInfo,Rt=!0;break e;case 4:je=n.stateNode.containerInfo,Rt=!0;break e}n=n.return}if(je===null)throw Error(K(160));kf(o,c,i),je=null,Rt=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(f){be(i,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Rf(t,e),t=t.sibling}function Rf(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Et(t,e),Bt(e),s&4){try{Zs(3,e,e.return),lo(3,e)}catch(y){be(e,e.return,y)}try{Zs(5,e,e.return)}catch(y){be(e,e.return,y)}}break;case 1:Et(t,e),Bt(e),s&512&&r!==null&&ns(r,r.return);break;case 5:if(Et(t,e),Bt(e),s&512&&r!==null&&ns(r,r.return),e.flags&32){var i=e.stateNode;try{si(i,"")}catch(y){be(e,e.return,y)}}if(s&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,c=r!==null?r.memoizedProps:o,n=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{n==="input"&&o.type==="radio"&&o.name!=null&&Xh(i,o),Ca(n,c);var f=Ca(n,o);for(c=0;c<a.length;c+=2){var m=a[c],p=a[c+1];m==="style"?Zh(i,p):m==="dangerouslySetInnerHTML"?Qh(i,p):m==="children"?si(i,p):Nl(i,m,p,f)}switch(n){case"input":ya(i,o);break;case"textarea":Gh(i,o);break;case"select":var _=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var S=o.value;S!=null?as(i,!!o.multiple,S,!1):_!==!!o.multiple&&(o.defaultValue!=null?as(i,!!o.multiple,o.defaultValue,!0):as(i,!!o.multiple,o.multiple?[]:"",!1))}i[di]=o}catch(y){be(e,e.return,y)}}break;case 6:if(Et(t,e),Bt(e),s&4){if(e.stateNode===null)throw Error(K(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(y){be(e,e.return,y)}}break;case 3:if(Et(t,e),Bt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{ai(t.containerInfo)}catch(y){be(e,e.return,y)}break;case 4:Et(t,e),Bt(e);break;case 13:Et(t,e),Bt(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(dc=we())),s&4&&Iu(e);break;case 22:if(m=r!==null&&r.memoizedState!==null,e.mode&1?(qe=(f=qe)||m,Et(t,e),qe=f):Et(t,e),Bt(e),s&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!m&&e.mode&1)for(Q=e,m=e.child;m!==null;){for(p=Q=m;Q!==null;){switch(_=Q,S=_.child,_.tag){case 0:case 11:case 14:case 15:Zs(4,_,_.return);break;case 1:ns(_,_.return);var b=_.stateNode;if(typeof b.componentWillUnmount=="function"){s=_,r=_.return;try{t=s,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(y){be(s,r,y)}}break;case 5:ns(_,_.return);break;case 22:if(_.memoizedState!==null){Hu(p);continue}}S!==null?(S.return=_,Q=S):Hu(p)}m=m.sibling}e:for(m=null,p=e;;){if(p.tag===5){if(m===null){m=p;try{i=p.stateNode,f?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(n=p.stateNode,a=p.memoizedProps.style,c=a!=null&&a.hasOwnProperty("display")?a.display:null,n.style.display=Yh("display",c))}catch(y){be(e,e.return,y)}}}else if(p.tag===6){if(m===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(y){be(e,e.return,y)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Et(t,e),Bt(e),s&4&&Iu(e);break;case 21:break;default:Et(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Ef(r)){var s=r;break e}r=r.return}throw Error(K(160))}switch(s.tag){case 5:var i=s.stateNode;s.flags&32&&(si(i,""),s.flags&=-33);var o=Mu(e);el(e,o,i);break;case 3:case 4:var c=s.stateNode.containerInfo,n=Mu(e);Za(e,n,c);break;default:throw Error(K(161))}}catch(a){be(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ig(e,t,r){Q=e,Tf(e)}function Tf(e,t,r){for(var s=(e.mode&1)!==0;Q!==null;){var i=Q,o=i.child;if(i.tag===22&&s){var c=i.memoizedState!==null||Ji;if(!c){var n=i.alternate,a=n!==null&&n.memoizedState!==null||qe;n=Ji;var f=qe;if(Ji=c,(qe=a)&&!f)for(Q=i;Q!==null;)c=Q,a=c.child,c.tag===22&&c.memoizedState!==null?Uu(i):a!==null?(a.return=c,Q=a):Uu(i);for(;o!==null;)Q=o,Tf(o),o=o.sibling;Q=i,Ji=n,qe=f}Fu(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,Q=o):Fu(e)}}function Fu(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:qe||lo(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!qe)if(r===null)s.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:kt(t.type,r.memoizedProps);s.componentDidUpdate(i,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&wu(t,o,s);break;case 3:var c=t.updateQueue;if(c!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}wu(t,c,r)}break;case 5:var n=t.stateNode;if(r===null&&t.flags&4){r=n;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var m=f.memoizedState;if(m!==null){var p=m.dehydrated;p!==null&&ai(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}qe||t.flags&512&&Ya(t)}catch(_){be(t,t.return,_)}}if(t===e){Q=null;break}if(r=t.sibling,r!==null){r.return=t.return,Q=r;break}Q=t.return}}function Hu(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Q=r;break}Q=t.return}}function Uu(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{lo(4,t)}catch(a){be(t,r,a)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var i=t.return;try{s.componentDidMount()}catch(a){be(t,i,a)}}var o=t.return;try{Ya(t)}catch(a){be(t,o,a)}break;case 5:var c=t.return;try{Ya(t)}catch(a){be(t,c,a)}}}catch(a){be(t,t.return,a)}if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}var ng=Math.ceil,qn=tr.ReactCurrentDispatcher,uc=tr.ReactCurrentOwner,St=tr.ReactCurrentBatchConfig,ae=0,Oe=null,Ee=null,Me=0,lt=0,os=Cr(0),Le=0,vi=null,Hr=0,co=0,hc=0,ei=null,rt=null,dc=0,Ss=1/0,Wt=null,Kn=!1,tl=null,mr=null,Qi=!1,lr=null,Xn=0,ti=0,rl=null,gn=-1,vn=0;function Qe(){return ae&6?we():gn!==-1?gn:gn=we()}function _r(e){return e.mode&1?ae&2&&Me!==0?Me&-Me:z_.transition!==null?(vn===0&&(vn=hd()),vn):(e=ue,e!==0||(e=window.event,e=e===void 0?16:vd(e.type)),e):1}function At(e,t,r,s){if(50<ti)throw ti=0,rl=null,Error(K(185));wi(e,r,s),(!(ae&2)||e!==Oe)&&(e===Oe&&(!(ae&2)&&(co|=r),Le===4&&or(e,Me)),ot(e,s),r===1&&ae===0&&!(t.mode&1)&&(Ss=we()+500,no&&Er()))}function ot(e,t){var r=e.callbackNode;zm(e,t);var s=An(e,e===Oe?Me:0);if(s===0)r!==null&&Jc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&Jc(r),t===1)e.tag===0?U_(zu.bind(null,e)):Md(zu.bind(null,e)),M_(function(){!(ae&6)&&Er()}),r=null;else{switch(dd(s)){case 1:r=Il;break;case 4:r=cd;break;case 16:r=Dn;break;case 536870912:r=ud;break;default:r=Dn}r=jf(r,Lf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Lf(e,t){if(gn=-1,vn=0,ae&6)throw Error(K(327));var r=e.callbackNode;if(ds()&&e.callbackNode!==r)return null;var s=An(e,e===Oe?Me:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Gn(e,s);else{t=s;var i=ae;ae|=2;var o=Af();(Oe!==e||Me!==t)&&(Wt=null,Ss=we()+500,Pr(e,t));do try{lg();break}catch(n){Df(e,n)}while(!0);Ql(),qn.current=o,ae=i,Ee!==null?t=0:(Oe=null,Me=0,t=Le)}if(t!==0){if(t===2&&(i=La(e),i!==0&&(s=i,t=sl(e,i))),t===1)throw r=vi,Pr(e,0),or(e,s),ot(e,we()),r;if(t===6)or(e,s);else{if(i=e.current.alternate,!(s&30)&&!og(i)&&(t=Gn(e,s),t===2&&(o=La(e),o!==0&&(s=o,t=sl(e,o))),t===1))throw r=vi,Pr(e,0),or(e,s),ot(e,we()),r;switch(e.finishedWork=i,e.finishedLanes=s,t){case 0:case 1:throw Error(K(345));case 2:Lr(e,rt,Wt);break;case 3:if(or(e,s),(s&130023424)===s&&(t=dc+500-we(),10<t)){if(An(e,0)!==0)break;if(i=e.suspendedLanes,(i&s)!==s){Qe(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Ma(Lr.bind(null,e,rt,Wt),t);break}Lr(e,rt,Wt);break;case 4:if(or(e,s),(s&4194240)===s)break;for(t=e.eventTimes,i=-1;0<s;){var c=31-Dt(s);o=1<<c,c=t[c],c>i&&(i=c),s&=~o}if(s=i,s=we()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*ng(s/1960))-s,10<s){e.timeoutHandle=Ma(Lr.bind(null,e,rt,Wt),s);break}Lr(e,rt,Wt);break;case 5:Lr(e,rt,Wt);break;default:throw Error(K(329))}}}return ot(e,we()),e.callbackNode===r?Lf.bind(null,e):null}function sl(e,t){var r=ei;return e.current.memoizedState.isDehydrated&&(Pr(e,t).flags|=256),e=Gn(e,t),e!==2&&(t=rt,rt=r,t!==null&&il(t)),e}function il(e){rt===null?rt=e:rt.push.apply(rt,e)}function og(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var i=r[s],o=i.getSnapshot;i=i.value;try{if(!Nt(o(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 or(e,t){for(t&=~hc,t&=~co,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Dt(t),s=1<<r;e[r]=-1,t&=~s}}function zu(e){if(ae&6)throw Error(K(327));ds();var t=An(e,0);if(!(t&1))return ot(e,we()),null;var r=Gn(e,t);if(e.tag!==0&&r===2){var s=La(e);s!==0&&(t=s,r=sl(e,s))}if(r===1)throw r=vi,Pr(e,0),or(e,t),ot(e,we()),r;if(r===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Lr(e,rt,Wt),ot(e,we()),null}function fc(e,t){var r=ae;ae|=1;try{return e(t)}finally{ae=r,ae===0&&(Ss=we()+500,no&&Er())}}function Ur(e){lr!==null&&lr.tag===0&&!(ae&6)&&ds();var t=ae;ae|=1;var r=St.transition,s=ue;try{if(St.transition=null,ue=1,e)return e()}finally{ue=s,St.transition=r,ae=t,!(ae&6)&&Er()}}function pc(){lt=os.current,ge(os)}function Pr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,j_(r)),Ee!==null)for(r=Ee.return;r!==null;){var s=r;switch(Xl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&jn();break;case 3:vs(),ge(it),ge(Ge),sc();break;case 5:rc(s);break;case 4:vs();break;case 13:ge(ye);break;case 19:ge(ye);break;case 10:Yl(s.type._context);break;case 22:case 23:pc()}r=r.return}if(Oe=e,Ee=e=gr(e.current,null),Me=lt=t,Le=0,vi=null,hc=co=Hr=0,rt=ei=null,Ar!==null){for(t=0;t<Ar.length;t++)if(r=Ar[t],s=r.interleaved,s!==null){r.interleaved=null;var i=s.next,o=r.pending;if(o!==null){var c=o.next;o.next=i,s.next=c}r.pending=s}Ar=null}return e}function Df(e,t){do{var r=Ee;try{if(Ql(),pn.current=Vn,Wn){for(var s=Se.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}Wn=!1}if(Fr=0,Ae=Te=Se=null,Ys=!1,mi=0,uc.current=null,r===null||r.return===null){Le=1,vi=t,Ee=null;break}e:{var o=e,c=r.return,n=r,a=t;if(t=Me,n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var f=a,m=n,p=m.tag;if(!(m.mode&1)&&(p===0||p===11||p===15)){var _=m.alternate;_?(m.updateQueue=_.updateQueue,m.memoizedState=_.memoizedState,m.lanes=_.lanes):(m.updateQueue=null,m.memoizedState=null)}var S=Lu(c);if(S!==null){S.flags&=-257,Du(S,c,n,o,t),S.mode&1&&Tu(o,f,t),t=S,a=f;var b=t.updateQueue;if(b===null){var y=new Set;y.add(a),t.updateQueue=y}else b.add(a);break e}else{if(!(t&1)){Tu(o,f,t),mc();break e}a=Error(K(426))}}else if(ve&&n.mode&1){var u=Lu(c);if(u!==null){!(u.flags&65536)&&(u.flags|=256),Du(u,c,n,o,t),Gl(ys(a,n));break e}}o=a=ys(a,n),Le!==4&&(Le=2),ei===null?ei=[o]:ei.push(o),o=c;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var h=ff(o,a,t);bu(o,h);break e;case 1:n=a;var l=o.type,d=o.stateNode;if(!(o.flags&128)&&(typeof l.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(mr===null||!mr.has(d)))){o.flags|=65536,t&=-t,o.lanes|=t;var g=pf(o,n,t);bu(o,g);break e}}o=o.return}while(o!==null)}Nf(r)}catch(x){t=x,Ee===r&&r!==null&&(Ee=r=r.return);continue}break}while(!0)}function Af(){var e=qn.current;return qn.current=Vn,e===null?Vn:e}function mc(){(Le===0||Le===3||Le===2)&&(Le=4),Oe===null||!(Hr&268435455)&&!(co&268435455)||or(Oe,Me)}function Gn(e,t){var r=ae;ae|=2;var s=Af();(Oe!==e||Me!==t)&&(Wt=null,Pr(e,t));do try{ag();break}catch(i){Df(e,i)}while(!0);if(Ql(),ae=r,qn.current=s,Ee!==null)throw Error(K(261));return Oe=null,Me=0,Le}function ag(){for(;Ee!==null;)Of(Ee)}function lg(){for(;Ee!==null&&!Nm();)Of(Ee)}function Of(e){var t=Bf(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?Nf(e):Ee=t,uc.current=null}function Nf(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=tg(r,t),r!==null){r.flags&=32767,Ee=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Le=6,Ee=null;return}}else if(r=eg(r,t,lt),r!==null){Ee=r;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Le===0&&(Le=5)}function Lr(e,t,r){var s=ue,i=St.transition;try{St.transition=null,ue=1,cg(e,t,r,s)}finally{St.transition=i,ue=s}return null}function cg(e,t,r,s){do ds();while(lr!==null);if(ae&6)throw Error(K(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if($m(e,o),e===Oe&&(Ee=Oe=null,Me=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Qi||(Qi=!0,jf(Dn,function(){return ds(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=St.transition,St.transition=null;var c=ue;ue=1;var n=ae;ae|=4,uc.current=null,sg(e,r),Rf(r,e),L_(Ba),On=!!Pa,Ba=Pa=null,e.current=r,ig(r),Pm(),ae=n,ue=c,St.transition=o}else e.current=r;if(Qi&&(Qi=!1,lr=e,Xn=i),o=e.pendingLanes,o===0&&(mr=null),Mm(r.stateNode),ot(e,we()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],s(i.value,{componentStack:i.stack,digest:i.digest});if(Kn)throw Kn=!1,e=tl,tl=null,e;return Xn&1&&e.tag!==0&&ds(),o=e.pendingLanes,o&1?e===rl?ti++:(ti=0,rl=e):ti=0,Er(),null}function ds(){if(lr!==null){var e=dd(Xn),t=St.transition,r=ue;try{if(St.transition=null,ue=16>e?16:e,lr===null)var s=!1;else{if(e=lr,lr=null,Xn=0,ae&6)throw Error(K(331));var i=ae;for(ae|=4,Q=e.current;Q!==null;){var o=Q,c=o.child;if(Q.flags&16){var n=o.deletions;if(n!==null){for(var a=0;a<n.length;a++){var f=n[a];for(Q=f;Q!==null;){var m=Q;switch(m.tag){case 0:case 11:case 15:Zs(8,m,o)}var p=m.child;if(p!==null)p.return=m,Q=p;else for(;Q!==null;){m=Q;var _=m.sibling,S=m.return;if(Cf(m),m===f){Q=null;break}if(_!==null){_.return=S,Q=_;break}Q=S}}}var b=o.alternate;if(b!==null){var y=b.child;if(y!==null){b.child=null;do{var u=y.sibling;y.sibling=null,y=u}while(y!==null)}}Q=o}}if(o.subtreeFlags&2064&&c!==null)c.return=o,Q=c;else e:for(;Q!==null;){if(o=Q,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Zs(9,o,o.return)}var h=o.sibling;if(h!==null){h.return=o.return,Q=h;break e}Q=o.return}}var l=e.current;for(Q=l;Q!==null;){c=Q;var d=c.child;if(c.subtreeFlags&2064&&d!==null)d.return=c,Q=d;else e:for(c=l;Q!==null;){if(n=Q,n.flags&2048)try{switch(n.tag){case 0:case 11:case 15:lo(9,n)}}catch(x){be(n,n.return,x)}if(n===c){Q=null;break e}var g=n.sibling;if(g!==null){g.return=n.return,Q=g;break e}Q=n.return}}if(ae=i,Er(),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(eo,e)}catch{}s=!0}return s}finally{ue=r,St.transition=t}}return!1}function $u(e,t,r){t=ys(r,t),t=ff(e,t,1),e=pr(e,t,1),t=Qe(),e!==null&&(wi(e,1,t),ot(e,t))}function be(e,t,r){if(e.tag===3)$u(e,e,r);else for(;t!==null;){if(t.tag===3){$u(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(mr===null||!mr.has(s))){e=ys(r,e),e=pf(t,e,1),t=pr(t,e,1),e=Qe(),t!==null&&(wi(t,1,e),ot(t,e));break}}t=t.return}}function ug(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=Qe(),e.pingedLanes|=e.suspendedLanes&r,Oe===e&&(Me&r)===r&&(Le===4||Le===3&&(Me&130023424)===Me&&500>we()-dc?Pr(e,0):hc|=r),ot(e,t)}function Pf(e,t){t===0&&(e.mode&1?(t=Ui,Ui<<=1,!(Ui&130023424)&&(Ui=4194304)):t=1);var r=Qe();e=Zt(e,t),e!==null&&(wi(e,t,r),ot(e,r))}function hg(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Pf(e,r)}function dg(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(K(314))}s!==null&&s.delete(t),Pf(e,r)}var Bf;Bf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||it.current)st=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return st=!1,Z_(e,t,r);st=!!(e.flags&131072)}else st=!1,ve&&t.flags&1048576&&Id(t,Fn,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;_n(e,t),e=t.pendingProps;var i=ms(t,Ge.current);hs(t,r),i=nc(null,t,s,e,i,r);var o=oc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,nt(s)?(o=!0,Mn(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ec(t),i.updater=ao,t.stateNode=i,i._reactInternals=t,Wa(t,s,e,r),t=Ka(null,t,s,!0,o,r)):(t.tag=0,ve&&o&&Kl(t),Je(null,t,i,r),t=t.child),t;case 16:s=t.elementType;e:{switch(_n(e,t),e=t.pendingProps,i=s._init,s=i(s._payload),t.type=s,i=t.tag=pg(s),e=kt(s,e),i){case 0:t=qa(null,t,s,e,r);break e;case 1:t=Nu(null,t,s,e,r);break e;case 11:t=Au(null,t,s,e,r);break e;case 14:t=Ou(null,t,s,kt(s.type,e),r);break e}throw Error(K(306,s,""))}return t;case 0:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:kt(s,i),qa(e,t,s,i,r);case 1:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:kt(s,i),Nu(e,t,s,i,r);case 3:e:{if(vf(t),e===null)throw Error(K(387));s=t.pendingProps,o=t.memoizedState,i=o.element,Wd(e,t),zn(t,s,null,r);var c=t.memoizedState;if(s=c.element,o.isDehydrated)if(o={element:s,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ys(Error(K(423)),t),t=Pu(e,t,s,r,i);break e}else if(s!==i){i=ys(Error(K(424)),t),t=Pu(e,t,s,r,i);break e}else for(ut=fr(t.stateNode.containerInfo.firstChild),ht=t,ve=!0,Lt=null,r=zd(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(_s(),s===i){t=er(e,t,r);break e}Je(e,t,s,r)}t=t.child}return t;case 5:return Vd(t),e===null&&Ua(t),s=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,c=i.children,ja(s,i)?c=null:o!==null&&ja(s,o)&&(t.flags|=32),gf(e,t),Je(e,t,c,r),t.child;case 6:return e===null&&Ua(t),null;case 13:return yf(e,t,r);case 4:return tc(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gs(t,null,s,r):Je(e,t,s,r),t.child;case 11:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:kt(s,i),Au(e,t,s,i,r);case 7:return Je(e,t,t.pendingProps,r),t.child;case 8:return Je(e,t,t.pendingProps.children,r),t.child;case 12:return Je(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,i=t.pendingProps,o=t.memoizedProps,c=i.value,de(Hn,s._currentValue),s._currentValue=c,o!==null)if(Nt(o.value,c)){if(o.children===i.children&&!it.current){t=er(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var n=o.dependencies;if(n!==null){c=o.child;for(var a=n.firstContext;a!==null;){if(a.context===s){if(o.tag===1){a=Jt(-1,r&-r),a.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var m=f.pending;m===null?a.next=a:(a.next=m.next,m.next=a),f.pending=a}}o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),za(o.return,r,t),n.lanes|=r;break}a=a.next}}else if(o.tag===10)c=o.type===t.type?null:o.child;else if(o.tag===18){if(c=o.return,c===null)throw Error(K(341));c.lanes|=r,n=c.alternate,n!==null&&(n.lanes|=r),za(c,r,t),c=o.sibling}else c=o.child;if(c!==null)c.return=o;else for(c=o;c!==null;){if(c===t){c=null;break}if(o=c.sibling,o!==null){o.return=c.return,c=o;break}c=c.return}o=c}Je(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,s=t.pendingProps.children,hs(t,r),i=xt(i),s=s(i),t.flags|=1,Je(e,t,s,r),t.child;case 14:return s=t.type,i=kt(s,t.pendingProps),i=kt(s.type,i),Ou(e,t,s,i,r);case 15:return mf(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,i=t.pendingProps,i=t.elementType===s?i:kt(s,i),_n(e,t),t.tag=1,nt(s)?(e=!0,Mn(t)):e=!1,hs(t,r),df(t,s,i),Wa(t,s,i,r),Ka(null,t,s,!0,e,r);case 19:return Sf(e,t,r);case 22:return _f(e,t,r)}throw Error(K(156,t.tag))};function jf(e,t){return ld(e,t)}function fg(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,r,s){return new fg(e,t,r,s)}function _c(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pg(e){if(typeof e=="function")return _c(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Bl)return 11;if(e===jl)return 14}return 2}function gr(e,t){var r=e.alternate;return r===null?(r=yt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function yn(e,t,r,s,i,o){var c=2;if(s=e,typeof e=="function")_c(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case Jr:return Br(r.children,i,o,t);case Pl:c=8,i|=8;break;case pa:return e=yt(12,r,t,i|2),e.elementType=pa,e.lanes=o,e;case ma:return e=yt(13,r,t,i),e.elementType=ma,e.lanes=o,e;case _a:return e=yt(19,r,t,i),e.elementType=_a,e.lanes=o,e;case Vh:return uo(r,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $h:c=10;break e;case Wh:c=9;break e;case Bl:c=11;break e;case jl:c=14;break e;case sr:c=16,s=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=yt(c,r,t,i),t.elementType=e,t.type=s,t.lanes=o,t}function Br(e,t,r,s){return e=yt(7,e,s,t),e.lanes=r,e}function uo(e,t,r,s){return e=yt(22,e,s,t),e.elementType=Vh,e.lanes=r,e.stateNode={isHidden:!1},e}function Go(e,t,r){return e=yt(6,e,null,t),e.lanes=r,e}function Jo(e,t,r){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mg(e,t,r,s,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Do(0),this.expirationTimes=Do(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Do(0),this.identifierPrefix=s,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gc(e,t,r,s,i,o,c,n,a){return e=new mg(e,t,r,n,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=yt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ec(o),e}function _g(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Gr,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function Mf(e){if(!e)return xr;e=e._reactInternals;e:{if(Wr(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(nt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var r=e.type;if(nt(r))return jd(e,r,t)}return t}function If(e,t,r,s,i,o,c,n,a){return e=gc(r,s,!0,e,i,o,c,n,a),e.context=Mf(null),r=e.current,s=Qe(),i=_r(r),o=Jt(s,i),o.callback=t??null,pr(r,o,i),e.current.lanes=i,wi(e,i,s),ot(e,s),e}function ho(e,t,r,s){var i=t.current,o=Qe(),c=_r(i);return r=Mf(r),t.context===null?t.context=r:t.pendingContext=r,t=Jt(o,c),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=pr(i,t,c),e!==null&&(At(e,i,c,o),fn(e,i,c)),c}function Jn(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Wu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function vc(e,t){Wu(e,t),(e=e.alternate)&&Wu(e,t)}function gg(){return null}var Ff=typeof reportError=="function"?reportError:function(e){console.error(e)};function yc(e){this._internalRoot=e}fo.prototype.render=yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));ho(e,t,null,null)};fo.prototype.unmount=yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ur(function(){ho(null,e,null,null)}),t[Yt]=null}};function fo(e){this._internalRoot=e}fo.prototype.unstable_scheduleHydration=function(e){if(e){var t=md();e={blockedOn:null,target:e,priority:t};for(var r=0;r<nr.length&&t!==0&&t<nr[r].priority;r++);nr.splice(r,0,e),r===0&&gd(e)}};function Sc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function po(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vu(){}function vg(e,t,r,s,i){if(i){if(typeof s=="function"){var o=s;s=function(){var f=Jn(c);o.call(f)}}var c=If(t,s,e,0,null,!1,!1,"",Vu);return e._reactRootContainer=c,e[Yt]=c.current,ui(e.nodeType===8?e.parentNode:e),Ur(),c}for(;i=e.lastChild;)e.removeChild(i);if(typeof s=="function"){var n=s;s=function(){var f=Jn(a);n.call(f)}}var a=gc(e,0,!1,null,null,!1,!1,"",Vu);return e._reactRootContainer=a,e[Yt]=a.current,ui(e.nodeType===8?e.parentNode:e),Ur(function(){ho(t,a,r,s)}),a}function mo(e,t,r,s,i){var o=r._reactRootContainer;if(o){var c=o;if(typeof i=="function"){var n=i;i=function(){var a=Jn(c);n.call(a)}}ho(t,c,e,i)}else c=vg(r,t,e,i,s);return Jn(c)}fd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ws(t.pendingLanes);r!==0&&(Fl(t,r|1),ot(t,we()),!(ae&6)&&(Ss=we()+500,Er()))}break;case 13:Ur(function(){var s=Zt(e,1);if(s!==null){var i=Qe();At(s,e,1,i)}}),vc(e,1)}};Hl=function(e){if(e.tag===13){var t=Zt(e,134217728);if(t!==null){var r=Qe();At(t,e,134217728,r)}vc(e,134217728)}};pd=function(e){if(e.tag===13){var t=_r(e),r=Zt(e,t);if(r!==null){var s=Qe();At(r,e,t,s)}vc(e,t)}};md=function(){return ue};_d=function(e,t){var r=ue;try{return ue=e,t()}finally{ue=r}};ka=function(e,t,r){switch(t){case"input":if(ya(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var i=io(s);if(!i)throw Error(K(90));Kh(s),ya(s,i)}}}break;case"textarea":Gh(e,r);break;case"select":t=r.value,t!=null&&as(e,!!r.multiple,t,!1)}};rd=fc;sd=Ur;var yg={usingClientEntryPoint:!1,Events:[Ei,es,io,ed,td,fc]},Ms={findFiberByHostInstance:Dr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Sg={bundleType:Ms.bundleType,version:Ms.version,rendererPackageName:Ms.rendererPackageName,rendererConfig:Ms.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:tr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=od(e),e===null?null:e.stateNode},findFiberByHostInstance:Ms.findFiberByHostInstance||gg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yi.isDisabled&&Yi.supportsFiber)try{eo=Yi.inject(Sg),Ft=Yi}catch{}}ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yg;ft.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sc(t))throw Error(K(200));return _g(e,t,null,r)};ft.createRoot=function(e,t){if(!Sc(e))throw Error(K(299));var r=!1,s="",i=Ff;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=gc(e,1,!1,null,null,r,!1,s,i),e[Yt]=t.current,ui(e.nodeType===8?e.parentNode:e),new yc(t)};ft.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=od(t),e=e===null?null:e.stateNode,e};ft.flushSync=function(e){return Ur(e)};ft.hydrate=function(e,t,r){if(!po(t))throw Error(K(200));return mo(null,e,t,!0,r)};ft.hydrateRoot=function(e,t,r){if(!Sc(e))throw Error(K(405));var s=r!=null&&r.hydratedSources||null,i=!1,o="",c=Ff;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(c=r.onRecoverableError)),t=If(t,null,e,1,r??null,i,!1,o,c),e[Yt]=t.current,ui(e),s)for(e=0;e<s.length;e++)r=s[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new fo(t)};ft.render=function(e,t,r){if(!po(t))throw Error(K(200));return mo(null,e,t,!1,r)};ft.unmountComponentAtNode=function(e){if(!po(e))throw Error(K(40));return e._reactRootContainer?(Ur(function(){mo(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1};ft.unstable_batchedUpdates=fc;ft.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!po(r))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return mo(e,t,r,!1,s)};ft.version="18.3.1-next-f1338f8080-20240426";function Hf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hf)}catch(e){console.error(e)}}Hf(),Fh.exports=ft;var xg=Fh.exports,qu=xg;da.createRoot=qu.createRoot,da.hydrateRoot=qu.hydrateRoot;/**
|
||
* @remix-run/router v1.23.2
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function yi(){return yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},yi.apply(this,arguments)}var cr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(cr||(cr={}));const Ku="popstate";function bg(e){e===void 0&&(e={});function t(s,i){let{pathname:o,search:c,hash:n}=s.location;return nl("",{pathname:o,search:c,hash:n},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(s,i){return typeof i=="string"?i:Qn(i)}return Cg(t,r,null,e)}function Re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function xc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wg(){return Math.random().toString(36).substr(2,8)}function Xu(e,t){return{usr:e.state,key:e.key,idx:t}}function nl(e,t,r,s){return r===void 0&&(r=null),yi({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ks(t):t,{state:r,key:t&&t.key||s||wg()})}function Qn(e){let{pathname:t="/",search:r="",hash:s=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function ks(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Cg(e,t,r,s){s===void 0&&(s={});let{window:i=document.defaultView,v5Compat:o=!1}=s,c=i.history,n=cr.Pop,a=null,f=m();f==null&&(f=0,c.replaceState(yi({},c.state,{idx:f}),""));function m(){return(c.state||{idx:null}).idx}function p(){n=cr.Pop;let u=m(),h=u==null?null:u-f;f=u,a&&a({action:n,location:y.location,delta:h})}function _(u,h){n=cr.Push;let l=nl(y.location,u,h);f=m()+1;let d=Xu(l,f),g=y.createHref(l);try{c.pushState(d,"",g)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;i.location.assign(g)}o&&a&&a({action:n,location:y.location,delta:1})}function S(u,h){n=cr.Replace;let l=nl(y.location,u,h);f=m();let d=Xu(l,f),g=y.createHref(l);c.replaceState(d,"",g),o&&a&&a({action:n,location:y.location,delta:0})}function b(u){let h=i.location.origin!=="null"?i.location.origin:i.location.href,l=typeof u=="string"?u:Qn(u);return l=l.replace(/ $/,"%20"),Re(h,"No window.location.(origin|href) available to create URL for href: "+l),new URL(l,h)}let y={get action(){return n},get location(){return e(i,c)},listen(u){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(Ku,p),a=u,()=>{i.removeEventListener(Ku,p),a=null}},createHref(u){return t(i,u)},createURL:b,encodeLocation(u){let h=b(u);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:_,replace:S,go(u){return c.go(u)}};return y}var Gu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Gu||(Gu={}));function Eg(e,t,r){return r===void 0&&(r="/"),kg(e,t,r)}function kg(e,t,r,s){let i=typeof t=="string"?ks(t):t,o=bc(i.pathname||"/",r);if(o==null)return null;let c=Uf(e);Rg(c);let n=null;for(let a=0;n==null&&a<c.length;++a){let f=Fg(o);n=jg(c[a],f)}return n}function Uf(e,t,r,s){t===void 0&&(t=[]),r===void 0&&(r=[]),s===void 0&&(s="");let i=(o,c,n)=>{let a={relativePath:n===void 0?o.path||"":n,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};a.relativePath.startsWith("/")&&(Re(a.relativePath.startsWith(s),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(s.length));let f=vr([s,a.relativePath]),m=r.concat(a);o.children&&o.children.length>0&&(Re(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),Uf(o.children,t,m,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:Pg(f,o.index),routesMeta:m})};return e.forEach((o,c)=>{var n;if(o.path===""||!((n=o.path)!=null&&n.includes("?")))i(o,c);else for(let a of zf(o.path))i(o,c,a)}),t}function zf(e){let t=e.split("/");if(t.length===0)return[];let[r,...s]=t,i=r.endsWith("?"),o=r.replace(/\?$/,"");if(s.length===0)return i?[o,""]:[o];let c=zf(s.join("/")),n=[];return n.push(...c.map(a=>a===""?o:[o,a].join("/"))),i&&n.push(...c),n.map(a=>e.startsWith("/")&&a===""?"/":a)}function Rg(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Bg(t.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}const Tg=/^:[\w-]+$/,Lg=3,Dg=2,Ag=1,Og=10,Ng=-2,Ju=e=>e==="*";function Pg(e,t){let r=e.split("/"),s=r.length;return r.some(Ju)&&(s+=Ng),t&&(s+=Dg),r.filter(i=>!Ju(i)).reduce((i,o)=>i+(Tg.test(o)?Lg:o===""?Ag:Og),s)}function Bg(e,t){return e.length===t.length&&e.slice(0,-1).every((s,i)=>s===t[i])?e[e.length-1]-t[t.length-1]:0}function jg(e,t,r){let{routesMeta:s}=e,i={},o="/",c=[];for(let n=0;n<s.length;++n){let a=s[n],f=n===s.length-1,m=o==="/"?t:t.slice(o.length)||"/",p=Mg({path:a.relativePath,caseSensitive:a.caseSensitive,end:f},m),_=a.route;if(!p)return null;Object.assign(i,p.params),c.push({params:i,pathname:vr([o,p.pathname]),pathnameBase:Wg(vr([o,p.pathnameBase])),route:_}),p.pathnameBase!=="/"&&(o=vr([o,p.pathnameBase]))}return c}function Mg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=Ig(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let o=i[0],c=o.replace(/(.)\/+$/,"$1"),n=i.slice(1);return{params:s.reduce((f,m,p)=>{let{paramName:_,isOptional:S}=m;if(_==="*"){let y=n[p]||"";c=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const b=n[p];return S&&!b?f[_]=void 0:f[_]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:c,pattern:e}}function Ig(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),xc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,n,a)=>(s.push({paramName:n,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),s]}function Fg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function bc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}const Hg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ug=e=>Hg.test(e);function zg(e,t){t===void 0&&(t="/");let{pathname:r,search:s="",hash:i=""}=typeof e=="string"?ks(e):e,o;if(r)if(Ug(r))o=r;else{if(r.includes("//")){let c=r;r=r.replace(/\/\/+/g,"/"),xc(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+r))}r.startsWith("/")?o=Qu(r.substring(1),"/"):o=Qu(r,t)}else o=t;return{pathname:o,search:Vg(s),hash:qg(i)}}function Qu(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Qo(e,t,r,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function $g(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $f(e,t){let r=$g(e);return t?r.map((s,i)=>i===r.length-1?s.pathname:s.pathnameBase):r.map(s=>s.pathnameBase)}function Wf(e,t,r,s){s===void 0&&(s=!1);let i;typeof e=="string"?i=ks(e):(i=yi({},e),Re(!i.pathname||!i.pathname.includes("?"),Qo("?","pathname","search",i)),Re(!i.pathname||!i.pathname.includes("#"),Qo("#","pathname","hash",i)),Re(!i.search||!i.search.includes("#"),Qo("#","search","hash",i)));let o=e===""||i.pathname==="",c=o?"/":i.pathname,n;if(c==null)n=r;else{let p=t.length-1;if(!s&&c.startsWith("..")){let _=c.split("/");for(;_[0]==="..";)_.shift(),p-=1;i.pathname=_.join("/")}n=p>=0?t[p]:"/"}let a=zg(i,n),f=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&r.endsWith("/");return!a.pathname.endsWith("/")&&(f||m)&&(a.pathname+="/"),a}const vr=e=>e.join("/").replace(/\/\/+/g,"/"),Wg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Kg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Vf=["post","put","patch","delete"];new Set(Vf);const Xg=["get",...Vf];new Set(Xg);/**
|
||
* React Router v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Si.apply(this,arguments)}const wc=M.createContext(null),Gg=M.createContext(null),Vr=M.createContext(null),_o=M.createContext(null),kr=M.createContext({outlet:null,matches:[],isDataRoute:!1}),qf=M.createContext(null);function Jg(e,t){let{relative:r}=t===void 0?{}:t;Ri()||Re(!1);let{basename:s,navigator:i}=M.useContext(Vr),{hash:o,pathname:c,search:n}=Xf(e,{relative:r}),a=c;return s!=="/"&&(a=c==="/"?s:vr([s,c])),i.createHref({pathname:a,search:n,hash:o})}function Ri(){return M.useContext(_o)!=null}function Ti(){return Ri()||Re(!1),M.useContext(_o).location}function Kf(e){M.useContext(Vr).static||M.useLayoutEffect(e)}function Cc(){let{isDataRoute:e}=M.useContext(kr);return e?uv():Qg()}function Qg(){Ri()||Re(!1);let e=M.useContext(wc),{basename:t,future:r,navigator:s}=M.useContext(Vr),{matches:i}=M.useContext(kr),{pathname:o}=Ti(),c=JSON.stringify($f(i,r.v7_relativeSplatPath)),n=M.useRef(!1);return Kf(()=>{n.current=!0}),M.useCallback(function(f,m){if(m===void 0&&(m={}),!n.current)return;if(typeof f=="number"){s.go(f);return}let p=Wf(f,JSON.parse(c),o,m.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:vr([t,p.pathname])),(m.replace?s.replace:s.push)(p,m.state,m)},[t,s,c,o,e])}function Yg(){let{matches:e}=M.useContext(kr),t=e[e.length-1];return t?t.params:{}}function Xf(e,t){let{relative:r}=t===void 0?{}:t,{future:s}=M.useContext(Vr),{matches:i}=M.useContext(kr),{pathname:o}=Ti(),c=JSON.stringify($f(i,s.v7_relativeSplatPath));return M.useMemo(()=>Wf(e,JSON.parse(c),o,r==="path"),[e,c,o,r])}function Zg(e,t){return ev(e,t)}function ev(e,t,r,s){Ri()||Re(!1);let{navigator:i}=M.useContext(Vr),{matches:o}=M.useContext(kr),c=o[o.length-1],n=c?c.params:{};c&&c.pathname;let a=c?c.pathnameBase:"/";c&&c.route;let f=Ti(),m;if(t){var p;let u=typeof t=="string"?ks(t):t;a==="/"||(p=u.pathname)!=null&&p.startsWith(a)||Re(!1),m=u}else m=f;let _=m.pathname||"/",S=_;if(a!=="/"){let u=a.replace(/^\//,"").split("/");S="/"+_.replace(/^\//,"").split("/").slice(u.length).join("/")}let b=Eg(e,{pathname:S}),y=nv(b&&b.map(u=>Object.assign({},u,{params:Object.assign({},n,u.params),pathname:vr([a,i.encodeLocation?i.encodeLocation(u.pathname).pathname:u.pathname]),pathnameBase:u.pathnameBase==="/"?a:vr([a,i.encodeLocation?i.encodeLocation(u.pathnameBase).pathname:u.pathnameBase])})),o,r,s);return t&&y?M.createElement(_o.Provider,{value:{location:Si({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:cr.Pop}},y):y}function tv(){let e=cv(),t=Kg(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},t),r?M.createElement("pre",{style:i},r):null,null)}const rv=M.createElement(tv,null);class sv extends M.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?M.createElement(kr.Provider,{value:this.props.routeContext},M.createElement(qf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function iv(e){let{routeContext:t,match:r,children:s}=e,i=M.useContext(wc);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),M.createElement(kr.Provider,{value:t},s)}function nv(e,t,r,s){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),s===void 0&&(s=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=s)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let c=e,n=(i=r)==null?void 0:i.errors;if(n!=null){let m=c.findIndex(p=>p.route.id&&(n==null?void 0:n[p.route.id])!==void 0);m>=0||Re(!1),c=c.slice(0,Math.min(c.length,m+1))}let a=!1,f=-1;if(r&&s&&s.v7_partialHydration)for(let m=0;m<c.length;m++){let p=c[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=m),p.route.id){let{loaderData:_,errors:S}=r,b=p.route.loader&&_[p.route.id]===void 0&&(!S||S[p.route.id]===void 0);if(p.route.lazy||b){a=!0,f>=0?c=c.slice(0,f+1):c=[c[0]];break}}}return c.reduceRight((m,p,_)=>{let S,b=!1,y=null,u=null;r&&(S=n&&p.route.id?n[p.route.id]:void 0,y=p.route.errorElement||rv,a&&(f<0&&_===0?(hv("route-fallback"),b=!0,u=null):f===_&&(b=!0,u=p.route.hydrateFallbackElement||null)));let h=t.concat(c.slice(0,_+1)),l=()=>{let d;return S?d=y:b?d=u:p.route.Component?d=M.createElement(p.route.Component,null):p.route.element?d=p.route.element:d=m,M.createElement(iv,{match:p,routeContext:{outlet:m,matches:h,isDataRoute:r!=null},children:d})};return r&&(p.route.ErrorBoundary||p.route.errorElement||_===0)?M.createElement(sv,{location:r.location,revalidation:r.revalidation,component:y,error:S,children:l(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):l()},null)}var Gf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Gf||{}),Jf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Jf||{});function ov(e){let t=M.useContext(wc);return t||Re(!1),t}function av(e){let t=M.useContext(Gg);return t||Re(!1),t}function lv(e){let t=M.useContext(kr);return t||Re(!1),t}function Qf(e){let t=lv(),r=t.matches[t.matches.length-1];return r.route.id||Re(!1),r.route.id}function cv(){var e;let t=M.useContext(qf),r=av(),s=Qf();return t!==void 0?t:(e=r.errors)==null?void 0:e[s]}function uv(){let{router:e}=ov(Gf.UseNavigateStable),t=Qf(Jf.UseNavigateStable),r=M.useRef(!1);return Kf(()=>{r.current=!0}),M.useCallback(function(i,o){o===void 0&&(o={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Si({fromRouteId:t},o)))},[e,t])}const Yu={};function hv(e,t,r){Yu[e]||(Yu[e]=!0)}function dv(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ve(e){Re(!1)}function fv(e){let{basename:t="/",children:r=null,location:s,navigationType:i=cr.Pop,navigator:o,static:c=!1,future:n}=e;Ri()&&Re(!1);let a=t.replace(/^\/*/,"/"),f=M.useMemo(()=>({basename:a,navigator:o,static:c,future:Si({v7_relativeSplatPath:!1},n)}),[a,n,o,c]);typeof s=="string"&&(s=ks(s));let{pathname:m="/",search:p="",hash:_="",state:S=null,key:b="default"}=s,y=M.useMemo(()=>{let u=bc(m,a);return u==null?null:{location:{pathname:u,search:p,hash:_,state:S,key:b},navigationType:i}},[a,m,p,_,S,b,i]);return y==null?null:M.createElement(Vr.Provider,{value:f},M.createElement(_o.Provider,{children:r,value:y}))}function pv(e){let{children:t,location:r}=e;return Zg(ol(t),r)}new Promise(()=>{});function ol(e,t){t===void 0&&(t=[]);let r=[];return M.Children.forEach(e,(s,i)=>{if(!M.isValidElement(s))return;let o=[...t,i];if(s.type===M.Fragment){r.push.apply(r,ol(s.props.children,o));return}s.type!==Ve&&Re(!1),!s.props.index||!s.props.children||Re(!1);let c={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=ol(s.props.children,o)),r.push(c)}),r}/**
|
||
* React Router DOM v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},al.apply(this,arguments)}function mv(e,t){if(e==null)return{};var r={},s=Object.keys(e),i,o;for(o=0;o<s.length;o++)i=s[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function _v(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function gv(e,t){return e.button===0&&(!t||t==="_self")&&!_v(e)}const vv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yv="6";try{window.__reactRouterVersion=yv}catch{}const Sv="startTransition",Zu=um[Sv];function xv(e){let{basename:t,children:r,future:s,window:i}=e,o=M.useRef();o.current==null&&(o.current=bg({window:i,v5Compat:!0}));let c=o.current,[n,a]=M.useState({action:c.action,location:c.location}),{v7_startTransition:f}=s||{},m=M.useCallback(p=>{f&&Zu?Zu(()=>a(p)):a(p)},[a,f]);return M.useLayoutEffect(()=>c.listen(m),[c,m]),M.useEffect(()=>dv(s),[s]),M.createElement(fv,{basename:t,children:r,location:n.location,navigationType:n.action,navigator:c,future:s})}const bv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Cv=M.forwardRef(function(t,r){let{onClick:s,relative:i,reloadDocument:o,replace:c,state:n,target:a,to:f,preventScrollReset:m,viewTransition:p}=t,_=mv(t,vv),{basename:S}=M.useContext(Vr),b,y=!1;if(typeof f=="string"&&wv.test(f)&&(b=f,bv))try{let d=new URL(window.location.href),g=f.startsWith("//")?new URL(d.protocol+f):new URL(f),x=bc(g.pathname,S);g.origin===d.origin&&x!=null?f=x+g.search+g.hash:y=!0}catch{}let u=Jg(f,{relative:i}),h=Ev(f,{replace:c,state:n,target:a,preventScrollReset:m,relative:i,viewTransition:p});function l(d){s&&s(d),d.defaultPrevented||h(d)}return M.createElement("a",al({},_,{href:b||u,onClick:y||o?s:l,ref:r,target:a}))});var eh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(eh||(eh={}));var th;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(th||(th={}));function Ev(e,t){let{target:r,replace:s,state:i,preventScrollReset:o,relative:c,viewTransition:n}=t===void 0?{}:t,a=Cc(),f=Ti(),m=Xf(e,{relative:c});return M.useCallback(p=>{if(gv(p,r)){p.preventDefault();let _=s!==void 0?s:Qn(f)===Qn(m);a(e,{replace:_,state:i,preventScrollReset:o,relative:c,viewTransition:n})}},[f,a,m,s,i,r,e,o,c,n])}const kv={user:null,theme:localStorage.getItem("dune-theme")||"emperor",connectionStatus:{database:!0,ssh:!0,bgd:!0,rmq:!0},toasts:[]};let Rv=0;function Tv(e,t){switch(t.type){case"SET_USER":return{...e,user:t.payload};case"SET_THEME":return{...e,theme:t.payload};case"SET_CONNECTION":return{...e,connectionStatus:{...e.connectionStatus,...t.payload}};case"ADD_TOAST":return{...e,toasts:[...e.toasts.slice(-2),{...t.payload,id:++Rv}]};case"REMOVE_TOAST":return{...e,toasts:e.toasts.filter(r=>r.id!==t.payload)};default:return e}}const Yf=M.createContext(null);function Lv({children:e}){const[t,r]=M.useReducer(Tv,kv);return M.useEffect(()=>{document.documentElement.dataset.theme=t.theme,localStorage.setItem("dune-theme",t.theme)},[t.theme]),v.jsx(Yf.Provider,{value:{state:t,dispatch:r},children:e})}function Fe(){const e=M.useContext(Yf);if(!e)throw new Error("useApp must be used within AppProvider");return e}function Dv(){const{dispatch:e}=Fe(),t=M.useRef(null);M.useEffect(()=>{const r=new EventSource("/api/events/stream");return t.current=r,r.onopen=()=>{console.log("[SSE] Connected")},r.addEventListener("battlegroup_update",s=>{try{const i=JSON.parse(s.data);console.log("[SSE] battlegroup_update",i)}catch{}}),r.addEventListener("rmq_health",s=>{try{const i=JSON.parse(s.data);console.log("[SSE] rmq_health",i)}catch{}}),r.addEventListener("connection_status",s=>{try{const i=JSON.parse(s.data);e({type:"SET_CONNECTION",payload:i})}catch{}}),r.addEventListener("chat_message",s=>{try{const i=JSON.parse(s.data);console.log("[SSE] chat_message",i)}catch{}}),r.onerror=()=>{console.warn("[SSE] Connection error")},()=>{r.close()}},[e])}const Av=[{key:"default",label:"Classic Dune"},{key:"atreides",label:"House Atreides"},{key:"harkonnen",label:"House Harkonnen"},{key:"fremen",label:"Fremen"},{key:"bene-gesserit",label:"Bene Gesserit"},{key:"spacing-guild",label:"Spacing Guild"},{key:"emperor",label:"Emperor"},{key:"corrino",label:"House Corrino"},{key:"mentat",label:"Mentat"},{key:"sardaukar",label:"Sardaukar"},{key:"tleilax",label:"Bene Tleilax"},{key:"ordos",label:"House Ordos"},{key:"ix",label:"Ix"},{key:"choam",label:"CHOAM"}];function Ov(){const{state:e,dispatch:t}=Fe(),[r,s]=M.useState(!1),i=M.useRef(null);return M.useEffect(()=>{function o(c){i.current&&!i.current.contains(c.target)&&s(!1)}return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),v.jsxs("div",{className:"relative",ref:i,children:[v.jsx("button",{onClick:()=>s(!r),className:"w-6 h-6 rounded-full",style:{background:"linear-gradient(135deg, var(--primary) 50%, var(--bg) 50%)"},title:"Change theme"}),r&&v.jsx("div",{className:"absolute right-0 mt-2 w-56 bg-card-bg border border-border rounded-lg shadow-xl z-50 py-2",children:Av.map(o=>v.jsxs("button",{onClick:()=>{t({type:"SET_THEME",payload:o.key}),s(!1)},className:`w-full text-left px-4 py-2 text-sm flex items-center gap-3 hover:bg-hover transition-colors ${e.theme===o.key?"text-primary font-semibold":"text-text-secondary"}`,children:[v.jsx("span",{className:"w-4 h-4 rounded border border-border",style:{background:"linear-gradient(135deg, var(--primary) 50%, var(--bg) 50%)"}}),o.label]},o.key))})]})}function Nv(){const{state:e}=Fe(),{database:t,ssh:r,bgd:s,rmq:i}=e.connectionStatus,o=t&&r&&s&&i,c=!o&&(t||r||s||i);return v.jsx("div",{className:"flex items-center gap-2",children:v.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:o?"#27ae60":c?"#f39c12":"#c0392b",boxShadow:`0 0 6px ${o?"#27ae60":c?"#f39c12":"#c0392b"}`},title:`DB: ${t?"OK":"DOWN"} | SSH: ${r?"OK":"DOWN"} | BGD: ${s?"OK":"DOWN"} | RMQ: ${i?"OK":"DOWN"}`})})}const Pv=[{path:"/",label:"Overview"},{path:"/players",label:"Players"},{path:"/guilds",label:"Guilds"},{path:"/vehicles",label:"Vehicles"},{path:"/buildings",label:"Buildings"},{path:"/map",label:"Map"},{path:"/accounts",label:"Accounts"},{path:"/server",label:"Server"},{path:"/chat",label:"Chat"},{path:"/admin",label:"Admin"},{path:"/files",label:"Files"},{path:"/director",label:"Director"},{path:"/settings",label:"Settings"},{path:"/shell",label:"Shell"}];function Bv(){const e=Ti(),{state:t}=Fe();return v.jsxs("nav",{className:"sticky top-0 z-50 h-[52px] bg-nav-bg flex items-center px-6 shadow-md border-b border-border",children:[v.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[v.jsx("span",{className:"text-primary font-serif font-bold text-lg tracking-wide",children:"Dune"}),v.jsx("span",{className:"text-nav-text text-xs uppercase tracking-widest",children:"Admin"})]}),v.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar",children:Pv.map(r=>v.jsx(Cv,{to:r.path,className:`px-4 h-[52px] flex items-center text-[13px] font-medium border-b-2 transition-colors whitespace-nowrap ${e.pathname===r.path||r.path!=="/"&&e.pathname.startsWith(r.path)?"text-nav-active border-nav-active":"text-nav-text border-transparent hover:text-white hover:bg-white/5"}`,children:r.label},r.path))}),v.jsxs("div",{className:"ml-auto flex items-center gap-4",children:[v.jsx(Nv,{}),v.jsx(Ov,{}),t.user&&v.jsx("span",{className:"text-nav-text text-xs",children:t.user})]})]})}function jv(){const{state:e,dispatch:t}=Fe();return M.useEffect(()=>{if(e.toasts.length===0)return;const r=e.toasts.map(s=>setTimeout(()=>{t({type:"REMOVE_TOAST",payload:s.id})},4e3));return()=>r.forEach(clearTimeout)},[e.toasts,t]),e.toasts.length===0?null:v.jsx("div",{className:"fixed top-16 right-6 z-[100] flex flex-col gap-2",children:e.toasts.map(r=>v.jsx("div",{className:`px-4 py-3 rounded-lg shadow-lg text-sm font-medium min-w-[240px] max-w-md border ${r.type==="success"?"bg-success/10 border-success/30 text-success":r.type==="error"?"bg-danger/10 border-danger/30 text-danger":r.type==="warning"?"bg-yellow-500/10 border-yellow-500/30 text-yellow-400":"bg-primary/10 border-primary/30 text-primary"}`,children:r.message},r.id))})}function Mv({children:e}){return v.jsxs("div",{className:"min-h-screen bg-background text-text-primary",children:[v.jsx(Bv,{}),v.jsxs("main",{className:"p-6 max-w-[1600px] mx-auto",children:[v.jsx(jv,{}),e]})]})}function Zf(e,t){return function(){return e.apply(t,arguments)}}const{toString:Iv}=Object.prototype,{getPrototypeOf:go}=Object,{iterator:vo,toStringTag:ep}=Symbol,yo=(e=>t=>{const r=Iv.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Pt=e=>(e=e.toLowerCase(),t=>yo(t)===e),So=e=>t=>typeof t===e,{isArray:Rs}=Array,xs=So("undefined");function Li(e){return e!==null&&!xs(e)&&e.constructor!==null&&!xs(e.constructor)&&at(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tp=Pt("ArrayBuffer");function Fv(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tp(e.buffer),t}const Hv=So("string"),at=So("function"),rp=So("number"),Di=e=>e!==null&&typeof e=="object",Uv=e=>e===!0||e===!1,Sn=e=>{if(yo(e)!=="object")return!1;const t=go(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ep in e)&&!(vo in e)},zv=e=>{if(!Di(e)||Li(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},$v=Pt("Date"),Wv=Pt("File"),Vv=e=>!!(e&&typeof e.uri<"u"),qv=e=>e&&typeof e.getParts<"u",Kv=Pt("Blob"),Xv=Pt("FileList"),Gv=e=>Di(e)&&at(e.pipe);function Jv(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const rh=Jv(),sh=typeof rh.FormData<"u"?rh.FormData:void 0,Qv=e=>{if(!e)return!1;if(sh&&e instanceof sh)return!0;const t=go(e);if(!t||t===Object.prototype||!at(e.append))return!1;const r=yo(e);return r==="formdata"||r==="object"&&at(e.toString)&&e.toString()==="[object FormData]"},Yv=Pt("URLSearchParams"),[Zv,ey,ty,ry]=["ReadableStream","Request","Response","Headers"].map(Pt),sy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ai(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let s,i;if(typeof e!="object"&&(e=[e]),Rs(e))for(s=0,i=e.length;s<i;s++)t.call(null,e[s],s,e);else{if(Li(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),c=o.length;let n;for(s=0;s<c;s++)n=o[s],t.call(null,e[n],n,e)}}function sp(e,t){if(Li(e))return null;t=t.toLowerCase();const r=Object.keys(e);let s=r.length,i;for(;s-- >0;)if(i=r[s],t===i.toLowerCase())return i;return null}const Nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ip=e=>!xs(e)&&e!==Nr;function ll(...e){const{caseless:t,skipUndefined:r}=ip(this)&&this||{},s={},i=(o,c)=>{if(c==="__proto__"||c==="constructor"||c==="prototype")return;const n=t&&sp(s,c)||c,a=cl(s,n)?s[n]:void 0;Sn(a)&&Sn(o)?s[n]=ll(a,o):Sn(o)?s[n]=ll({},o):Rs(o)?s[n]=o.slice():(!r||!xs(o))&&(s[n]=o)};for(let o=0,c=e.length;o<c;o++)e[o]&&Ai(e[o],i);return s}const iy=(e,t,r,{allOwnKeys:s}={})=>(Ai(t,(i,o)=>{r&&at(i)?Object.defineProperty(e,o,{__proto__:null,value:Zf(i,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),ny=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),oy=(e,t,r,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},ay=(e,t,r,s)=>{let i,o,c;const n={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)c=i[o],(!s||s(c,e,t))&&!n[c]&&(t[c]=e[c],n[c]=!0);e=r!==!1&&go(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ly=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const s=e.indexOf(t,r);return s!==-1&&s===r},cy=e=>{if(!e)return null;if(Rs(e))return e;let t=e.length;if(!rp(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},uy=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&go(Uint8Array)),hy=(e,t)=>{const s=(e&&e[vo]).call(e);let i;for(;(i=s.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},dy=(e,t)=>{let r;const s=[];for(;(r=e.exec(t))!==null;)s.push(r);return s},fy=Pt("HTMLFormElement"),py=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,i){return s.toUpperCase()+i}),cl=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),my=Pt("RegExp"),np=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),s={};Ai(r,(i,o)=>{let c;(c=t(i,o,e))!==!1&&(s[o]=c||i)}),Object.defineProperties(e,s)},_y=e=>{np(e,(t,r)=>{if(at(e)&&["arguments","caller","callee"].includes(r))return!1;const s=e[r];if(at(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},gy=(e,t)=>{const r={},s=i=>{i.forEach(o=>{r[o]=!0})};return Rs(e)?s(e):s(String(e).split(t)),r},vy=()=>{},yy=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Sy(e){return!!(e&&at(e.append)&&e[ep]==="FormData"&&e[vo])}const xy=e=>{const t=new WeakSet,r=s=>{if(Di(s)){if(t.has(s))return;if(Li(s))return s;if(!("toJSON"in s)){t.add(s);const i=Rs(s)?[]:{};return Ai(s,(o,c)=>{const n=r(o);!xs(n)&&(i[c]=n)}),t.delete(s),i}}return s};return r(e)},by=Pt("AsyncFunction"),wy=e=>e&&(Di(e)||at(e))&&at(e.then)&&at(e.catch),op=((e,t)=>e?setImmediate:t?((r,s)=>(Nr.addEventListener("message",({source:i,data:o})=>{i===Nr&&o===r&&s.length&&s.shift()()},!1),i=>{s.push(i),Nr.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",at(Nr.postMessage)),Cy=typeof queueMicrotask<"u"?queueMicrotask.bind(Nr):typeof process<"u"&&process.nextTick||op,Ey=e=>e!=null&&at(e[vo]),I={isArray:Rs,isArrayBuffer:tp,isBuffer:Li,isFormData:Qv,isArrayBufferView:Fv,isString:Hv,isNumber:rp,isBoolean:Uv,isObject:Di,isPlainObject:Sn,isEmptyObject:zv,isReadableStream:Zv,isRequest:ey,isResponse:ty,isHeaders:ry,isUndefined:xs,isDate:$v,isFile:Wv,isReactNativeBlob:Vv,isReactNative:qv,isBlob:Kv,isRegExp:my,isFunction:at,isStream:Gv,isURLSearchParams:Yv,isTypedArray:uy,isFileList:Xv,forEach:Ai,merge:ll,extend:iy,trim:sy,stripBOM:ny,inherits:oy,toFlatObject:ay,kindOf:yo,kindOfTest:Pt,endsWith:ly,toArray:cy,forEachEntry:hy,matchAll:dy,isHTMLForm:fy,hasOwnProperty:cl,hasOwnProp:cl,reduceDescriptors:np,freezeMethods:_y,toObjectSet:gy,toCamelCase:py,noop:vy,toFiniteNumber:yy,findKey:sp,global:Nr,isContextDefined:ip,isSpecCompliantForm:Sy,toJSONObject:xy,isAsyncFn:by,isThenable:wy,setImmediate:op,asap:Cy,isIterable:Ey},ky=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ry=e=>{const t={};let r,s,i;return e&&e.split(`
|
||
`).forEach(function(c){i=c.indexOf(":"),r=c.substring(0,i).trim().toLowerCase(),s=c.substring(i+1).trim(),!(!r||t[r]&&ky[r])&&(r==="set-cookie"?t[r]?t[r].push(s):t[r]=[s]:t[r]=t[r]?t[r]+", "+s:s)}),t};function Ty(e){let t=0,r=e.length;for(;t<r;){const s=e.charCodeAt(t);if(s!==9&&s!==32)break;t+=1}for(;r>t;){const s=e.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const Ly=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Dy=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ec(e,t){return I.isArray(e)?e.map(r=>Ec(r,t)):Ty(String(e).replace(t,""))}const Ay=e=>Ec(e,Ly),Oy=e=>Ec(e,Dy);function ap(e){const t=Object.create(null);return I.forEach(e.toJSON(),(r,s)=>{t[s]=Oy(r)}),t}const ih=Symbol("internals");function Is(e){return e&&String(e).trim().toLowerCase()}function xn(e){return e===!1||e==null?e:I.isArray(e)?e.map(xn):Ay(String(e))}function Ny(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(e);)t[s[1]]=s[2];return t}const Py=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Yo(e,t,r,s,i){if(I.isFunction(s))return s.call(this,t,r);if(i&&(t=r),!!I.isString(t)){if(I.isString(s))return t.indexOf(s)!==-1;if(I.isRegExp(s))return s.test(t)}}function By(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,s)=>r.toUpperCase()+s)}function jy(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+r,{__proto__:null,value:function(i,o,c){return this[s].call(this,t,i,o,c)},configurable:!0})})}let Ye=class{constructor(t){t&&this.set(t)}set(t,r,s){const i=this;function o(n,a,f){const m=Is(a);if(!m)throw new Error("header name must be a non-empty string");const p=I.findKey(i,m);(!p||i[p]===void 0||f===!0||f===void 0&&i[p]!==!1)&&(i[p||a]=xn(n))}const c=(n,a)=>I.forEach(n,(f,m)=>o(f,m,a));if(I.isPlainObject(t)||t instanceof this.constructor)c(t,r);else if(I.isString(t)&&(t=t.trim())&&!Py(t))c(Ry(t),r);else if(I.isObject(t)&&I.isIterable(t)){let n={},a,f;for(const m of t){if(!I.isArray(m))throw TypeError("Object iterator must return a key-value pair");n[f=m[0]]=(a=n[f])?I.isArray(a)?[...a,m[1]]:[a,m[1]]:m[1]}c(n,r)}else t!=null&&o(r,t,s);return this}get(t,r){if(t=Is(t),t){const s=I.findKey(this,t);if(s){const i=this[s];if(!r)return i;if(r===!0)return Ny(i);if(I.isFunction(r))return r.call(this,i,s);if(I.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Is(t),t){const s=I.findKey(this,t);return!!(s&&this[s]!==void 0&&(!r||Yo(this,this[s],s,r)))}return!1}delete(t,r){const s=this;let i=!1;function o(c){if(c=Is(c),c){const n=I.findKey(s,c);n&&(!r||Yo(s,s[n],n,r))&&(delete s[n],i=!0)}}return I.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let s=r.length,i=!1;for(;s--;){const o=r[s];(!t||Yo(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,s={};return I.forEach(this,(i,o)=>{const c=I.findKey(s,o);if(c){r[c]=xn(i),delete r[o];return}const n=t?By(o):String(o).trim();n!==o&&delete r[o],r[n]=xn(i),s[n]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(s,i)=>{s!=null&&s!==!1&&(r[i]=t&&I.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const s=new this(t);return r.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ih]=this[ih]={accessors:{}}).accessors,i=this.prototype;function o(c){const n=Is(c);s[n]||(jy(i,c),s[n]=!0)}return I.isArray(t)?t.forEach(o):o(t),this}};Ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(Ye.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[r]=s}}});I.freezeMethods(Ye);const My="[REDACTED ****]";function Iy(e){if(I.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(I.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Fy(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),s=[],i=o=>{if(o===null||typeof o!="object"||I.isBuffer(o))return o;if(s.indexOf(o)!==-1)return;o instanceof Ye&&(o=o.toJSON()),s.push(o);let c;if(I.isArray(o))c=[],o.forEach((n,a)=>{const f=i(n);I.isUndefined(f)||(c[a]=f)});else{if(!I.isPlainObject(o)&&Iy(o))return s.pop(),o;c=Object.create(null);for(const[n,a]of Object.entries(o)){const f=r.has(n.toLowerCase())?My:i(a);I.isUndefined(f)||(c[n]=f)}}return s.pop(),c};return i(e)}let Z=class lp extends Error{static from(t,r,s,i,o,c){const n=new lp(t.message,r||t.code,s,i,o);return n.cause=t,n.name=t.name,t.status!=null&&n.status==null&&(n.status=t.status),c&&Object.assign(n,c),n}constructor(t,r,s,i,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),s&&(this.config=s),i&&(this.request=i),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&I.hasOwnProp(t,"redact")?t.redact:void 0,s=I.isArray(r)&&r.length>0?Fy(t,r):I.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:s,code:this.code,status:this.status}}};Z.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Z.ERR_BAD_OPTION="ERR_BAD_OPTION";Z.ECONNABORTED="ECONNABORTED";Z.ETIMEDOUT="ETIMEDOUT";Z.ECONNREFUSED="ECONNREFUSED";Z.ERR_NETWORK="ERR_NETWORK";Z.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Z.ERR_DEPRECATED="ERR_DEPRECATED";Z.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Z.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Z.ERR_CANCELED="ERR_CANCELED";Z.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Z.ERR_INVALID_URL="ERR_INVALID_URL";Z.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Hy=null;function ul(e){return I.isPlainObject(e)||I.isArray(e)}function cp(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function Zo(e,t,r){return e?e.concat(t).map(function(i,o){return i=cp(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function Uy(e){return I.isArray(e)&&!e.some(ul)}const zy=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function xo(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,h){return!I.isUndefined(h[u])});const s=r.metaTokens,i=r.visitor||p,o=r.dots,c=r.indexes,n=r.Blob||typeof Blob<"u"&&Blob,a=r.maxDepth===void 0?100:r.maxDepth,f=n&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function m(y){if(y===null)return"";if(I.isDate(y))return y.toISOString();if(I.isBoolean(y))return y.toString();if(!f&&I.isBlob(y))throw new Z("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(y)||I.isTypedArray(y)?f&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y,u,h){let l=y;if(I.isReactNative(t)&&I.isReactNativeBlob(y))return t.append(Zo(h,u,o),m(y)),!1;if(y&&!h&&typeof y=="object"){if(I.endsWith(u,"{}"))u=s?u:u.slice(0,-2),y=JSON.stringify(y);else if(I.isArray(y)&&Uy(y)||(I.isFileList(y)||I.endsWith(u,"[]"))&&(l=I.toArray(y)))return u=cp(u),l.forEach(function(g,x){!(I.isUndefined(g)||g===null)&&t.append(c===!0?Zo([u],x,o):c===null?u:u+"[]",m(g))}),!1}return ul(y)?!0:(t.append(Zo(h,u,o),m(y)),!1)}const _=[],S=Object.assign(zy,{defaultVisitor:p,convertValue:m,isVisitable:ul});function b(y,u,h=0){if(!I.isUndefined(y)){if(h>a)throw new Z("Object is too deeply nested ("+h+" levels). Max depth: "+a,Z.ERR_FORM_DATA_DEPTH_EXCEEDED);if(_.indexOf(y)!==-1)throw Error("Circular reference detected in "+u.join("."));_.push(y),I.forEach(y,function(d,g){(!(I.isUndefined(d)||d===null)&&i.call(t,d,I.isString(g)?g.trim():g,u,S))===!0&&b(d,u?u.concat(g):[g],h+1)}),_.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return b(e),t}function nh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(s){return t[s]})}function kc(e,t){this._pairs=[],e&&xo(e,this,t)}const up=kc.prototype;up.append=function(t,r){this._pairs.push([t,r])};up.toString=function(t){const r=t?function(s){return t.call(this,s,nh)}:nh;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function $y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function hp(e,t,r){if(!t)return e;const s=r&&r.encode||$y,i=I.isFunction(r)?{serialize:r}:r,o=i&&i.serialize;let c;if(o?c=o(t,i):c=I.isURLSearchParams(t)?t.toString():new kc(t,i).toString(s),c){const n=e.indexOf("#");n!==-1&&(e=e.slice(0,n)),e+=(e.indexOf("?")===-1?"?":"&")+c}return e}class oh{constructor(){this.handlers=[]}use(t,r,s){return this.handlers.push({fulfilled:t,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,function(s){s!==null&&t(s)})}}const Rc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Wy=typeof URLSearchParams<"u"?URLSearchParams:kc,Vy=typeof FormData<"u"?FormData:null,qy=typeof Blob<"u"?Blob:null,Ky={isBrowser:!0,classes:{URLSearchParams:Wy,FormData:Vy,Blob:qy},protocols:["http","https","file","blob","url","data"]},Tc=typeof window<"u"&&typeof document<"u",hl=typeof navigator=="object"&&navigator||void 0,Xy=Tc&&(!hl||["ReactNative","NativeScript","NS"].indexOf(hl.product)<0),Gy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jy=Tc&&window.location.href||"http://localhost",Qy=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Tc,hasStandardBrowserEnv:Xy,hasStandardBrowserWebWorkerEnv:Gy,navigator:hl,origin:Jy},Symbol.toStringTag,{value:"Module"})),Xe={...Qy,...Ky};function Yy(e,t){return xo(e,new Xe.classes.URLSearchParams,{visitor:function(r,s,i,o){return Xe.isNode&&I.isBuffer(r)?(this.append(s,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Zy(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function e0(e){const t={},r=Object.keys(e);let s;const i=r.length;let o;for(s=0;s<i;s++)o=r[s],t[o]=e[o];return t}function dp(e){function t(r,s,i,o){let c=r[o++];if(c==="__proto__")return!0;const n=Number.isFinite(+c),a=o>=r.length;return c=!c&&I.isArray(i)?i.length:c,a?(I.hasOwnProp(i,c)?i[c]=I.isArray(i[c])?i[c].concat(s):[i[c],s]:i[c]=s,!n):((!I.hasOwnProp(i,c)||!I.isObject(i[c]))&&(i[c]=[]),t(r,s,i[c],o)&&I.isArray(i[c])&&(i[c]=e0(i[c])),!n)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(s,i)=>{t(Zy(s),i,r,0)}),r}return null}const Xr=(e,t)=>e!=null&&I.hasOwnProp(e,t)?e[t]:void 0;function t0(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(e)}const Oi={transitional:Rc,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const s=r.getContentType()||"",i=s.indexOf("application/json")>-1,o=I.isObject(t);if(o&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(dp(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let n;if(o){const a=Xr(this,"formSerializer");if(s.indexOf("application/x-www-form-urlencoded")>-1)return Yy(t,a).toString();if((n=I.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=Xr(this,"env"),m=f&&f.FormData;return xo(n?{"files[]":t}:t,m&&new m,a)}}return o||i?(r.setContentType("application/json",!1),t0(t)):t}],transformResponse:[function(t){const r=Xr(this,"transitional")||Oi.transitional,s=r&&r.forcedJSONParsing,i=Xr(this,"responseType"),o=i==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(s&&!i||o)){const n=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Xr(this,"parseReviver"))}catch(a){if(n)throw a.name==="SyntaxError"?Z.from(a,Z.ERR_BAD_RESPONSE,this,null,Xr(this,"response")):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Xe.classes.FormData,Blob:Xe.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch","query"],e=>{Oi.headers[e]={}});function ea(e,t){const r=this||Oi,s=t||r,i=Ye.from(s.headers);let o=s.data;return I.forEach(e,function(n){o=n.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function fp(e){return!!(e&&e.__CANCEL__)}let Ni=class extends Z{constructor(t,r,s){super(t??"canceled",Z.ERR_CANCELED,r,s),this.name="CanceledError",this.__CANCEL__=!0}};function pp(e,t,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):t(new Z("Request failed with status code "+r.status,r.status>=400&&r.status<500?Z.ERR_BAD_REQUEST:Z.ERR_BAD_RESPONSE,r.config,r.request,r))}function r0(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function s0(e,t){e=e||10;const r=new Array(e),s=new Array(e);let i=0,o=0,c;return t=t!==void 0?t:1e3,function(a){const f=Date.now(),m=s[o];c||(c=f),r[i]=a,s[i]=f;let p=o,_=0;for(;p!==i;)_+=r[p++],p=p%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-c<t)return;const S=m&&f-m;return S?Math.round(_*1e3/S):void 0}}function i0(e,t){let r=0,s=1e3/t,i,o;const c=(f,m=Date.now())=>{r=m,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),p=m-r;p>=s?c(f,m):(i=f,o||(o=setTimeout(()=>{o=null,c(i)},s-p)))},()=>i&&c(i)]}const Yn=(e,t,r=3)=>{let s=0;const i=s0(50,250);return i0(o=>{if(!o||typeof o.loaded!="number")return;const c=o.loaded,n=o.lengthComputable?o.total:void 0,a=n!=null?Math.min(c,n):c,f=Math.max(0,a-s),m=i(f);s=Math.max(s,a);const p={loaded:a,total:n,progress:n?a/n:void 0,bytes:f,rate:m||void 0,estimated:m&&n?(n-a)/m:void 0,event:o,lengthComputable:n!=null,[t?"download":"upload"]:!0};e(p)},r)},ah=(e,t)=>{const r=e!=null;return[s=>t[0]({lengthComputable:r,total:e,loaded:s}),t[1]]},lh=e=>(...t)=>I.asap(()=>e(...t)),n0=Xe.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Xe.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Xe.origin),Xe.navigator&&/(msie|trident)/i.test(Xe.navigator.userAgent)):()=>!0,o0=Xe.hasStandardBrowserEnv?{write(e,t,r,s,i,o,c){if(typeof document>"u")return;const n=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&n.push(`expires=${new Date(r).toUTCString()}`),I.isString(s)&&n.push(`path=${s}`),I.isString(i)&&n.push(`domain=${i}`),o===!0&&n.push("secure"),I.isString(c)&&n.push(`SameSite=${c}`),document.cookie=n.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const s=t[r].replace(/^\s+/,""),i=s.indexOf("=");if(i!==-1&&s.slice(0,i)===e)return decodeURIComponent(s.slice(i+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function a0(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function l0(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mp(e,t,r){let s=!a0(t);return e&&(s||r===!1)?l0(e,t):t}const ch=e=>e instanceof Ye?{...e}:e;function zr(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function s(f,m,p,_){return I.isPlainObject(f)&&I.isPlainObject(m)?I.merge.call({caseless:_},f,m):I.isPlainObject(m)?I.merge({},m):I.isArray(m)?m.slice():m}function i(f,m,p,_){if(I.isUndefined(m)){if(!I.isUndefined(f))return s(void 0,f,p,_)}else return s(f,m,p,_)}function o(f,m){if(!I.isUndefined(m))return s(void 0,m)}function c(f,m){if(I.isUndefined(m)){if(!I.isUndefined(f))return s(void 0,f)}else return s(void 0,m)}function n(f,m,p){if(I.hasOwnProp(t,p))return s(f,m);if(I.hasOwnProp(e,p))return s(void 0,f)}const a={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,allowedSocketPaths:c,responseEncoding:c,validateStatus:n,headers:(f,m,p)=>i(ch(f),ch(m),p,!0)};return I.forEach(Object.keys({...e,...t}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;const p=I.hasOwnProp(a,m)?a[m]:i,_=I.hasOwnProp(e,m)?e[m]:void 0,S=I.hasOwnProp(t,m)?t[m]:void 0,b=p(_,S,m);I.isUndefined(b)&&p!==n||(r[m]=b)}),r}const c0=["content-type","content-length"];function u0(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([s,i])=>{c0.includes(s.toLowerCase())&&e.set(s,i)})}const h0=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),_p=e=>{const t=zr({},e),r=_=>I.hasOwnProp(t,_)?t[_]:void 0,s=r("data");let i=r("withXSRFToken");const o=r("xsrfHeaderName"),c=r("xsrfCookieName");let n=r("headers");const a=r("auth"),f=r("baseURL"),m=r("allowAbsoluteUrls"),p=r("url");if(t.headers=n=Ye.from(n),t.url=hp(mp(f,p,m),e.params,e.paramsSerializer),a&&n.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?h0(a.password):""))),I.isFormData(s)&&(Xe.hasStandardBrowserEnv||Xe.hasStandardBrowserWebWorkerEnv?n.setContentType(void 0):I.isFunction(s.getHeaders)&&u0(n,s.getHeaders(),r("formDataHeaderPolicy"))),Xe.hasStandardBrowserEnv&&(I.isFunction(i)&&(i=i(t)),i===!0||i==null&&n0(t.url))){const S=o&&c&&o0.read(c);S&&n.set(o,S)}return t},d0=typeof XMLHttpRequest<"u",f0=d0&&function(e){return new Promise(function(r,s){const i=_p(e);let o=i.data;const c=Ye.from(i.headers).normalize();let{responseType:n,onUploadProgress:a,onDownloadProgress:f}=i,m,p,_,S,b;function y(){S&&S(),b&&b(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let u=new XMLHttpRequest;u.open(i.method.toUpperCase(),i.url,!0),u.timeout=i.timeout;function h(){if(!u)return;const d=Ye.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),x={data:!n||n==="text"||n==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:d,config:e,request:u};pp(function(k){r(k),y()},function(k){s(k),y()},x),u=null}"onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.startsWith("file:"))||setTimeout(h)},u.onabort=function(){u&&(s(new Z("Request aborted",Z.ECONNABORTED,e,u)),y(),u=null)},u.onerror=function(g){const x=g&&g.message?g.message:"Network Error",C=new Z(x,Z.ERR_NETWORK,e,u);C.event=g||null,s(C),y(),u=null},u.ontimeout=function(){let g=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||Rc;i.timeoutErrorMessage&&(g=i.timeoutErrorMessage),s(new Z(g,x.clarifyTimeoutError?Z.ETIMEDOUT:Z.ECONNABORTED,e,u)),y(),u=null},o===void 0&&c.setContentType(null),"setRequestHeader"in u&&I.forEach(ap(c),function(g,x){u.setRequestHeader(x,g)}),I.isUndefined(i.withCredentials)||(u.withCredentials=!!i.withCredentials),n&&n!=="json"&&(u.responseType=i.responseType),f&&([_,b]=Yn(f,!0),u.addEventListener("progress",_)),a&&u.upload&&([p,S]=Yn(a),u.upload.addEventListener("progress",p),u.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(m=d=>{u&&(s(!d||d.type?new Ni(null,e,u):d),u.abort(),y(),u=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const l=r0(i.url);if(l&&!Xe.protocols.includes(l)){s(new Z("Unsupported protocol "+l+":",Z.ERR_BAD_REQUEST,e));return}u.send(o||null)})},p0=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let s=!1;const i=function(a){if(!s){s=!0,c();const f=a instanceof Error?a:this.reason;r.abort(f instanceof Z?f:new Ni(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,i(new Z(`timeout of ${t}ms exceeded`,Z.ETIMEDOUT))},t);const c=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(a=>{a.unsubscribe?a.unsubscribe(i):a.removeEventListener("abort",i)}),e=null)};e.forEach(a=>a.addEventListener("abort",i));const{signal:n}=r;return n.unsubscribe=()=>I.asap(c),n},m0=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let s=0,i;for(;s<r;)i=s+t,yield e.slice(s,i),s=i},_0=async function*(e,t){for await(const r of g0(e))yield*m0(r,t)},g0=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:s}=await t.read();if(r)break;yield s}}finally{await t.cancel()}},uh=(e,t,r,s)=>{const i=_0(e,t);let o=0,c,n=a=>{c||(c=!0,s&&s(a))};return new ReadableStream({async pull(a){try{const{done:f,value:m}=await i.next();if(f){n(),a.close();return}let p=m.byteLength;if(r){let _=o+=p;r(_)}a.enqueue(new Uint8Array(m))}catch(f){throw n(f),f}},cancel(a){return n(a),i.return()}},{highWaterMark:2})};function v0(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),s=e.slice(t+1);if(/;base64/i.test(r)){let c=s.length;const n=s.length;for(let S=0;S<n;S++)if(s.charCodeAt(S)===37&&S+2<n){const b=s.charCodeAt(S+1),y=s.charCodeAt(S+2);(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102)&&(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102)&&(c-=2,S+=2)}let a=0,f=n-1;const m=S=>S>=2&&s.charCodeAt(S-2)===37&&s.charCodeAt(S-1)===51&&(s.charCodeAt(S)===68||s.charCodeAt(S)===100);f>=0&&(s.charCodeAt(f)===61?(a++,f--):m(f)&&(a++,f-=3)),a===1&&f>=0&&(s.charCodeAt(f)===61||m(f))&&a++;const _=Math.floor(c/4)*3-(a||0);return _>0?_:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(s,"utf8");let o=0;for(let c=0,n=s.length;c<n;c++){const a=s.charCodeAt(c);if(a<128)o+=1;else if(a<2048)o+=2;else if(a>=55296&&a<=56319&&c+1<n){const f=s.charCodeAt(c+1);f>=56320&&f<=57343?(o+=4,c++):o+=3}else o+=3}return o}const Lc="1.16.1",hh=64*1024,{isFunction:Zi}=I,dh=(e,...t)=>{try{return!!e(...t)}catch{return!1}},y0=e=>{const t=I.global!==void 0&&I.global!==null?I.global:globalThis,{ReadableStream:r,TextEncoder:s}=t;e=I.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:o,Response:c}=e,n=i?Zi(i):typeof fetch=="function",a=Zi(o),f=Zi(c);if(!n)return!1;const m=n&&Zi(r),p=n&&(typeof s=="function"?(h=>l=>h.encode(l))(new s):async h=>new Uint8Array(await new o(h).arrayBuffer())),_=a&&m&&dh(()=>{let h=!1;const l=new o(Xe.origin,{body:new r,method:"POST",get duplex(){return h=!0,"half"}}),d=l.headers.has("Content-Type");return l.body!=null&&l.body.cancel(),h&&!d}),S=f&&m&&dh(()=>I.isReadableStream(new c("").body)),b={stream:S&&(h=>h.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!b[h]&&(b[h]=(l,d)=>{let g=l&&l[h];if(g)return g.call(l);throw new Z(`Response type '${h}' is not supported`,Z.ERR_NOT_SUPPORT,d)})});const y=async h=>{if(h==null)return 0;if(I.isBlob(h))return h.size;if(I.isSpecCompliantForm(h))return(await new o(Xe.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(I.isArrayBufferView(h)||I.isArrayBuffer(h))return h.byteLength;if(I.isURLSearchParams(h)&&(h=h+""),I.isString(h))return(await p(h)).byteLength},u=async(h,l)=>{const d=I.toFiniteNumber(h.getContentLength());return d??y(l)};return async h=>{let{url:l,method:d,data:g,signal:x,cancelToken:C,timeout:k,onDownloadProgress:w,onUploadProgress:E,responseType:L,headers:N,withCredentials:O="same-origin",fetchOptions:P,maxContentLength:F,maxBodyLength:z}=_p(h);const W=I.isNumber(F)&&F>-1,V=I.isNumber(z)&&z>-1;let R=i||fetch;L=L?(L+"").toLowerCase():"text";let D=p0([x,C&&C.toAbortSignal()],k),A=null;const B=D&&D.unsubscribe&&(()=>{D.unsubscribe()});let H;try{if(W&&typeof l=="string"&&l.startsWith("data:")&&v0(l)>F)throw new Z("maxContentLength size of "+F+" exceeded",Z.ERR_BAD_RESPONSE,h,A);if(V&&d!=="get"&&d!=="head"){const j=await u(N,g);if(typeof j=="number"&&isFinite(j)&&j>z)throw new Z("Request body larger than maxBodyLength limit",Z.ERR_BAD_REQUEST,h,A)}if(E&&_&&d!=="get"&&d!=="head"&&(H=await u(N,g))!==0){let j=new o(l,{method:"POST",body:g,duplex:"half"}),$;if(I.isFormData(g)&&($=j.headers.get("content-type"))&&N.setContentType($),j.body){const[U,ee]=ah(H,Yn(lh(E)));g=uh(j.body,hh,U,ee)}}I.isString(O)||(O=O?"include":"omit");const q=a&&"credentials"in o.prototype;if(I.isFormData(g)){const j=N.getContentType();j&&/^multipart\/form-data/i.test(j)&&!/boundary=/i.test(j)&&N.delete("content-type")}N.set("User-Agent","axios/"+Lc,!1);const G={...P,signal:D,method:d.toUpperCase(),headers:ap(N.normalize()),body:g,duplex:"half",credentials:q?O:void 0};A=a&&new o(l,G);let X=await(a?R(A,P):R(l,G));if(W){const j=I.toFiniteNumber(X.headers.get("content-length"));if(j!=null&&j>F)throw new Z("maxContentLength size of "+F+" exceeded",Z.ERR_BAD_RESPONSE,h,A)}const te=S&&(L==="stream"||L==="response");if(S&&X.body&&(w||W||te&&B)){const j={};["status","statusText","headers"].forEach(ce=>{j[ce]=X[ce]});const $=I.toFiniteNumber(X.headers.get("content-length")),[U,ee]=w&&ah($,Yn(lh(w),!0))||[];let J=0;const oe=ce=>{if(W&&(J=ce,J>F))throw new Z("maxContentLength size of "+F+" exceeded",Z.ERR_BAD_RESPONSE,h,A);U&&U(ce)};X=new c(uh(X.body,hh,oe,()=>{ee&&ee(),B&&B()}),j)}L=L||"text";let T=await b[I.findKey(b,L)||"text"](X,h);if(W&&!S&&!te){let j;if(T!=null&&(typeof T.byteLength=="number"?j=T.byteLength:typeof T.size=="number"?j=T.size:typeof T=="string"&&(j=typeof s=="function"?new s().encode(T).byteLength:T.length)),typeof j=="number"&&j>F)throw new Z("maxContentLength size of "+F+" exceeded",Z.ERR_BAD_RESPONSE,h,A)}return!te&&B&&B(),await new Promise((j,$)=>{pp(j,$,{data:T,headers:Ye.from(X.headers),status:X.status,statusText:X.statusText,config:h,request:A})})}catch(q){if(B&&B(),D&&D.aborted&&D.reason instanceof Z){const G=D.reason;throw G.config=h,A&&(G.request=A),q!==G&&(G.cause=q),G}throw q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new Z("Network Error",Z.ERR_NETWORK,h,A,q&&q.response),{cause:q.cause||q}):Z.from(q,q&&q.code,h,A,q&&q.response)}}},S0=new Map,gp=e=>{let t=e&&e.env||{};const{fetch:r,Request:s,Response:i}=t,o=[s,i,r];let c=o.length,n=c,a,f,m=S0;for(;n--;)a=o[n],f=m.get(a),f===void 0&&m.set(a,f=n?new Map:y0(t)),m=f;return f};gp();const Dc={http:Hy,xhr:f0,fetch:{get:gp}};I.forEach(Dc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const fh=e=>`- ${e}`,x0=e=>I.isFunction(e)||e===null||e===!1;function b0(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let s,i;const o={};for(let c=0;c<r;c++){s=e[c];let n;if(i=s,!x0(s)&&(i=Dc[(n=String(s)).toLowerCase()],i===void 0))throw new Z(`Unknown adapter '${n}'`);if(i&&(I.isFunction(i)||(i=i.get(t))))break;o[n||"#"+c]=i}if(!i){const c=Object.entries(o).map(([a,f])=>`adapter ${a} `+(f===!1?"is not supported by the environment":"is not available in the build"));let n=r?c.length>1?`since :
|
||
`+c.map(fh).join(`
|
||
`):" "+fh(c[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return i}const vp={getAdapter:b0,adapters:Dc};function ta(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ni(null,e)}function ph(e){return ta(e),e.headers=Ye.from(e.headers),e.data=ea.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vp.getAdapter(e.adapter||Oi.adapter,e)(e).then(function(s){ta(e),e.response=s;try{s.data=ea.call(e,e.transformResponse,s)}finally{delete e.response}return s.headers=Ye.from(s.headers),s},function(s){if(!fp(s)&&(ta(e),s&&s.response)){e.response=s.response;try{s.response.data=ea.call(e,e.transformResponse,s.response)}finally{delete e.response}s.response.headers=Ye.from(s.response.headers)}return Promise.reject(s)})}const bo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bo[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const mh={};bo.transitional=function(t,r,s){function i(o,c){return"[Axios v"+Lc+"] Transitional option '"+o+"'"+c+(s?". "+s:"")}return(o,c,n)=>{if(t===!1)throw new Z(i(c," has been removed"+(r?" in "+r:"")),Z.ERR_DEPRECATED);return r&&!mh[c]&&(mh[c]=!0,console.warn(i(c," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,c,n):!0}};bo.spelling=function(t){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function w0(e,t,r){if(typeof e!="object")throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const o=s[i],c=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(c){const n=e[o],a=n===void 0||c(n,o,e);if(a!==!0)throw new Z("option "+o+" must be "+a,Z.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Z("Unknown option "+o,Z.ERR_BAD_OPTION)}}const bn={assertOptions:w0,validators:bo},mt=bn.validators;let jr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new oh,response:new oh}}async request(t,r){try{return await this._request(t,r)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=(()=>{if(!i.stack)return"";const c=i.stack.indexOf(`
|
||
`);return c===-1?"":i.stack.slice(c+1)})();try{if(!s.stack)s.stack=o;else if(o){const c=o.indexOf(`
|
||
`),n=c===-1?-1:o.indexOf(`
|
||
`,c+1),a=n===-1?"":o.slice(n+1);String(s.stack).endsWith(a)||(s.stack+=`
|
||
`+o)}}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=zr(this.defaults,r);const{transitional:s,paramsSerializer:i,headers:o}=r;s!==void 0&&bn.assertOptions(s,{silentJSONParsing:mt.transitional(mt.boolean),forcedJSONParsing:mt.transitional(mt.boolean),clarifyTimeoutError:mt.transitional(mt.boolean),legacyInterceptorReqResOrdering:mt.transitional(mt.boolean)},!1),i!=null&&(I.isFunction(i)?r.paramsSerializer={serialize:i}:bn.assertOptions(i,{encode:mt.function,serialize:mt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),bn.assertOptions(r,{baseUrl:mt.spelling("baseURL"),withXsrfToken:mt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let c=o&&I.merge(o.common,o[r.method]);o&&I.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete o[b]}),r.headers=Ye.concat(c,o);const n=[];let a=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;a=a&&y.synchronous;const u=r.transitional||Rc;u&&u.legacyInterceptorReqResOrdering?n.unshift(y.fulfilled,y.rejected):n.push(y.fulfilled,y.rejected)});const f=[];this.interceptors.response.forEach(function(y){f.push(y.fulfilled,y.rejected)});let m,p=0,_;if(!a){const b=[ph.bind(this),void 0];for(b.unshift(...n),b.push(...f),_=b.length,m=Promise.resolve(r);p<_;)m=m.then(b[p++],b[p++]);return m}_=n.length;let S=r;for(;p<_;){const b=n[p++],y=n[p++];try{S=b(S)}catch(u){y.call(this,u);break}}try{m=ph.call(this,S)}catch(b){return Promise.reject(b)}for(p=0,_=f.length;p<_;)m=m.then(f[p++],f[p++]);return m}getUri(t){t=zr(this.defaults,t);const r=mp(t.baseURL,t.url,t.allowAbsoluteUrls);return hp(r,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){jr.prototype[t]=function(r,s){return this.request(zr(s||{},{method:t,url:r,data:(s||{}).data}))}});I.forEach(["post","put","patch","query"],function(t){function r(s){return function(o,c,n){return this.request(zr(n||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}jr.prototype[t]=r(),t!=="query"&&(jr.prototype[t+"Form"]=r(!0))});let C0=class yp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const s=this;this.promise.then(i=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const c=new Promise(n=>{s.subscribe(n),o=n}).then(i);return c.cancel=function(){s.unsubscribe(o)},c},t(function(o,c,n){s.reason||(s.reason=new Ni(o,c,n),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new yp(function(i){t=i}),cancel:t}}};function E0(e){return function(r){return e.apply(null,r)}}function k0(e){return I.isObject(e)&&e.isAxiosError===!0}const dl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dl).forEach(([e,t])=>{dl[t]=e});function Sp(e){const t=new jr(e),r=Zf(jr.prototype.request,t);return I.extend(r,jr.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return Sp(zr(e,i))},r}const Ce=Sp(Oi);Ce.Axios=jr;Ce.CanceledError=Ni;Ce.CancelToken=C0;Ce.isCancel=fp;Ce.VERSION=Lc;Ce.toFormData=xo;Ce.AxiosError=Z;Ce.Cancel=Ce.CanceledError;Ce.all=function(t){return Promise.all(t)};Ce.spread=E0;Ce.isAxiosError=k0;Ce.mergeConfig=zr;Ce.AxiosHeaders=Ye;Ce.formToJSON=e=>dp(I.isHTMLForm(e)?new FormData(e):e);Ce.getAdapter=vp.getAdapter;Ce.HttpStatusCode=dl;Ce.default=Ce;const{Axios:t1,AxiosError:r1,CanceledError:s1,isCancel:i1,CancelToken:n1,VERSION:o1,all:a1,Cancel:l1,isAxiosError:c1,spread:u1,toFormData:h1,AxiosHeaders:d1,HttpStatusCode:f1,formToJSON:p1,getAdapter:m1,mergeConfig:_1,create:g1}=Ce,ne=Ce.create({baseURL:"/api",headers:{"Content-Type":"application/json"},timeout:3e4});ne.interceptors.response.use(e=>e,e=>{var t;return((t=e.response)==null?void 0:t.status)===401&&(window.location.href="/login"),Promise.reject(e)});function R0(){const[e,t]=M.useState(null),[r,s]=M.useState(!0),{dispatch:i}=Fe();M.useEffect(()=>{async function c(){try{const a=await ne.get("/stats");a.data.success&&t(a.data.data)}catch(a){console.error(a)}finally{s(!1)}}c();const n=new EventSource("/api/events/stream");return n.addEventListener("metrics",a=>{try{t(JSON.parse(a.data))}catch{}}),()=>n.close()},[]);const o=e?[{label:"Total Players",value:e.total_players.toLocaleString(),icon:"👥"},{label:"Online Players",value:e.online_players.toLocaleString(),icon:"🟢"},{label:"Guilds",value:e.guild_count.toLocaleString(),icon:"🛡️"},{label:"Active Guilds",value:e.active_guilds.toLocaleString(),icon:"⚔️"},{label:"Servers",value:e.server_count.toLocaleString(),icon:"🖥️"},{label:"Partitions",value:e.partition_count.toLocaleString(),icon:"🗺️"},{label:"Total Worth",value:"$"+Math.round(e.total_worth).toLocaleString(),icon:"💰"},{label:"Flavor Text",value:e.total_flavor_text.toLocaleString(),icon:"📝"}]:[];return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Dashboard Overview"}),r?v.jsx("div",{className:"text-text-muted",children:"Loading metrics..."}):v.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:o.map(c=>v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 shadow-card",children:[v.jsx("div",{className:"flex items-center justify-between mb-2",children:v.jsx("span",{className:"text-2xl",children:c.icon})}),v.jsx("div",{className:"text-2xl font-bold text-text-primary mb-1",children:c.value}),v.jsx("div",{className:"text-sm text-text-muted",children:c.label})]},c.label))}),v.jsxs("div",{className:"mt-8 grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 shadow-card",children:[v.jsx("h2",{className:"font-serif text-xl text-primary mb-4",children:"Quick Actions"}),v.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[v.jsx(en,{label:"Broadcast Message",onClick:()=>{}}),v.jsx(en,{label:"Player Search",onClick:()=>{}}),v.jsx(en,{label:"Guild Lookup",onClick:()=>{}}),v.jsx(en,{label:"Server Restart",onClick:()=>{}})]})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 shadow-card",children:[v.jsx("h2",{className:"font-serif text-xl text-primary mb-4",children:"System Health"}),v.jsxs("div",{className:"space-y-3",children:[v.jsx(tn,{label:"Database",status:"ok",detail:"Connected"}),v.jsx(tn,{label:"SSH Tunnel",status:"ok",detail:"Connected"}),v.jsx(tn,{label:"BG Director",status:"ok",detail:"Connected"}),v.jsx(tn,{label:"RMQ Game",status:"ok",detail:"Connected"})]})]})]})]})}function en({label:e,onClick:t}){return v.jsx("button",{onClick:t,className:"px-4 py-3 bg-primary/10 border border-primary/20 rounded-lg text-primary text-sm font-medium hover:bg-primary/20 transition-colors text-left",children:e})}function tn({label:e,status:t,detail:r}){const s=t==="ok"?"#27ae60":t==="warn"?"#f39c12":"#c0392b";return v.jsxs("div",{className:"flex items-center justify-between text-sm",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:s}}),v.jsx("span",{className:"text-text-secondary",children:e})]}),v.jsx("span",{className:"text-text-muted",children:r})]})}var xp={exports:{}},bp={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var bs=M;function T0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var L0=typeof Object.is=="function"?Object.is:T0,D0=bs.useState,A0=bs.useEffect,O0=bs.useLayoutEffect,N0=bs.useDebugValue;function P0(e,t){var r=t(),s=D0({inst:{value:r,getSnapshot:t}}),i=s[0].inst,o=s[1];return O0(function(){i.value=r,i.getSnapshot=t,ra(i)&&o({inst:i})},[e,r,t]),A0(function(){return ra(i)&&o({inst:i}),e(function(){ra(i)&&o({inst:i})})},[e]),N0(r),r}function ra(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!L0(e,r)}catch{return!0}}function B0(e,t){return t()}var j0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?B0:P0;bp.useSyncExternalStore=bs.useSyncExternalStore!==void 0?bs.useSyncExternalStore:j0;xp.exports=bp;var _h=xp.exports;const wp=0,Cp=1,Ep=2,gh=3;var vh=Object.prototype.hasOwnProperty;function fl(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&fl(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(vh.call(e,r)&&++s&&!vh.call(t,r)||!(r in t)||!fl(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const qt=new WeakMap,Gt=()=>{},Ke=Gt(),pl=Object,se=e=>e===Ke,It=e=>typeof e=="function",br=(e,t)=>({...e,...t}),kp=e=>It(e.then),sa={},rn={},Ac="undefined",Pi=typeof window!=Ac,ml=typeof document!=Ac,M0=Pi&&"Deno"in window,I0=()=>Pi&&typeof window.requestAnimationFrame!=Ac,Rp=(e,t)=>{const r=qt.get(e);return[()=>!se(t)&&e.get(t)||sa,s=>{if(!se(t)){const i=e.get(t);t in rn||(rn[t]=i),r[5](t,br(i,s),i||sa)}},r[6],()=>!se(t)&&t in rn?rn[t]:!se(t)&&e.get(t)||sa]};let _l=!0;const F0=()=>_l,[gl,vl]=Pi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gt,Gt],H0=()=>{const e=ml&&document.visibilityState;return se(e)||e!=="hidden"},U0=e=>(ml&&document.addEventListener("visibilitychange",e),gl("focus",e),()=>{ml&&document.removeEventListener("visibilitychange",e),vl("focus",e)}),z0=e=>{const t=()=>{_l=!0,e()},r=()=>{_l=!1};return gl("online",t),gl("offline",r),()=>{vl("online",t),vl("offline",r)}},$0={isOnline:F0,isVisible:H0},W0={initFocus:U0,initReconnect:z0},yh=!bi.useId,fs=!Pi||M0,V0=e=>I0()?window.requestAnimationFrame(e):setTimeout(e,1),ia=fs?M.useEffect:M.useLayoutEffect,na=typeof navigator<"u"&&navigator.connection,Sh=!fs&&na&&(["slow-2g","2g"].includes(na.effectiveType)||na.saveData),sn=new WeakMap,q0=e=>pl.prototype.toString.call(e),oa=(e,t)=>e===`[object ${t}]`;let K0=0;const yl=e=>{const t=typeof e,r=q0(e),s=oa(r,"Date"),i=oa(r,"RegExp"),o=oa(r,"Object");let c,n;if(pl(e)===e&&!s&&!i){if(c=sn.get(e),c)return c;if(c=++K0+"~",sn.set(e,c),Array.isArray(e)){for(c="@",n=0;n<e.length;n++)c+=yl(e[n])+",";sn.set(e,c)}if(o){c="#";const a=pl.keys(e).sort();for(;!se(n=a.pop());)se(e[n])||(c+=n+":"+yl(e[n])+",");sn.set(e,c)}}else c=s?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return c},Oc=e=>{if(It(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?yl(e):"",[e,t]};let X0=0;const Sl=()=>++X0;async function Tp(...e){const[t,r,s,i]=e,o=br({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let c=o.populateCache;const n=o.rollbackOnError;let a=o.optimisticData;const f=_=>typeof n=="function"?n(_):n!==!1,m=o.throwOnError;if(It(r)){const _=r,S=[],b=t.keys();for(const y of b)!/^\$(inf|sub)\$/.test(y)&&_(t.get(y)._k)&&S.push(y);return Promise.all(S.map(p))}return p(r);async function p(_){const[S]=Oc(_);if(!S)return;const[b,y]=Rp(t,S),[u,h,l,d]=qt.get(t),g=()=>{const F=u[S];return(It(o.revalidate)?o.revalidate(b().data,_):o.revalidate!==!1)&&(delete l[S],delete d[S],F&&F[0])?F[0](Ep).then(()=>b().data):b().data};if(e.length<3)return g();let x=s,C,k=!1;const w=Sl();h[S]=[w,0];const E=!se(a),L=b(),N=L.data,O=L._c,P=se(O)?N:O;if(E&&(a=It(a)?a(P,N):a,y({data:a,_c:P})),It(x))try{x=x(P)}catch(F){C=F,k=!0}if(x&&kp(x))if(x=await x.catch(F=>{C=F,k=!0}),w!==h[S][0]){if(k)throw C;return x}else k&&E&&f(C)&&(c=!0,y({data:P,_c:Ke}));if(c&&!k)if(It(c)){const F=c(x,P);y({data:F,error:Ke,_c:Ke})}else y({data:x,error:Ke,_c:Ke});if(h[S][1]=Sl(),Promise.resolve(g()).then(()=>{y({_c:Ke})}),k){if(m)throw C;return}return x}}const xh=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},G0=(e,t)=>{if(!qt.has(e)){const r=br(W0,t),s=Object.create(null),i=Tp.bind(Ke,e);let o=Gt;const c=Object.create(null),n=(m,p)=>{const _=c[m]||[];return c[m]=_,_.push(p),()=>_.splice(_.indexOf(p),1)},a=(m,p,_)=>{e.set(m,p);const S=c[m];if(S)for(const b of S)b(p,_)},f=()=>{if(!qt.has(e)&&(qt.set(e,[s,Object.create(null),Object.create(null),Object.create(null),i,a,n]),!fs)){const m=r.initFocus(setTimeout.bind(Ke,xh.bind(Ke,s,wp))),p=r.initReconnect(setTimeout.bind(Ke,xh.bind(Ke,s,Cp)));o=()=>{m&&m(),p&&p(),qt.delete(e)}}};return f(),[e,i,f,o]}return[e,qt.get(e)[4]]},J0=(e,t,r,s,i)=>{const o=r.errorRetryCount,c=i.retryCount,n=~~((Math.random()+.5)*(1<<(c<8?c:8)))*r.errorRetryInterval;!se(o)&&c>o||setTimeout(s,n,i)},Q0=fl,[Lp,Y0]=G0(new Map),Z0=br({onLoadingSlow:Gt,onSuccess:Gt,onError:Gt,onErrorRetry:J0,onDiscarded:Gt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Sh?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Sh?5e3:3e3,compare:Q0,isPaused:()=>!1,cache:Lp,mutate:Y0,fallback:{}},$0),eS=(e,t)=>{const r=br(e,t);if(t){const{use:s,fallback:i}=e,{use:o,fallback:c}=t;s&&o&&(r.use=s.concat(o)),i&&c&&(r.fallback=br(i,c))}return r},tS=M.createContext({}),rS="$inf$",Dp=Pi&&window.__SWR_DEVTOOLS_USE__,sS=Dp?window.__SWR_DEVTOOLS_USE__:[],iS=()=>{Dp&&(window.__SWR_DEVTOOLS_REACT__=bi)},nS=e=>It(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],oS=()=>{const e=M.useContext(tS);return M.useMemo(()=>br(Z0,e),[e])},aS=e=>(t,r,s)=>e(t,r&&((...o)=>{const[c]=Oc(t),[,,,n]=qt.get(Lp);if(c.startsWith(rS))return r(...o);const a=n[c];return se(a)?r(...o):(delete n[c],a)}),s),lS=sS.concat(aS),cS=e=>function(...r){const s=oS(),[i,o,c]=nS(r),n=eS(s,c);let a=e;const{use:f}=n,m=(f||[]).concat(lS);for(let p=m.length;p--;)a=m[p](a);return a(i,o||n.fetcher||null,n)},uS=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const i=s.indexOf(r);i>=0&&(s[i]=s[s.length-1],s.pop())}};iS();const aa=bi.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),la={dedupe:!0},bh=Promise.resolve(Ke),hS=()=>Gt,dS=(e,t,r)=>{const{cache:s,compare:i,suspense:o,fallbackData:c,revalidateOnMount:n,revalidateIfStale:a,refreshInterval:f,refreshWhenHidden:m,refreshWhenOffline:p,keepPreviousData:_,strictServerPrefetchWarning:S}=r,[b,y,u,h]=qt.get(s),[l,d]=Oc(e),g=M.useRef(!1),x=M.useRef(!1),C=M.useRef(l),k=M.useRef(t),w=M.useRef(r),E=()=>w.current,L=()=>E().isVisible()&&E().isOnline(),[N,O,P,F]=Rp(s,l),z=M.useRef({}).current,W=se(c)?se(r.fallback)?Ke:r.fallback[l]:c,V=(Y,he)=>{for(const fe in z){const pe=fe;if(pe==="data"){if(!i(Y[pe],he[pe])&&(!se(Y[pe])||!i(te,he[pe])))return!1}else if(he[pe]!==Y[pe])return!1}return!0},R=!g.current,D=M.useMemo(()=>{const Y=N(),he=F(),fe=le=>{const Be=br(le);return delete Be._k,(()=>{if(!l||!t||E().isPaused())return!1;if(R&&!se(n))return n;const wt=se(W)?Be.data:W;return se(wt)||a})()?{isValidating:!0,isLoading:!0,...Be}:Be},pe=fe(Y),tt=Y===he?pe:fe(he);let Pe=pe;return[()=>{const le=fe(N());return V(le,Pe)?(Pe.data=le.data,Pe.isLoading=le.isLoading,Pe.isValidating=le.isValidating,Pe.error=le.error,Pe):(Pe=le,le)},()=>tt]},[s,l]),A=_h.useSyncExternalStore(M.useCallback(Y=>P(l,(he,fe)=>{V(fe,he)||Y()}),[s,l]),D[0],D[1]),B=b[l]&&b[l].length>0,H=A.data,q=se(H)?W&&kp(W)?aa(W):W:H,G=A.error,X=M.useRef(q),te=_?se(H)?se(X.current)?q:X.current:H:q,T=l&&se(q),j=M.useRef(null);!fs&&_h.useSyncExternalStore(hS,()=>(j.current=!1,j),()=>(j.current=!0,j));const $=j.current;S&&$&&!o&&T&&console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const U=!l||!t||E().isPaused()||B&&!se(G)?!1:R&&!se(n)?n:o?se(q)?!1:a:se(q)||a,ee=R&&U,J=se(A.isValidating)?ee:A.isValidating,oe=se(A.isLoading)?ee:A.isLoading,ce=M.useCallback(async Y=>{const he=k.current;if(!l||!he||x.current||E().isPaused())return!1;let fe,pe,tt=!0;const Pe=Y||{},le=!u[l]||!Pe.dedupe,Be=()=>yh?!x.current&&l===C.current&&g.current:l===C.current,He={isValidating:!1,isLoading:!1},wt=()=>{O(He)},qr=()=>{const Ue=u[l];Ue&&Ue[1]===pe&&delete u[l]},Ct={isValidating:!0};se(N().data)&&(Ct.isLoading=!0);try{if(le&&(O(Ct),r.loadingTimeout&&se(N().data)&&setTimeout(()=>{tt&&Be()&&E().onLoadingSlow(l,r)},r.loadingTimeout),u[l]=[he(d),Sl()]),[fe,pe]=u[l],fe=await fe,le&&setTimeout(qr,r.dedupingInterval),!u[l]||u[l][1]!==pe)return le&&Be()&&E().onDiscarded(l),!1;He.error=Ke;const Ue=y[l];if(!se(Ue)&&(pe<=Ue[0]||pe<=Ue[1]||Ue[1]===0))return wt(),le&&Be()&&E().onDiscarded(l),!1;const De=N().data;He.data=i(De,fe)?De:fe,le&&Be()&&E().onSuccess(fe,l,r)}catch(Ue){qr();const De=E(),{shouldRetryOnError:$t}=De;De.isPaused()||(He.error=Ue,le&&Be()&&(De.onError(Ue,l,De),($t===!0||It($t)&&$t(Ue))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||L())&&De.onErrorRetry(Ue,l,De,me=>{const Ls=b[l];Ls&&Ls[0]&&Ls[0](gh,me)},{retryCount:(Pe.retryCount||0)+1,dedupe:!0})))}return tt=!1,wt(),!0},[l,s]),Ne=M.useCallback((...Y)=>Tp(s,C.current,...Y),[]);if(ia(()=>{k.current=t,w.current=r,se(H)||(X.current=H)}),ia(()=>{if(!l)return;const Y=ce.bind(Ke,la);let he=0;E().revalidateOnFocus&&(he=Date.now()+E().focusThrottleInterval);const pe=uS(l,b,(tt,Pe={})=>{if(tt==wp){const le=Date.now();E().revalidateOnFocus&&le>he&&L()&&(he=le+E().focusThrottleInterval,Y())}else if(tt==Cp)E().revalidateOnReconnect&&L()&&Y();else{if(tt==Ep)return ce();if(tt==gh)return ce(Pe)}});return x.current=!1,C.current=l,g.current=!0,O({_k:d}),U&&(u[l]||(se(q)||fs?Y():V0(Y))),()=>{x.current=!0,pe()}},[l]),ia(()=>{let Y;function he(){const pe=It(f)?f(N().data):f;pe&&Y!==-1&&(Y=setTimeout(fe,pe))}function fe(){!N().error&&(m||E().isVisible())&&(p||E().isOnline())?ce(la).then(he):he()}return he(),()=>{Y&&(clearTimeout(Y),Y=-1)}},[f,m,p,l]),M.useDebugValue(te),o){if(!yh&&fs&&T)throw new Error("Fallback data is required when using Suspense in SSR.");T&&(k.current=t,w.current=r,x.current=!1);const Y=h[l],he=!se(Y)&&T?Ne(Y):bh;if(aa(he),!se(G)&&T)throw G;const fe=T?ce(la):bh;!se(te)&&T&&(fe.status="fulfilled",fe.value=!0),aa(fe)}return{mutate:Ne,get data(){return z.data=!0,te},get error(){return z.error=!0,G},get isValidating(){return z.isValidating=!0,J},get isLoading(){return z.isLoading=!0,oe}}},ct=cS(dS);function fS(e,t=300){const[r,s]=M.useState(e);return M.useEffect(()=>{const i=setTimeout(()=>s(e),t);return()=>clearTimeout(i)},[e,t]),r}function Bi({columns:e,data:t,onRowClick:r,loading:s}){const[i,o]=M.useState(null),[c,n]=M.useState("asc"),a=m=>{i===m?n(c==="asc"?"desc":"asc"):(o(m),n("asc"))};let f=[...t];if(i){const m=e.find(p=>p.header===i);m&&typeof m.accessor=="string"&&f.sort((p,_)=>{const S=p[m.accessor],b=_[m.accessor];return S==null&&b==null?0:S==null?c==="asc"?1:-1:b==null?c==="asc"?-1:1:typeof S=="string"?c==="asc"?S.localeCompare(b):b.localeCompare(S):typeof S=="number"?c==="asc"?S-b:b-S:0})}return v.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsx("tr",{className:"border-b border-border",children:e.map(m=>v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase tracking-wider cursor-pointer hover:text-text-primary select-none",style:{width:m.width},onClick:()=>a(m.header),children:v.jsxs("div",{className:"flex items-center gap-1",children:[m.header,i===m.header&&v.jsx("span",{className:"text-primary",children:c==="asc"?" ▲":" ▼"})]})},m.header))})}),v.jsx("tbody",{children:s?v.jsx("tr",{children:v.jsx("td",{colSpan:e.length,className:"px-4 py-8 text-center text-text-muted",children:"Loading..."})}):f.length===0?v.jsx("tr",{children:v.jsx("td",{colSpan:e.length,className:"px-4 py-8 text-center text-text-muted",children:"No results found"})}):f.map((m,p)=>v.jsx("tr",{onClick:()=>r==null?void 0:r(m),className:`border-b border-border last:border-0 transition-colors ${r?"cursor-pointer hover:bg-hover":"hover:bg-hover/50"}`,children:e.map(_=>v.jsx("td",{className:"px-4 py-3 whitespace-nowrap",children:typeof _.accessor=="function"?_.accessor(m):String(m[_.accessor]??"")},_.header))},p))})]})})}function Ot({label:e,variant:t="default"}){const r={default:"bg-primary/10 text-primary border-primary/20",success:"bg-success/10 text-success border-success/20",warning:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",danger:"bg-danger/10 text-danger border-danger/20"};return v.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[11px] font-semibold border uppercase tracking-wide ${r[t]}`,children:e})}const pS=e=>ne.get(e).then(t=>t.data);function mS(){const[e,t]=M.useState(""),r=fS(e,300),s=Cc(),{dispatch:i}=Fe(),{data:o,isLoading:c}=ct(r.length>=2?`/players?q=${encodeURIComponent(r)}&limit=25`:null,pS,{refreshInterval:3e4}),n=async(f,m,p={})=>{var _,S;try{let b;if(m==="cheater")b=await ne.post(`/players/${f}/cheater`,p);else if(m==="tags")b=await ne.put(`/players/${f}/tags`,p);else{i({type:"ADD_TOAST",payload:{message:`Action "${m}" not yet implemented`,type:"warning"}});return}b.data.success?i({type:"ADD_TOAST",payload:{message:"Action successful",type:"success"}}):i({type:"ADD_TOAST",payload:{message:b.data.error||"Action failed",type:"error"}})}catch(b){i({type:"ADD_TOAST",payload:{message:((S=(_=b.response)==null?void 0:_.data)==null?void 0:S.error)||"Action failed",type:"error"}})}},a=o!=null&&o.success?o.data:[];return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Player Explorer"}),v.jsx("div",{className:"mb-6",children:v.jsxs("div",{className:"relative max-w-md",children:[v.jsx("input",{type:"text",value:e,onChange:f=>t(f.target.value),placeholder:"Search by name, email, or Funcom ID...",className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2.5 pl-10 text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"}),v.jsx("svg",{className:"absolute left-3 top-3 w-4 h-4 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0"})})]})}),v.jsx(Bi,{columns:[{header:"Name",accessor:"character_name"},{header:"Status",accessor:f=>v.jsx(Ot,{label:f.online_status,variant:f.online_status==="Online"?"success":"default"})},{header:"Funcom ID",accessor:"funcom_id"},{header:"Faction",accessor:"faction_name"},{header:"Map",accessor:"map"},{header:"Quick Actions",accessor:f=>v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{onClick:m=>{m.stopPropagation(),n(f.account_id||f.player_controller_id||0,"cheater",{cheat_type:"exploit"})},className:"text-[10px] text-primary hover:underline",children:"Cheater"}),v.jsx("button",{onClick:m=>{m.stopPropagation(),n(f.account_id||f.player_controller_id||0,"tags",{add:["reviewed"]})},className:"text-[10px] text-primary hover:underline",children:"Tag"})]})}],data:a,onRowClick:f=>s(`/players/${f.account_id||f.player_controller_id||0}`),loading:c})]})}const _S=e=>ne.get(e).then(t=>t.data);function gS(){var f;const{accountId:e}=Yg(),t=Cc(),{dispatch:r}=Fe(),[s,i]=M.useState("overview"),{data:o}=ct(e?`/players/${e}`:null,_S,{refreshInterval:3e4}),c=o!=null&&o.success?o.data:null,n=async(m,p={})=>{var _,S;try{const b=await ne.post(m,p);b.data.success?r({type:"ADD_TOAST",payload:{message:"Action successful",type:"success"}}):r({type:"ADD_TOAST",payload:{message:b.data.error||"Failed",type:"error"}})}catch(b){r({type:"ADD_TOAST",payload:{message:((S=(_=b.response)==null?void 0:_.data)==null?void 0:S.error)||"Action failed",type:"error"}})}};if(!c)return v.jsx("div",{className:"text-text-muted",children:"Loading player details..."});const a=[{key:"overview",label:"Overview"},{key:"inventory",label:"Inventory"},{key:"vehicles",label:"Vehicles"},{key:"buildings",label:"Buildings"},{key:"progression",label:"Progression"},{key:"actions",label:"Actions"}];return v.jsxs("div",{children:[v.jsx("div",{className:"flex items-center gap-4 mb-6",children:v.jsx("button",{onClick:()=>t("/players"),className:"text-text-muted hover:text-text-primary text-sm",children:"← Back to Players"})}),v.jsx("div",{className:"flex items-center justify-between mb-6",children:v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary",children:c.character_name}),v.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[v.jsx(Ot,{label:c.online_status,variant:c.is_online?"success":"default"}),c.faction_name&&v.jsx("span",{className:"text-sm text-text-secondary",children:c.faction_name}),(f=c.tags)==null?void 0:f.map(m=>v.jsx(Ot,{label:m,variant:"warning"},m))]})]})}),v.jsx("div",{className:"flex gap-1 mb-6 border-b border-border",children:a.map(m=>v.jsx("button",{onClick:()=>i(m.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${s===m.key?"text-primary border-primary":"text-text-muted border-transparent hover:text-text-primary"}`,children:m.label},m.key))}),s==="overview"&&v.jsx(vS,{player:c}),s==="inventory"&&v.jsx(yS,{player:c}),s==="vehicles"&&v.jsx(SS,{player:c}),s==="buildings"&&v.jsx(xS,{player:c}),s==="progression"&&v.jsx(bS,{player:c}),s==="actions"&&v.jsx(wS,{player:c,onAction:n})]})}function vS({player:e}){const t=e.vitals||{},r=e.currency||[];return v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Character Info"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[v.jsx(We,{label:"Account ID",value:e.account_id}),v.jsx(We,{label:"Controller ID",value:e.player_controller_id}),v.jsx(We,{label:"Pawn ID",value:e.player_pawn_id}),v.jsx(We,{label:"Email",value:e.account_email}),v.jsx(We,{label:"Funcom ID",value:e.funcom_id}),v.jsx(We,{label:"Map",value:e.map}),v.jsx(We,{label:"Life State",value:e.life_state}),v.jsx(We,{label:"Last Login",value:e.last_login_time})]})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Vitals"}),v.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[v.jsx(We,{label:"Health",value:`${t.current_health??"?"}/${t.max_health??"?"}`}),v.jsx(We,{label:"Hydration",value:t.current_hydration??"?"}),v.jsx(We,{label:"Dehydration",value:t.dehydration_penalty??"?"}),v.jsx(We,{label:"Spice",value:t.current_spice??"?"}),v.jsx(We,{label:"Addiction",value:t.spice_addiction_level??"?"}),v.jsx(We,{label:"Tolerance",value:t.spice_tolerance??"?"})]})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Currency"}),v.jsxs("div",{className:"space-y-2",children:[r.length===0&&v.jsx("span",{className:"text-text-muted text-sm",children:"No currency data"}),r.map(s=>v.jsxs("div",{className:"flex justify-between text-sm",children:[v.jsx("span",{className:"text-text-secondary",children:s.currency_label}),v.jsx("span",{className:"text-text-primary font-mono",children:s.balance})]},s.currency_id))]})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Landsraad"}),v.jsx("div",{className:"grid grid-cols-2 gap-4 text-sm",children:e.landsraad?v.jsxs(v.Fragment,{children:[v.jsx(We,{label:"Daily Charges",value:e.landsraad.daily_reward_charges}),v.jsx(We,{label:"Last Term",value:e.landsraad.last_viewed_term_id})]}):v.jsx("span",{className:"text-text-muted",children:"No landsraad data"})})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Faction Reputation"}),v.jsxs("div",{className:"space-y-2",children:[(e.faction_reputation||[]).length===0&&v.jsx("span",{className:"text-text-muted text-sm",children:"No reputation data"}),(e.faction_reputation||[]).map(s=>v.jsxs("div",{className:"flex justify-between text-sm",children:[v.jsx("span",{className:"text-text-secondary",children:s.faction_name||`Faction ${s.faction_id}`}),v.jsx("span",{className:"text-text-primary font-mono",children:s.reputation_amount})]},s.faction_id))]})]})]})}function We({label:e,value:t}){return v.jsxs("div",{children:[v.jsx("div",{className:"text-text-muted text-xs uppercase tracking-wider",children:e}),v.jsx("div",{className:"text-text-primary font-mono",children:t??"N/A"})]})}function yS({player:e}){const t=e.inventories||[],[r,s]=M.useState(null);return v.jsxs("div",{children:[v.jsx("h3",{className:"font-serif text-xl text-primary mb-4",children:"Inventories"}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:t.map(i=>{var o;return v.jsxs("button",{onClick:()=>s(i),className:`text-left p-4 rounded-lg border transition-colors ${(r==null?void 0:r.inventory_id)===i.inventory_id?"bg-primary/10 border-primary":"bg-card-bg border-border hover:bg-hover"}`,children:[v.jsx("div",{className:"text-sm font-medium text-text-primary",children:i.inventory_type_label}),v.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["ID: ",i.inventory_id]}),v.jsxs("div",{className:"text-xs text-text-muted",children:["Items: ",((o=i.items)==null?void 0:o.length)||0]})]},i.inventory_id)})}),r&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsxs("h4",{className:"text-text-primary font-medium mb-3",children:[r.inventory_type_label," Items"]}),v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Item"}),v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Stack"}),v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Quality"}),v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Durability"})]})}),v.jsx("tbody",{children:(r.items||[]).map((i,o)=>v.jsxs("tr",{className:"border-b border-border last:border-0",children:[v.jsx("td",{className:"px-3 py-2",children:i.template_id}),v.jsx("td",{className:"px-3 py-2 font-mono",children:i.stack_size}),v.jsx("td",{className:"px-3 py-2 font-mono",children:i.quality_level}),v.jsx("td",{className:"px-3 py-2 font-mono",children:i.durability!=null?`${Math.round(i.durability)}/${Math.round(i.max_durability)}`:"N/A"})]},o))})]})})]})]})}function SS({player:e}){const t=e.vehicles||[];return v.jsxs("div",{children:[v.jsx("h3",{className:"font-serif text-xl text-primary mb-4",children:"Vehicles"}),t.length===0?v.jsx("div",{className:"text-text-muted",children:"No vehicles found."}):v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(r=>v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-4",children:[v.jsx("div",{className:"text-text-primary font-medium",children:r.display_name||r.class_name}),v.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["Map: ",r.map||"Unknown"]}),v.jsxs("div",{className:"text-xs text-text-muted font-mono",children:["ID: ",r.id]})]},r.id))})]})}function xS({player:e}){const t=e.buildings||[],r=e.landclaims||[];return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"font-serif text-xl text-primary mb-4",children:"Buildings"}),t.length===0?v.jsx("div",{className:"text-text-muted",children:"No buildings found."}):v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(s=>v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-4",children:[v.jsx("div",{className:"text-text-primary font-medium",children:s.class_name}),v.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["Map: ",s.map||"Unknown"]}),v.jsxs("div",{className:"flex gap-2 mt-2",children:[s.is_powered&&v.jsx(Ot,{label:"Powered",variant:"success"}),s.power_level!=null&&v.jsx(Ot,{label:`Power ${s.power_level}`,variant:"default"})]})]},s.id))})]}),v.jsxs("div",{children:[v.jsx("h3",{className:"font-serif text-xl text-primary mb-4",children:"Landclaims"}),r.length===0?v.jsx("div",{className:"text-text-muted",children:"No landclaims found."}):v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(s=>v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-4",children:[v.jsx("div",{className:"text-text-primary font-medium",children:s.class_name}),v.jsxs("div",{className:"text-xs text-text-muted mt-1",children:["Map: ",s.map||"Unknown"]})]},s.id))})]})]})}function bS({player:e}){const t=e.specialization||[],r=e.keystones||[];return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Specialization Tracks"}),t.length===0?v.jsx("div",{className:"text-text-muted",children:"No specialization data."}):v.jsx("div",{className:"space-y-3",children:t.map((s,i)=>v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-text-secondary text-sm",children:s.track_type}),v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsxs("span",{className:"text-text-muted text-xs",children:["XP: ",s.xp_amount]}),v.jsx(Ot,{label:`Lv ${s.level}`,variant:"default"})]})]},i))})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"font-serif text-lg text-primary mb-4",children:"Keystones"}),r.length===0?v.jsx("div",{className:"text-text-muted",children:"No keystones."}):v.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(s=>v.jsx(Ot,{label:s.name,variant:"default"},s.id))})]})]})}function wS({player:e,onAction:t}){const r=e.account_id,[s,i]=M.useState(""),[o,c]=M.useState({currency_id:"0",amount:""}),[n,a]=M.useState({health:"",hydration:"",spice:""}),[f,m]=M.useState({partition:"",x:"",y:"",z:""}),[p,_]=M.useState(""),[S,b]=M.useState("0");return v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsx(Fs,{title:"Currency",children:v.jsxs("div",{className:"space-y-2",children:[v.jsxs("select",{value:o.currency_id,onChange:y=>c({...o,currency_id:y.target.value}),className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:"0",children:"Solari Credits"}),v.jsx("option",{value:"1",children:"House Script"}),v.jsx("option",{value:"2",children:"Spice"})]}),v.jsx("input",{type:"number",value:o.amount,onChange:y=>c({...o,amount:y.target.value}),placeholder:"Amount",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{onClick:()=>t("/currency/adjust",{player_id:r,currency_id:parseInt(o.currency_id),amount:parseFloat(o.amount)}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Adjust"}),v.jsx("button",{onClick:()=>t("/currency/set",{player_id:r,currency_id:parseInt(o.currency_id),amount:parseFloat(o.amount)}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Set Exact"})]})]})}),v.jsx(Fs,{title:"Vitals",children:v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{type:"number",value:n.health,onChange:y=>a({...n,health:y.target.value}),placeholder:"Health",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:n.hydration,onChange:y=>a({...n,hydration:y.target.value}),placeholder:"Hydration",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:n.spice,onChange:y=>a({...n,spice:y.target.value}),placeholder:"Spice",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("button",{onClick:()=>t("/vitals/set",{player_id:r,health:parseFloat(n.health)||void 0,hydration:parseFloat(n.hydration)||void 0,spice:parseFloat(n.spice)||void 0}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Set Vitals"})]})}),v.jsx(Fs,{title:"Teleport",children:v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{value:f.partition,onChange:y=>m({...f,partition:y.target.value}),placeholder:"Partition ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx("input",{type:"number",value:f.x,onChange:y=>m({...f,x:y.target.value}),placeholder:"X",className:"bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:f.y,onChange:y=>m({...f,y:y.target.value}),placeholder:"Y",className:"bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:f.z,onChange:y=>m({...f,z:y.target.value}),placeholder:"Z",className:"bg-card-bg border border-border rounded px-3 py-2 text-sm"})]}),v.jsx("button",{onClick:()=>t("/teleport",{fls_id:r,partition_id:f.partition,x:parseFloat(f.x)||0,y:parseFloat(f.y)||0,z:parseFloat(f.z)||0}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Teleport"})]})}),v.jsx(Fs,{title:"Character",children:v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{value:s,onChange:y=>i(y.target.value),placeholder:"New character name",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("div",{className:"flex flex-wrap gap-2",children:[v.jsx("button",{onClick:()=>t(`/characters/${r}/name`,{name:s}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Rename"}),v.jsx("button",{onClick:()=>t(`/accounts/${r}/demo`,{demo:!0}),className:"px-3 py-1.5 rounded text-xs bg-warning/10 border border-warning/20 text-warning",children:"Set Demo"}),v.jsx("button",{onClick:()=>t(`/accounts/${r}/demo`,{demo:!1}),className:"px-3 py-1.5 rounded text-xs bg-warning/10 border border-warning/20 text-warning",children:"Clear Demo"}),v.jsx("button",{onClick:()=>{confirm("Delete this character? This cannot be undone.")&&t(`/characters/${r}`,{})},className:"px-3 py-1.5 rounded text-xs bg-danger/10 border border-danger/30 text-danger",children:"Delete Character"}),v.jsx("button",{onClick:()=>{confirm("Delete this entire account? This cannot be undone.")&&t(`/accounts/${r}`,{})},className:"px-3 py-1.5 rounded text-xs bg-danger/10 border border-danger/30 text-danger",children:"Delete Account"})]})]})}),v.jsx(Fs,{title:"Moderation",children:v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{value:p,onChange:y=>_(y.target.value),placeholder:"Ban reason",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:S,onChange:y=>b(y.target.value),placeholder:"Duration (hours, 0 = permanent)",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("div",{className:"flex flex-wrap gap-2",children:[v.jsx("button",{onClick:()=>t(`/players/${r}/ban`,{reason:p,duration_hours:parseInt(S)||0}),className:"px-3 py-1.5 rounded text-xs bg-danger/10 border border-danger/30 text-danger",children:"Ban Player"}),v.jsx("button",{onClick:()=>t(`/players/${r}/unban`,{}),className:"px-3 py-1.5 rounded text-xs bg-success/10 border border-success/30 text-success",children:"Unban Player"}),v.jsx("button",{onClick:()=>t(`/players/${r}/kick`,{reason:p}),className:"px-3 py-1.5 rounded text-xs bg-warning/10 border border-warning/20 text-warning",children:"Kick Player"})]})]})})]})}function Fs({title:e,children:t}){return v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h4",{className:"text-text-primary font-medium mb-3",children:e}),t]})}function CS({open:e,title:t,onClose:r,children:s,maxWidth:i="500px"}){return e?v.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-card-bg border border-border rounded-xl shadow-2xl w-full mx-4",style:{maxWidth:i},children:[v.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[v.jsx("h3",{className:"font-serif text-lg text-text-primary",children:t}),v.jsx("button",{onClick:r,className:"text-text-muted hover:text-text-primary text-xl leading-none",children:"×"})]}),v.jsx("div",{className:"p-5 max-h-[80vh] overflow-auto",children:s})]})}):null}const ES=e=>ne.get(e).then(t=>t.data);function kS(){const[e,t]=M.useState(""),[r,s]=M.useState(null),[i,o]=M.useState(null),{dispatch:c}=Fe(),{data:n,isLoading:a}=ct(e.length>=2?`/guilds?q=${encodeURIComponent(e)}&limit=25`:null,ES,{refreshInterval:3e4}),f=async S=>{var b,y;try{const u=await ne.get(`/guilds/${S}`);u.data.success&&o(u.data.data)}catch(u){c({type:"ADD_TOAST",payload:{message:((y=(b=u.response)==null?void 0:b.data)==null?void 0:y.error)||"Failed",type:"error"}})}},m=async()=>{var S,b;try{const y=await ne.delete(`/guilds/${r.guild_id}`);y.data.success?(c({type:"ADD_TOAST",payload:{message:"Guild disbanded",type:"success"}}),s(null),o(null)):c({type:"ADD_TOAST",payload:{message:y.data.error||"Failed",type:"error"}})}catch(y){c({type:"ADD_TOAST",payload:{message:((b=(S=y.response)==null?void 0:S.data)==null?void 0:b.error)||"Failed",type:"error"}})}},p=async(S,b,y)=>{var u,h;try{let l;S==="remove"?l=await ne.delete(`/guilds/${r.guild_id}/members/${b}`):l=await ne.put(`/guilds/${r.guild_id}/members/${b}/role`,{action:S,role_id:y}),l.data.success?(c({type:"ADD_TOAST",payload:{message:"Member updated",type:"success"}}),f(r.guild_id)):c({type:"ADD_TOAST",payload:{message:l.data.error||"Failed",type:"error"}})}catch(l){c({type:"ADD_TOAST",payload:{message:((h=(u=l.response)==null?void 0:u.data)==null?void 0:h.error)||"Failed",type:"error"}})}},_=n!=null&&n.success?n.data:[];return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Guild Manager"}),v.jsx("div",{className:"mb-6",children:v.jsxs("div",{className:"relative max-w-md",children:[v.jsx("input",{type:"text",value:e,onChange:S=>t(S.target.value),placeholder:"Search guilds...",className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2.5 pl-10 text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"}),v.jsx("svg",{className:"absolute left-3 top-3 w-4 h-4 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0"})})]})}),v.jsx(Bi,{columns:[{header:"Name",accessor:"guild_name"},{header:"Faction",accessor:"faction_name"},{header:"Members",accessor:"member_count"},{header:"Online",accessor:"online_count"}],data:_,onRowClick:S=>{s(S),f(S.guild_id)},loading:a}),v.jsx(CS,{open:!!r,title:(r==null?void 0:r.guild_name)||"",onClose:()=>{s(null),o(null)},maxWidth:"700px",children:r&&i&&v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[v.jsx(nn,{label:"Guild ID",value:r.guild_id}),v.jsx(nn,{label:"Members",value:r.member_count}),v.jsx(nn,{label:"Faction",value:r.faction_name||"None"}),v.jsx(nn,{label:"Description",value:r.guild_description||"None"})]}),v.jsxs("div",{className:"border-t border-border pt-4",children:[v.jsx("h4",{className:"text-text-muted text-xs uppercase tracking-wider mb-3",children:"Members"}),v.jsx("div",{className:"overflow-x-auto rounded-lg border border-border max-h-64 overflow-y-auto",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{className:"sticky top-0 bg-card-bg",children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Name"}),v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Role"}),v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Status"}),v.jsx("th",{className:"text-left px-3 py-2 text-text-muted text-[11px] uppercase",children:"Actions"})]})}),v.jsx("tbody",{children:(i.members||[]).map(S=>v.jsxs("tr",{className:"border-b border-border last:border-0",children:[v.jsx("td",{className:"px-3 py-2",children:S.player_name}),v.jsx("td",{className:"px-3 py-2",children:v.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] bg-primary/10 text-primary border border-primary/20",children:S.role_name})}),v.jsx("td",{className:"px-3 py-2 text-xs",children:S.online_status}),v.jsxs("td",{className:"px-3 py-2 flex gap-1",children:[v.jsx("button",{onClick:()=>p("promote",S.player_id,90),className:"text-[10px] text-primary hover:underline",children:"Promote"}),v.jsx("button",{onClick:()=>p("demote",S.player_id,50),className:"text-[10px] text-text-muted hover:underline",children:"Demote"}),v.jsx("button",{onClick:()=>p("remove",S.player_id),className:"text-[10px] text-danger hover:underline",children:"Remove"})]})]},S.player_id))})]})})]}),v.jsx("div",{className:"flex gap-2 pt-4 border-t border-border",children:v.jsx("button",{onClick:m,className:"px-3 py-1.5 rounded text-xs font-medium bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20",children:"Disband Guild"})})]})})]})}function nn({label:e,value:t}){return v.jsxs("div",{children:[v.jsx("div",{className:"text-text-muted text-xs uppercase tracking-wider",children:e}),v.jsx("div",{className:"text-text-primary font-mono",children:t??"N/A"})]})}const RS=e=>ne.get(e).then(t=>t.data);function TS(){const[e,t]=M.useState(""),{dispatch:r}=Fe(),{data:s,isLoading:i}=ct(e.length>=2?`/vehicles?q=${encodeURIComponent(e)}&limit=50`:"/vehicles?limit=100",RS,{refreshInterval:3e4}),o=s!=null&&s.success?s.data:[],c=async(n,a)=>{var f,m;try{const p=await ne.post(`/vehicles/${n}/${a}`,{});p.data.success?r({type:"ADD_TOAST",payload:{message:"Action successful",type:"success"}}):r({type:"ADD_TOAST",payload:{message:p.data.error||"Failed",type:"error"}})}catch(p){r({type:"ADD_TOAST",payload:{message:((m=(f=p.response)==null?void 0:f.data)==null?void 0:m.error)||"Failed",type:"error"}})}};return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Vehicles"}),v.jsx("div",{className:"mb-6",children:v.jsxs("div",{className:"relative max-w-md",children:[v.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"Search vehicles...",className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2.5 pl-10 text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"}),v.jsx("svg",{className:"absolute left-3 top-3 w-4 h-4 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0"})})]})}),v.jsx(Bi,{columns:[{header:"Name",accessor:"display_name"},{header:"Class",accessor:"class_name"},{header:"Map",accessor:"map"},{header:"Owner",accessor:"owner_name"},{header:"Actions",accessor:n=>v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{onClick:a=>{a.stopPropagation(),c(n.id,"repair")},className:"text-xs text-primary hover:underline",children:"Repair"}),v.jsx("button",{onClick:a=>{a.stopPropagation(),c(n.id,"destroy")},className:"text-xs text-danger hover:underline",children:"Destroy"})]})}],data:o,loading:i})]})}const LS=e=>ne.get(e).then(t=>t.data);function DS(){const[e,t]=M.useState(""),{dispatch:r}=Fe(),{data:s,isLoading:i}=ct(e.length>=2?`/buildings?q=${encodeURIComponent(e)}&limit=50`:"/buildings?limit=100",LS,{refreshInterval:3e4}),o=s!=null&&s.success?s.data:[];return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Buildings"}),v.jsx("div",{className:"mb-6",children:v.jsxs("div",{className:"relative max-w-md",children:[v.jsx("input",{type:"text",value:e,onChange:c=>t(c.target.value),placeholder:"Search buildings...",className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2.5 pl-10 text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"}),v.jsx("svg",{className:"absolute left-3 top-3 w-4 h-4 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0"})})]})}),v.jsx(Bi,{columns:[{header:"Class",accessor:"class_name"},{header:"Map",accessor:"map"},{header:"Owner",accessor:"owner_name"},{header:"Power",accessor:c=>v.jsxs("div",{className:"flex gap-1",children:[c.is_powered?v.jsx(Ot,{label:"Powered",variant:"success"}):v.jsx(Ot,{label:"Unpowered",variant:"default"}),c.power_level!=null&&v.jsx(Ot,{label:`Lv ${c.power_level}`,variant:"default"})]})},{header:"Instances",accessor:"instance_count"}],data:o,loading:i})]})}const AS=e=>ne.get(e).then(t=>t.data);function OS(){const e=M.useRef(null),[t,r]=M.useState([]),[s,i]=M.useState("all"),[o,c]=M.useState(null),[n,a]=M.useState(1),[f,m]=M.useState({x:0,y:0}),[p,_]=M.useState(!1),S=M.useRef({x:0,y:0}),{data:b}=ct("/partitions",AS,{refreshInterval:6e4});M.useEffect(()=>{const d=[];b!=null&&b.success&&(b.data||[]).forEach(g=>{g.center_x!=null&&g.center_y!=null&&d.push({id:`partition-${g.partition_id}`,name:g.name||`Partition ${g.partition_id}`,x:g.center_x,y:g.center_y,type:"building"})}),r(d)},[b]),M.useEffect(()=>{const d=e.current;if(!d)return;const g=d.getContext("2d");if(!g)return;const x=window.devicePixelRatio||1,C=d.getBoundingClientRect();d.width=C.width*x,d.height=C.height*x,g.scale(x,x),g.fillStyle="#1a1a1a",g.fillRect(0,0,C.width,C.height),g.strokeStyle="#333",g.lineWidth=1;const k=50*n;for(let E=f.x%k;E<C.width;E+=k)g.beginPath(),g.moveTo(E,0),g.lineTo(E,C.height),g.stroke();for(let E=f.y%k;E<C.height;E+=k)g.beginPath(),g.moveTo(0,E),g.lineTo(C.width,E),g.stroke();(s==="all"?t:t.filter(E=>E.type===s)).forEach(E=>{const L=C.width/2+E.x*.001*n+f.x,N=C.height/2+E.y*.001*n+f.y;g.beginPath(),g.arc(L,N,6,0,Math.PI*2),g.fillStyle=E.type==="player"?"#27ae60":E.type==="vehicle"?"#4a90d9":"#d4af37",g.fill(),g.strokeStyle="#fff",g.lineWidth=1,g.stroke(),g.fillStyle="#c0c0c0",g.font="10px Inter",g.fillText(E.name,L+10,N+3)})},[t,s,n,f]);const y=d=>{d.preventDefault();const g=Math.max(.1,Math.min(10,n+(d.deltaY>0?-.1:.1)));a(g)},u=d=>{_(!0),S.current={x:d.clientX-f.x,y:d.clientY-f.y}},h=d=>{p&&m({x:d.clientX-S.current.x,y:d.clientY-S.current.y})},l=()=>_(!1);return v.jsxs("div",{className:"h-[calc(100vh-140px)] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between mb-4",children:[v.jsx("h1",{className:"font-serif text-3xl text-primary",children:"Map Viewer"}),v.jsxs("div",{className:"flex gap-2",children:[["all","player","vehicle","building"].map(d=>v.jsx("button",{onClick:()=>i(d),className:`px-3 py-1.5 rounded text-xs font-medium border capitalize ${s===d?"bg-primary/10 border-primary text-primary":"bg-card-bg border-border text-text-muted hover:text-text-primary"}`,children:d},d)),v.jsx("button",{onClick:()=>{a(1),m({x:0,y:0})},className:"px-3 py-1.5 rounded text-xs font-medium border bg-card-bg border-border text-text-muted hover:text-text-primary",children:"Reset View"})]})]}),v.jsxs("div",{className:"flex-1 bg-card-bg border border-border rounded-lg overflow-hidden relative",children:[v.jsx("canvas",{ref:e,className:"w-full h-full cursor-grab active:cursor-grabbing",onWheel:y,onMouseDown:u,onMouseMove:h,onMouseUp:l,onMouseLeave:l}),v.jsxs("div",{className:"absolute bottom-4 left-4 bg-card-bg/90 border border-border rounded px-3 py-2 text-xs text-text-muted",children:["Zoom: ",n.toFixed(1),"x | Markers: ",t.length]})]})]})}const NS=e=>ne.get(e).then(t=>t.data);function PS(){const[e,t]=M.useState(""),{dispatch:r}=Fe(),{data:s,isLoading:i}=ct(e.length>=2?`/accounts?q=${encodeURIComponent(e)}&limit=50`:"/accounts?limit=100",NS,{refreshInterval:3e4}),o=s!=null&&s.success?s.data:[];return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Accounts"}),v.jsx("div",{className:"mb-6",children:v.jsxs("div",{className:"relative max-w-md",children:[v.jsx("input",{type:"text",value:e,onChange:c=>t(c.target.value),placeholder:"Search accounts...",className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2.5 pl-10 text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary"}),v.jsx("svg",{className:"absolute left-3 top-3 w-4 h-4 text-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:v.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0"})})]})}),v.jsx(Bi,{columns:[{header:"Email",accessor:"email"},{header:"Funcom ID",accessor:"funcom_id"},{header:"Characters",accessor:"character_count"},{header:"Last Login",accessor:"last_login"}],data:o,loading:i})]})}const Hs=e=>ne.get(e).then(t=>t.data);function BS(){const[e,t]=M.useState("pods"),{dispatch:r}=Fe(),{data:s,mutate:i}=ct("/server/pods",Hs,{refreshInterval:15e3}),{data:o}=ct("/server/deployments",Hs,{refreshInterval:3e4}),{data:c}=ct("/server/metrics?hours=24",Hs,{refreshInterval:6e4}),{data:n}=ct("/server/firewall/status",Hs,{refreshInterval:3e4}),{data:a}=ct("/server/rmq/overview",Hs,{refreshInterval:3e4}),f=s!=null&&s.success?s.data:[],m=o!=null&&o.success?o.data:[],p=c!=null&&c.success?c.data:[],_=async b=>{var y,u;try{const h=await ne.post(`/server/deployments/${b}/restart`);h.data.success?r({type:"ADD_TOAST",payload:{message:"Restart initiated",type:"success"}}):r({type:"ADD_TOAST",payload:{message:h.data.error||"Failed",type:"error"}})}catch(h){r({type:"ADD_TOAST",payload:{message:((u=(y=h.response)==null?void 0:y.data)==null?void 0:u.error)||"Failed",type:"error"}})}},S=async(b,y)=>{var u,h;try{const l=await ne.post(`/server/deployments/${b}/scale`,{replicas:y});l.data.success?r({type:"ADD_TOAST",payload:{message:"Scaled successfully",type:"success"}}):r({type:"ADD_TOAST",payload:{message:l.data.error||"Failed",type:"error"}})}catch(l){r({type:"ADD_TOAST",payload:{message:((h=(u=l.response)==null?void 0:u.data)==null?void 0:h.error)||"Failed",type:"error"}})}};return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Server Control"}),v.jsx("div",{className:"flex gap-1 mb-6 border-b border-border",children:["pods","deployments","metrics","firewall","rmq"].map(b=>v.jsx("button",{onClick:()=>t(b),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors capitalize ${e===b?"text-primary border-primary":"text-text-muted border-transparent hover:text-text-primary"}`,children:b},b))}),e==="pods"&&v.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Name"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Namespace"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Status"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Restarts"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Age"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Actions"})]})}),v.jsx("tbody",{children:f.map(b=>v.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-hover/50",children:[v.jsx("td",{className:"px-4 py-3 font-mono text-xs",children:b.name}),v.jsx("td",{className:"px-4 py-3",children:b.namespace}),v.jsx("td",{className:"px-4 py-3",children:v.jsx(Ot,{label:b.status,variant:b.status==="Running"?"success":b.status==="Pending"?"warning":"danger"})}),v.jsx("td",{className:"px-4 py-3",children:b.restarts}),v.jsx("td",{className:"px-4 py-3",children:b.age}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("button",{onClick:()=>_(b.name),className:"text-xs text-primary hover:underline",children:"Restart"})})]},b.name))})]})}),e==="deployments"&&v.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Name"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Namespace"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Replicas"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Available"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Actions"})]})}),v.jsx("tbody",{children:m.map(b=>v.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-hover/50",children:[v.jsx("td",{className:"px-4 py-3 font-mono text-xs",children:b.name}),v.jsx("td",{className:"px-4 py-3",children:b.namespace}),v.jsx("td",{className:"px-4 py-3",children:b.replicas}),v.jsx("td",{className:"px-4 py-3",children:b.available}),v.jsxs("td",{className:"px-4 py-3 flex gap-2",children:[v.jsx("button",{onClick:()=>S(b.name,b.replicas+1),className:"text-xs px-2 py-1 bg-primary/10 border border-primary/20 rounded text-primary",children:"+1"}),v.jsx("button",{onClick:()=>S(b.name,Math.max(0,b.replicas-1)),className:"text-xs px-2 py-1 bg-primary/10 border border-primary/20 rounded text-primary",children:"-1"}),v.jsx("button",{onClick:()=>_(b.name),className:"text-xs px-2 py-1 bg-danger/10 border border-danger/20 rounded text-danger",children:"Restart"})]})]},b.name))})]})}),e==="metrics"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"Server Metrics (24h)"}),p.length===0?v.jsx("div",{className:"text-text-muted text-sm",children:"No metrics available"}):v.jsx("div",{className:"space-y-2",children:p.slice(-20).map((b,y)=>v.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[v.jsx("span",{className:"text-text-muted w-32",children:new Date(b.timestamp).toLocaleTimeString()}),v.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[v.jsx("span",{className:"text-text-muted w-8",children:"CPU"}),v.jsx("div",{className:"flex-1 h-2 bg-border rounded overflow-hidden",children:v.jsx("div",{className:"h-full bg-primary",style:{width:`${Math.min(100,b.cpu_percent)}%`}})}),v.jsxs("span",{className:"text-text-secondary w-10 text-right",children:[b.cpu_percent,"%"]})]}),v.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[v.jsx("span",{className:"text-text-muted w-12",children:"Mem"}),v.jsx("div",{className:"flex-1 h-2 bg-border rounded overflow-hidden",children:v.jsx("div",{className:"h-full bg-success",style:{width:`${Math.min(100,b.memory_percent)}%`}})}),v.jsxs("span",{className:"text-text-secondary w-10 text-right",children:[b.memory_percent,"%"]})]})]},y))})]}),e==="firewall"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"Firewall Status"}),n!=null&&n.success?v.jsx("pre",{className:"text-xs text-text-secondary font-mono bg-code-bg p-4 rounded overflow-auto",children:JSON.stringify(n.data,null,2)}):v.jsx("div",{className:"text-text-muted text-sm",children:"No firewall data available"})]}),e==="rmq"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"RMQ Overview"}),a!=null&&a.success?v.jsx("pre",{className:"text-xs text-text-secondary font-mono bg-code-bg p-4 rounded overflow-auto",children:JSON.stringify(a.data,null,2)}):v.jsx("div",{className:"text-text-muted text-sm",children:"No RMQ data available"})]})]})}const jS=["all","server","partition"],MS=["na","eu","sea","sa","oc"],IS=["parrish","sietch","bazar"];function FS(){const[e,t]=M.useState("broadcast"),{dispatch:r}=Fe();return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Admin Tools"}),v.jsx("div",{className:"flex gap-1 mb-6 border-b border-border overflow-x-auto no-scrollbar",children:[{key:"broadcast",label:"Broadcast"},{key:"economy",label:"Economy"},{key:"world",label:"World"},{key:"character",label:"Character"},{key:"functions",label:"Functions"},{key:"raw",label:"Raw Query"},{key:"audit",label:"Audit Log"}].map(s=>v.jsx("button",{onClick:()=>t(s.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors whitespace-nowrap ${e===s.key?"text-primary border-primary":"text-text-muted border-transparent hover:text-text-primary"}`,children:s.label},s.key))}),e==="broadcast"&&v.jsx(HS,{dispatch:r}),e==="economy"&&v.jsx(US,{dispatch:r}),e==="world"&&v.jsx(zS,{dispatch:r}),e==="character"&&v.jsx($S,{dispatch:r}),e==="functions"&&v.jsx(WS,{dispatch:r}),e==="raw"&&v.jsx(VS,{dispatch:r}),e==="audit"&&v.jsx(qS,{dispatch:r})]})}function HS({dispatch:e}){const[t,r]=M.useState(""),[s,i]=M.useState("all"),[o,c]=M.useState("na"),[n,a]=M.useState("parrish"),[f,m]=M.useState(!1),p=async()=>{var _,S;if(t.trim()){m(!0);try{const b={message:t.trim()};s==="server"&&(b.server=o),s==="partition"&&(b.server=o,b.partition=n);const y=await ne.post("/broadcast",b);y.data.success?(e({type:"ADD_TOAST",payload:{message:"Broadcast sent",type:"success"}}),r("")):e({type:"ADD_TOAST",payload:{message:y.data.error||"Failed",type:"error"}})}catch(b){e({type:"ADD_TOAST",payload:{message:((S=(_=b.response)==null?void 0:_.data)==null?void 0:S.error)||"Failed",type:"error"}})}finally{m(!1)}}};return v.jsx("div",{className:"max-w-xl",children:v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Scope"}),v.jsx("div",{className:"flex gap-2",children:jS.map(_=>v.jsx("button",{onClick:()=>i(_),className:`px-3 py-1.5 rounded text-xs font-medium border capitalize ${s===_?"bg-primary/10 border-primary text-primary":"bg-card-bg border-border text-text-muted hover:text-text-primary"}`,children:_},_))})]}),s!=="all"&&v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Server"}),v.jsx("select",{value:o,onChange:_=>c(_.target.value),className:"bg-card-bg border border-border rounded px-3 py-2 text-sm text-text-primary",children:MS.map(_=>v.jsx("option",{value:_,children:_.toUpperCase()},_))})]}),s==="partition"&&v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Partition"}),v.jsx("select",{value:n,onChange:_=>a(_.target.value),className:"bg-card-bg border border-border rounded px-3 py-2 text-sm text-text-primary",children:IS.map(_=>v.jsx("option",{value:_,children:_},_))})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Message"}),v.jsx("textarea",{value:t,onChange:_=>r(_.target.value),rows:4,className:"w-full bg-card-bg border border-border rounded-lg px-4 py-3 text-sm text-text-primary placeholder-text-muted focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary resize-y",placeholder:"Enter broadcast message..."})]}),v.jsx("button",{onClick:p,disabled:f||!t.trim(),className:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-dark disabled:opacity-50 transition-colors",children:f?"Sending...":"Send Broadcast"})]})})}function US({dispatch:e}){const[t,r]=M.useState(""),[s,i]=M.useState({template_id:"",stack_size:"1",quality:"0",inventory_id:""}),[o,c]=M.useState({item_id:"",field:"stack_size",value:""}),n=async(a,f)=>{var m,p;try{const _=await ne.post(a,f);_.data.success?e({type:"ADD_TOAST",payload:{message:"Success",type:"success"}}):e({type:"ADD_TOAST",payload:{message:_.data.error||"Failed",type:"error"}})}catch(_){e({type:"ADD_TOAST",payload:{message:((p=(m=_.response)==null?void 0:m.data)==null?void 0:p.error)||"Failed",type:"error"}})}};return v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Add Item"}),v.jsx("input",{value:t,onChange:a=>r(a.target.value),placeholder:"Player ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{value:s.template_id,onChange:a=>i({...s,template_id:a.target.value}),placeholder:"Template ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{value:s.stack_size,onChange:a=>i({...s,stack_size:a.target.value}),placeholder:"Stack Size",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{value:s.quality,onChange:a=>i({...s,quality:a.target.value}),placeholder:"Quality",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{value:s.inventory_id,onChange:a=>i({...s,inventory_id:a.target.value}),placeholder:"Inventory ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("button",{onClick:()=>n("/items/add",{player_id:parseInt(t),template_id:s.template_id,stack_size:parseInt(s.stack_size),quality_level:parseInt(s.quality),inventory_id:parseInt(s.inventory_id)||void 0}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Add Item"})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Edit Item"}),v.jsx("input",{value:o.item_id,onChange:a=>c({...o,item_id:a.target.value}),placeholder:"Item ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("select",{value:o.field,onChange:a=>c({...o,field:a.target.value}),className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm",children:["stack_size","quality_level","durability","ammo"].map(a=>v.jsx("option",{value:a,children:a},a))}),v.jsx("input",{value:o.value,onChange:a=>c({...o,value:a.target.value}),placeholder:"New value",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{onClick:()=>n(`/items/${o.item_id}`,{[o.field]:o.value}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Update"}),v.jsx("button",{onClick:()=>n(`/items/${o.item_id}`,{}),className:"px-3 py-1.5 rounded text-xs bg-danger/10 border border-danger/30 text-danger",children:"Delete"})]})]})]})}function zS({dispatch:e}){const[t,r]=M.useState({fls_id:"",partition:"",x:"",y:"",z:""}),s=async(i,o)=>{var c,n;try{const a=await ne.post(i,o);a.data.success?e({type:"ADD_TOAST",payload:{message:"Success",type:"success"}}):e({type:"ADD_TOAST",payload:{message:a.data.error||"Failed",type:"error"}})}catch(a){e({type:"ADD_TOAST",payload:{message:((n=(c=a.response)==null?void 0:c.data)==null?void 0:n.error)||"Failed",type:"error"}})}};return v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Teleport Player"}),v.jsx("input",{value:t.fls_id,onChange:i=>r({...t,fls_id:i.target.value}),placeholder:"FLS ID / Account ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{value:t.partition,onChange:i=>r({...t,partition:i.target.value}),placeholder:"Partition ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx("input",{type:"number",value:t.x,onChange:i=>r({...t,x:i.target.value}),placeholder:"X",className:"bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:t.y,onChange:i=>r({...t,y:i.target.value}),placeholder:"Y",className:"bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{type:"number",value:t.z,onChange:i=>r({...t,z:i.target.value}),placeholder:"Z",className:"bg-card-bg border border-border rounded px-3 py-2 text-sm"})]}),v.jsx("button",{onClick:()=>s("/teleport",{fls_id:parseInt(t.fls_id),partition_id:t.partition,x:parseFloat(t.x)||0,y:parseFloat(t.y)||0,z:parseFloat(t.z)||0}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Teleport"})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Spice Control"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{onClick:()=>s("/spice/reset",{}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Reset Spice Fields"}),v.jsx("button",{onClick:()=>s("/spice/spawn",{}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Force Spawn"})]})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Partitions"}),v.jsx("button",{onClick:()=>ne.get("/partitions").then(i=>e({type:"ADD_TOAST",payload:{message:"Partitions loaded",type:"info"}})),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"List Partitions"})]})]})}function $S({dispatch:e}){const[t,r]=M.useState(""),[s,i]=M.useState(""),[o,c]=M.useState("true"),n=async(a,f)=>{var m,p;try{const _=await ne.post(a,f);_.data.success?e({type:"ADD_TOAST",payload:{message:"Success",type:"success"}}):e({type:"ADD_TOAST",payload:{message:_.data.error||"Failed",type:"error"}})}catch(_){e({type:"ADD_TOAST",payload:{message:((p=(m=_.response)==null?void 0:m.data)==null?void 0:p.error)||"Failed",type:"error"}})}};return v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Rename Character"}),v.jsx("input",{value:t,onChange:a=>r(a.target.value),placeholder:"Account ID / Character ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("input",{value:s,onChange:a=>i(a.target.value),placeholder:"New Name",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsx("button",{onClick:()=>n(`/characters/${t}/name`,{name:s}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Rename"})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Demo State"}),v.jsx("input",{value:t,onChange:a=>r(a.target.value),placeholder:"Account ID",className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm"}),v.jsxs("select",{value:o,onChange:a=>c(a.target.value),className:"w-full bg-card-bg border border-border rounded px-3 py-2 text-sm",children:[v.jsx("option",{value:"true",children:"Demo"}),v.jsx("option",{value:"false",children:"Normal"})]}),v.jsx("button",{onClick:()=>n(`/accounts/${t}/demo`,{demo:o==="true"}),className:"px-3 py-1.5 rounded text-xs bg-primary/10 border border-primary/20 text-primary",children:"Set Demo State"})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-3",children:[v.jsx("h3",{className:"font-medium text-text-primary",children:"Danger Zone"}),v.jsxs("div",{className:"flex flex-wrap gap-2",children:[v.jsx("button",{onClick:()=>{confirm("Delete character?")&&n(`/characters/${t}`,{})},className:"px-3 py-1.5 rounded text-xs bg-danger/10 border border-danger/30 text-danger",children:"Delete Character"}),v.jsx("button",{onClick:()=>{confirm("Delete account?")&&n(`/accounts/${t}`,{})},className:"px-3 py-1.5 rounded text-xs bg-danger/10 border border-danger/30 text-danger",children:"Delete Account"})]})]})]})}function WS({dispatch:e}){const[t,r]=M.useState(""),[s,i]=M.useState(""),[o,c]=M.useState("{}"),[n,a]=M.useState(""),[f,m]=M.useState(!1),p=async()=>{m(!0);try{const _=JSON.parse(o||"{}"),S=await ne.post("/functions/execute",{schema:t||void 0,function:s,args:_});S.data.success?(a(JSON.stringify(S.data.data,null,2)),e({type:"ADD_TOAST",payload:{message:"Function executed",type:"success"}})):e({type:"ADD_TOAST",payload:{message:S.data.error||"Failed",type:"error"}})}catch(_){e({type:"ADD_TOAST",payload:{message:_.message,type:"error"}})}finally{m(!1)}};return v.jsx("div",{className:"max-w-2xl",children:v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Schema (optional)"}),v.jsx("input",{value:t,onChange:_=>r(_.target.value),className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2 text-sm text-text-primary",placeholder:"e.g., public"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Function Name"}),v.jsx("input",{value:s,onChange:_=>i(_.target.value),className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2 text-sm text-text-primary",placeholder:"e.g., get_player_stats"})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Arguments (JSON)"}),v.jsx("textarea",{value:o,onChange:_=>c(_.target.value),rows:4,className:"w-full bg-card-bg border border-border rounded-lg px-4 py-3 text-sm font-mono text-text-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary resize-y"})]}),v.jsx("button",{onClick:p,disabled:f||!s,className:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-dark disabled:opacity-50 transition-colors",children:f?"Running...":"Execute"}),n&&v.jsx("pre",{className:"mt-4 text-xs font-mono bg-code-bg p-4 rounded overflow-auto text-text-secondary",children:n})]})})}function VS({dispatch:e}){const[t,r]=M.useState(""),[s,i]=M.useState(""),[o,c]=M.useState(!1),n=async()=>{var a,f;c(!0);try{const m=await ne.post("/query",{query:t});m.data.success?(i(JSON.stringify(m.data.data,null,2)),e({type:"ADD_TOAST",payload:{message:"Query executed",type:"success"}})):e({type:"ADD_TOAST",payload:{message:m.data.error||"Failed",type:"error"}})}catch(m){e({type:"ADD_TOAST",payload:{message:((f=(a=m.response)==null?void 0:a.data)==null?void 0:f.error)||m.message,type:"error"}})}finally{c(!1)}};return v.jsx("div",{className:"max-w-3xl",children:v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("label",{className:"text-sm text-text-muted",children:"SQL Query (Read-Only SELECT)"}),v.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider bg-danger/10 px-2 py-0.5 rounded border border-danger/20",children:"Read Only"})]}),v.jsx("textarea",{value:t,onChange:a=>r(a.target.value),rows:6,className:"w-full bg-card-bg border border-border rounded-lg px-4 py-3 text-sm font-mono text-text-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary resize-y",placeholder:"SELECT * FROM public.characters LIMIT 10;"}),v.jsx("button",{onClick:n,disabled:o||!t.trim(),className:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-dark disabled:opacity-50 transition-colors",children:o?"Running...":"Run Query"}),s&&v.jsx("pre",{className:"mt-4 text-xs font-mono bg-code-bg p-4 rounded overflow-auto text-text-secondary",children:s})]})})}function qS({dispatch:e}){const[t,r]=M.useState(50),[s,i]=M.useState([]),[o,c]=M.useState(!1),n=async()=>{var a,f;c(!0);try{const m=await ne.get(`/audit/logs?limit=${t}`);m.data.success&&i(m.data.data)}catch(m){e({type:"ADD_TOAST",payload:{message:((f=(a=m.response)==null?void 0:a.data)==null?void 0:f.error)||"Failed",type:"error"}})}finally{c(!1)}};return v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[v.jsx("button",{onClick:n,disabled:o,className:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-dark disabled:opacity-50 transition-colors",children:o?"Loading...":"Load Logs"}),v.jsx("select",{value:t,onChange:a=>r(Number(a.target.value)),className:"bg-card-bg border border-border rounded px-3 py-2 text-sm text-text-primary",children:[10,25,50,100,250].map(a=>v.jsxs("option",{value:a,children:[a," entries"]},a))})]}),v.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Time"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Admin"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Action"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Target"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Details"})]})}),v.jsx("tbody",{children:s.map((a,f)=>v.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-hover/50",children:[v.jsx("td",{className:"px-4 py-3 text-text-muted text-xs",children:new Date(a.timestamp).toLocaleString()}),v.jsx("td",{className:"px-4 py-3",children:a.admin_name}),v.jsx("td",{className:"px-4 py-3",children:v.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold bg-primary/10 text-primary border border-primary/20",children:a.action})}),v.jsxs("td",{className:"px-4 py-3",children:[a.target_type,": ",a.target_id]}),v.jsx("td",{className:"px-4 py-3 text-xs text-text-muted max-w-md truncate",children:JSON.stringify(a.details)})]},f))})]})})]})}const KS=["Global","Guild","System","Combat"];function XS(){const[e,t]=M.useState("Global"),[r,s]=M.useState([]),i=M.useRef(null);return M.useEffect(()=>{async function o(){try{const c=await ne.get(`/chat/history?channel=${e}&limit=100`);c.data.success&&s(c.data.data)}catch(c){console.error(c)}}o()},[e]),M.useEffect(()=>{const o=new EventSource("/api/events/stream");return o.addEventListener("chat_message",c=>{try{const n=JSON.parse(c.data);(n.channel===e||e==="Global")&&s(a=>[...a.slice(-199),n])}catch{}}),()=>o.close()},[e]),M.useEffect(()=>{var o;(o=i.current)==null||o.scrollIntoView({behavior:"smooth"})},[r]),v.jsxs("div",{className:"h-[calc(100vh-140px)] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between mb-4",children:[v.jsx("h1",{className:"font-serif text-3xl text-primary",children:"Chat Monitor"}),v.jsx("div",{className:"flex gap-2",children:KS.map(o=>v.jsx("button",{onClick:()=>t(o),className:`px-3 py-1.5 rounded text-xs font-medium border ${e===o?"bg-primary/10 border-primary text-primary":"bg-card-bg border-border text-text-muted hover:text-text-primary"}`,children:o},o))})]}),v.jsx("div",{className:"flex-1 bg-card-bg border border-border rounded-lg overflow-hidden flex flex-col",children:v.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-2 font-mono text-sm",children:[r.map(o=>v.jsxs("div",{className:"flex gap-3",children:[v.jsx("span",{className:"text-text-muted text-xs whitespace-nowrap",children:new Date(o.timestamp).toLocaleTimeString()}),v.jsxs("span",{className:"text-primary font-semibold whitespace-nowrap",children:["[",o.channel,"]"]}),v.jsxs("span",{className:"text-accent font-semibold whitespace-nowrap",children:[o.sender,":"]}),v.jsx("span",{className:"text-text-secondary break-all",children:o.message})]},o.id)),v.jsx("div",{ref:i})]})})]})}var Ap={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(self,()=>(()=>{var r={4567:function(c,n,a){var f=this&&this.__decorate||function(d,g,x,C){var k,w=arguments.length,E=w<3?g:C===null?C=Object.getOwnPropertyDescriptor(g,x):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(d,g,x,C);else for(var L=d.length-1;L>=0;L--)(k=d[L])&&(E=(w<3?k(E):w>3?k(g,x,E):k(g,x))||E);return w>3&&E&&Object.defineProperty(g,x,E),E},m=this&&this.__param||function(d,g){return function(x,C){g(x,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const p=a(9042),_=a(6114),S=a(9924),b=a(844),y=a(5596),u=a(4725),h=a(3656);let l=n.AccessibilityManager=class extends b.Disposable{constructor(d,g){super(),this._terminal=d,this._renderService=g,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
||
`))),this.register(this._terminal.onA11yTab(x=>this._handleTab(x))),this.register(this._terminal.onKey(x=>this._handleKey(x.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new y.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,h.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,b.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let g=0;g<d;g++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)),_.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,_.isMac&&this._liveRegion.remove()}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,g){this._liveRegionDebouncer.refresh(d,g,this._terminal.rows)}_renderRows(d,g){const x=this._terminal.buffer,C=x.lines.length.toString();for(let k=d;k<=g;k++){const w=x.translateBufferLineToString(x.ydisp+k,!0),E=(x.ydisp+k+1).toString(),L=this._rowElements[k];L&&(w.length===0?L.innerText=" ":L.textContent=w,L.setAttribute("aria-posinset",E),L.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,g){const x=d.target,C=this._rowElements[g===0?1:this._rowElements.length-2];if(x.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==C)return;let k,w;if(g===0?(k=x,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(k=this._rowElements.shift(),w=x,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),g===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=document.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=l=f([m(1,u.IRenderService)],l)},3614:(c,n)=>{function a(_){return _.replace(/\r?\n/g,"\r")}function f(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function m(_,S,b,y){_=f(_=a(_),b.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(_,!0),S.value=""}function p(_,S,b){const y=b.getBoundingClientRect(),u=_.clientX-y.left-10,h=_.clientY-y.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${u}px`,S.style.top=`${h}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=a,n.bracketTextForPaste=f,n.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},n.handlePasteEvent=function(_,S,b,y){_.stopPropagation(),_.clipboardData&&m(_.clipboardData.getData("text/plain"),S,b,y)},n.paste=m,n.moveTextAreaUnderMouseCursor=p,n.rightClickHandler=function(_,S,b,y,u){p(_,S,b),u&&y.rightClickSelect(_),S.value=y.selectionText,S.select()}},7239:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const f=a(1505);n.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(m,p,_){this._css.set(m,p,_)}getCss(m,p){return this._css.get(m,p)}setColor(m,p,_){this._color.set(m,p,_)}getColor(m,p){return this._color.get(m,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(a,f,m,p){a.addEventListener(f,m,p);let _=!1;return{dispose:()=>{_||(_=!0,a.removeEventListener(f,m,p))}}}},6465:function(c,n,a){var f=this&&this.__decorate||function(u,h,l,d){var g,x=arguments.length,C=x<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,h,l,d);else for(var k=u.length-1;k>=0;k--)(g=u[k])&&(C=(x<3?g(C):x>3?g(h,l,C):g(h,l))||C);return x>3&&C&&Object.defineProperty(h,l,C),C},m=this&&this.__param||function(u,h){return function(l,d){h(l,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier2=void 0;const p=a(3656),_=a(8460),S=a(844),b=a(2585);let y=n.Linkifier2=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(u){super(),this._bufferService=u,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(u){return this._linkProviders.push(u),{dispose:()=>{const h=this._linkProviders.indexOf(u);h!==-1&&this._linkProviders.splice(h,1)}}}attachToDom(u,h,l){this._element=u,this._mouseService=h,this._renderService=l,this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){if(this._lastMouseEvent=u,!this._element||!this._mouseService)return;const h=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const l=u.composedPath();for(let d=0;d<l.length;d++){const g=l[d];if(g.classList.contains("xterm"))break;if(g.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,h){var l,d;this._activeProviderReplies&&h||((l=this._activeProviderReplies)===null||l===void 0||l.forEach(x=>{x==null||x.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=u.y);let g=!1;for(const[x,C]of this._linkProviders.entries())h?!((d=this._activeProviderReplies)===null||d===void 0)&&d.get(x)&&(g=this._checkLinkProviderResult(x,u,g)):C.provideLinks(u.y,k=>{var w,E;if(this._isMouseOut)return;const L=k==null?void 0:k.map(N=>({link:N}));(w=this._activeProviderReplies)===null||w===void 0||w.set(x,L),g=this._checkLinkProviderResult(x,u,g),((E=this._activeProviderReplies)===null||E===void 0?void 0:E.size)===this._linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)})}_removeIntersectingLinks(u,h){const l=new Set;for(let d=0;d<h.size;d++){const g=h.get(d);if(g)for(let x=0;x<g.length;x++){const C=g[x],k=C.link.range.start.y<u?0:C.link.range.start.x,w=C.link.range.end.y>u?this._bufferService.cols:C.link.range.end.x;for(let E=k;E<=w;E++){if(l.has(E)){g.splice(x--,1);break}l.add(E)}}}}_checkLinkProviderResult(u,h,l){var d;if(!this._activeProviderReplies)return l;const g=this._activeProviderReplies.get(u);let x=!1;for(let C=0;C<u;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(x=!0);if(!x&&g){const C=g.find(k=>this._linkAtPosition(k.link,h));C&&(l=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!l)for(let C=0;C<this._activeProviderReplies.size;C++){const k=(d=this._activeProviderReplies.get(C))===null||d===void 0?void 0:d.find(w=>this._linkAtPosition(w.link,h));if(k){l=!0,this._handleNewLink(k);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._element||!this._mouseService||!this._currentLink)return;const h=this._positionFromMouseEvent(u,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,h){this._element&&this._currentLink&&this._lastMouseEvent&&(!u||!h||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(u.link,h)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var l,d;return(d=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||d===void 0?void 0:d.decorations.pointerCursor},set:l=>{var d,g;!((d=this._currentLink)===null||d===void 0)&&d.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&((g=this._element)===null||g===void 0||g.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:()=>{var l,d;return(d=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||d===void 0?void 0:d.decorations.underline},set:l=>{var d,g,x;!((d=this._currentLink)===null||d===void 0)&&d.state&&((x=(g=this._currentLink)===null||g===void 0?void 0:g.state)===null||x===void 0?void 0:x.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const d=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,g=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=d&&this._currentLink.link.range.end.y<=g&&(this._clearCurrentLink(d,g),this._lastMouseEvent&&this._element)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}})))}_linkHover(u,h,l){var d;!((d=this._currentLink)===null||d===void 0)&&d.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(l,h.text)}_fireUnderlineEvent(u,h){const l=u.range,d=this._bufferService.buffer.ydisp,g=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-d-1,l.end.x,l.end.y-d-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(g)}_linkLeave(u,h,l){var d;!((d=this._currentLink)===null||d===void 0)&&d.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(l,h.text)}_linkAtPosition(u,h){const l=u.range.start.y*this._bufferService.cols+u.range.start.x,d=u.range.end.y*this._bufferService.cols+u.range.end.x,g=h.y*this._bufferService.cols+h.x;return l<=g&&g<=d}_positionFromMouseEvent(u,h,l){const d=l.getCoords(u,h,this._bufferService.cols,this._bufferService.rows);if(d)return{x:d[0],y:d[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,h,l,d,g){return{x1:u,y1:h,x2:l,y2:d,cols:this._bufferService.cols,fg:g}}};n.Linkifier2=y=f([m(0,b.IBufferService)],y)},9042:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(c,n,a){var f=this&&this.__decorate||function(y,u,h,l){var d,g=arguments.length,x=g<3?u:l===null?l=Object.getOwnPropertyDescriptor(u,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(y,u,h,l);else for(var C=y.length-1;C>=0;C--)(d=y[C])&&(x=(g<3?d(x):g>3?d(u,h,x):d(u,h))||x);return g>3&&x&&Object.defineProperty(u,h,x),x},m=this&&this.__param||function(y,u){return function(h,l){u(h,l,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const p=a(511),_=a(2585);let S=n.OscLinkProvider=class{constructor(y,u,h){this._bufferService=y,this._optionsService=u,this._oscLinkService=h}provideLinks(y,u){var h;const l=this._bufferService.buffer.lines.get(y-1);if(!l)return void u(void 0);const d=[],g=this._optionsService.rawOptions.linkHandler,x=new p.CellData,C=l.getTrimmedLength();let k=-1,w=-1,E=!1;for(let L=0;L<C;L++)if(w!==-1||l.hasContent(L)){if(l.loadCell(L,x),x.hasExtendedAttrs()&&x.extended.urlId){if(w===-1){w=L,k=x.extended.urlId;continue}E=x.extended.urlId!==k}else w!==-1&&(E=!0);if(E||w!==-1&&L===C-1){const N=(h=this._oscLinkService.getLinkData(k))===null||h===void 0?void 0:h.uri;if(N){const O={start:{x:w+1,y},end:{x:L+(E||L!==C-1?0:1),y}};let P=!1;if(!(g!=null&&g.allowNonHttpProtocols))try{const F=new URL(N);["http:","https:"].includes(F.protocol)||(P=!0)}catch{P=!0}P||d.push({text:N,range:O,activate:(F,z)=>g?g.activate(F,z,O):b(0,z),hover:(F,z)=>{var W;return(W=g==null?void 0:g.hover)===null||W===void 0?void 0:W.call(g,F,z,O)},leave:(F,z)=>{var W;return(W=g==null?void 0:g.leave)===null||W===void 0?void 0:W.call(g,F,z,O)}})}E=!1,x.hasExtendedAttrs()&&x.extended.urlId?(w=L,k=x.extended.urlId):(w=-1,k=-1)}}u(d)}};function b(y,u){if(confirm(`Do you want to navigate to ${u}?
|
||
|
||
WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=S=f([m(0,_.IBufferService),m(1,_.IOptionsService),m(2,_.IOscLinkService)],S)},6193:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(a,f){this._parentWindow=a,this._renderCallback=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,f,m){this._rowCount=m,a=a!==void 0?a:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ScreenDprMonitor=void 0;const f=a(844);class m extends f.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,f.toDisposable)(()=>{this.clearListener()}))}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}n.ScreenDprMonitor=m},3236:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const f=a(3614),m=a(3656),p=a(6465),_=a(9042),S=a(3730),b=a(1680),y=a(3107),u=a(5744),h=a(2950),l=a(1296),d=a(428),g=a(4269),x=a(5114),C=a(8934),k=a(3230),w=a(9312),E=a(4725),L=a(6731),N=a(8055),O=a(8969),P=a(8460),F=a(844),z=a(6114),W=a(8437),V=a(2584),R=a(7399),D=a(5941),A=a(9074),B=a(2585),H=a(5435),q=a(4567),G=typeof window<"u"?window.document:null;class X extends O.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(T={}){super(T),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(p.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((j,$)=>this.refresh(j,$))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(j=>this._reportWindowsOptions(j))),this.register(this._inputHandler.onColor(j=>this._handleColorEvent(j))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(j=>this._afterResize(j.cols,j.rows))),this.register((0,F.toDisposable)(()=>{var j,$;this._customKeyEventHandler=void 0,($=(j=this.element)===null||j===void 0?void 0:j.parentNode)===null||$===void 0||$.removeChild(this.element)}))}_handleColorEvent(T){if(this._themeService)for(const j of T){let $,U="";switch(j.index){case 256:$="foreground",U="10";break;case 257:$="background",U="11";break;case 258:$="cursor",U="12";break;default:$="ansi",U="4;"+j.index}switch(j.type){case 0:const ee=N.color.toColorRGB($==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[$]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${U};${(0,D.toRgbString)(ee)}${V.C1_ESCAPED.ST}`);break;case 1:if($==="ansi")this._themeService.modifyColors(J=>J.ansi[j.index]=N.rgba.toColor(...j.color));else{const J=$;this._themeService.modifyColors(oe=>oe[J]=N.rgba.toColor(...j.color))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.ESC+"[I"),this.updateCursorStyle(T),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)===null||T===void 0?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const T=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(T);if(!j)return;const $=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,ee=j.getWidth($),J=this._renderService.dimensions.css.cell.width*ee,oe=this.buffer.y*this._renderService.dimensions.css.cell.height,ce=$*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ce+"px",this.textarea.style.top=oe+"px",this.textarea.style.width=J+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",j=>{this.hasSelection()&&(0,f.copyHandler)(j,this._selectionService)}));const T=j=>(0,f.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,m.addDisposableDomListener)(this.element,"paste",T)),z.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",j=>{j.button===2&&(0,f.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",j=>{(0,f.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",j=>{j.button===1&&(0,f.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",T=>this._keyUp(T),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",T=>this._keyDown(T),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",T=>this._keyPress(T),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",T=>this._compositionHelper.compositionupdate(T))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,m.addDisposableDomListener)(this.textarea,"input",T=>this._inputEvent(T),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(T){var j;if(!T)throw new Error("Terminal requires a parent element.");T.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=T.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),T.appendChild(this.element);const $=G.createDocumentFragment();this._viewportElement=G.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=G.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=G.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=G.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=G.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,(j=this._document.defaultView)!==null&&j!==void 0?j:window),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(g.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=G.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(b.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(w.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const T=this,j=this.element;function $(J){const oe=T._mouseService.getMouseReportCoords(J,T.screenElement);if(!oe)return!1;let ce,Ne;switch(J.overrideType||J.type){case"mousemove":Ne=32,J.buttons===void 0?(ce=3,J.button!==void 0&&(ce=J.button<3?J.button:3)):ce=1&J.buttons?0:4&J.buttons?1:2&J.buttons?2:3;break;case"mouseup":Ne=0,ce=J.button<3?J.button:3;break;case"mousedown":Ne=1,ce=J.button<3?J.button:3;break;case"wheel":if(T.viewport.getLinesScrolled(J)===0)return!1;Ne=J.deltaY<0?0:1,ce=4;break;default:return!1}return!(Ne===void 0||ce===void 0||ce>4)&&T.coreMouseService.triggerMouseEvent({col:oe.col,row:oe.row,x:oe.x,y:oe.y,button:ce,action:Ne,ctrl:J.ctrlKey,alt:J.altKey,shift:J.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ee={mouseup:J=>($(J),J.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(J)),wheel:J=>($(J),this.cancel(J,!0)),mousedrag:J=>{J.buttons&&$(J)},mousemove:J=>{J.buttons||$(J)}};this.register(this.coreMouseService.onProtocolChange(J=>{J?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(J)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&J?U.mousemove||(j.addEventListener("mousemove",ee.mousemove),U.mousemove=ee.mousemove):(j.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&J?U.wheel||(j.addEventListener("wheel",ee.wheel,{passive:!1}),U.wheel=ee.wheel):(j.removeEventListener("wheel",U.wheel),U.wheel=null),2&J?U.mouseup||(j.addEventListener("mouseup",ee.mouseup),U.mouseup=ee.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),j.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&J?U.mousedrag||(U.mousedrag=ee.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(j,"mousedown",J=>{if(J.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(J))return $(J),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(J)})),this.register((0,m.addDisposableDomListener)(j,"wheel",J=>{if(!U.wheel){if(!this.buffer.hasScrollback){const oe=this.viewport.getLinesScrolled(J);if(oe===0)return;const ce=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(J.deltaY<0?"A":"B");let Ne="";for(let Rr=0;Rr<Math.abs(oe);Rr++)Ne+=ce;return this.coreService.triggerDataEvent(Ne,!0),this.cancel(J,!0)}return this.viewport.handleWheel(J)?this.cancel(J):void 0}},{passive:!1})),this.register((0,m.addDisposableDomListener)(j,"touchstart",J=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(J),this.cancel(J)},{passive:!0})),this.register((0,m.addDisposableDomListener)(j,"touchmove",J=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(J)?void 0:this.cancel(J)},{passive:!1}))}refresh(T,j){var $;($=this._renderService)===null||$===void 0||$.refreshRows(T,j)}updateCursorStyle(T){var j;!((j=this._selectionService)===null||j===void 0)&&j.shouldColumnSelect(T)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(T,j,$=0){var U;$===1?(super.scrollLines(T,j,$),this.refresh(0,this.rows-1)):(U=this.viewport)===null||U===void 0||U.scrollLines(T)}paste(T){(0,f.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}registerLinkProvider(T){return this.linkifier2.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,j,$){this._selectionService.setSelection(T,j,$)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var T;(T=this._selectionService)===null||T===void 0||T.clearSelection()}selectAll(){var T;(T=this._selectionService)===null||T===void 0||T.selectAll()}selectLines(T,j){var $;($=this._selectionService)===null||$===void 0||$.selectLines(T,j)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!j&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const $=(0,R.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),$.type===3||$.type===2){const U=this.rows-1;return this.scrollLines($.type===2?-U:U),this.cancel(T,!0)}return $.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||($.cancel&&this.cancel(T,!0),!$.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):($.key!==V.C0.ETX&&$.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:$.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent($.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,j){const $=T.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||T.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||T.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?$:$&&(!j.keyCode||j.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||(function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18}(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)j=T.charCode;else if(T.which===null||T.which===void 0)j=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;j=T.which}return!(!j||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=T.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(T),!0}return!1}resize(T,j){T!==this.cols||j!==this.rows?super.resize(T,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,j){var $,U;($=this._charSizeService)===null||$===void 0||$.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){var T;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)===null||T===void 0||T.reset(),this.refresh(0,this.rows-1)}}reset(){var T,j;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(T=this._selectionService)===null||T===void 0||T.reset(),this._decorationService.reset(),(j=this.viewport)===null||j===void 0||j.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)===null||T===void 0||T.clearTextureAtlas()}_reportFocus(){var T;!((T=this.element)===null||T===void 0)&&T.classList.contains("focus")?this.coreService.triggerDataEvent(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),$=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${$};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),ee=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${ee};${U}t`)}}cancel(T,j){if(this.options.cancelEvents||j)return T.preventDefault(),T.stopPropagation(),!1}}n.Terminal=X},9924:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(a,f=1e3){this._renderCallback=a,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,f,m){this._rowCount=m,a=a!==void 0?a:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=p-this._lastRefreshMs,S=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,f)}}},1680:function(c,n,a){var f=this&&this.__decorate||function(h,l,d,g){var x,C=arguments.length,k=C<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,l,d,g);else for(var w=h.length-1;w>=0;w--)(x=h[w])&&(k=(C<3?x(k):C>3?x(l,d,k):x(l,d))||k);return C>3&&k&&Object.defineProperty(l,d,k),k},m=this&&this.__param||function(h,l){return function(d,g){l(d,g,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const p=a(3656),_=a(4725),S=a(8460),b=a(844),y=a(2585);let u=n.Viewport=class extends b.Disposable{constructor(h,l,d,g,x,C,k,w){super(),this._viewportElement=h,this._scrollArea=l,this._bufferService=d,this._optionsService=g,this._charSizeService=x,this._renderService=C,this._coreBrowserService=k,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(h){if(h)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(h,l){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&d<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const l=this._getPixelsScrolled(h);return l!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(h,l){var d;let g,x="";const C=[],k=l??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let E=h;E<k;E++){const L=w.get(E);if(!L)continue;const N=(d=w.get(E+1))===null||d===void 0?void 0:d.isWrapped;if(x+=L.translateToString(!N),!N||E===w.length-1){const O=document.createElement("div");O.textContent=x,C.push(O),x.length>0&&(g=O),x=""}}return{bufferElements:C,cursorElement:g}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(h,l){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&l.altKey||d==="ctrl"&&l.ctrlKey||d==="shift"&&l.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const l=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}};n.Viewport=u=f([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,_.ICharSizeService),m(5,_.IRenderService),m(6,_.ICoreBrowserService),m(7,_.IThemeService)],u)},3107:function(c,n,a){var f=this&&this.__decorate||function(u,h,l,d){var g,x=arguments.length,C=x<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,h,l,d);else for(var k=u.length-1;k>=0;k--)(g=u[k])&&(C=(x<3?g(C):x>3?g(h,l,C):g(h,l))||C);return x>3&&C&&Object.defineProperty(h,l,C),C},m=this&&this.__param||function(u,h){return function(l,d){h(l,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const p=a(3656),_=a(4725),S=a(844),b=a(2585);let y=n.BufferDecorationRenderer=class extends S.Disposable{constructor(u,h,l,d){super(),this._screenElement=u,this._bufferService=h,this._decorationService=l,this._renderService=d,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,p.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(g=>this._removeDecoration(g))),this.register((0,S.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const u of this._decorationService.decorations)this._renderDecoration(u);this._dimensionsChanged=!1}_renderDecoration(u){this._refreshStyle(u),this._dimensionsChanged&&this._refreshXPosition(u)}_createElement(u){var h,l;const d=document.createElement("div");d.classList.add("xterm-decoration"),d.classList.toggle("xterm-decoration-top-layer",((h=u==null?void 0:u.options)===null||h===void 0?void 0:h.layer)==="top"),d.style.width=`${Math.round((u.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,d.style.height=(u.options.height||1)*this._renderService.dimensions.css.cell.height+"px",d.style.top=(u.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",d.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=(l=u.options.x)!==null&&l!==void 0?l:0;return g&&g>this._bufferService.cols&&(d.style.display="none"),this._refreshXPosition(u,d),d}_refreshStyle(u){const h=u.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)u.element&&(u.element.style.display="none",u.onRenderEmitter.fire(u.element));else{let l=this._decorationElements.get(u);l||(l=this._createElement(u),u.element=l,this._decorationElements.set(u,l),this._container.appendChild(l),u.onDispose(()=>{this._decorationElements.delete(u),l.remove()})),l.style.top=h*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",u.onRenderEmitter.fire(l)}}_refreshXPosition(u,h=u.element){var l;if(!h)return;const d=(l=u.options.x)!==null&&l!==void 0?l:0;(u.options.anchor||"left")==="right"?h.style.right=d?d*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=d?d*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(u){var h;(h=this._decorationElements.get(u))===null||h===void 0||h.remove(),this._decorationElements.delete(u),u.dispose()}};n.BufferDecorationRenderer=y=f([m(1,b.IBufferService),m(2,b.IDecorationService),m(3,_.IRenderService)],y)},5871:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const f of this._zones)if(f.color===a.options.overviewRulerOptions.color&&f.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,a.marker.line))return;if(this._lineAdjacentToZone(f,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(f,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,f){return f>=a.startBufferLine&&f<=a.endBufferLine}_lineAdjacentToZone(a,f,m){return f>=a.startBufferLine-this._linePadding[m||"full"]&&f<=a.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(a,f){a.startBufferLine=Math.min(a.startBufferLine,f),a.endBufferLine=Math.max(a.endBufferLine,f)}}},5744:function(c,n,a){var f=this&&this.__decorate||function(g,x,C,k){var w,E=arguments.length,L=E<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,C):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,x,C,k);else for(var N=g.length-1;N>=0;N--)(w=g[N])&&(L=(E<3?w(L):E>3?w(x,C,L):w(x,C))||L);return E>3&&L&&Object.defineProperty(x,C,L),L},m=this&&this.__param||function(g,x){return function(C,k){x(C,k,g)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const p=a(5871),_=a(3656),S=a(4725),b=a(844),y=a(2585),u={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let d=n.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,x,C,k,w,E,L){var N;super(),this._viewportElement=g,this._screenElement=x,this._bufferService=C,this._decorationService=k,this._renderService=w,this._optionsService=E,this._coreBrowseService=L,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(N=this._viewportElement.parentElement)===null||N===void 0||N.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)(()=>{var P;(P=this._canvas)===null||P===void 0||P.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const g=Math.floor(this._canvas.width/3),x=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=g,h.center=x,h.right=g,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=h.left,l.right=h.left+h.center}_refreshDrawHeightConstants(){u.full=Math.round(2*this._coreBrowseService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,x=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowseService.dpr);u.left=x,u.center=x,u.right=x}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*u.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const x of this._decorationService.decorations)this._colorZoneStore.addDecoration(x);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const x of g)x.position!=="full"&&this._renderColorZone(x);for(const x of g)x.position==="full"&&this._renderColorZone(x);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(l[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-u[g.position||"full"]/2),h[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+u[g.position||"full"]))}_queueRefresh(g,x){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=x||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=d=f([m(2,y.IBufferService),m(3,y.IDecorationService),m(4,S.IRenderService),m(5,y.IOptionsService),m(6,S.ICoreBrowserService)],d)},2950:function(c,n,a){var f=this&&this.__decorate||function(y,u,h,l){var d,g=arguments.length,x=g<3?u:l===null?l=Object.getOwnPropertyDescriptor(u,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(y,u,h,l);else for(var C=y.length-1;C>=0;C--)(d=y[C])&&(x=(g<3?d(x):g>3?d(u,h,x):d(u,h))||x);return g>3&&x&&Object.defineProperty(u,h,x),x},m=this&&this.__param||function(y,u){return function(h,l){u(h,l,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const p=a(4725),_=a(2585),S=a(2584);let b=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,u,h,l,d,g){this._textarea=y,this._compositionView=u,this._bufferService=h,this._optionsService=l,this._coreService=d,this._renderService=g,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(y){this._compositionView.textContent=y.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(y){if(this._isComposing||this._isSendingComposition){if(y.keyCode===229||y.keyCode===16||y.keyCode===17||y.keyCode===18)return!1;this._finalizeComposition(!1)}return y.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(y){if(this._compositionView.classList.remove("active"),this._isComposing=!1,y){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,h=u.replace(y,"");this._dataAlreadySent=h,u.length>y.length?this._coreService.triggerDataEvent(h,!0):u.length<y.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):u.length===y.length&&u!==y&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const g=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(g.width,1)+"px",this._textarea.style.height=Math.max(g.height,1)+"px",this._textarea.style.lineHeight=g.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};n.CompositionHelper=b=f([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,_.ICoreService),m(5,p.IRenderService)],b)},9806:(c,n)=>{function a(f,m,p){const _=p.getBoundingClientRect(),S=f.getComputedStyle(p),b=parseInt(S.getPropertyValue("padding-left")),y=parseInt(S.getPropertyValue("padding-top"));return[m.clientX-_.left-b,m.clientY-_.top-y]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=a,n.getCoords=function(f,m,p,_,S,b,y,u,h){if(!b)return;const l=a(f,m,p);return l?(l[0]=Math.ceil((l[0]+(h?y/2:0))/y),l[1]=Math.ceil(l[1]/u),l[0]=Math.min(Math.max(l[0],1),_+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),S),l):void 0}},9504:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const f=a(2584);function m(u,h,l,d){const g=u-p(u,l),x=h-p(h,l),C=Math.abs(g-x)-function(k,w,E){let L=0;const N=k-p(k,E),O=w-p(w,E);for(let P=0;P<Math.abs(N-O);P++){const F=_(k,w)==="A"?-1:1,z=E.buffer.lines.get(N+F*P);z!=null&&z.isWrapped&&L++}return L}(u,h,l);return y(C,b(_(u,h),d))}function p(u,h){let l=0,d=h.buffer.lines.get(u),g=d==null?void 0:d.isWrapped;for(;g&&u>=0&&u<h.rows;)l++,d=h.buffer.lines.get(--u),g=d==null?void 0:d.isWrapped;return l}function _(u,h){return u>h?"A":"B"}function S(u,h,l,d,g,x){let C=u,k=h,w="";for(;C!==l||k!==d;)C+=g?1:-1,g&&C>x.cols-1?(w+=x.buffer.translateBufferLineToString(k,!1,u,C),C=0,u=0,k++):!g&&C<0&&(w+=x.buffer.translateBufferLineToString(k,!1,0,u+1),C=x.cols-1,u=C,k--);return w+x.buffer.translateBufferLineToString(k,!1,u,C)}function b(u,h){const l=h?"O":"[";return f.C0.ESC+l+u}function y(u,h){u=Math.floor(u);let l="";for(let d=0;d<u;d++)l+=h;return l}n.moveToCellSequence=function(u,h,l,d){const g=l.buffer.x,x=l.buffer.y;if(!l.buffer.hasScrollback)return function(w,E,L,N,O,P){return m(E,N,O,P).length===0?"":y(S(w,E,w,E-p(E,O),!1,O).length,b("D",P))}(g,x,0,h,l,d)+m(x,h,l,d)+function(w,E,L,N,O,P){let F;F=m(E,N,O,P).length>0?N-p(N,O):E;const z=N,W=function(V,R,D,A,B,H){let q;return q=m(D,A,B,H).length>0?A-p(A,B):R,V<D&&q<=A||V>=D&&q<A?"C":"D"}(w,E,L,N,O,P);return y(S(w,F,L,z,W==="C",O).length,b(W,P))}(g,x,u,h,l,d);let C;if(x===h)return C=g>u?"D":"C",y(Math.abs(g-u),b(C,d));C=x>h?"D":"C";const k=Math.abs(x-h);return y(function(w,E){return E.cols-w}(x>h?u:g,l)+(k-1)*l.cols+1+((x>h?g:u)-1),b(C,d))}},1296:function(c,n,a){var f=this&&this.__decorate||function(O,P,F,z){var W,V=arguments.length,R=V<3?P:z===null?z=Object.getOwnPropertyDescriptor(P,F):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(O,P,F,z);else for(var D=O.length-1;D>=0;D--)(W=O[D])&&(R=(V<3?W(R):V>3?W(P,F,R):W(P,F))||R);return V>3&&R&&Object.defineProperty(P,F,R),R},m=this&&this.__param||function(O,P){return function(F,z){P(F,z,O)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const p=a(3787),_=a(2550),S=a(2223),b=a(6171),y=a(4725),u=a(8055),h=a(8460),l=a(844),d=a(2585),g="xterm-dom-renderer-owner-",x="xterm-rows",C="xterm-fg-",k="xterm-bg-",w="xterm-focus",E="xterm-selection";let L=1,N=n.DomRenderer=class extends l.Disposable{constructor(O,P,F,z,W,V,R,D,A,B){super(),this._element=O,this._screenElement=P,this._viewportElement=F,this._linkifier2=z,this._charSizeService=V,this._optionsService=R,this._bufferService=D,this._coreBrowserService=A,this._themeService=B,this._terminalClass=L++,this._rowElements=[],this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(x),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,b.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(H=>this._injectCss(H))),this._injectCss(this._themeService.colors),this._rowFactory=W.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(g+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(H=>this._handleLinkHover(H))),this.register(this._linkifier2.onHideLinkUnderline(H=>this._handleLinkLeave(H))),this.register((0,l.toDisposable)(()=>{this._element.classList.remove(g+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const O=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*O,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*O),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/O),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/O),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(O){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let P=`${this._terminalSelector} .${x} { color: ${O.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${x} .xterm-dim { color: ${u.color.multiplyOpacity(O.foreground,.5).css};}`,P+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,P+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",P+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${O.cursor.css}; color: ${O.cursorAccent.css}; } 50% { background-color: inherit; color: ${O.cursor.css}; }}`,P+=`${this._terminalSelector} .${x}.${w} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${x}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${O.cursor.css}; color: ${O.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${O.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${O.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${O.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${O.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${O.selectionInactiveBackgroundOpaque.css};}`;for(const[F,z]of O.ansi.entries())P+=`${this._terminalSelector} .${C}${F} { color: ${z.css}; }${this._terminalSelector} .${C}${F}.xterm-dim { color: ${u.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${F} { background-color: ${z.css}; }`;P+=`${this._terminalSelector} .${C}${S.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(O.background).css}; }${this._terminalSelector} .${C}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(O.background),.5).css}; }${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR} { background-color: ${O.foreground.css}; }`,this._themeStyleElement.textContent=P}_setDefaultSpacing(){const O=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${O}px`,this._rowFactory.defaultSpacing=O}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(O,P){for(let F=this._rowElements.length;F<=P;F++){const z=document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(O,P){this._refreshRowElements(O,P),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(w)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(O,P,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(O,P,F),this.renderRows(0,this._bufferService.rows-1),!O||!P)return;const z=O[1]-this._bufferService.buffer.ydisp,W=P[1]-this._bufferService.buffer.ydisp,V=Math.max(z,0),R=Math.min(W,this._bufferService.rows-1);if(V>=this._bufferService.rows||R<0)return;const D=document.createDocumentFragment();if(F){const A=O[0]>P[0];D.appendChild(this._createSelectionElement(V,A?P[0]:O[0],A?O[0]:P[0],R-V+1))}else{const A=z===V?O[0]:0,B=V===W?P[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(V,A,B));const H=R-V-1;if(D.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,H)),V!==R){const q=W===R?P[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(R,0,q))}}this._selectionContainer.appendChild(D)}_createSelectionElement(O,P,F,z=1){const W=document.createElement("div");return W.style.height=z*this.dimensions.css.cell.height+"px",W.style.top=O*this.dimensions.css.cell.height+"px",W.style.left=P*this.dimensions.css.cell.width+"px",W.style.width=this.dimensions.css.cell.width*(F-P)+"px",W}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const O of this._rowElements)O.replaceChildren()}renderRows(O,P){const F=this._bufferService.buffer,z=F.ybase+F.y,W=Math.min(F.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=O;A<=P;A++){const B=A+F.ydisp,H=this._rowElements[A],q=F.lines.get(B);if(!H||!q)break;H.replaceChildren(...this._rowFactory.createRow(q,B,B===z,R,D,W,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${g}${this._terminalClass}`}_handleLinkHover(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!0)}_handleLinkLeave(O){this._setCellUnderline(O.x1,O.x2,O.y1,O.y2,O.cols,!1)}_setCellUnderline(O,P,F,z,W,V){F<0&&(O=0),z<0&&(P=0);const R=this._bufferService.rows-1;F=Math.max(Math.min(F,R),0),z=Math.max(Math.min(z,R),0),W=Math.min(W,this._bufferService.cols);const D=this._bufferService.buffer,A=D.ybase+D.y,B=Math.min(D.x,W-1),H=this._optionsService.rawOptions.cursorBlink,q=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=F;X<=z;++X){const te=X+D.ydisp,T=this._rowElements[X],j=D.lines.get(te);if(!T||!j)break;T.replaceChildren(...this._rowFactory.createRow(j,te,te===A,q,G,B,H,this.dimensions.css.cell.width,this._widthCache,V?X===F?O:0:-1,V?(X===z?P:W)-1:-1))}}};n.DomRenderer=N=f([m(4,d.IInstantiationService),m(5,y.ICharSizeService),m(6,d.IOptionsService),m(7,d.IBufferService),m(8,y.ICoreBrowserService),m(9,y.IThemeService)],N)},3787:function(c,n,a){var f=this&&this.__decorate||function(C,k,w,E){var L,N=arguments.length,O=N<3?k:E===null?E=Object.getOwnPropertyDescriptor(k,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(C,k,w,E);else for(var P=C.length-1;P>=0;P--)(L=C[P])&&(O=(N<3?L(O):N>3?L(k,w,O):L(k,w))||O);return N>3&&O&&Object.defineProperty(k,w,O),O},m=this&&this.__param||function(C,k){return function(w,E){k(w,E,C)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const p=a(2223),_=a(643),S=a(511),b=a(2585),y=a(8055),u=a(4725),h=a(4269),l=a(6171),d=a(3734);let g=n.DomRendererRowFactory=class{constructor(C,k,w,E,L,N,O){this._document=C,this._characterJoinerService=k,this._optionsService=w,this._coreBrowserService=E,this._coreService=L,this._decorationService=N,this._themeService=O,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,k,w){this._selectionStart=C,this._selectionEnd=k,this._columnSelectMode=w}createRow(C,k,w,E,L,N,O,P,F,z,W){const V=[],R=this._characterJoinerService.getJoinedCharacters(k),D=this._themeService.colors;let A,B=C.getNoBgTrimmedLength();w&&B<N+1&&(B=N+1);let H=0,q="",G=0,X=0,te=0,T=!1,j=0,$=!1,U=0;const ee=[],J=z!==-1&&W!==-1;for(let oe=0;oe<B;oe++){C.loadCell(oe,this._workCell);let ce=this._workCell.getWidth();if(ce===0)continue;let Ne=!1,Rr=oe,Y=this._workCell;if(R.length>0&&oe===R[0][0]){Ne=!0;const me=R.shift();Y=new h.JoinedCellData(this._workCell,C.translateToString(!0,me[0],me[1]),me[1]-me[0]),Rr=me[1]-1,ce=Y.getWidth()}const he=this._isCellInSelection(oe,k),fe=w&&oe===N,pe=J&&oe>=z&&oe<=W;let tt=!1;this._decorationService.forEachDecorationAtCell(oe,k,void 0,me=>{tt=!0});let Pe=Y.getChars()||_.WHITESPACE_CELL_CHAR;if(Pe===" "&&(Y.isUnderline()||Y.isOverline())&&(Pe=" "),U=ce*P-F.get(Pe,Y.isBold(),Y.isItalic()),A){if(H&&(he&&$||!he&&!$&&Y.bg===G)&&(he&&$&&D.selectionForeground||Y.fg===X)&&Y.extended.ext===te&&pe===T&&U===j&&!fe&&!Ne&&!tt){q+=Pe,H++;continue}H&&(A.textContent=q),A=this._document.createElement("span"),H=0,q=""}else A=this._document.createElement("span");if(G=Y.bg,X=Y.fg,te=Y.extended.ext,T=pe,j=U,$=he,Ne&&N>=oe&&N<=Rr&&(N=oe),!this._coreService.isCursorHidden&&fe){if(ee.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&ee.push("xterm-cursor-blink"),ee.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":ee.push("xterm-cursor-outline");break;case"block":ee.push("xterm-cursor-block");break;case"bar":ee.push("xterm-cursor-bar");break;case"underline":ee.push("xterm-cursor-underline")}}if(Y.isBold()&&ee.push("xterm-bold"),Y.isItalic()&&ee.push("xterm-italic"),Y.isDim()&&ee.push("xterm-dim"),q=Y.isInvisible()?_.WHITESPACE_CELL_CHAR:Y.getChars()||_.WHITESPACE_CELL_CHAR,Y.isUnderline()&&(ee.push(`xterm-underline-${Y.extended.underlineStyle}`),q===" "&&(q=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())A.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let me=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&me<8&&(me+=8),A.style.textDecorationColor=D.ansi[me].css}Y.isOverline()&&(ee.push("xterm-overline"),q===" "&&(q=" ")),Y.isStrikethrough()&&ee.push("xterm-strikethrough"),pe&&(A.style.textDecoration="underline");let le=Y.getFgColor(),Be=Y.getFgColorMode(),He=Y.getBgColor(),wt=Y.getBgColorMode();const qr=!!Y.isInverse();if(qr){const me=le;le=He,He=me;const Ls=Be;Be=wt,wt=Ls}let Ct,Ue,De,$t=!1;switch(this._decorationService.forEachDecorationAtCell(oe,k,void 0,me=>{me.options.layer!=="top"&&$t||(me.backgroundColorRGB&&(wt=50331648,He=me.backgroundColorRGB.rgba>>8&16777215,Ct=me.backgroundColorRGB),me.foregroundColorRGB&&(Be=50331648,le=me.foregroundColorRGB.rgba>>8&16777215,Ue=me.foregroundColorRGB),$t=me.options.layer==="top")}),!$t&&he&&(Ct=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,He=Ct.rgba>>8&16777215,wt=50331648,$t=!0,D.selectionForeground&&(Be=50331648,le=D.selectionForeground.rgba>>8&16777215,Ue=D.selectionForeground)),$t&&ee.push("xterm-decoration-top"),wt){case 16777216:case 33554432:De=D.ansi[He],ee.push(`xterm-bg-${He}`);break;case 50331648:De=y.rgba.toColor(He>>16,He>>8&255,255&He),this._addStyle(A,`background-color:#${x((He>>>0).toString(16),"0",6)}`);break;default:qr?(De=D.foreground,ee.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):De=D.background}switch(Ct||Y.isDim()&&(Ct=y.color.multiplyOpacity(De,.5)),Be){case 16777216:case 33554432:Y.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(A,De,D.ansi[le],Y,Ct,void 0)||ee.push(`xterm-fg-${le}`);break;case 50331648:const me=y.rgba.toColor(le>>16&255,le>>8&255,255&le);this._applyMinimumContrast(A,De,me,Y,Ct,Ue)||this._addStyle(A,`color:#${x(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(A,De,D.foreground,Y,Ct,void 0)||qr&&ee.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ee.length&&(A.className=ee.join(" "),ee.length=0),fe||Ne||tt?A.textContent=q:H++,U!==this.defaultSpacing&&(A.style.letterSpacing=`${U}px`),V.push(A),oe=Rr}return A&&H&&(A.textContent=q),V}_applyMinimumContrast(C,k,w,E,L,N){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.excludeFromContrastRatioDemands)(E.getCode()))return!1;const O=this._getContrastCache(E);let P;if(L||N||(P=O.getColor(k.rgba,w.rgba)),P===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);P=y.color.ensureContrastRatio(L||k,N||w,F),O.setColor((L||k).rgba,(N||w).rgba,P??null)}return!!P&&(this._addStyle(C,`color:${P.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,k){C.setAttribute("style",`${C.getAttribute("style")||""}${k};`)}_isCellInSelection(C,k){const w=this._selectionStart,E=this._selectionEnd;return!(!w||!E)&&(this._columnSelectMode?w[0]<=E[0]?C>=w[0]&&k>=w[1]&&C<E[0]&&k<=E[1]:C<w[0]&&k>=w[1]&&C>=E[0]&&k<=E[1]:k>w[1]&&k<E[1]||w[1]===E[1]&&k===w[1]&&C>=w[0]&&C<E[0]||w[1]<E[1]&&k===E[1]&&C<E[0]||w[1]<E[1]&&k===w[1]&&C>=w[0])}};function x(C,k,w){for(;C.length<w;)C=k+C;return C}n.DomRendererRowFactory=g=f([m(1,u.ICharacterJoinerService),m(2,b.IOptionsService),m(3,u.ICoreBrowserService),m(4,b.ICoreService),m(5,b.IDecorationService),m(6,u.IThemeService)],g)},2550:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const f=a.createElement("span"),m=a.createElement("span");m.style.fontWeight="bold";const p=a.createElement("span");p.style.fontStyle="italic";const _=a.createElement("span");_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[f,m,p,_],this._container.appendChild(f),this._container.appendChild(m),this._container.appendChild(p),this._container.appendChild(_),a.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(a,f,m,p){a===this._font&&f===this._fontSize&&m===this._weight&&p===this._weightBold||(this._font=a,this._fontSize=f,this._weight=m,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(a,f,m){let p=0;if(!f&&!m&&a.length===1&&(p=a.charCodeAt(0))<256)return this._flat[p]!==-9999?this._flat[p]:this._flat[p]=this._measure(a,0);let _=a;f&&(_+="B"),m&&(_+="I");let S=this._holey.get(_);if(S===void 0){let b=0;f&&(b|=1),m&&(b|=2),S=this._measure(a,b),this._holey.set(_,S)}return S}_measure(a,f){const m=this._measureElements[f];return m.textContent=a.repeat(32),m.offsetWidth/32}}},2223:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const f=a(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(c,n)=>{function a(f){return 57508<=f&&f<=57558}Object.defineProperty(n,"__esModule",{value:!0}),n.createRenderDimensions=n.excludeFromContrastRatioDemands=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},n.isPowerlineGlyph=a,n.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},n.excludeFromContrastRatioDemands=function(f){return a(f)||function(m){return 9472<=m&&m<=9631}(f)},n.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,f=this.selectionEnd;return!(!a||!f)&&(a[1]>f[1]||a[1]===f[1]&&a[0]>f[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,n,a){var f=this&&this.__decorate||function(u,h,l,d){var g,x=arguments.length,C=x<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,h,l,d);else for(var k=u.length-1;k>=0;k--)(g=u[k])&&(C=(x<3?g(C):x>3?g(h,l,C):g(h,l))||C);return x>3&&C&&Object.defineProperty(h,l,C),C},m=this&&this.__param||function(u,h){return function(l,d){h(l,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const p=a(2585),_=a(8460),S=a(844);let b=n.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(u,h,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(u,h,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const u=this._measureStrategy.measure();u.width===this.width&&u.height===this.height||(this.width=u.width,this.height=u.height,this._onCharSizeChange.fire())}};n.CharSizeService=b=f([m(2,p.IOptionsService)],b);class y{constructor(h,l,d){this._document=h,this._parentElement=l,this._optionsService=d,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const h={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return h.width!==0&&h.height!==0&&(this._result.width=h.width/32,this._result.height=Math.ceil(h.height)),this._result}}},4269:function(c,n,a){var f=this&&this.__decorate||function(h,l,d,g){var x,C=arguments.length,k=C<3?l:g===null?g=Object.getOwnPropertyDescriptor(l,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,l,d,g);else for(var w=h.length-1;w>=0;w--)(x=h[w])&&(k=(C<3?x(k):C>3?x(l,d,k):x(l,d))||k);return C>3&&k&&Object.defineProperty(l,d,k),k},m=this&&this.__param||function(h,l){return function(d,g){l(d,g,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const p=a(3734),_=a(643),S=a(511),b=a(2585);class y extends p.AttributeData{constructor(l,d,g){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=d,this._width=g}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=y;let u=n.CharacterJoinerService=class Op{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(l){const d={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(d),d.id}deregister(l){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===l)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(l);if(!d||d.length===0)return[];const g=[],x=d.translateToString(!0);let C=0,k=0,w=0,E=d.getFg(0),L=d.getBg(0);for(let N=0;N<d.getTrimmedLength();N++)if(d.loadCell(N,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==L){if(N-C>1){const O=this._getJoinedRanges(x,w,k,d,C);for(let P=0;P<O.length;P++)g.push(O[P])}C=N,w=k,E=this._workCell.fg,L=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const N=this._getJoinedRanges(x,w,k,d,C);for(let O=0;O<N.length;O++)g.push(N[O])}return g}_getJoinedRanges(l,d,g,x,C){const k=l.substring(d,g);let w=[];try{w=this._characterJoiners[0].handler(k)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const L=this._characterJoiners[E].handler(k);for(let N=0;N<L.length;N++)Op._mergeRanges(w,L[N])}catch(L){console.error(L)}return this._stringRangesToCellRanges(w,x,C),w}_stringRangesToCellRanges(l,d,g){let x=0,C=!1,k=0,w=l[x];if(w){for(let E=g;E<this._bufferService.cols;E++){const L=d.getWidth(E),N=d.getString(E).length||_.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!C&&w[0]<=k&&(w[0]=E,C=!0),w[1]<=k){if(w[1]=E,w=l[++x],!w)break;w[0]<=k?(w[0]=E,C=!0):C=!1}k+=N}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(l,d){let g=!1;for(let x=0;x<l.length;x++){const C=l[x];if(g){if(d[1]<=C[0])return l[x-1][1]=d[1],l;if(d[1]<=C[1])return l[x-1][1]=Math.max(d[1],C[1]),l.splice(x,1),l;l.splice(x,1),x--}else{if(d[1]<=C[0])return l.splice(x,0,d),l;if(d[1]<=C[1])return C[0]=Math.min(d[0],C[0]),l;d[0]<C[1]&&(C[0]=Math.min(d[0],C[0]),g=!0)}}return g?l[l.length-1][1]=d[1]:l.push(d),l}};n.CharacterJoinerService=u=f([m(0,b.IBufferService)],u)},5114:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0,n.CoreBrowserService=class{constructor(a,f){this._textarea=a,this.window=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(c,n,a){var f=this&&this.__decorate||function(b,y,u,h){var l,d=arguments.length,g=d<3?y:h===null?h=Object.getOwnPropertyDescriptor(y,u):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(b,y,u,h);else for(var x=b.length-1;x>=0;x--)(l=b[x])&&(g=(d<3?l(g):d>3?l(y,u,g):l(y,u))||g);return d>3&&g&&Object.defineProperty(y,u,g),g},m=this&&this.__param||function(b,y){return function(u,h){y(u,h,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const p=a(4725),_=a(9806);let S=n.MouseService=class{constructor(b,y){this._renderService=b,this._charSizeService=y}getCoords(b,y,u,h,l){return(0,_.getCoords)(window,b,y,u,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(b,y){const u=(0,_.getCoordsRelativeToElement)(window,b,y);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};n.MouseService=S=f([m(0,p.IRenderService),m(1,p.ICharSizeService)],S)},3230:function(c,n,a){var f=this&&this.__decorate||function(g,x,C,k){var w,E=arguments.length,L=E<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,C):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,x,C,k);else for(var N=g.length-1;N>=0;N--)(w=g[N])&&(L=(E<3?w(L):E>3?w(x,C,L):w(x,C))||L);return E>3&&L&&Object.defineProperty(x,C,L),L},m=this&&this.__param||function(g,x){return function(C,k){x(C,k,g)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const p=a(3656),_=a(6193),S=a(5596),b=a(4725),y=a(8460),u=a(844),h=a(7226),l=a(2585);let d=n.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,x,C,k,w,E,L,N){if(super(),this._rowCount=g,this._charSizeService=k,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new _.RenderDebouncer(L.window,(O,P)=>this._renderRows(O,P)),this.register(this._renderDebouncer),this._screenDprMonitor=new S.ScreenDprMonitor(L.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var O;return(O=this._renderer.value)===null||O===void 0?void 0:O.clear()})),this.register(C.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(w.onDecorationRegistered(()=>this._fullRefresh())),this.register(w.onDecorationRemoved(()=>this._fullRefresh())),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register((0,p.addDisposableDomListener)(L.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(N.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in L.window){const O=new L.window.IntersectionObserver(P=>this._handleIntersectionChange(P[P.length-1]),{threshold:0});O.observe(x),this.register({dispose:()=>O.disconnect()})}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(g,x,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,x,this._rowCount))}_renderRows(g,x){this._renderer.value&&(g=Math.min(g,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(g,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:x}),this._onRender.fire({start:g,end:x}),this._isNextRenderRedrawOnly=!0)}resize(g,x){this._rowCount=x,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(g){this._renderer.value=g,this._renderer.value.onRequestRedraw(x=>this.refreshRows(x.start,x.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,x;this._renderer.value&&((x=(g=this._renderer.value).clearTextureAtlas)===null||x===void 0||x.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(g,x)):this._renderer.value.handleResize(g,x),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)===null||g===void 0||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)===null||g===void 0||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)===null||g===void 0||g.handleFocus()}handleSelectionChanged(g,x,C){var k;this._selectionState.start=g,this._selectionState.end=x,this._selectionState.columnSelectMode=C,(k=this._renderer.value)===null||k===void 0||k.handleSelectionChanged(g,x,C)}handleCursorMove(){var g;(g=this._renderer.value)===null||g===void 0||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)===null||g===void 0||g.clear()}};n.RenderService=d=f([m(2,l.IOptionsService),m(3,b.ICharSizeService),m(4,l.IDecorationService),m(5,l.IBufferService),m(6,b.ICoreBrowserService),m(7,b.IThemeService)],d)},9312:function(c,n,a){var f=this&&this.__decorate||function(w,E,L,N){var O,P=arguments.length,F=P<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,L):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(w,E,L,N);else for(var z=w.length-1;z>=0;z--)(O=w[z])&&(F=(P<3?O(F):P>3?O(E,L,F):O(E,L))||F);return P>3&&F&&Object.defineProperty(E,L,F),F},m=this&&this.__param||function(w,E){return function(L,N){E(L,N,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const p=a(9806),_=a(9504),S=a(456),b=a(4725),y=a(8460),u=a(844),h=a(6114),l=a(4841),d=a(511),g=a(2585),x=" ",C=new RegExp(x,"g");let k=n.SelectionService=class extends u.Disposable{constructor(w,E,L,N,O,P,F,z,W){super(),this._element=w,this._screenElement=E,this._linkifier=L,this._bufferService=N,this._coreService=O,this._mouseService=P,this._optionsService=F,this._renderService=z,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new y.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new y.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(V=>this._handleTrim(V)),this.register(this._bufferService.buffers.onBufferActivate(V=>this._handleBufferActivate(V))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!w||!E||w[0]===E[0]&&w[1]===E[1])}get selectionText(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!w||!E)return"";const L=this._bufferService.buffer,N=[];if(this._activeSelectionMode===3){if(w[0]===E[0])return"";const O=w[0]<E[0]?w[0]:E[0],P=w[0]<E[0]?E[0]:w[0];for(let F=w[1];F<=E[1];F++){const z=L.translateBufferLineToString(F,!0,O,P);N.push(z)}}else{const O=w[1]===E[1]?E[0]:void 0;N.push(L.translateBufferLineToString(w[1],!0,w[0],O));for(let P=w[1]+1;P<=E[1]-1;P++){const F=L.lines.get(P),z=L.translateBufferLineToString(P,!0);F!=null&&F.isWrapped?N[N.length-1]+=z:N.push(z)}if(w[1]!==E[1]){const P=L.lines.get(E[1]),F=L.translateBufferLineToString(E[1],!0,0,E[0]);P&&P.isWrapped?N[N.length-1]+=F:N.push(F)}}return N.map(O=>O.replace(C," ")).join(h.isWindows?`\r
|
||
`:`
|
||
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&w&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(w){const E=this._getMouseBufferCoords(w),L=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!!(L&&N&&E)&&this._areCoordsInSelection(E,L,N)}isCellInSelection(w,E){const L=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!L||!N)&&this._areCoordsInSelection([w,E],L,N)}_areCoordsInSelection(w,E,L){return w[1]>E[1]&&w[1]<L[1]||E[1]===L[1]&&w[1]===E[1]&&w[0]>=E[0]&&w[0]<L[0]||E[1]<L[1]&&w[1]===L[1]&&w[0]<L[0]||E[1]<L[1]&&w[1]===E[1]&&w[0]>=E[0]}_selectWordAtCursor(w,E){var L,N;const O=(N=(L=this._linkifier.currentLink)===null||L===void 0?void 0:L.link)===null||N===void 0?void 0:N.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(w);return!!P&&(this._selectWordAt(P,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,E){this._model.clearSelection(),w=Math.max(w,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const E=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(w){let E=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=L?0:(E>L&&(E-=L),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(w){return h.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const E=this._getMouseBufferCoords(w);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(w){return w.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const N=L.lines.get(this._model.selectionEnd[1]);N&&N.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const E=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const N=(0,_.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(N,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,L=!(!w||!E||w[0]===E[0]&&w[1]===E[1]);L?w&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,E,L)):this._oldHasSelection&&this._fireOnSelectionChange(w,E,L)}_fireOnSelectionChange(w,E,L){this._oldSelectionStart=w,this._oldSelectionEnd=E,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(w,E){let L=E;for(let N=0;E>=N;N++){const O=w.loadCell(N,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:O>1&&E!==N&&(L+=O-1)}return L}setSelection(w,E,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,E],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,E,L=!0,N=!0){if(w[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,P=O.lines.get(w[1]);if(!P)return;const F=O.translateBufferLineToString(w[1],!1);let z=this._convertViewportColToCharacterIndex(P,w[0]),W=z;const V=w[0]-z;let R=0,D=0,A=0,B=0;if(F.charAt(z)===" "){for(;z>0&&F.charAt(z-1)===" ";)z--;for(;W<F.length&&F.charAt(W+1)===" ";)W++}else{let G=w[0],X=w[0];P.getWidth(G)===0&&(R++,G--),P.getWidth(X)===2&&(D++,X++);const te=P.getString(X).length;for(te>1&&(B+=te-1,W+=te-1);G>0&&z>0&&!this._isCharWordSeparator(P.loadCell(G-1,this._workCell));){P.loadCell(G-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(R++,G--):T>1&&(A+=T-1,z-=T-1),z--,G--}for(;X<P.length&&W+1<F.length&&!this._isCharWordSeparator(P.loadCell(X+1,this._workCell));){P.loadCell(X+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,X++):T>1&&(B+=T-1,W+=T-1),W++,X++}}W++;let H=z+V-R+A,q=Math.min(this._bufferService.cols,W-z+R+D-A-B);if(E||F.slice(z,W).trim()!==""){if(L&&H===0&&P.getCodePoint(0)!==32){const G=O.lines.get(w[1]-1);if(G&&P.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(X){const te=this._bufferService.cols-X.start;H-=te,q+=te}}}if(N&&H+q===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const G=O.lines.get(w[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const X=this._getWordAt([0,w[1]+1],!1,!1,!0);X&&(q+=X.length)}}return{start:H,length:q}}}_selectWordAt(w,E){const L=this._getWordAt(w,E);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[L.start,w[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(w){const E=this._getWordAt(w,!0);if(E){let L=w[1];for(;E.start<0;)E.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,L]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const E=this._bufferService.buffer.getWrappedRangeForLine(w),L={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=k=f([m(3,g.IBufferService),m(4,g.ICoreService),m(5,b.IMouseService),m(6,g.IOptionsService),m(7,b.IRenderService),m(8,b.ICoreBrowserService)],k)},4725:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const f=a(8343);n.ICharSizeService=(0,f.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),n.IMouseService=(0,f.createDecorator)("MouseService"),n.IRenderService=(0,f.createDecorator)("RenderService"),n.ISelectionService=(0,f.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(c,n,a){var f=this&&this.__decorate||function(k,w,E,L){var N,O=arguments.length,P=O<3?w:L===null?L=Object.getOwnPropertyDescriptor(w,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(k,w,E,L);else for(var F=k.length-1;F>=0;F--)(N=k[F])&&(P=(O<3?N(P):O>3?N(w,E,P):N(w,E))||P);return O>3&&P&&Object.defineProperty(w,E,P),P},m=this&&this.__param||function(k,w){return function(E,L){w(E,L,k)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const p=a(7239),_=a(8055),S=a(8460),b=a(844),y=a(2585),u=_.css.toColor("#ffffff"),h=_.css.toColor("#000000"),l=_.css.toColor("#ffffff"),d=_.css.toColor("#000000"),g={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let E=0;E<216;E++){const L=w[E/36%6|0],N=w[E/6%6|0],O=w[E%6];k.push({css:_.channels.toCss(L,N,O),rgba:_.channels.toRgba(L,N,O)})}for(let E=0;E<24;E++){const L=8+10*E;k.push({css:_.channels.toCss(L,L,L),rgba:_.channels.toRgba(L,L,L)})}return k})());let x=n.ThemeService=class extends b.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:h,cursor:l,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:g,selectionBackgroundOpaque:_.color.blend(h,g),selectionInactiveBackgroundTransparent:g,selectionInactiveBackgroundOpaque:_.color.blend(h,g),ansi:n.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(k={}){const w=this._colors;if(w.foreground=C(k.foreground,u),w.background=C(k.background,h),w.cursor=C(k.cursor,l),w.cursorAccent=C(k.cursorAccent,d),w.selectionBackgroundTransparent=C(k.selectionBackground,g),w.selectionBackgroundOpaque=_.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=C(k.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=_.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=k.selectionForeground?C(k.selectionForeground,_.NULL_COLOR):void 0,w.selectionForeground===_.NULL_COLOR&&(w.selectionForeground=void 0),_.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=_.color.opacity(w.selectionBackgroundTransparent,.3)),_.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=_.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=n.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=C(k.black,n.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=C(k.red,n.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=C(k.green,n.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=C(k.yellow,n.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=C(k.blue,n.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=C(k.magenta,n.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=C(k.cyan,n.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=C(k.white,n.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=C(k.brightBlack,n.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=C(k.brightRed,n.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=C(k.brightGreen,n.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=C(k.brightYellow,n.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=C(k.brightBlue,n.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=C(k.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=C(k.brightCyan,n.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=C(k.brightWhite,n.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const E=Math.min(w.ansi.length-16,k.extendedAnsi.length);for(let L=0;L<E;L++)w.ansi[L+16]=C(k.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[k]=this._restoreColors.ansi[k]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(k){k(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function C(k,w){if(k!==void 0)try{return _.css.toColor(k)}catch{}return w}n.ThemeService=x=f([m(0,y.IOptionsService)],x)},6349:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const f=a(8460),m=a(844);class p extends m.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const b=new Array(S);for(let y=0;y<Math.min(S,this.length);y++)b[y]=this._array[this._getCyclicIndex(y)];this._array=b,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let b=this._length;b<S;b++)this._array[b]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,b){this._array[this._getCyclicIndex(S)]=b}push(S){this._array[this._getCyclicIndex(this._length)]=S,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(S,b,...y){if(b){for(let u=S;u<this._length-b;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+b)];this._length-=b,this.onDeleteEmitter.fire({index:S,amount:b})}for(let u=this._length-1;u>=S;u--)this._array[this._getCyclicIndex(u+y.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<y.length;u++)this._array[this._getCyclicIndex(S+u)]=y[u];if(y.length&&this.onInsertEmitter.fire({index:S,amount:y.length}),this._length+y.length>this._maxLength){const u=this._length+y.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=y.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,b,y){if(!(b<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let h=b-1;h>=0;h--)this.set(S+h+y,this.get(S+h));const u=S+b+y-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<b;u++)this.set(S+u+y,this.get(S+u))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}n.CircularList=p},1439:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function a(f,m=5){if(typeof f!="object")return f;const p=Array.isArray(f)?[]:{};for(const _ in f)p[_]=m<=1?f[_]:f[_]&&a(f[_],m-1);return p}},8055:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;const f=a(6114);let m=0,p=0,_=0,S=0;var b,y,u,h,l;function d(x){const C=x.toString(16);return C.length<2?"0"+C:C}function g(x,C){return x<C?(C+.05)/(x+.05):(x+.05)/(C+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},function(x){x.toCss=function(C,k,w,E){return E!==void 0?`#${d(C)}${d(k)}${d(w)}${d(E)}`:`#${d(C)}${d(k)}${d(w)}`},x.toRgba=function(C,k,w,E=255){return(C<<24|k<<16|w<<8|E)>>>0}}(b||(n.channels=b={})),function(x){function C(k,w){return S=Math.round(255*w),[m,p,_]=l.toChannels(k.rgba),{css:b.toCss(m,p,_,S),rgba:b.toRgba(m,p,_,S)}}x.blend=function(k,w){if(S=(255&w.rgba)/255,S===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,L=w.rgba>>16&255,N=w.rgba>>8&255,O=k.rgba>>24&255,P=k.rgba>>16&255,F=k.rgba>>8&255;return m=O+Math.round((E-O)*S),p=P+Math.round((L-P)*S),_=F+Math.round((N-F)*S),{css:b.toCss(m,p,_),rgba:b.toRgba(m,p,_)}},x.isOpaque=function(k){return(255&k.rgba)==255},x.ensureContrastRatio=function(k,w,E){const L=l.ensureContrastRatio(k.rgba,w.rgba,E);if(L)return l.toColor(L>>24&255,L>>16&255,L>>8&255)},x.opaque=function(k){const w=(255|k.rgba)>>>0;return[m,p,_]=l.toChannels(w),{css:b.toCss(m,p,_),rgba:w}},x.opacity=C,x.multiplyOpacity=function(k,w){return S=255&k.rgba,C(k,S*w/255)},x.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}}(y||(n.color=y={})),function(x){let C,k;if(!f.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const E=w.getContext("2d",{willReadFrequently:!0});E&&(C=E,C.globalCompositeOperation="copy",k=C.createLinearGradient(0,0,1,1))}x.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return m=parseInt(w.slice(1,2).repeat(2),16),p=parseInt(w.slice(2,3).repeat(2),16),_=parseInt(w.slice(3,4).repeat(2),16),l.toColor(m,p,_);case 5:return m=parseInt(w.slice(1,2).repeat(2),16),p=parseInt(w.slice(2,3).repeat(2),16),_=parseInt(w.slice(3,4).repeat(2),16),S=parseInt(w.slice(4,5).repeat(2),16),l.toColor(m,p,_,S);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const E=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return m=parseInt(E[1]),p=parseInt(E[2]),_=parseInt(E[3]),S=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),l.toColor(m,p,_,S);if(!C||!k)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=k,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[m,p,_,S]=C.getImageData(0,0,1,1).data,S!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(m,p,_,S),css:w}}}(u||(n.css=u={})),function(x){function C(k,w,E){const L=k/255,N=w/255,O=E/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}x.relativeLuminance=function(k){return C(k>>16&255,k>>8&255,255&k)},x.relativeLuminance2=C}(h||(n.rgb=h={})),function(x){function C(w,E,L){const N=w>>24&255,O=w>>16&255,P=w>>8&255;let F=E>>24&255,z=E>>16&255,W=E>>8&255,V=g(h.relativeLuminance2(F,z,W),h.relativeLuminance2(N,O,P));for(;V<L&&(F>0||z>0||W>0);)F-=Math.max(0,Math.ceil(.1*F)),z-=Math.max(0,Math.ceil(.1*z)),W-=Math.max(0,Math.ceil(.1*W)),V=g(h.relativeLuminance2(F,z,W),h.relativeLuminance2(N,O,P));return(F<<24|z<<16|W<<8|255)>>>0}function k(w,E,L){const N=w>>24&255,O=w>>16&255,P=w>>8&255;let F=E>>24&255,z=E>>16&255,W=E>>8&255,V=g(h.relativeLuminance2(F,z,W),h.relativeLuminance2(N,O,P));for(;V<L&&(F<255||z<255||W<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),z=Math.min(255,z+Math.ceil(.1*(255-z))),W=Math.min(255,W+Math.ceil(.1*(255-W))),V=g(h.relativeLuminance2(F,z,W),h.relativeLuminance2(N,O,P));return(F<<24|z<<16|W<<8|255)>>>0}x.ensureContrastRatio=function(w,E,L){const N=h.relativeLuminance(w>>8),O=h.relativeLuminance(E>>8);if(g(N,O)<L){if(O<N){const z=C(w,E,L),W=g(N,h.relativeLuminance(z>>8));if(W<L){const V=k(w,E,L);return W>g(N,h.relativeLuminance(V>>8))?z:V}return z}const P=k(w,E,L),F=g(N,h.relativeLuminance(P>>8));if(F<L){const z=C(w,E,L);return F>g(N,h.relativeLuminance(z>>8))?P:z}return P}},x.reduceLuminance=C,x.increaseLuminance=k,x.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},x.toColor=function(w,E,L,N){return{css:b.toCss(w,E,L,N),rgba:b.toRgba(w,E,L,N)}}}(l||(n.rgba=l={})),n.toPaddedHex=d,n.contrastRatio=g},8969:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const f=a(844),m=a(2585),p=a(4348),_=a(7866),S=a(744),b=a(7302),y=a(6975),u=a(8460),h=a(1753),l=a(1480),d=a(7994),g=a(9282),x=a(5435),C=a(5981),k=a(2660);let w=!1;class E extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(N=>{var O;(O=this._onScrollApi)===null||O===void 0||O.fire(N.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(N){for(const O in N)this.optionsService.options[O]=N[O]}constructor(N){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new b.OptionsService(N)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new C.WriteBuffer((O,P)=>this._inputHandler.parse(O,P))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(N,O){this._writeBuffer.write(N,O)}writeSync(N,O){this._logService.logLevel<=m.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(N,O)}resize(N,O){isNaN(N)||isNaN(O)||(N=Math.max(N,S.MINIMUM_COLS),O=Math.max(O,S.MINIMUM_ROWS),this._bufferService.resize(N,O))}scroll(N,O=!1){this._bufferService.scroll(N,O)}scrollLines(N,O,P){this._bufferService.scrollLines(N,O,P)}scrollPages(N){this.scrollLines(N*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(N){const O=N-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(N,O){return this._inputHandler.registerEscHandler(N,O)}registerDcsHandler(N,O){return this._inputHandler.registerDcsHandler(N,O)}registerCsiHandler(N,O){return this._inputHandler.registerCsiHandler(N,O)}registerOscHandler(N,O){return this._inputHandler.registerOscHandler(N,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let N=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?N=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(N=!0),N?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const N=[];N.push(this.onLineFeed(g.updateWindowsModeWrappedState.bind(null,this._bufferService))),N.push(this.registerCsiHandler({final:"H"},()=>((0,g.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const O of N)O.dispose()})}}}n.CoreTerminal=E},8460:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===a)return void this._listeners.splice(f,1)}}})),this._event}fire(a,f){const m=[];for(let p=0;p<this._listeners.length;p++)m.push(this._listeners[p]);for(let p=0;p<m.length;p++)m[p].call(void 0,a,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(a,f){return a(m=>f.fire(m))}},5435:function(c,n,a){var f=this&&this.__decorate||function(V,R,D,A){var B,H=arguments.length,q=H<3?R:A===null?A=Object.getOwnPropertyDescriptor(R,D):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(V,R,D,A);else for(var G=V.length-1;G>=0;G--)(B=V[G])&&(q=(H<3?B(q):H>3?B(R,D,q):B(R,D))||q);return H>3&&q&&Object.defineProperty(R,D,q),q},m=this&&this.__param||function(V,R){return function(D,A){R(D,A,V)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const p=a(2584),_=a(7116),S=a(2015),b=a(844),y=a(482),u=a(8437),h=a(8460),l=a(643),d=a(511),g=a(3734),x=a(2585),C=a(6242),k=a(6351),w=a(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},L=131072;function N(V,R){if(V>24)return R.setWinLines||!1;switch(V){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var O;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(O||(n.WindowsOptionsReportType=O={}));let P=0;class F extends b.Disposable{getAttrData(){return this._curAttrData}constructor(R,D,A,B,H,q,G,X,te=new S.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=D,this._coreService=A,this._logService=B,this._optionsService=H,this._oscLinkService=q,this._coreMouseService=G,this._unicodeService=X,this._parser=te,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(T=>this._activeBuffer=T.activeBuffer)),this._parser.setCsiHandlerFallback((T,j)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(T),params:j.toArray()})}),this._parser.setEscHandlerFallback(T=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(T)})}),this._parser.setExecuteHandlerFallback(T=>{this._logService.debug("Unknown EXECUTE code: ",{code:T})}),this._parser.setOscHandlerFallback((T,j,$)=>{this._logService.debug("Unknown OSC code: ",{identifier:T,action:j,data:$})}),this._parser.setDcsHandlerFallback((T,j,$)=>{j==="HOOK"&&($=$.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(T),action:j,payload:$})}),this._parser.setPrintHandler((T,j,$)=>this.print(T,j,$)),this._parser.registerCsiHandler({final:"@"},T=>this.insertChars(T)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},T=>this.scrollLeft(T)),this._parser.registerCsiHandler({final:"A"},T=>this.cursorUp(T)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},T=>this.scrollRight(T)),this._parser.registerCsiHandler({final:"B"},T=>this.cursorDown(T)),this._parser.registerCsiHandler({final:"C"},T=>this.cursorForward(T)),this._parser.registerCsiHandler({final:"D"},T=>this.cursorBackward(T)),this._parser.registerCsiHandler({final:"E"},T=>this.cursorNextLine(T)),this._parser.registerCsiHandler({final:"F"},T=>this.cursorPrecedingLine(T)),this._parser.registerCsiHandler({final:"G"},T=>this.cursorCharAbsolute(T)),this._parser.registerCsiHandler({final:"H"},T=>this.cursorPosition(T)),this._parser.registerCsiHandler({final:"I"},T=>this.cursorForwardTab(T)),this._parser.registerCsiHandler({final:"J"},T=>this.eraseInDisplay(T,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},T=>this.eraseInDisplay(T,!0)),this._parser.registerCsiHandler({final:"K"},T=>this.eraseInLine(T,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},T=>this.eraseInLine(T,!0)),this._parser.registerCsiHandler({final:"L"},T=>this.insertLines(T)),this._parser.registerCsiHandler({final:"M"},T=>this.deleteLines(T)),this._parser.registerCsiHandler({final:"P"},T=>this.deleteChars(T)),this._parser.registerCsiHandler({final:"S"},T=>this.scrollUp(T)),this._parser.registerCsiHandler({final:"T"},T=>this.scrollDown(T)),this._parser.registerCsiHandler({final:"X"},T=>this.eraseChars(T)),this._parser.registerCsiHandler({final:"Z"},T=>this.cursorBackwardTab(T)),this._parser.registerCsiHandler({final:"`"},T=>this.charPosAbsolute(T)),this._parser.registerCsiHandler({final:"a"},T=>this.hPositionRelative(T)),this._parser.registerCsiHandler({final:"b"},T=>this.repeatPrecedingCharacter(T)),this._parser.registerCsiHandler({final:"c"},T=>this.sendDeviceAttributesPrimary(T)),this._parser.registerCsiHandler({prefix:">",final:"c"},T=>this.sendDeviceAttributesSecondary(T)),this._parser.registerCsiHandler({final:"d"},T=>this.linePosAbsolute(T)),this._parser.registerCsiHandler({final:"e"},T=>this.vPositionRelative(T)),this._parser.registerCsiHandler({final:"f"},T=>this.hVPosition(T)),this._parser.registerCsiHandler({final:"g"},T=>this.tabClear(T)),this._parser.registerCsiHandler({final:"h"},T=>this.setMode(T)),this._parser.registerCsiHandler({prefix:"?",final:"h"},T=>this.setModePrivate(T)),this._parser.registerCsiHandler({final:"l"},T=>this.resetMode(T)),this._parser.registerCsiHandler({prefix:"?",final:"l"},T=>this.resetModePrivate(T)),this._parser.registerCsiHandler({final:"m"},T=>this.charAttributes(T)),this._parser.registerCsiHandler({final:"n"},T=>this.deviceStatus(T)),this._parser.registerCsiHandler({prefix:"?",final:"n"},T=>this.deviceStatusPrivate(T)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},T=>this.softReset(T)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},T=>this.setCursorStyle(T)),this._parser.registerCsiHandler({final:"r"},T=>this.setScrollRegion(T)),this._parser.registerCsiHandler({final:"s"},T=>this.saveCursor(T)),this._parser.registerCsiHandler({final:"t"},T=>this.windowOptions(T)),this._parser.registerCsiHandler({final:"u"},T=>this.restoreCursor(T)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},T=>this.insertColumns(T)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},T=>this.deleteColumns(T)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},T=>this.selectProtected(T)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},T=>this.requestMode(T,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},T=>this.requestMode(T,!1)),this._parser.setExecuteHandler(p.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(p.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(p.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(p.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(p.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(p.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(p.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(p.C1.IND,()=>this.index()),this._parser.setExecuteHandler(p.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(p.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(T=>(this.setTitle(T),this.setIconName(T),!0))),this._parser.registerOscHandler(1,new C.OscHandler(T=>this.setIconName(T))),this._parser.registerOscHandler(2,new C.OscHandler(T=>this.setTitle(T))),this._parser.registerOscHandler(4,new C.OscHandler(T=>this.setOrReportIndexedColor(T))),this._parser.registerOscHandler(8,new C.OscHandler(T=>this.setHyperlink(T))),this._parser.registerOscHandler(10,new C.OscHandler(T=>this.setOrReportFgColor(T))),this._parser.registerOscHandler(11,new C.OscHandler(T=>this.setOrReportBgColor(T))),this._parser.registerOscHandler(12,new C.OscHandler(T=>this.setOrReportCursorColor(T))),this._parser.registerOscHandler(104,new C.OscHandler(T=>this.restoreIndexedColor(T))),this._parser.registerOscHandler(110,new C.OscHandler(T=>this.restoreFgColor(T))),this._parser.registerOscHandler(111,new C.OscHandler(T=>this.restoreBgColor(T))),this._parser.registerOscHandler(112,new C.OscHandler(T=>this.restoreCursorColor(T))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const T in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:T},()=>this.selectCharset("("+T)),this._parser.registerEscHandler({intermediates:")",final:T},()=>this.selectCharset(")"+T)),this._parser.registerEscHandler({intermediates:"*",final:T},()=>this.selectCharset("*"+T)),this._parser.registerEscHandler({intermediates:"+",final:T},()=>this.selectCharset("+"+T)),this._parser.registerEscHandler({intermediates:"-",final:T},()=>this.selectCharset("-"+T)),this._parser.registerEscHandler({intermediates:".",final:T},()=>this.selectCharset("."+T)),this._parser.registerEscHandler({intermediates:"/",final:T},()=>this.selectCharset("/"+T));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(T=>(this._logService.error("Parsing error: ",T),T)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((T,j)=>this.requestStatusString(T,j)))}_preserveStack(R,D,A,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=A,this._parseStack.position=B}_logSlowResolvingAsync(R){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([R,new Promise((D,A)=>setTimeout(()=>A("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,D){let A,B=this._activeBuffer.x,H=this._activeBuffer.y,q=0;const G=this._parseStack.paused;if(G){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(A),A;B=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>L&&(q=this._parseStack.position+L)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,X=>String.fromCharCode(X)).join("")}"`),typeof R=="string"?R.split("").map(X=>X.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<L&&(this._parseBuffer=new Uint32Array(Math.min(R.length,L))),G||this._dirtyRowTracker.clearRange(),R.length>L)for(let X=q;X<R.length;X+=L){const te=X+L<R.length?X+L:R.length,T=typeof R=="string"?this._stringDecoder.decode(R.substring(X,te),this._parseBuffer):this._utf8Decoder.decode(R.subarray(X,te),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,T))return this._preserveStack(B,H,T,X),this._logSlowResolvingAsync(A),A}else if(!G){const X=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,X))return this._preserveStack(B,H,X,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===B&&this._activeBuffer.y===H||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(R,D,A){let B,H;const q=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,X=this._bufferService.cols,te=this._coreService.decPrivateModes.wraparound,T=this._coreService.modes.insertMode,j=this._curAttrData;let $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-D>0&&$.getWidth(this._activeBuffer.x-1)===2&&$.setCellFromCodePoint(this._activeBuffer.x-1,0,1,j.fg,j.bg,j.extended);for(let U=D;U<A;++U){if(B=R[U],H=this._unicodeService.wcwidth(B),B<127&&q){const ee=q[String.fromCharCode(B)];ee&&(B=ee.charCodeAt(0))}if(G&&this._onA11yChar.fire((0,y.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),H||!this._activeBuffer.x){if(this._activeBuffer.x+H-1>=X){if(te){for(;this._activeBuffer.x<X;)$.setCellFromCodePoint(this._activeBuffer.x++,0,1,j.fg,j.bg,j.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=X-1,H===2)continue}if(T&&($.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(j),j),$.getWidth(X-1)===2&&$.setCellFromCodePoint(X-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,j.fg,j.bg,j.extended)),$.setCellFromCodePoint(this._activeBuffer.x++,B,H,j.fg,j.bg,j.extended),H>0)for(;--H;)$.setCellFromCodePoint(this._activeBuffer.x++,0,0,j.fg,j.bg,j.extended)}else $.getWidth(this._activeBuffer.x-1)?$.addCodepointToCell(this._activeBuffer.x-1,B):$.addCodepointToCell(this._activeBuffer.x-2,B)}A-D>0&&($.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<X&&A-D>0&&$.getWidth(this._activeBuffer.x)===0&&!$.hasContent(this._activeBuffer.x)&&$.setCellFromCodePoint(this._activeBuffer.x,0,1,j.fg,j.bg,j.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,D){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,D):this._parser.registerCsiHandler(R,A=>!N(A.params[0],this._optionsService.rawOptions.windowOptions)||D(A))}registerDcsHandler(R,D){return this._parser.registerDcsHandler(R,new k.DcsHandler(D))}registerEscHandler(R,D){return this._parser.registerEscHandler(R,D)}registerOscHandler(R,D){return this._parser.registerOscHandler(R,new C.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||R===void 0)&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(R,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=R,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+D)}cursorUp(R){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const D=R.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=R.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=R.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const D=R.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,D,A,B=!1,H=!1){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);q.replaceCells(D,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),H),B&&(q.isWrapped=!1)}_resetBufferLine(R,D=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),A.isWrapped=!1)}eraseInDisplay(R,D=!1){let A;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);A<this._bufferService.rows;A++)this._resetBufferLine(A,D);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,D);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(R,D=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let D=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;D--;)this._activeBuffer.lines.splice(H-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let D=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;D--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let D=R.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(R){let D=R.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){if(!this._parser.precedingCodepoint)return!0;const D=R.params[0]||1,A=new Uint32Array(D);for(let B=0;B<D;++B)A[B]=this._parser.precedingCodepoint;return this.print(A,0,A.length),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let D=0;D<R.length;D++)switch(R.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let D=0;D<R.length;D++)switch(R.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let D=0;D<R.length;D++)switch(R.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let D=0;D<R.length;D++)switch(R.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,D){const A=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:H}=this._coreMouseService,q=this._coreService,{buffers:G,cols:X}=this._bufferService,{active:te,alt:T}=G,j=this._optionsService.rawOptions,$=oe=>oe?1:2,U=R.params[0];return ee=U,J=D?U===2?4:U===4?$(q.modes.insertMode):U===12?3:U===20?$(j.convertEol):0:U===1?$(A.applicationCursorKeys):U===3?j.windowOptions.setWinLines?X===80?2:X===132?1:0:0:U===6?$(A.origin):U===7?$(A.wraparound):U===8?3:U===9?$(B==="X10"):U===12?$(j.cursorBlink):U===25?$(!q.isCursorHidden):U===45?$(A.reverseWraparound):U===66?$(A.applicationKeypad):U===67?4:U===1e3?$(B==="VT200"):U===1002?$(B==="DRAG"):U===1003?$(B==="ANY"):U===1004?$(A.sendFocus):U===1005?4:U===1006?$(H==="SGR"):U===1015?4:U===1016?$(H==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?$(te===T):U===2004?$(A.bracketedPasteMode):0,q.triggerDataEvent(`${p.C0.ESC}[${D?"":"?"}${ee};${J}$y`),!0;var ee,J}_updateAttrColor(R,D,A,B,H){return D===2?(R|=50331648,R&=-16777216,R|=g.AttributeData.fromColorRGB([A,B,H])):D===5&&(R&=-50331904,R|=33554432|255&A),R}_extractColor(R,D,A){const B=[0,0,-1,0,0,0];let H=0,q=0;do{if(B[q+H]=R.params[D+q],R.hasSubParams(D+q)){const G=R.getSubParams(D+q);let X=0;do B[1]===5&&(H=1),B[q+X+1+H]=G[X];while(++X<G.length&&X+q+1+H<B.length);break}if(B[1]===5&&q+H>=2||B[1]===2&&q+H>=5)break;B[1]&&(H=1)}while(++q+D<R.length&&q+H<B.length);for(let G=2;G<B.length;++G)B[G]===-1&&(B[G]=0);switch(B[0]){case 38:A.fg=this._updateAttrColor(A.fg,B[1],B[3],B[4],B[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,B[1],B[3],B[4],B[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,B[1],B[3],B[4],B[5])}return q}_processUnderline(R,D){D.extended=D.extended.clone(),(!~R||R>5)&&(R=1),D.extended.underlineStyle=R,D.fg|=268435456,R===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(R){R.fg=u.DEFAULT_ATTR_DATA.fg,R.bg=u.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=R.length;let A;const B=this._curAttrData;for(let H=0;H<D;H++)A=R.params[H],A>=30&&A<=37?(B.fg&=-50331904,B.fg|=16777216|A-30):A>=40&&A<=47?(B.bg&=-50331904,B.bg|=16777216|A-40):A>=90&&A<=97?(B.fg&=-50331904,B.fg|=16777224|A-90):A>=100&&A<=107?(B.bg&=-50331904,B.bg|=16777224|A-100):A===0?this._processSGR0(B):A===1?B.fg|=134217728:A===3?B.bg|=67108864:A===4?(B.fg|=268435456,this._processUnderline(R.hasSubParams(H)?R.getSubParams(H)[0]:1,B)):A===5?B.fg|=536870912:A===7?B.fg|=67108864:A===8?B.fg|=1073741824:A===9?B.fg|=2147483648:A===2?B.bg|=134217728:A===21?this._processUnderline(2,B):A===22?(B.fg&=-134217729,B.bg&=-134217729):A===23?B.bg&=-67108865:A===24?(B.fg&=-268435457,this._processUnderline(0,B)):A===25?B.fg&=-536870913:A===27?B.fg&=-67108865:A===28?B.fg&=-1073741825:A===29?B.fg&=2147483647:A===39?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):A===49?(B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?H+=this._extractColor(R,H,B):A===53?B.bg|=1073741824:A===55?B.bg&=-1073741825:A===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):A===100?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${D};${A}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const D=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${D};${A}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const D=R.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=D%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(R){const D=R.params[0]||1;let A;return(R.length<2||(A=R.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(R){if(!N(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(O.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(O.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(R){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const D=[],A=R.split(";");for(;A.length>1;){const B=A.shift(),H=A.shift();if(/^\d+$/.exec(B)){const q=parseInt(B);if(W(q))if(H==="?")D.push({type:0,index:q});else{const G=(0,w.parseColor)(H);G&&D.push({type:1,index:q,color:G})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(R){const D=R.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(R,D){this._getCurrentLinkId()&&this._finishHyperlink();const A=R.split(":");let B;const H=A.findIndex(q=>q.startsWith("id="));return H!==-1&&(B=A[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,D){const A=R.split(";");for(let B=0;B<A.length&&!(D>=this._specialColors.length);++B,++D)if(A[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const H=(0,w.parseColor)(A[B]);H&&this._onColor.fire([{type:1,index:this._specialColors[D],color:H}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const D=[],A=R.split(";");for(let B=0;B<A.length;++B)if(/^\d+$/.exec(A[B])){const H=parseInt(A[B]);W(H)&&D.push({type:2,index:H})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(E[R[0]],_.CHARSETS[R[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new d.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const A=this._activeBuffer.ybase+this._activeBuffer.y+D,B=this._activeBuffer.lines.get(A);B&&(B.fill(R),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,D){const A=this._bufferService.buffer,B=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${H}${p.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,D){this._dirtyRowTracker.markRangeDirty(R,D)}}n.InputHandler=F;let z=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,R){V>R&&(P=V,V=R,R=P),V<this.start&&(this.start=V),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(V){return 0<=V&&V<256}z=f([m(0,x.IBufferService)],z)},844:(c,n)=>{function a(f){for(const m of f)m.dispose();f.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const m=this._disposables.indexOf(f);m!==-1&&this._disposables.splice(m,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var m;this._isDisposed||f===this._value||((m=this._value)===null||m===void 0||m.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}},n.toDisposable=function(f){return{dispose:f}},n.disposeArray=a,n.getDisposeArrayDisposable=function(f){return{dispose:()=>a(f)}}},1505:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,p,_){this._data[m]||(this._data[m]={}),this._data[m][p]=_}get(m,p){return this._data[m]?this._data[m][p]:void 0}clear(){this._data={}}}n.TwoKeyMap=a,n.FourKeyMap=class{constructor(){this._data=new a}set(f,m,p,_,S){this._data.get(f,m)||this._data.set(f,m,new a),this._data.get(f,m).set(p,_,S)}get(f,m,p,_){var S;return(S=this._data.get(f,m))===null||S===void 0?void 0:S.get(p,_)}clear(){this._data.clear()}}},6114:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof navigator>"u";const a=n.isNode?"node":navigator.userAgent,f=n.isNode?"node":navigator.platform;n.isFirefox=a.includes("Firefox"),n.isLegacyEdge=a.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(a),n.getSafariVersion=function(){if(!n.isSafari)return 0;const m=a.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),n.isIpad=f==="iPad",n.isIphone=f==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),n.isLinux=f.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(a)},6106:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let a=0;n.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(a=this._search(this._getKey(f)),this._array.splice(a,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const m=this._getKey(f);if(m===void 0||(a=this._search(m),a===-1)||this._getKey(this._array[a])!==m)return!1;do if(this._array[a]===f)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===m);return!1}*getKeyIterator(f){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===f)}forEachByKey(f,m){if(this._array.length!==0&&(a=this._search(f),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===f))do m(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===f)}values(){return[...this._array].values()}_search(f){let m=0,p=this._array.length-1;for(;p>=m;){let _=m+p>>1;const S=this._getKey(this._array[_]);if(S>f)p=_-1;else{if(!(S<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}m=_+1}}return m}}},7226:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const f=a(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let b=0,y=0,u=S.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(b=Date.now(),this._tasks[this._i]()||this._i++,b=Math.max(1,Date.now()-b),y=Math.max(b,y),h=S.timeRemaining(),1.5*y>h)return u-b<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-b))}ms`),void this._start();u=h}this.clear()}}class p extends m{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const b=Date.now()+S;return{timeRemaining:()=>Math.max(0,b-Date.now())}}}n.PriorityTaskQueue=p,n.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:p,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const f=a(643);n.updateWindowsModeWrappedState=function(m){const p=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),_=p==null?void 0:p.get(m.cols-1),S=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);S&&_&&(S.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new a;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}n.AttributeData=a;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}constructor(p=0,_=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=f},9092:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const f=a(6349),m=a(7226),p=a(3734),_=a(8437),S=a(4634),b=a(511),y=a(643),u=a(4863),h=a(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(l,d,g){this._hasScrollback=l,this._optionsService=d,this._bufferService=g,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=b.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=b.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,d){return new _.BufferLine(this._bufferService.cols,this.getNullCell(l),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const d=l+this._optionsService.rawOptions.scrollback;return d>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:d}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=_.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,d){const g=this.getNullCell(_.DEFAULT_ATTR_DATA);let x=0;const C=this._getCorrectBufferLength(d);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<l)for(let w=0;w<this.lines.length;w++)x+=+this.lines.get(w).resize(l,g);let k=0;if(this._rows<d)for(let w=this._rows;w<d;w++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(l,g)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(l,g)));else for(let w=this._rows;w>d;w--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const w=this.lines.length-C;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=C}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,d-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(l,d),this._cols>l))for(let k=0;k<this.lines.length;k++)x+=+this.lines.get(k).resize(l,g);this._cols=l,this._rows=d,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,d){this._cols!==l&&(l>this._cols?this._reflowLarger(l,d):this._reflowSmaller(l,d))}_reflowLarger(l,d){const g=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(g.length>0){const x=(0,S.reflowLargerCreateNewLayout)(this.lines,g);(0,S.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(l,d,x.countRemoved)}}_reflowLargerAdjustViewport(l,d,g){const x=this.getNullCell(_.DEFAULT_ATTR_DATA);let C=g;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new _.BufferLine(l,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-g,0)}_reflowSmaller(l,d){const g=this.getNullCell(_.DEFAULT_ATTR_DATA),x=[];let C=0;for(let k=this.lines.length-1;k>=0;k--){let w=this.lines.get(k);if(!w||!w.isWrapped&&w.getTrimmedLength()<=l)continue;const E=[w];for(;w.isWrapped&&k>0;)w=this.lines.get(--k),E.unshift(w);const L=this.ybase+this.y;if(L>=k&&L<k+E.length)continue;const N=E[E.length-1].getTrimmedLength(),O=(0,S.reflowSmallerGetNewLineLengths)(E,this._cols,l),P=O.length-E.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const z=[];for(let B=0;B<P;B++){const H=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);z.push(H)}z.length>0&&(x.push({start:k+E.length+C,newLines:z}),C+=z.length),E.push(...z);let W=O.length-1,V=O[W];V===0&&(W--,V=O[W]);let R=E.length-P-1,D=N;for(;R>=0;){const B=Math.min(D,V);if(E[W]===void 0)break;if(E[W].copyCellsFrom(E[R],D-B,V-B,B,!0),V-=B,V===0&&(W--,V=O[W]),D-=B,D===0){R--;const H=Math.max(R,0);D=(0,S.getWrappedLineTrimmedLength)(E,H,this._cols)}}for(let B=0;B<E.length;B++)O[B]<l&&E[B].setCell(O[B],g);let A=P-F;for(;A-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+d-1)}if(x.length>0){const k=[],w=[];for(let W=0;W<this.lines.length;W++)w.push(this.lines.get(W));const E=this.lines.length;let L=E-1,N=0,O=x[N];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let P=0;for(let W=Math.min(this.lines.maxLength-1,E+C-1);W>=0;W--)if(O&&O.start>L+P){for(let V=O.newLines.length-1;V>=0;V--)this.lines.set(W--,O.newLines[V]);W++,k.push({index:L+1,amount:O.newLines.length}),P+=O.newLines.length,O=x[++N]}else this.lines.set(W,w[L--]);let F=0;for(let W=k.length-1;W>=0;W--)k[W].index+=F,this.lines.onInsertEmitter.fire(k[W]),F+=k[W].amount;const z=Math.max(0,E+C-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(l,d,g=0,x){const C=this.lines.get(l);return C?C.translateToString(d,g,x):""}getWrappedRangeForLine(l){let d=l,g=l;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;g+1<this.lines.length&&this.lines.get(g+1).isWrapped;)g++;return{first:d,last:g}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===l&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const d=new u.Marker(l);return this.markers.push(d),d.register(this.lines.onTrim(g=>{d.line-=g,d.line<0&&d.dispose()})),d.register(this.lines.onInsert(g=>{d.line>=g.index&&(d.line+=g.amount)})),d.register(this.lines.onDelete(g=>{d.line>=g.index&&d.line<g.index+g.amount&&d.dispose(),d.line>g.index&&(d.line-=g.amount)})),d.register(d.onDispose(()=>this._removeMarker(d))),d}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const f=a(3734),m=a(511),p=a(643),_=a(482);n.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class b{constructor(u,h,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const d=h||m.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let g=0;g<u;++g)this.setCell(g,d);this.length=u}get(u){const h=this._data[3*u+0],l=2097151&h;return[this._data[3*u+1],2097152&h?this._combined[u]:l?(0,_.stringFromCodePoint)(l):"",h>>22,2097152&h?this._combined[u].charCodeAt(this._combined[u].length-1):l]}set(u,h){this._data[3*u+1]=h[p.CHAR_DATA_ATTR_INDEX],h[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=h[1],this._data[3*u+0]=2097152|u|h[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=h[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const h=this._data[3*u+0];return 2097152&h?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&h}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const h=this._data[3*u+0];return 2097152&h?this._combined[u]:2097151&h?(0,_.stringFromCodePoint)(2097151&h):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,h){return S=3*u,h.content=this._data[S+0],h.fg=this._data[S+1],h.bg=this._data[S+2],2097152&h.content&&(h.combinedData=this._combined[u]),268435456&h.bg&&(h.extended=this._extendedAttrs[u]),h}setCell(u,h){2097152&h.content&&(this._combined[u]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[u]=h.extended),this._data[3*u+0]=h.content,this._data[3*u+1]=h.fg,this._data[3*u+2]=h.bg}setCellFromCodePoint(u,h,l,d,g,x){268435456&g&&(this._extendedAttrs[u]=x),this._data[3*u+0]=h|l<<22,this._data[3*u+1]=d,this._data[3*u+2]=g}addCodepointToCell(u,h){let l=this._data[3*u+0];2097152&l?this._combined[u]+=(0,_.stringFromCodePoint)(h):(2097151&l?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&l)+(0,_.stringFromCodePoint)(h),l&=-2097152,l|=2097152):l=h|4194304,this._data[3*u+0]=l)}insertCells(u,h,l,d){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),h<this.length-u){const g=new m.CellData;for(let x=this.length-u-h-1;x>=0;--x)this.setCell(u+h+x,this.loadCell(u+x,g));for(let x=0;x<h;++x)this.setCell(u+x,l)}else for(let g=u;g<this.length;++g)this.setCell(g,l);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs)}deleteCells(u,h,l,d){if(u%=this.length,h<this.length-u){const g=new m.CellData;for(let x=0;x<this.length-u-h;++x)this.setCell(u+x,this.loadCell(u+h+x,g));for(let x=this.length-h;x<this.length;++x)this.setCell(x,l)}else for(let g=u;g<this.length;++g)this.setCell(g,l);u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodePoint(u,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs)}replaceCells(u,h,l,d,g=!1){if(g)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodePoint(h,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs);u<h&&u<this.length;)this.isProtected(u)||this.setCell(u,l),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodePoint(h,0,1,(d==null?void 0:d.fg)||0,(d==null?void 0:d.bg)||0,(d==null?void 0:d.extended)||new f.ExtendedAttrs);u<h&&u<this.length;)this.setCell(u++,l)}resize(u,h){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const d=new Uint32Array(l);d.set(this._data),this._data=d}for(let d=this.length;d<u;++d)this.setCell(d,h)}else{this._data=this._data.subarray(0,l);const d=Object.keys(this._combined);for(let x=0;x<d.length;x++){const C=parseInt(d[x],10);C>=u&&delete this._combined[C]}const g=Object.keys(this._extendedAttrs);for(let x=0;x<g.length;x++){const C=parseInt(g[x],10);C>=u&&delete this._extendedAttrs[C]}}return this.length=u,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,h=!1){if(h)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,u);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const h in u._combined)this._combined[h]=u._combined[h];this._extendedAttrs={};for(const h in u._extendedAttrs)this._extendedAttrs[h]=u._extendedAttrs[h];this.isWrapped=u.isWrapped}clone(){const u=new b(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const h in this._combined)u._combined[h]=this._combined[h];for(const h in this._extendedAttrs)u._extendedAttrs[h]=this._extendedAttrs[h];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,h,l,d,g){const x=u._data;if(g)for(let k=d-1;k>=0;k--){for(let w=0;w<3;w++)this._data[3*(l+k)+w]=x[3*(h+k)+w];268435456&x[3*(h+k)+2]&&(this._extendedAttrs[l+k]=u._extendedAttrs[h+k])}else for(let k=0;k<d;k++){for(let w=0;w<3;w++)this._data[3*(l+k)+w]=x[3*(h+k)+w];268435456&x[3*(h+k)+2]&&(this._extendedAttrs[l+k]=u._extendedAttrs[h+k])}const C=Object.keys(u._combined);for(let k=0;k<C.length;k++){const w=parseInt(C[k],10);w>=h&&(this._combined[w-h+l]=u._combined[w])}}translateToString(u=!1,h=0,l=this.length){u&&(l=Math.min(l,this.getTrimmedLength()));let d="";for(;h<l;){const g=this._data[3*h+0],x=2097151&g;d+=2097152&g?this._combined[h]:x?(0,_.stringFromCodePoint)(x):p.WHITESPACE_CELL_CHAR,h+=g>>22||1}return d}}n.BufferLine=b},4841:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(a,f){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return f*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(c,n)=>{function a(f,m,p){if(m===f.length-1)return f[m].getTrimmedLength();const _=!f[m].hasContent(p-1)&&f[m].getWidth(p-1)===1,S=f[m+1].getWidth(0)===2;return _&&S?p-1:p}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(f,m,p,_,S){const b=[];for(let y=0;y<f.length-1;y++){let u=y,h=f.get(++u);if(!h.isWrapped)continue;const l=[f.get(y)];for(;u<f.length&&h.isWrapped;)l.push(h),h=f.get(++u);if(_>=y&&_<u){y+=l.length-1;continue}let d=0,g=a(l,d,m),x=1,C=0;for(;x<l.length;){const w=a(l,x,m),E=w-C,L=p-g,N=Math.min(E,L);l[d].copyCellsFrom(l[x],C,g,N,!1),g+=N,g===p&&(d++,g=0),C+=N,C===w&&(x++,C=0),g===0&&d!==0&&l[d-1].getWidth(p-1)===2&&(l[d].copyCellsFrom(l[d-1],p-1,g++,1,!1),l[d-1].setCell(p-1,S))}l[d].replaceCells(g,p,S);let k=0;for(let w=l.length-1;w>0&&(w>d||l[w].getTrimmedLength()===0);w--)k++;k>0&&(b.push(y+l.length-k),b.push(k)),y+=l.length-1}return b},n.reflowLargerCreateNewLayout=function(f,m){const p=[];let _=0,S=m[_],b=0;for(let y=0;y<f.length;y++)if(S===y){const u=m[++_];f.onDeleteEmitter.fire({index:y-b,amount:u}),y+=u-1,b+=u,S=m[++_]}else p.push(y);return{layout:p,countRemoved:b}},n.reflowLargerApplyNewLayout=function(f,m){const p=[];for(let _=0;_<m.length;_++)p.push(f.get(m[_]));for(let _=0;_<p.length;_++)f.set(_,p[_]);f.length=m.length},n.reflowSmallerGetNewLineLengths=function(f,m,p){const _=[],S=f.map((h,l)=>a(f,l,m)).reduce((h,l)=>h+l);let b=0,y=0,u=0;for(;u<S;){if(S-u<p){_.push(S-u);break}b+=p;const h=a(f,y,m);b>h&&(b-=h,y++);const l=f[y].getWidth(b-1)===2;l&&b--;const d=l?p-1:p;_.push(d),u+=d}return _},n.getWrappedLineTrimmedLength=a},5295:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const f=a(8460),m=a(844),p=a(9092);class _ extends m.Disposable{constructor(b,y){super(),this._optionsService=b,this._bufferService=y,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(b){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(b),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(b,y){this._normal.resize(b,y),this._alt.resize(b,y),this.setupTabStops(b)}setupTabStops(b){this._normal.setupTabStops(b),this._alt.setupTabStops(b)}}n.BufferSet=_},511:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const f=a(482),m=a(643),p=a(3734);class _ extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(b){const y=new _;return y.setFromCharData(b),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(b){this.fg=b[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(b[m.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(b[m.CHAR_DATA_CHAR_INDEX].length===2){const u=b[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const h=b[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(u-55296)+h-56320+65536|b[m.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=b[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[m.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=b[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=_},643:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const f=a(8460),m=a(844);class p{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}n.Marker=p,p._nextId=1},7116:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(c,n)=>{var a,f,m;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
|
||
`,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""}(a||(n.C0=a={})),function(p){p.PAD="",p.HOP="",p.BPH="",p.NBH="",p.IND="",p.NEL="
",p.SSA="",p.ESA="",p.HTS="",p.HTJ="",p.VTS="",p.PLD="",p.PLU="",p.RI="",p.SS2="",p.SS3="",p.DCS="",p.PU1="",p.PU2="",p.STS="",p.CCH="",p.MW="",p.SPA="",p.EPA="",p.SOS="",p.SGCI="",p.SCI="",p.CSI="",p.ST="",p.OSC="",p.PM="",p.APC=""}(f||(n.C1=f={})),function(p){p.ST=`${a.ESC}\\`}(m||(n.C1_ESCAPED=m={}))},7399:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const f=a(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(p,_,S,b){const y={type:0,cancel:!1,key:void 0},u=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?y.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?y.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?y.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(y.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(p.altKey){y.key=f.C0.ESC+f.C0.DEL;break}y.key=f.C0.DEL;break;case 9:if(p.shiftKey){y.key=f.C0.ESC+"[Z";break}y.key=f.C0.HT,y.cancel=!0;break;case 13:y.key=p.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,y.cancel=!0;break;case 27:y.key=f.C0.ESC,p.altKey&&(y.key=f.C0.ESC+f.C0.ESC),y.cancel=!0;break;case 37:if(p.metaKey)break;u?(y.key=f.C0.ESC+"[1;"+(u+1)+"D",y.key===f.C0.ESC+"[1;3D"&&(y.key=f.C0.ESC+(S?"b":"[1;5D"))):y.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(p.metaKey)break;u?(y.key=f.C0.ESC+"[1;"+(u+1)+"C",y.key===f.C0.ESC+"[1;3C"&&(y.key=f.C0.ESC+(S?"f":"[1;5C"))):y.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(p.metaKey)break;u?(y.key=f.C0.ESC+"[1;"+(u+1)+"A",S||y.key!==f.C0.ESC+"[1;3A"||(y.key=f.C0.ESC+"[1;5A")):y.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(p.metaKey)break;u?(y.key=f.C0.ESC+"[1;"+(u+1)+"B",S||y.key!==f.C0.ESC+"[1;3B"||(y.key=f.C0.ESC+"[1;5B")):y.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(y.key=f.C0.ESC+"[2~");break;case 46:y.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:y.key=u?f.C0.ESC+"[1;"+(u+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:y.key=u?f.C0.ESC+"[1;"+(u+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:p.shiftKey?y.type=2:p.ctrlKey?y.key=f.C0.ESC+"[5;"+(u+1)+"~":y.key=f.C0.ESC+"[5~";break;case 34:p.shiftKey?y.type=3:p.ctrlKey?y.key=f.C0.ESC+"[6;"+(u+1)+"~":y.key=f.C0.ESC+"[6~";break;case 112:y.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:y.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:y.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:y.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:y.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:y.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:y.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:y.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:y.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:y.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:y.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:y.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(S&&!b||!p.altKey||p.metaKey)!S||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?y.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(y.key=f.C0.US),p.key==="@"&&(y.key=f.C0.NUL)):p.keyCode===65&&(y.type=1);else{const h=m[p.keyCode],l=h==null?void 0:h[p.shiftKey?1:0];if(l)y.key=f.C0.ESC+l;else if(p.keyCode>=65&&p.keyCode<=90){const d=p.ctrlKey?p.keyCode-64:p.keyCode+32;let g=String.fromCharCode(d);p.shiftKey&&(g=g.toUpperCase()),y.key=f.C0.ESC+g}else if(p.keyCode===32)y.key=f.C0.ESC+(p.ctrlKey?f.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let d=p.code.slice(3,4);p.shiftKey||(d=d.toLowerCase()),y.key=f.C0.ESC+d,y.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?y.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?y.key=f.C0.NUL:p.keyCode>=51&&p.keyCode<=55?y.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?y.key=f.C0.DEL:p.keyCode===219?y.key=f.C0.ESC:p.keyCode===220?y.key=f.C0.FS:p.keyCode===221&&(y.key=f.C0.GS)}return y}},482:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},n.utf32ToString=function(a,f=0,m=a.length){let p="";for(let _=f;_<m;++_){let S=a[_];S>65535?(S-=65536,p+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):p+=String.fromCharCode(S)}return p},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,f){const m=a.length;if(!m)return 0;let p=0,_=0;if(this._interim){const S=a.charCodeAt(_++);56320<=S&&S<=57343?f[p++]=1024*(this._interim-55296)+S-56320+65536:(f[p++]=this._interim,f[p++]=S),this._interim=0}for(let S=_;S<m;++S){const b=a.charCodeAt(S);if(55296<=b&&b<=56319){if(++S>=m)return this._interim=b,p;const y=a.charCodeAt(S);56320<=y&&y<=57343?f[p++]=1024*(b-55296)+y-56320+65536:(f[p++]=b,f[p++]=y)}else b!==65279&&(f[p++]=b)}return p}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,f){const m=a.length;if(!m)return 0;let p,_,S,b,y=0,u=0,h=0;if(this.interim[0]){let g=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let C,k=0;for(;(C=63&this.interim[++k])&&k<4;)x<<=6,x|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-k;for(;h<E;){if(h>=m)return 0;if(C=a[h++],(192&C)!=128){h--,g=!0;break}this.interim[k++]=C,x<<=6,x|=63&C}g||(w===2?x<128?h--:f[y++]=x:w===3?x<2048||x>=55296&&x<=57343||x===65279||(f[y++]=x):x<65536||x>1114111||(f[y++]=x)),this.interim.fill(0)}const l=m-4;let d=h;for(;d<m;){for(;!(!(d<l)||128&(p=a[d])||128&(_=a[d+1])||128&(S=a[d+2])||128&(b=a[d+3]));)f[y++]=p,f[y++]=_,f[y++]=S,f[y++]=b,d+=4;if(p=a[d++],p<128)f[y++]=p;else if((224&p)==192){if(d>=m)return this.interim[0]=p,y;if(_=a[d++],(192&_)!=128){d--;continue}if(u=(31&p)<<6|63&_,u<128){d--;continue}f[y++]=u}else if((240&p)==224){if(d>=m)return this.interim[0]=p,y;if(_=a[d++],(192&_)!=128){d--;continue}if(d>=m)return this.interim[0]=p,this.interim[1]=_,y;if(S=a[d++],(192&S)!=128){d--;continue}if(u=(15&p)<<12|(63&_)<<6|63&S,u<2048||u>=55296&&u<=57343||u===65279)continue;f[y++]=u}else if((248&p)==240){if(d>=m)return this.interim[0]=p,y;if(_=a[d++],(192&_)!=128){d--;continue}if(d>=m)return this.interim[0]=p,this.interim[1]=_,y;if(S=a[d++],(192&S)!=128){d--;continue}if(d>=m)return this.interim[0]=p,this.interim[1]=_,this.interim[2]=S,y;if(b=a[d++],(192&b)!=128){d--;continue}if(u=(7&p)<<18|(63&_)<<12|(63&S)<<6|63&b,u<65536||u>1114111)continue;f[y++]=u}}return y}}},225:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const a=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;n.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let p=0;p<a.length;++p)m.fill(0,a[p][0],a[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?m[p]:function(_,S){let b,y=0,u=S.length-1;if(_<S[0][0]||_>S[u][1])return!1;for(;u>=y;)if(b=y+u>>1,_>S[b][1])y=b+1;else{if(!(_<S[b][0]))return!0;u=b-1}return!1}(p,f)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}}},5981:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const f=a(8460),m=a(844);class p extends m.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,b){if(b!==void 0&&this._syncCalls>b)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,b){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(b),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(b)}_innerWrite(S=0,b=!0){const y=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],h=this._action(u,b);if(h){const d=g=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,g)):this._innerWrite(y,g);return void h.catch(g=>(queueMicrotask(()=>{throw g}),Promise.resolve(!1))).then(d)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-y>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}n.WriteBuffer=p},5941:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function m(p,_){const S=p.toString(16),b=S.length<2?"0"+S:S;switch(_){case 4:return S[0];case 8:return b;case 12:return(b+b).slice(0,3);default:return b+b}}n.parseColor=function(p){if(!p)return;let _=p.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const S=a.exec(_);if(S){const b=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/b*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/b*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/b*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const S=_.length/3,b=[0,0,0];for(let y=0;y<3;++y){const u=parseInt(_.slice(S*y,S*y+S),16);b[y]=S===1?u<<4:S===2?u:S===3?u>>4:u>>8}return b}},n.toRgbString=function(p,_=16){const[S,b,y]=p;return`rgb:${m(S,_)}/${m(b,_)}/${m(y,_)}`}},5770:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const f=a(482),m=a(8742),p=a(5770),_=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(b,y){this._handlers[b]===void 0&&(this._handlers[b]=[]);const u=this._handlers[b];return u.push(y),{dispose:()=>{const h=u.indexOf(y);h!==-1&&u.splice(h,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}reset(){if(this._active.length)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(b,y){if(this.reset(),this._ident=b,this._active=this._handlers[b]||_,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(b,y,u){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(b,y,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(b,y,u))}unhook(b,y=!0){if(this._active.length){let u=!1,h=this._active.length-1,l=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,u=y,l=this._stack.fallThrough,this._stack.paused=!1),!l&&u===!1){for(;h>=0&&(u=this._active[h].unhook(b),u!==!0);h--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,u;h--}for(;h>=0;h--)if(u=this._active[h].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",b);this._active=_,this._ident=0}};const S=new m.Params;S.addParam(0),n.DcsHandler=class{constructor(b){this._handler=b,this._data="",this._params=S,this._hitLimit=!1}hook(b){this._params=b.length>1||b.params[0]?b.clone():S,this._data="",this._hitLimit=!1}put(b,y,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(b,y,u),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(b){let y=!1;if(this._hitLimit)y=!1;else if(b&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(u=>(this._params=S,this._data="",this._hitLimit=!1,u));return this._params=S,this._data="",this._hitLimit=!1,y}}},2015:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const f=a(844),m=a(8742),p=a(6242),_=a(6351);class S{constructor(h){this.table=new Uint8Array(h)}setDefault(h,l){this.table.fill(h<<4|l)}add(h,l,d,g){this.table[l<<8|h]=d<<4|g}addMany(h,l,d,g){for(let x=0;x<h.length;x++)this.table[l<<8|h[x]]=d<<4|g}}n.TransitionTable=S;const b=160;n.VT500_TRANSITION_TABLE=function(){const u=new S(4095),h=Array.apply(null,Array(256)).map((k,w)=>w),l=(k,w)=>h.slice(k,w),d=l(32,127),g=l(0,24);g.push(25),g.push.apply(g,l(28,32));const x=l(0,14);let C;for(C in u.setDefault(1,0),u.addMany(d,0,2,0),x)u.addMany([24,26,153,154],C,3,0),u.addMany(l(128,144),C,3,0),u.addMany(l(144,152),C,3,0),u.add(156,C,0,0),u.add(27,C,11,1),u.add(157,C,4,8),u.addMany([152,158,159],C,0,7),u.add(155,C,11,3),u.add(144,C,11,9);return u.addMany(g,0,3,0),u.addMany(g,1,3,1),u.add(127,1,0,1),u.addMany(g,8,0,8),u.addMany(g,3,3,3),u.add(127,3,0,3),u.addMany(g,4,3,4),u.add(127,4,0,4),u.addMany(g,6,3,6),u.addMany(g,5,3,5),u.add(127,5,0,5),u.addMany(g,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(d,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(l(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(d,7,0,7),u.addMany(g,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(l(64,127),3,7,0),u.addMany(l(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(l(48,60),4,8,4),u.addMany(l(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(l(32,64),6,0,6),u.add(127,6,0,6),u.addMany(l(64,127),6,0,0),u.addMany(l(32,48),3,9,5),u.addMany(l(32,48),5,9,5),u.addMany(l(48,64),5,0,6),u.addMany(l(64,127),5,7,0),u.addMany(l(32,48),4,9,5),u.addMany(l(32,48),1,9,2),u.addMany(l(32,48),2,9,2),u.addMany(l(48,127),2,10,0),u.addMany(l(48,80),1,10,0),u.addMany(l(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(l(96,127),1,10,0),u.add(80,1,11,9),u.addMany(g,9,0,9),u.add(127,9,0,9),u.addMany(l(28,32),9,0,9),u.addMany(l(32,48),9,9,12),u.addMany(l(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(g,11,0,11),u.addMany(l(32,128),11,0,11),u.addMany(l(28,32),11,0,11),u.addMany(g,10,0,10),u.add(127,10,0,10),u.addMany(l(28,32),10,0,10),u.addMany(l(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(l(32,48),10,9,12),u.addMany(g,12,0,12),u.add(127,12,0,12),u.addMany(l(28,32),12,0,12),u.addMany(l(32,48),12,9,12),u.addMany(l(48,64),12,0,11),u.addMany(l(64,127),12,12,13),u.addMany(l(64,127),10,12,13),u.addMany(l(64,127),9,12,13),u.addMany(g,13,13,13),u.addMany(d,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(b,0,2,0),u.add(b,8,5,8),u.add(b,6,0,6),u.add(b,11,0,11),u.add(b,13,13,13),u}();class y extends f.Disposable{constructor(h=n.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(l,d,g)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,d)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(h,l=[64,126]){let d=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=h.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<h.intermediates.length;++x){const C=h.intermediates.charCodeAt(x);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=C}}if(h.final.length!==1)throw new Error("final must be a single byte");const g=h.final.charCodeAt(0);if(l[0]>g||g>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return d<<=8,d|=g,d}identToString(h){const l=[];for(;h;)l.push(String.fromCharCode(255&h)),h>>=8;return l.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,l){const d=this._identifier(h,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const g=this._escHandlers[d];return g.push(l),{dispose:()=>{const x=g.indexOf(l);x!==-1&&g.splice(x,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,l){this._executeHandlers[h.charCodeAt(0)]=l}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,l){const d=this._identifier(h);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const g=this._csiHandlers[d];return g.push(l),{dispose:()=>{const x=g.indexOf(l);x!==-1&&g.splice(x,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,l){return this._dcsParser.registerHandler(this._identifier(h),l)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,l){return this._oscParser.registerHandler(h,l)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(h,l,d,g,x){this._parseStack.state=h,this._parseStack.handlers=l,this._parseStack.handlerPos=d,this._parseStack.transition=g,this._parseStack.chunkPos=x}parse(h,l,d){let g,x=0,C=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&E>-1){for(;E>=0&&(g=w[E](this._params),g!==!0);E--)if(g instanceof Promise)return this._parseStack.handlerPos=E,g}this._parseStack.handlers=[];break;case 4:if(d===!1&&E>-1){for(;E>=0&&(g=w[E](),g!==!0);E--)if(g instanceof Promise)return this._parseStack.handlerPos=E,g}this._parseStack.handlers=[];break;case 6:if(x=h[this._parseStack.chunkPos],g=this._dcsParser.unhook(x!==24&&x!==26,d),g)return g;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=h[this._parseStack.chunkPos],g=this._oscParser.end(x!==24&&x!==26,d),g)return g;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let w=k;w<l;++w){switch(x=h[w],C=this._transitions.table[this.currentState<<8|(x<160?x:b)],C>>4){case 2:for(let P=w+1;;++P){if(P>=l||(x=h[P])<32||x>126&&x<b){this._printHandler(h,w,P),w=P-1;break}if(++P>=l||(x=h[P])<32||x>126&&x<b){this._printHandler(h,w,P),w=P-1;break}if(++P>=l||(x=h[P])<32||x>126&&x<b){this._printHandler(h,w,P),w=P-1;break}if(++P>=l||(x=h[P])<32||x>126&&x<b){this._printHandler(h,w,P),w=P-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|x];let L=E?E.length-1:-1;for(;L>=0&&(g=E[L](this._params),g!==!0);L--)if(g instanceof Promise)return this._preserveStack(3,E,L,C,w),g;L<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingCodepoint=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++w<l&&(x=h[w])>47&&x<60);w--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const N=this._escHandlers[this._collect<<8|x];let O=N?N.length-1:-1;for(;O>=0&&(g=N[O](),g!==!0);O--)if(g instanceof Promise)return this._preserveStack(4,N,O,C,w),g;O<0&&this._escHandlerFb(this._collect<<8|x),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|x,this._params);break;case 13:for(let P=w+1;;++P)if(P>=l||(x=h[P])===24||x===26||x===27||x>127&&x<b){this._dcsParser.put(h,w,P),w=P-1;break}break;case 14:if(g=this._dcsParser.unhook(x!==24&&x!==26),g)return this._preserveStack(6,[],0,C,w),g;x===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let P=w+1;;P++)if(P>=l||(x=h[P])<32||x>127&&x<b){this._oscParser.put(h,w,P),w=P-1;break}break;case 6:if(g=this._oscParser.end(x!==24&&x!==26),g)return this._preserveStack(5,[],0,C,w),g;x===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&C}}}n.EscapeSequenceParser=y},6242:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const f=a(5770),m=a(482),p=[];n.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,S){this._handlers[_]===void 0&&(this._handlers[_]=[]);const b=this._handlers[_];return b.push(S),{dispose:()=>{const y=b.indexOf(S);y!==-1&&b.splice(y,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,S,b){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(_,S,b);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(_,S,b))}start(){this.reset(),this._state=1}put(_,S,b){if(this._state!==3){if(this._state===1)for(;S<b;){const y=_[S++];if(y===59){this._state=2,this._start();break}if(y<48||57<y)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+y-48}this._state===2&&b-S>0&&this._put(_,S,b)}}end(_,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let b=!1,y=this._active.length-1,u=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,b=S,u=this._stack.fallThrough,this._stack.paused=!1),!u&&b===!1){for(;y>=0&&(b=this._active[y].end(_),b!==!0);y--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,b;y--}for(;y>=0;y--)if(b=this._active[y].end(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,b}else this._handlerFb(this._id,"END",_);this._active=p,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,S,b){this._hitLimit||(this._data+=(0,m.utf32ToString)(_,S,b),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let S=!1;if(this._hitLimit)S=!1;else if(_&&(S=this._handler(this._data),S instanceof Promise))return S.then(b=>(this._data="",this._hitLimit=!1,b));return this._data="",this._hitLimit=!1,S}}},8742:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const a=2147483647;class f{static fromArray(p){const _=new f;if(!p.length)return _;for(let S=Array.isArray(p[0])?1:0;S<p.length;++S){const b=p[S];if(Array.isArray(b))for(let y=0;y<b.length;++y)_.addSubParam(b[y]);else _.addParam(b)}return _}constructor(p=32,_=32){if(this.maxLength=p,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new f(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let _=0;_<this.length;++_){p.push(this.params[_]);const S=this._subParamsIdx[_]>>8,b=255&this._subParamsIdx[_];b-S>0&&p.push(Array.prototype.slice.call(this._subParams,S,b))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>a?a:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>a?a:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const _=this._subParamsIdx[p]>>8,S=255&this._subParamsIdx[p];return S-_>0?this._subParams.subarray(_,S):null}getSubParamsAll(){const p={};for(let _=0;_<this.length;++_){const S=this._subParamsIdx[_]>>8,b=255&this._subParamsIdx[_];b-S>0&&(p[_]=this._subParams.slice(S,b))}return p}addDigit(p){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,b=S[_-1];S[_-1]=~b?Math.min(10*b+p,a):p}}n.Params=f},5741:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,f){const m={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(m),f.dispose=()=>this._wrappedAddonDispose(m),f.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let f=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===a){f=m;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(f,1)}}},8771:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const f=a(3785),m=a(511);n.BufferApiView=class{constructor(p,_){this._buffer=p,this.type=_}init(p){return this._buffer=p,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(p){const _=this._buffer.lines.get(p);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new m.CellData}}},3785:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const f=a(511);n.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,p){if(!(m<0||m>=this._line.length))return p?(this._line.loadCell(m,p),p):this._line.loadCell(m,new f.CellData)}translateToString(m,p,_){return this._line.translateToString(m,p,_)}}},8285:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const f=a(8771),m=a(8460),p=a(844);class _ extends p.Disposable{constructor(b){super(),this._core=b,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}n.BufferNamespaceApi=_},7975:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,f){return this._core.registerCsiHandler(a,m=>f(m.toArray()))}addCsiHandler(a,f){return this.registerCsiHandler(a,f)}registerDcsHandler(a,f){return this._core.registerDcsHandler(a,(m,p)=>f(m,p.toArray()))}addDcsHandler(a,f){return this.registerDcsHandler(a,f)}registerEscHandler(a,f){return this._core.registerEscHandler(a,f)}addEscHandler(a,f){return this.registerEscHandler(a,f)}registerOscHandler(a,f){return this._core.registerOscHandler(a,f)}addOscHandler(a,f){return this.registerOscHandler(a,f)}}},7090:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(c,n,a){var f=this&&this.__decorate||function(u,h,l,d){var g,x=arguments.length,C=x<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,h,l,d);else for(var k=u.length-1;k>=0;k--)(g=u[k])&&(C=(x<3?g(C):x>3?g(h,l,C):g(h,l))||C);return x>3&&C&&Object.defineProperty(h,l,C),C},m=this&&this.__param||function(u,h){return function(l,d){h(l,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const p=a(8460),_=a(844),S=a(5295),b=a(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let y=n.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(u,this))}resize(u,h){this.cols=u,this.rows=h,this.buffers.resize(u,h),this._onResize.fire({cols:u,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,h=!1){const l=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===u.fg&&d.getBg(0)===u.bg||(d=l.getBlankLine(u,h),this._cachedBlankLine=d),d.isWrapped=h;const g=l.ybase+l.scrollTop,x=l.ybase+l.scrollBottom;if(l.scrollTop===0){const C=l.lines.isFull;x===l.lines.length-1?C?l.lines.recycle().copyFrom(d):l.lines.push(d.clone()):l.lines.splice(x+1,0,d.clone()),C?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const C=x-g+1;l.lines.shiftElements(g+1,C-1,-1),l.lines.set(x,d.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(u,h,l){const d=this.buffer;if(u<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else u+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const g=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+u,d.ybase),0),g!==d.ydisp&&(h||this._onScroll.fire(d.ydisp))}};n.BufferService=y=f([m(0,b.IOptionsService)],y)},7994:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,f){this._charsets[a]=f,this.glevel===a&&(this.charset=f)}}},1753:function(c,n,a){var f=this&&this.__decorate||function(d,g,x,C){var k,w=arguments.length,E=w<3?g:C===null?C=Object.getOwnPropertyDescriptor(g,x):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(d,g,x,C);else for(var L=d.length-1;L>=0;L--)(k=d[L])&&(E=(w<3?k(E):w>3?k(g,x,E):k(g,x))||E);return w>3&&E&&Object.defineProperty(g,x,E),E},m=this&&this.__param||function(d,g){return function(x,C){g(x,C,d)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const p=a(2585),_=a(8460),S=a(844),b={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function y(d,g){let x=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(x|=64,x|=d.action):(x|=3&d.button,4&d.button&&(x|=64),8&d.button&&(x|=128),d.action===32?x|=32:d.action!==0||g||(x|=3)),x}const u=String.fromCharCode,h={DEFAULT:d=>{const g=[y(d,!1)+32,d.col+32,d.row+32];return g[0]>255||g[1]>255||g[2]>255?"":`\x1B[M${u(g[0])}${u(g[1])}${u(g[2])}`},SGR:d=>{const g=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${y(d,!0)};${d.col};${d.row}${g}`},SGR_PIXELS:d=>{const g=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${y(d,!0)};${d.x};${d.y}${g}`}};let l=n.CoreMouseService=class extends S.Disposable{constructor(d,g){super(),this._bufferService=d,this._coreService=g,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(b))this.addProtocol(x,b[x]);for(const x of Object.keys(h))this.addEncoding(x,h[x]);this.reset()}addProtocol(d,g){this._protocols[d]=g}addEncoding(d,g){this._encodings[d]=g}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const g=this._encodings[this._activeEncoding](d);return g&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(g):this._coreService.triggerDataEvent(g,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,g,x){if(x){if(d.x!==g.x||d.y!==g.y)return!1}else if(d.col!==g.col||d.row!==g.row)return!1;return d.button===g.button&&d.action===g.action&&d.ctrl===g.ctrl&&d.alt===g.alt&&d.shift===g.shift}};n.CoreMouseService=l=f([m(0,p.IBufferService),m(1,p.ICoreService)],l)},6975:function(c,n,a){var f=this&&this.__decorate||function(l,d,g,x){var C,k=arguments.length,w=k<3?d:x===null?x=Object.getOwnPropertyDescriptor(d,g):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,d,g,x);else for(var E=l.length-1;E>=0;E--)(C=l[E])&&(w=(k<3?C(w):k>3?C(d,g,w):C(d,g))||w);return k>3&&w&&Object.defineProperty(d,g,w),w},m=this&&this.__param||function(l,d){return function(g,x){d(g,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const p=a(1439),_=a(8460),S=a(844),b=a(2585),y=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=n.CoreService=class extends S.Disposable{constructor(l,d,g){super(),this._bufferService=l,this._logService=d,this._optionsService=g,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(y),this.decPrivateModes=(0,p.clone)(u)}reset(){this.modes=(0,p.clone)(y),this.decPrivateModes=(0,p.clone)(u)}triggerDataEvent(l,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const g=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&g.ybase!==g.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,()=>l.split("").map(x=>x.charCodeAt(0))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,()=>l.split("").map(d=>d.charCodeAt(0))),this._onBinary.fire(l))}};n.CoreService=h=f([m(0,b.IBufferService),m(1,b.ILogService),m(2,b.IOptionsService)],h)},9074:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const f=a(8055),m=a(8460),p=a(844),_=a(6106);let S=0,b=0;class y extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(l=>l==null?void 0:l.marker.line),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)(()=>this.reset()))}registerDecoration(l){if(l.marker.isDisposed)return;const d=new u(l);if(d){const g=d.marker.onDispose(()=>d.dispose());d.onDispose(()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),g.dispose())}),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,d,g){var x,C,k;let w=0,E=0;for(const L of this._decorations.getKeyIterator(d))w=(x=L.options.x)!==null&&x!==void 0?x:0,E=w+((C=L.options.width)!==null&&C!==void 0?C:1),l>=w&&l<E&&(!g||((k=L.options.layer)!==null&&k!==void 0?k:"bottom")===g)&&(yield L)}forEachDecorationAtCell(l,d,g,x){this._decorations.forEachByKey(d,C=>{var k,w,E;S=(k=C.options.x)!==null&&k!==void 0?k:0,b=S+((w=C.options.width)!==null&&w!==void 0?w:1),l>=S&&l<b&&(!g||((E=C.options.layer)!==null&&E!==void 0?E:"bottom")===g)&&x(C)})}}n.DecorationService=y;class u extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const f=a(2585),m=a(8343);class p{constructor(...S){this._entries=new Map;for(const[b,y]of S)this.set(b,y)}set(S,b){const y=this._entries.get(S);return this._entries.set(S,b),y}forEach(S){for(const[b,y]of this._entries.entries())S(b,y)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}n.ServiceCollection=p,n.InstantiationService=class{constructor(){this._services=new p,this._services.set(f.IInstantiationService,this)}setService(_,S){this._services.set(_,S)}getService(_){return this._services.get(_)}createInstance(_,...S){const b=(0,m.getServiceDependencies)(_).sort((h,l)=>h.index-l.index),y=[];for(const h of b){const l=this._services.get(h.id);if(!l)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${h.id}.`);y.push(l)}const u=b.length>0?b[0].index:S.length;if(S.length!==u)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${u+1} conflicts with ${S.length} static arguments`);return new _(...S,...y)}}},7866:function(c,n,a){var f=this&&this.__decorate||function(u,h,l,d){var g,x=arguments.length,C=x<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,h,l,d);else for(var k=u.length-1;k>=0;k--)(g=u[k])&&(C=(x<3?g(C):x>3?g(h,l,C):g(h,l))||C);return x>3&&C&&Object.defineProperty(h,l,C),C},m=this&&this.__param||function(u,h){return function(l,d){h(l,d,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const p=a(844),_=a(2585),S={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let b,y=n.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),b=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let h=0;h<u.length;h++)typeof u[h]=="function"&&(u[h]=u[h]())}_log(u,h,l){this._evalLazyOptionalParams(l),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(u,...h){var l,d;this._logLevel<=_.LogLevelEnum.TRACE&&this._log((d=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.trace.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.log,u,h)}debug(u,...h){var l,d;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log((d=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.debug.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.log,u,h)}info(u,...h){var l,d;this._logLevel<=_.LogLevelEnum.INFO&&this._log((d=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.info.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.info,u,h)}warn(u,...h){var l,d;this._logLevel<=_.LogLevelEnum.WARN&&this._log((d=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.warn.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.warn,u,h)}error(u,...h){var l,d;this._logLevel<=_.LogLevelEnum.ERROR&&this._log((d=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.error.bind(this._optionsService.options.logger))!==null&&d!==void 0?d:console.error,u,h)}};n.LogService=y=f([m(0,_.IOptionsService)],y),n.setTraceLogger=function(u){b=u},n.traceCall=function(u,h,l){if(typeof l.value!="function")throw new Error("not supported");const d=l.value;l.value=function(...g){if(b.logLevel!==_.LogLevelEnum.TRACE)return d.apply(this,g);b.trace(`GlyphRenderer#${d.name}(${g.map(C=>JSON.stringify(C)).join(", ")})`);const x=d.apply(this,g);return b.trace(`GlyphRenderer#${d.name} return`,x),x}}},7302:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const f=a(8460),m=a(844),p=a(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends m.Disposable{constructor(y){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u=Object.assign({},n.DEFAULT_OPTIONS);for(const h in y)if(h in u)try{const l=y[h];u[h]=this._sanitizeAndValidateOption(h,l)}catch(l){console.error(l)}this.rawOptions=u,this.options=Object.assign({},u),this._setupOptions()}onSpecificOptionChange(y,u){return this.onOptionChange(h=>{h===y&&u(this.rawOptions[y])})}onMultipleOptionChange(y,u){return this.onOptionChange(h=>{y.indexOf(h)!==-1&&u()})}_setupOptions(){const y=h=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},u=(h,l)=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);l=this._sanitizeAndValidateOption(h,l),this.rawOptions[h]!==l&&(this.rawOptions[h]=l,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const l={get:y.bind(this,h),set:u.bind(this,h)};Object.defineProperty(this.options,h,l)}}_sanitizeAndValidateOption(y,u){switch(y){case"cursorStyle":if(u||(u=n.DEFAULT_OPTIONS[y]),!function(h){return h==="block"||h==="underline"||h==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${y}`);break;case"wordSeparator":u||(u=n.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=_.includes(u)?u:n.DEFAULT_OPTIONS[y];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${y} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${y} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}n.OptionsService=S},2660:function(c,n,a){var f=this&&this.__decorate||function(S,b,y,u){var h,l=arguments.length,d=l<3?b:u===null?u=Object.getOwnPropertyDescriptor(b,y):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(S,b,y,u);else for(var g=S.length-1;g>=0;g--)(h=S[g])&&(d=(l<3?h(d):l>3?h(b,y,d):h(b,y))||d);return l>3&&d&&Object.defineProperty(b,y,d),d},m=this&&this.__param||function(S,b){return function(y,u){b(y,u,S)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const p=a(2585);let _=n.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const b=this._bufferService.buffer;if(S.id===void 0){const g=b.addMarker(b.ybase+b.y),x={data:S,id:this._nextId++,lines:[g]};return g.onDispose(()=>this._removeMarkerFromLink(x,g)),this._dataByLinkId.set(x.id,x),x.id}const y=S,u=this._getEntryIdKey(y),h=this._entriesWithId.get(u);if(h)return this.addLineToLink(h.id,b.ybase+b.y),h.id;const l=b.addMarker(b.ybase+b.y),d={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(d,l)),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(S,b){const y=this._dataByLinkId.get(S);if(y&&y.lines.every(u=>u.line!==b)){const u=this._bufferService.buffer.addMarker(b);y.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(y,u))}}getLinkData(S){var b;return(b=this._dataByLinkId.get(S))===null||b===void 0?void 0:b.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,b){const y=S.lines.indexOf(b);y!==-1&&(S.lines.splice(y,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};n.OscLinkService=_=f([m(0,p.IBufferService)],_)},8343:(c,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const a="di$target",f="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(m){return m[f]||[]},n.createDecorator=function(m){if(n.serviceRegistry.has(m))return n.serviceRegistry.get(m);const p=function(_,S,b){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,u,h){u[a]===u?u[f].push({id:y,index:h}):(u[f]=[{id:y,index:h}],u[a]=u)})(p,_,b)};return p.toString=()=>m,n.serviceRegistry.set(m,p),p}},2585:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const f=a(8343);var m;n.IBufferService=(0,f.createDecorator)("BufferService"),n.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),n.ICoreService=(0,f.createDecorator)("CoreService"),n.ICharsetService=(0,f.createDecorator)("CharsetService"),n.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"}(m||(n.LogLevelEnum=m={})),n.ILogService=(0,f.createDecorator)("LogService"),n.IOptionsService=(0,f.createDecorator)("OptionsService"),n.IOscLinkService=(0,f.createDecorator)("OscLinkService"),n.IUnicodeService=(0,f.createDecorator)("UnicodeService"),n.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(c,n,a)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const f=a(8460),m=a(225);n.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const p=new m.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let _=0;const S=p.length;for(let b=0;b<S;++b){let y=p.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=S)return _+this.wcwidth(y);const u=p.charCodeAt(b);56320<=u&&u<=57343?y=1024*(y-55296)+u-56320+65536:_+=this.wcwidth(u)}_+=this.wcwidth(y)}return _}}}},s={};function i(c){var n=s[c];if(n!==void 0)return n.exports;var a=s[c]={exports:{}};return r[c].call(a.exports,a,a.exports,i),a.exports}var o={};return(()=>{var c=o;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const n=i(9042),a=i(3236),f=i(844),m=i(5741),p=i(8285),_=i(7975),S=i(7090),b=["cols","rows"];class y extends f.Disposable{constructor(h){super(),this._core=this.register(new a.Terminal(h)),this._addonManager=this.register(new m.AddonManager),this._publicOptions=Object.assign({},this._core.options);const l=g=>this._core.options[g],d=(g,x)=>{this._checkReadonlyOptions(g),this._core.options[g]=x};for(const g in this._core.options){const x={get:l.bind(this,g),set:d.bind(this,g)};Object.defineProperty(this._publicOptions,g,x)}}_checkReadonlyOptions(h){if(b.includes(h))throw new Error(`Option "${h}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const l in h)this._publicOptions[l]=h[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(h,l){this._verifyIntegers(h,l),this._core.resize(h,l)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){var l,d,g;return this._checkProposedApi(),this._verifyPositiveIntegers((l=h.x)!==null&&l!==void 0?l:0,(d=h.width)!==null&&d!==void 0?d:0,(g=h.height)!==null&&g!==void 0?g:0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,l,d){this._verifyIntegers(h,l,d),this._core.select(h,l,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,l){this._verifyIntegers(h,l),this._core.selectLines(h,l)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,l){this._core.write(h,l)}writeln(h,l){this._core.write(h),this._core.write(`\r
|
||
`,l)}paste(h){this._core.paste(h)}refresh(h,l){this._verifyIntegers(h,l),this._core.refresh(h,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return n}_verifyIntegers(...h){for(const l of h)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const l of h)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}c.Terminal=y})(),o})())})(Ap);var GS=Ap.exports,Np={exports:{}};(function(e,t){(function(r,s){e.exports=s()})(self,()=>(()=>{var r={};return(()=>{var s=r;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const o=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(o._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,o=i._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(n.getPropertyValue("height")),f=Math.max(0,parseInt(n.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),p=a-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),_=f-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(_/o.css.cell.width)),rows:Math.max(1,Math.floor(p/o.css.cell.height))}}}})(),r})())})(Np);var JS=Np.exports;const zt=Object.create(null);zt.open="0";zt.close="1";zt.ping="2";zt.pong="3";zt.message="4";zt.upgrade="5";zt.noop="6";const wn=Object.create(null);Object.keys(zt).forEach(e=>{wn[zt[e]]=e});const xl={type:"error",data:"parser error"},Pp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Bp=typeof ArrayBuffer=="function",jp=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Nc=({type:e,data:t},r,s)=>Pp&&t instanceof Blob?r?s(t):wh(t,s):Bp&&(t instanceof ArrayBuffer||jp(t))?r?s(t):wh(new Blob([t]),s):s(zt[e]+(t||"")),wh=(e,t)=>{const r=new FileReader;return r.onload=function(){const s=r.result.split(",")[1];t("b"+(s||""))},r.readAsDataURL(e)};function Ch(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ca;function QS(e,t){if(Pp&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ch).then(t);if(Bp&&(e.data instanceof ArrayBuffer||jp(e.data)))return t(Ch(e.data));Nc(e,!1,r=>{ca||(ca=new TextEncoder),t(ca.encode(r))})}const Eh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Eh.length;e++)qs[Eh.charCodeAt(e)]=e;const YS=e=>{let t=e.length*.75,r=e.length,s,i=0,o,c,n,a;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(s=0;s<r;s+=4)o=qs[e.charCodeAt(s)],c=qs[e.charCodeAt(s+1)],n=qs[e.charCodeAt(s+2)],a=qs[e.charCodeAt(s+3)],m[i++]=o<<2|c>>4,m[i++]=(c&15)<<4|n>>2,m[i++]=(n&3)<<6|a&63;return f},ZS=typeof ArrayBuffer=="function",Pc=(e,t)=>{if(typeof e!="string")return{type:"message",data:Mp(e,t)};const r=e.charAt(0);return r==="b"?{type:"message",data:ex(e.substring(1),t)}:wn[r]?e.length>1?{type:wn[r],data:e.substring(1)}:{type:wn[r]}:xl},ex=(e,t)=>{if(ZS){const r=YS(e);return Mp(r,t)}else return{base64:!0,data:e}},Mp=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Ip="",tx=(e,t)=>{const r=e.length,s=new Array(r);let i=0;e.forEach((o,c)=>{Nc(o,!1,n=>{s[c]=n,++i===r&&t(s.join(Ip))})})},rx=(e,t)=>{const r=e.split(Ip),s=[];for(let i=0;i<r.length;i++){const o=Pc(r[i],t);if(s.push(o),o.type==="error")break}return s};function sx(){return new TransformStream({transform(e,t){QS(e,r=>{const s=r.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,s)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(r)})}})}let ua;function on(e){return e.reduce((t,r)=>t+r.length,0)}function an(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let s=0;for(let i=0;i<t;i++)r[i]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),r}function ix(e,t){ua||(ua=new TextDecoder);const r=[];let s=0,i=-1,o=!1;return new TransformStream({transform(c,n){for(r.push(c);;){if(s===0){if(on(r)<1)break;const a=an(r,1);o=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(on(r)<2)break;const a=an(r,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(on(r)<8)break;const a=an(r,8),f=new DataView(a.buffer,a.byteOffset,a.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){n.enqueue(xl);break}i=m*Math.pow(2,32)+f.getUint32(4),s=3}else{if(on(r)<i)break;const a=an(r,i);n.enqueue(Pc(o?a:ua.decode(a),t)),s=0}if(i===0||i>e){n.enqueue(xl);break}}}})}const Fp=4;function ke(e){if(e)return nx(e)}function nx(e){for(var t in ke.prototype)e[t]=ke.prototype[t];return e}ke.prototype.on=ke.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ke.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this};ke.prototype.off=ke.prototype.removeListener=ke.prototype.removeAllListeners=ke.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+e];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,i=0;i<r.length;i++)if(s=r[i],s===t||s.fn===t){r.splice(i,1);break}return r.length===0&&delete this._callbacks["$"+e],this};ke.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(r){r=r.slice(0);for(var s=0,i=r.length;s<i;++s)r[s].apply(this,t)}return this};ke.prototype.emitReserved=ke.prototype.emit;ke.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ke.prototype.hasListeners=function(e){return!!this.listeners(e).length};const wo=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,r)=>r(t,0),vt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ox="arraybuffer";function Hp(e,...t){return t.reduce((r,s)=>(e.hasOwnProperty(s)&&(r[s]=e[s]),r),{})}const ax=vt.setTimeout,lx=vt.clearTimeout;function Co(e,t){t.useNativeTimers?(e.setTimeoutFn=ax.bind(vt),e.clearTimeoutFn=lx.bind(vt)):(e.setTimeoutFn=vt.setTimeout.bind(vt),e.clearTimeoutFn=vt.clearTimeout.bind(vt))}const cx=1.33;function ux(e){return typeof e=="string"?hx(e):Math.ceil((e.byteLength||e.size)*cx)}function hx(e){let t=0,r=0;for(let s=0,i=e.length;s<i;s++)t=e.charCodeAt(s),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(s++,r+=4);return r}function Up(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function dx(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}function fx(e){let t={},r=e.split("&");for(let s=0,i=r.length;s<i;s++){let o=r[s].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class px extends Error{constructor(t,r,s){super(t),this.description=r,this.context=s,this.type="TransportError"}}class Bc extends ke{constructor(t){super(),this.writable=!1,Co(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,r,s){return super.emitReserved("error",new px(t,r,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const r=Pc(t,this.socket.binaryType);this.onPacket(r)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,r={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const r=dx(t);return r.length?"?"+r:""}}class mx extends Bc{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const r=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||r()})),this.writable||(s++,this.once("drain",function(){--s||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const r=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};rx(t,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,tx(t,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=Up()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(t,r)}}let zp=!1;try{zp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const _x=zp;function gx(){}class vx extends mx{constructor(t){if(super(t),typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,r){const s=this.request({method:"POST",data:t});s.on("success",r),s.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(r,s)=>{this.onError("xhr poll error",r,s)}),this.pollXhr=t}}class Ut extends ke{constructor(t,r,s){super(),this.createRequest=t,Co(this,s),this._opts=s,this._method=s.method||"GET",this._uri=r,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const r=Hp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(r);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ut.requestsCount++,Ut.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=gx,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ut.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ut.requestsCount=0;Ut.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",kh);else if(typeof addEventListener=="function"){const e="onpagehide"in vt?"pagehide":"unload";addEventListener(e,kh,!1)}}function kh(){for(let e in Ut.requests)Ut.requests.hasOwnProperty(e)&&Ut.requests[e].abort()}const yx=function(){const e=$p({xdomain:!1});return e&&e.responseType!==null}();class Sx extends vx{constructor(t){super(t);const r=t&&t.forceBase64;this.supportsBinary=yx&&!r}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ut($p,this.uri(),t)}}function $p(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||_x))return new XMLHttpRequest}catch{}if(!t)try{return new vt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Wp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xx extends Bc{get name(){return"websocket"}doOpen(){const t=this.uri(),r=this.opts.protocols,s=Wp?{}:Hp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,r,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const s=t[r],i=r===t.length-1;Nc(s,this.supportsBinary,o=>{try{this.doWrite(s,o)}catch{}i&&wo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=Up()),this.supportsBinary||(r.b64=1),this.createUri(t,r)}}const ha=vt.WebSocket||vt.MozWebSocket;class bx extends xx{createSocket(t,r,s){return Wp?new ha(t,r,s):r?new ha(t,r):new ha(t)}doWrite(t,r){this.ws.send(r)}}class wx extends Bc{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const r=ix(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(r).getReader(),i=sx();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const o=()=>{s.read().then(({done:n,value:a})=>{n||(this.onPacket(a),o())}).catch(n=>{})};o();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let r=0;r<t.length;r++){const s=t[r],i=r===t.length-1;this._writer.write(s).then(()=>{i&&wo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Cx={websocket:bx,webtransport:wx,polling:Sx},Ex=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kx=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bl(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),s=e.indexOf("]");r!=-1&&s!=-1&&(e=e.substring(0,r)+e.substring(r,s).replace(/:/g,";")+e.substring(s,e.length));let i=Ex.exec(e||""),o={},c=14;for(;c--;)o[kx[c]]=i[c]||"";return r!=-1&&s!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Rx(o,o.path),o.queryKey=Tx(o,o.query),o}function Rx(e,t){const r=/\/{2,9}/g,s=t.replace(r,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Tx(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,o){i&&(r[i]=o)}),r}const wl=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cn=[];wl&&addEventListener("offline",()=>{Cn.forEach(e=>e())},!1);class yr extends ke{constructor(t,r){if(super(),this.binaryType=ox,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(r=t,t=null),t){const s=bl(t);r.hostname=s.host,r.secure=s.protocol==="https"||s.protocol==="wss",r.port=s.port,s.query&&(r.query=s.query)}else r.host&&(r.hostname=bl(r.host).host);Co(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=fx(this.opts.query)),wl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Cn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const r=Object.assign({},this.opts.query);r.EIO=Fp,r.transport=t,this.id&&(r.sid=this.id);const s=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&yr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(t);r.open(),this.setTransport(r)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",yr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=t.data,this._onError(r);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let s=0;s<this.writeBuffer.length;s++){const i=this.writeBuffer[s].data;if(i&&(r+=ux(i)),s>0&&r>this._maxPayload)return this.writeBuffer.slice(0,s);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,wo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,r,s){return this._sendPacket("message",t,r,s),this}send(t,r,s){return this._sendPacket("message",t,r,s),this}_sendPacket(t,r,s,i){if(typeof r=="function"&&(i=r,r=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const o={type:t,data:r,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),t()},s=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(yr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),wl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Cn.indexOf(this._offlineEventListener);s!==-1&&Cn.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,r),this.writeBuffer=[],this._prevBufferLen=0}}}yr.protocol=Fp;class Lx extends yr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let r=this.createTransport(t),s=!1;yr.priorWebsocketSuccess=!1;const i=()=>{s||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;yr.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(m(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const _=new Error("probe error");_.transport=r.name,this.emitReserved("upgradeError",_)}}))};function o(){s||(s=!0,m(),r.close(),r=null)}const c=p=>{const _=new Error("probe error: "+p);_.transport=r.name,o(),this.emitReserved("upgradeError",_)};function n(){c("transport closed")}function a(){c("socket closed")}function f(p){r&&p.name!==r.name&&o()}const m=()=>{r.removeListener("open",i),r.removeListener("error",c),r.removeListener("close",n),this.off("close",a),this.off("upgrading",f)};r.once("open",i),r.once("error",c),r.once("close",n),this.once("close",a),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||r.open()},200):r.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const r=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&r.push(t[s]);return r}}let Dx=class extends Lx{constructor(t,r={}){const s=typeof t=="object"?t:r;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>Cx[i]).filter(i=>!!i)),super(t,s)}};function Ax(e,t="",r){let s=e;r=r||typeof location<"u"&&location,e==null&&(e=r.protocol+"//"+r.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=r.protocol+e:e=r.host+e),/^(https?|wss?):\/\//.test(e)||(typeof r<"u"?e=r.protocol+"//"+e:e="https://"+e),s=bl(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+t,s.href=s.protocol+"://"+o+(r&&r.port===s.port?"":":"+s.port),s}const Ox=typeof ArrayBuffer=="function",Nx=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Vp=Object.prototype.toString,Px=typeof Blob=="function"||typeof Blob<"u"&&Vp.call(Blob)==="[object BlobConstructor]",Bx=typeof File=="function"||typeof File<"u"&&Vp.call(File)==="[object FileConstructor]";function jc(e){return Ox&&(e instanceof ArrayBuffer||Nx(e))||Px&&e instanceof Blob||Bx&&e instanceof File}function En(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let r=0,s=e.length;r<s;r++)if(En(e[r]))return!0;return!1}if(jc(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return En(e.toJSON(),!0);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&En(e[r]))return!0;return!1}function jx(e){const t=[],r=e.data,s=e;return s.data=Cl(r,t),s.attachments=t.length,{packet:s,buffers:t}}function Cl(e,t){if(!e)return e;if(jc(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let s=0;s<e.length;s++)r[s]=Cl(e[s],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){const r={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Cl(e[s],t));return r}return e}function Mx(e,t){return e.data=El(e.data,t),delete e.attachments,e}function El(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=El(e[r],t);else if(typeof e=="object")for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=El(e[r],t));return e}const Ix=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ie;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(ie||(ie={}));class Fx{constructor(t){this.replacer=t}encode(t){return(t.type===ie.EVENT||t.type===ie.ACK)&&En(t)?this.encodeAsBinary({type:t.type===ie.EVENT?ie.BINARY_EVENT:ie.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let r=""+t.type;return(t.type===ie.BINARY_EVENT||t.type===ie.BINARY_ACK)&&(r+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(r+=t.nsp+","),t.id!=null&&(r+=t.id),t.data!=null&&(r+=JSON.stringify(t.data,this.replacer)),r}encodeAsBinary(t){const r=jx(t),s=this.encodeAsString(r.packet),i=r.buffers;return i.unshift(s),i}}class Mc extends ke{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let r;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(t);const s=r.type===ie.BINARY_EVENT;s||r.type===ie.BINARY_ACK?(r.type=s?ie.EVENT:ie.ACK,this.reconstructor=new Hx(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(jc(t)||t.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let r=0;const s={type:Number(t.charAt(0))};if(ie[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===ie.BINARY_EVENT||s.type===ie.BINARY_ACK){const o=r+1;for(;t.charAt(++r)!=="-"&&r!=t.length;);const c=t.substring(o,r);if(c!=Number(c)||t.charAt(r)!=="-")throw new Error("Illegal attachments");const n=Number(c);if(!Ux(n)||n<0)throw new Error("Illegal attachments");if(n>this.opts.maxAttachments)throw new Error("too many attachments");s.attachments=n}if(t.charAt(r+1)==="/"){const o=r+1;for(;++r&&!(t.charAt(r)===","||r===t.length););s.nsp=t.substring(o,r)}else s.nsp="/";const i=t.charAt(r+1);if(i!==""&&Number(i)==i){const o=r+1;for(;++r;){const c=t.charAt(r);if(c==null||Number(c)!=c){--r;break}if(r===t.length)break}s.id=Number(t.substring(o,r+1))}if(t.charAt(++r)){const o=this.tryParse(t.substr(r));if(Mc.isPayloadValid(s.type,o))s.data=o;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,r){switch(t){case ie.CONNECT:return Rh(r);case ie.DISCONNECT:return r===void 0;case ie.CONNECT_ERROR:return typeof r=="string"||Rh(r);case ie.EVENT:case ie.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&Ix.indexOf(r[0])===-1);case ie.ACK:case ie.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Hx{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const r=Mx(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Ux=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Rh(e){return Object.prototype.toString.call(e)==="[object Object]"}const zx=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mc,Encoder:Fx,get PacketType(){return ie}},Symbol.toStringTag,{value:"Module"}));function Tt(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const $x=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class qp extends ke{constructor(t,r,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=r,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Tt(t,"open",this.onopen.bind(this)),Tt(t,"packet",this.onpacket.bind(this)),Tt(t,"error",this.onerror.bind(this)),Tt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...r){var s,i,o;if($x.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(r.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const c={type:ie.EVENT,data:r};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const m=this.ids++,p=r.pop();this._registerAckCallback(m,p),c.id=m}const n=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!n||(a?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,r){var s;const i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[t]=r;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let n=0;n<this.sendBuffer.length;n++)this.sendBuffer[n].id===t&&this.sendBuffer.splice(n,1);r.call(this,new Error("operation has timed out"))},i),c=(...n)=>{this.io.clearTimeoutFn(o),r.apply(this,n)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...r){return new Promise((s,i)=>{const o=(c,n)=>c?i(c):s(n);o.withError=!0,r.push(o),this.emit(t,...r)})}_addToQueue(t){let r;typeof t[t.length-1]=="function"&&(r=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(i)):(this._queue.shift(),r&&r(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!t||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:ie.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case ie.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ie.EVENT:case ie.BINARY_EVENT:this.onevent(t);break;case ie.ACK:case ie.BINARY_ACK:this.onack(t);break;case ie.DISCONNECT:this.ondisconnect();break;case ie.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const r=t.data||[];t.id!=null&&r.push(this.ack(t.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const s of r)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const r=this;let s=!1;return function(...i){s||(s=!0,r.packet({type:ie.ACK,id:t,data:i}))}}onack(t){const r=this.acks[t.id];typeof r=="function"&&(delete this.acks[t.id],r.withError&&t.data.unshift(null),r.apply(this,t.data))}onconnect(t,r){this.id=t,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ie.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const r=this._anyListeners;for(let s=0;s<r.length;s++)if(t===r[s])return r.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const r=this._anyOutgoingListeners;for(let s=0;s<r.length;s++)if(t===r[s])return r.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const s of r)s.apply(this,t.data)}}}function Ts(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ts.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+r:e-r}return Math.min(e,this.max)|0};Ts.prototype.reset=function(){this.attempts=0};Ts.prototype.setMin=function(e){this.ms=e};Ts.prototype.setMax=function(e){this.max=e};Ts.prototype.setJitter=function(e){this.jitter=e};class kl extends ke{constructor(t,r){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(r=t,t=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,Co(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((s=r.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Ts({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=t;const i=r.parser||zx;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var r;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(r=this.backoff)===null||r===void 0||r.setMin(t),this)}randomizationFactor(t){var r;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(r=this.backoff)===null||r===void 0||r.setJitter(t),this)}reconnectionDelayMax(t){var r;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(r=this.backoff)===null||r===void 0||r.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Dx(this.uri,this.opts);const r=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=Tt(r,"open",function(){s.onopen(),t&&t()}),o=n=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",n),t?t(n):this.maybeReconnectOnOpen()},c=Tt(r,"error",o);if(this._timeout!==!1){const n=this._timeout,a=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),r.close()},n);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Tt(t,"ping",this.onping.bind(this)),Tt(t,"data",this.ondata.bind(this)),Tt(t,"error",this.onerror.bind(this)),Tt(t,"close",this.onclose.bind(this)),Tt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(r){this.onclose("parse error",r)}}ondecoded(t){wo(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,r){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new qp(this,t,r),this.nsps[t]=s),s}_destroy(t){const r=Object.keys(this.nsps);for(const s of r)if(this.nsps[s].active)return;this._close()}_packet(t){const r=this.encoder.encode(t);for(let s=0;s<r.length;s++)this.engine.write(r[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,r){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},r);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Us={};function kn(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const r=Ax(e,t.path||"/socket.io"),s=r.source,i=r.id,o=r.path,c=Us[i]&&o in Us[i].nsps,n=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let a;return n?a=new kl(s,t):(Us[i]||(Us[i]=new kl(s,t)),a=Us[i]),r.query&&!t.query&&(t.query=r.queryKey),a.socket(r.path,t)}Object.assign(kn,{Manager:kl,Socket:qp,io:kn,connect:kn});function Wx(){const e=M.useRef(null),t=M.useRef(null),r=M.useRef(null),s=M.useRef(null);return M.useEffect(()=>{if(!e.current)return;const i=new GS.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"Roboto Mono, monospace",theme:{background:"#1a1a1a",foreground:"#f0f0f0",cursor:"#d4af37",selectionBackground:"#404040",black:"#1a1a1a",red:"#c0392b",green:"#27ae60",yellow:"#f39c12",blue:"#4a90d9",magenta:"#9966cc",cyan:"#20b2aa",white:"#f0f0f0",brightBlack:"#404040",brightRed:"#ff6b6b",brightGreen:"#6abf6a",brightYellow:"#e8c962",brightBlue:"#6baee8",brightMagenta:"#c8a8e8",brightCyan:"#7de8d8",brightWhite:"#ffffff"}}),o=new JS.FitAddon;i.loadAddon(o),i.open(e.current),o.fit(),t.current=i,r.current=o;const c=kn({transports:["websocket"]});s.current=c,c.on("connect",()=>{i.writeln("Connecting to remote shell..."),c.emit("shell_create",{type:"vm"})}),c.on("shell_created",a=>{a.success?i.writeln(`\r
|
||
Connected to remote shell.`):i.writeln(`\r
|
||
Failed to create shell: ${a.error||"Unknown error"}`)}),c.on("shell_output",a=>{a.data&&i.write(a.data)}),c.on("disconnect",()=>{i.writeln(`\r
|
||
[Disconnected]`)}),i.onData(a=>{c.emit("shell_input",{data:a})});const n=()=>{o.fit()};return window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n),c.emit("shell_disconnect"),c.disconnect(),i.dispose()}},[]),v.jsxs("div",{className:"h-[calc(100vh-140px)] flex flex-col",children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-4",children:"Remote Shell"}),v.jsx("div",{ref:e,className:"flex-1 bg-[#1a1a1a] rounded-lg border border-border overflow-hidden"})]})}function Vx(){const[e,t]=M.useState("/"),[r,s]=M.useState([]),[i,o]=M.useState(!1),[c,n]=M.useState(null),{dispatch:a}=Fe(),f=async _=>{var S,b;o(!0);try{const y=await ne.post("/files/list",{path:_});y.data.success?(s(y.data.data),t(_)):a({type:"ADD_TOAST",payload:{message:y.data.error||"Failed",type:"error"}})}catch(y){a({type:"ADD_TOAST",payload:{message:((b=(S=y.response)==null?void 0:S.data)==null?void 0:b.error)||"Failed",type:"error"}})}finally{o(!1)}};M.useEffect(()=>{f("/")},[]);const m=async _=>{var S,b;try{const y=await ne.get(`/files/view?path=${encodeURIComponent(_)}`);y.data.success&&n({path:_,content:y.data.data})}catch(y){a({type:"ADD_TOAST",payload:{message:((b=(S=y.response)==null?void 0:S.data)==null?void 0:b.error)||"Failed",type:"error"}})}},p=e.split("/").filter(Boolean);return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"File Browser"}),v.jsxs("div",{className:"flex items-center gap-2 mb-4 text-sm",children:[v.jsx("button",{onClick:()=>f("/"),className:"text-primary hover:underline",children:"/"}),p.map((_,S)=>{const b="/"+p.slice(0,S+1).join("/");return v.jsxs("span",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-text-muted",children:"/"}),v.jsx("button",{onClick:()=>f(b),className:"text-primary hover:underline",children:_})]},S)})]}),v.jsx("div",{className:"bg-card-bg border border-border rounded-lg overflow-hidden",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border",children:[v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Name"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Size"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Modified"}),v.jsx("th",{className:"text-left px-4 py-3 text-text-muted font-semibold text-[11px] uppercase",children:"Actions"})]})}),v.jsxs("tbody",{children:[e!=="/"&&v.jsxs("tr",{className:"border-b border-border hover:bg-hover/50 cursor-pointer",onClick:()=>{const _=e.substring(0,e.lastIndexOf("/"))||"/";f(_)},children:[v.jsx("td",{className:"px-4 py-3 text-text-primary",children:".."}),v.jsx("td",{className:"px-4 py-3",children:"-"}),v.jsx("td",{className:"px-4 py-3",children:"-"}),v.jsx("td",{className:"px-4 py-3",children:"-"})]}),i?v.jsx("tr",{children:v.jsx("td",{colSpan:4,className:"px-4 py-8 text-center text-text-muted",children:"Loading..."})}):r.map(_=>v.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-hover/50 cursor-pointer",onClick:()=>_.is_dir&&f(_.path),children:[v.jsxs("td",{className:"px-4 py-3 text-text-primary",children:[_.is_dir?"📁":"📄"," ",_.name]}),v.jsx("td",{className:"px-4 py-3 text-text-muted",children:_.is_dir?"-":qx(_.size)}),v.jsx("td",{className:"px-4 py-3 text-text-muted",children:new Date(_.mod_time).toLocaleString()}),v.jsx("td",{className:"px-4 py-3",children:!_.is_dir&&v.jsx("button",{onClick:S=>{S.stopPropagation(),m(_.path)},className:"text-xs text-primary hover:underline",children:"View"})})]},_.path))]})]})}),c&&v.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:v.jsxs("div",{className:"bg-card-bg border border-border rounded-xl shadow-2xl w-full mx-4 max-w-4xl max-h-[80vh] flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[v.jsx("h3",{className:"font-serif text-lg text-text-primary truncate",children:c.path}),v.jsx("button",{onClick:()=>n(null),className:"text-text-muted hover:text-text-primary text-xl leading-none",children:"×"})]}),v.jsx("pre",{className:"p-5 overflow-auto flex-1 text-xs font-mono text-text-secondary bg-code-bg",children:c.content})]})})]})}function qx(e){if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB"],s=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,s)).toFixed(2))+" "+r[s]}const Kx=e=>ne.get(e).then(t=>t.data);function Xx(){const[e,t]=M.useState("battlegroup"),{dispatch:r}=Fe(),{data:s}=ct("/director/battlegroup",Kx,{refreshInterval:15e3}),i=async(o,c)=>{var n,a;try{const f=await ne.post(o,c);f.data.success?r({type:"ADD_TOAST",payload:{message:"Success",type:"success"}}):r({type:"ADD_TOAST",payload:{message:f.data.error||"Failed",type:"error"}})}catch(f){r({type:"ADD_TOAST",payload:{message:((a=(n=f.response)==null?void 0:n.data)==null?void 0:a.error)||"Failed",type:"error"}})}};return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Director Control"}),v.jsx("div",{className:"flex gap-1 mb-6 border-b border-border",children:[{key:"battlegroup",label:"Battlegroup"},{key:"config",label:"Config"},{key:"transfer",label:"Transfer"},{key:"fls",label:"FLS"}].map(o=>v.jsx("button",{onClick:()=>t(o.key),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${e===o.key?"text-primary border-primary":"text-text-muted border-transparent hover:text-text-primary"}`,children:o.label},o.key))}),e==="battlegroup"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"Battlegroup State"}),s!=null&&s.success?v.jsx("pre",{className:"text-xs text-text-secondary font-mono bg-code-bg p-4 rounded overflow-auto max-h-[60vh]",children:JSON.stringify(s.data,null,2)}):v.jsx("div",{className:"text-text-muted",children:"Loading battlegroup data..."})]}),e==="config"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4 max-w-xl",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"Update Config"}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Map Name"}),v.jsx("input",{id:"config-map",className:"w-full bg-card-bg border border-border rounded-lg px-4 py-2 text-sm",placeholder:"e.g., HaggaBasin"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm text-text-muted mb-2",children:"Config JSON"}),v.jsx("textarea",{id:"config-json",rows:6,className:"w-full bg-card-bg border border-border rounded-lg px-4 py-3 text-sm font-mono",placeholder:'{"maxPlayers": 100}'})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("button",{onClick:()=>{const o=document.getElementById("config-map").value,c=document.getElementById("config-json").value;i("/director/config",{map:o,config:JSON.parse(c)})},className:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium",children:"Update Config"}),v.jsx("button",{onClick:()=>i("/director/config/clear",{}),className:"px-4 py-2 bg-danger/10 border border-danger/30 text-danger rounded-lg text-sm font-medium",children:"Clear Config"})]})]}),e==="transfer"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4 max-w-xl",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"Transfer Rules"}),v.jsx("div",{className:"flex gap-2",children:v.jsx("button",{onClick:()=>i("/director/transfer/clear",{}),className:"px-4 py-2 bg-danger/10 border border-danger/30 text-danger rounded-lg text-sm font-medium",children:"Clear Overrides"})})]}),e==="fls"&&v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4 max-w-xl",children:[v.jsx("h3",{className:"text-text-muted text-xs uppercase tracking-wider mb-4",children:"FLS Settings"}),v.jsx("div",{className:"flex gap-2",children:v.jsx("button",{onClick:()=>i("/director/fls/clear",{}),className:"px-4 py-2 bg-danger/10 border border-danger/30 text-danger rounded-lg text-sm font-medium",children:"Clear FLS Overrides"})})]})]})}function Gx(){const[e,t]=M.useState({}),[r,s]=M.useState(!1),[i,o]=M.useState(!1),{dispatch:c}=Fe(),n=async()=>{var p,_;s(!0);try{const S=await ne.get("/settings");S.data.success&&t(S.data.data)}catch(S){c({type:"ADD_TOAST",payload:{message:((_=(p=S.response)==null?void 0:p.data)==null?void 0:_.error)||"Failed to load settings",type:"error"}})}finally{s(!1)}};M.useEffect(()=>{n()},[]);const a=async()=>{var p,_;o(!0);try{(await ne.post("/settings",e)).data.success&&c({type:"ADD_TOAST",payload:{message:"Settings saved",type:"success"}})}catch(S){c({type:"ADD_TOAST",payload:{message:((_=(p=S.response)==null?void 0:p.data)==null?void 0:_.error)||"Failed to save",type:"error"}})}finally{o(!1)}},f=(p,_)=>{t({...e,[p]:_})},m=()=>{const p=prompt("Enter new setting key:");p&&t({...e,[p]:""})};return v.jsxs("div",{children:[v.jsx("h1",{className:"font-serif text-3xl text-primary mb-6",children:"Settings"}),v.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[v.jsx("button",{onClick:n,disabled:r,className:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-dark disabled:opacity-50",children:r?"Loading...":"Reload"}),v.jsx("button",{onClick:a,disabled:i,className:"px-4 py-2 bg-success text-white rounded-lg text-sm font-medium hover:bg-success/80 disabled:opacity-50",children:i?"Saving...":"Save Settings"}),v.jsx("button",{onClick:m,className:"px-4 py-2 bg-card-bg border border-border text-text-primary rounded-lg text-sm font-medium hover:bg-hover",children:"Add Key"})]}),v.jsxs("div",{className:"bg-card-bg border border-border rounded-lg p-5 space-y-4 max-w-2xl",children:[Object.entries(e).length===0&&!r&&v.jsx("div",{className:"text-text-muted",children:"No settings found."}),Object.entries(e).map(([p,_])=>v.jsxs("div",{className:"grid grid-cols-[200px_1fr] gap-4 items-center",children:[v.jsx("label",{className:"text-sm text-text-secondary truncate",title:p,children:p}),v.jsx("input",{value:_,onChange:S=>f(p,S.target.value),className:"bg-card-bg border border-border rounded px-3 py-2 text-sm text-text-primary"})]},p))]})]})}function Jx(){return Dv(),null}function Qx(){return v.jsx(Lv,{children:v.jsxs(xv,{children:[v.jsx(Jx,{}),v.jsx(Mv,{children:v.jsxs(pv,{children:[v.jsx(Ve,{path:"/",element:v.jsx(R0,{})}),v.jsx(Ve,{path:"/players",element:v.jsx(mS,{})}),v.jsx(Ve,{path:"/players/:accountId",element:v.jsx(gS,{})}),v.jsx(Ve,{path:"/guilds",element:v.jsx(kS,{})}),v.jsx(Ve,{path:"/vehicles",element:v.jsx(TS,{})}),v.jsx(Ve,{path:"/buildings",element:v.jsx(DS,{})}),v.jsx(Ve,{path:"/map",element:v.jsx(OS,{})}),v.jsx(Ve,{path:"/accounts",element:v.jsx(PS,{})}),v.jsx(Ve,{path:"/server",element:v.jsx(BS,{})}),v.jsx(Ve,{path:"/admin",element:v.jsx(FS,{})}),v.jsx(Ve,{path:"/chat",element:v.jsx(XS,{})}),v.jsx(Ve,{path:"/shell",element:v.jsx(Wx,{})}),v.jsx(Ve,{path:"/files",element:v.jsx(Vx,{})}),v.jsx(Ve,{path:"/director",element:v.jsx(Xx,{})}),v.jsx(Ve,{path:"/settings",element:v.jsx(Gx,{})})]})})]})})}da.createRoot(document.getElementById("root")).render(v.jsx(bi.StrictMode,{children:v.jsx(Qx,{})}));
|