var sk=Object.defineProperty;var ok=(e,t,n)=>t in e?sk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ms=(e,t,n)=>(ok(e,typeof t!="symbol"?t+"":t,n),n),ah=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var V=(e,t,n)=>(ah(e,t,"read from private field"),n?n.call(e):t.get(e)),le=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ie=(e,t,n,r)=>(ah(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Kl=(e,t,n,r)=>({set _(i){ie(e,t,i,n)},get _(){return V(e,t,r)}}),ye=(e,t,n)=>(ah(e,t,"access private method"),n);/*!
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *                     _            _       _           _       
 *                    | |___  __   / \   __| |_ __ ___ (_)_ __  
 *                    | __\ \/ /  / _ \ / _` | '_ ` _ \| | '_ \ 
 *                    | |_ >  <  / ___ \ (_| | | | | | | | | | |
 *                     \__/_/\_\/_/   \_\__,_|_| |_| |_|_|_| |_|
 *                                                              
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * Author: André Tabarra (https://github.com/tabarra)
 * Repository: https://github.com/tabarra/txAdmin
 * This bundled file includes third party libraries under their respective licenses.
 * txAdmin is a free open source software provided under the license below.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * MIT License
 * 
 * Copyright (c) 2019-2024 André Tabarra <maintainer@txadmin.gg>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */function ak(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[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"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(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 r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function ld(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vy={exports:{}},cd={},_y={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 yl=Symbol.for("react.element"),lk=Symbol.for("react.portal"),ck=Symbol.for("react.fragment"),uk=Symbol.for("react.strict_mode"),dk=Symbol.for("react.profiler"),hk=Symbol.for("react.provider"),fk=Symbol.for("react.context"),pk=Symbol.for("react.forward_ref"),mk=Symbol.for("react.suspense"),gk=Symbol.for("react.memo"),vk=Symbol.for("react.lazy"),Iv=Symbol.iterator;function _k(e){return e===null||typeof e!="object"?null:(e=Iv&&e[Iv]||e["@@iterator"],typeof e=="function"?e:null)}var yy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xy=Object.assign,wy={};function Do(e,t,n){this.props=e,this.context=t,this.refs=wy,this.updater=n||yy}Do.prototype.isReactComponent={};Do.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")};Do.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function by(){}by.prototype=Do.prototype;function lm(e,t,n){this.props=e,this.context=t,this.refs=wy,this.updater=n||yy}var cm=lm.prototype=new by;cm.constructor=lm;xy(cm,Do.prototype);cm.isPureReactComponent=!0;var jv=Array.isArray,Sy=Object.prototype.hasOwnProperty,um={current:null},Cy={key:!0,ref:!0,__self:!0,__source:!0};function ky(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Sy.call(t,r)&&!Cy.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),c=0;c<s;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:yl,type:e,key:o,ref:a,props:i,_owner:um.current}}function yk(e,t){return{$$typeof:yl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function dm(e){return typeof e=="object"&&e!==null&&e.$$typeof===yl}function xk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Bv=/\/+/g;function lh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?xk(""+e.key):t.toString(36)}function Nc(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case yl:case lk:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+lh(a,0):r,jv(i)?(n="",e!=null&&(n=e.replace(Bv,"$&/")+"/"),Nc(i,t,n,"",function(c){return c})):i!=null&&(dm(i)&&(i=yk(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(Bv,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",jv(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+lh(o,s);a+=Nc(o,t,n,l,i)}else if(l=_k(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+lh(o,s++),a+=Nc(o,t,n,l,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 a}function ql(e,t,n){if(e==null)return e;var r=[],i=0;return Nc(e,r,"","",function(o){return t.call(n,o,i++)}),r}function wk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var At={current:null},Ic={transition:null},bk={ReactCurrentDispatcher:At,ReactCurrentBatchConfig:Ic,ReactCurrentOwner:um};Re.Children={map:ql,forEach:function(e,t,n){ql(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ql(e,function(){t++}),t},toArray:function(e){return ql(e,function(t){return t})||[]},only:function(e){if(!dm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Component=Do;Re.Fragment=ck;Re.Profiler=dk;Re.PureComponent=lm;Re.StrictMode=uk;Re.Suspense=mk;Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=bk;Re.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=xy({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=um.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)Sy.call(t,l)&&!Cy.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var c=0;c<l;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:yl,type:e.type,key:i,ref:o,props:r,_owner:a}};Re.createContext=function(e){return e={$$typeof:fk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:hk,_context:e},e.Consumer=e};Re.createElement=ky;Re.createFactory=function(e){var t=ky.bind(null,e);return t.type=e,t};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:pk,render:e}};Re.isValidElement=dm;Re.lazy=function(e){return{$$typeof:vk,_payload:{_status:-1,_result:e},_init:wk}};Re.memo=function(e,t){return{$$typeof:gk,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Ic.transition;Ic.transition={};try{e()}finally{Ic.transition=t}};Re.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Re.useCallback=function(e,t){return At.current.useCallback(e,t)};Re.useContext=function(e){return At.current.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e){return At.current.useDeferredValue(e)};Re.useEffect=function(e,t){return At.current.useEffect(e,t)};Re.useId=function(){return At.current.useId()};Re.useImperativeHandle=function(e,t,n){return At.current.useImperativeHandle(e,t,n)};Re.useInsertionEffect=function(e,t){return At.current.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return At.current.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return At.current.useMemo(e,t)};Re.useReducer=function(e,t,n){return At.current.useReducer(e,t,n)};Re.useRef=function(e){return At.current.useRef(e)};Re.useState=function(e){return At.current.useState(e)};Re.useSyncExternalStore=function(e,t,n){return At.current.useSyncExternalStore(e,t,n)};Re.useTransition=function(){return At.current.useTransition()};Re.version="18.2.0";_y.exports=Re;var b=_y.exports;const tt=ld(b),Ey=ak({__proto__:null,default:tt},[b]);/**
 * @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 Sk=b,Ck=Symbol.for("react.element"),kk=Symbol.for("react.fragment"),Ek=Object.prototype.hasOwnProperty,Rk=Sk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Lk={key:!0,ref:!0,__self:!0,__source:!0};function Ry(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Ek.call(t,r)&&!Lk.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Ck,type:e,key:o,ref:a,props:i,_owner:Rk.current}}cd.Fragment=kk;cd.jsx=Ry;cd.jsxs=Ry;vy.exports=cd;var _=vy.exports;const Mk=b.createContext(null),ch={didCatch:!1,error:null};class Ly extends b.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ch}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(ch)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&Tk(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(ch)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")s=n(l);else if(r)s=b.createElement(r,l);else if(i===null||b.isValidElement(i))s=i;else throw a}return b.createElement(Mk.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Tk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}var df={},My={exports:{}},rn={},Ty={exports:{}},Ay={};/**
 * @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(B,A){var T=B.length;B.push(A);e:for(;0<T;){var j=T-1>>>1,z=B[j];if(0<i(z,A))B[j]=A,B[T]=z,T=j;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var A=B[0],T=B.pop();if(T!==A){B[0]=T;e:for(var j=0,z=B.length,N=z>>>1;j<N;){var X=2*(j+1)-1,re=B[X],H=X+1,W=B[H];if(0>i(re,T))H<z&&0>i(W,re)?(B[j]=W,B[H]=T,j=H):(B[j]=re,B[X]=T,j=X);else if(H<z&&0>i(W,T))B[j]=W,B[H]=T,j=H;else break e}}return A}function i(B,A){var T=B.sortIndex-A.sortIndex;return T!==0?T:B.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],p=1,u=null,m=3,g=!1,x=!1,y=!1,h=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(B){for(var A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=B)r(c),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(c)}}function S(B){if(y=!1,v(B),!x)if(n(l)!==null)x=!0,F(k);else{var A=n(c);A!==null&&U(S,A.startTime-B)}}function k(B,A){x=!1,y&&(y=!1,f(w),w=-1),g=!0;var T=m;try{for(v(A),u=n(l);u!==null&&(!(u.expirationTime>A)||B&&!M());){var j=u.callback;if(typeof j=="function"){u.callback=null,m=u.priorityLevel;var z=j(u.expirationTime<=A);A=e.unstable_now(),typeof z=="function"?u.callback=z:u===n(l)&&r(l),v(A)}else r(l);u=n(l)}if(u!==null)var N=!0;else{var X=n(c);X!==null&&U(S,X.startTime-A),N=!1}return N}finally{u=null,m=T,g=!1}}var C=!1,R=null,w=-1,E=5,L=-1;function M(){return!(e.unstable_now()-L<E)}function D(){if(R!==null){var B=e.unstable_now();L=B;var A=!0;try{A=R(!0,B)}finally{A?P():(C=!1,R=null)}}else C=!1}var P;if(typeof d=="function")P=function(){d(D)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,O=$.port2;$.port1.onmessage=D,P=function(){O.postMessage(null)}}else P=function(){h(D,0)};function F(B){R=B,C||(C=!0,P())}function U(B,A){w=h(function(){B(e.unstable_now())},A)}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(B){B.callback=null},e.unstable_continueExecution=function(){x||g||(x=!0,F(k))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(B){switch(m){case 1:case 2:case 3:var A=3;break;default:A=m}var T=m;m=A;try{return B()}finally{m=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,A){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var T=m;m=B;try{return A()}finally{m=T}},e.unstable_scheduleCallback=function(B,A,T){var j=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?j+T:j):T=j,B){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=T+z,B={id:p++,callback:A,priorityLevel:B,startTime:T,expirationTime:z,sortIndex:-1},T>j?(B.sortIndex=T,t(c,B),n(l)===null&&B===n(c)&&(y?(f(w),w=-1):y=!0,U(S,T-j))):(B.sortIndex=z,t(l,B),x||g||(x=!0,F(k))),B},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(B){var A=m;return function(){var T=m;m=A;try{return B.apply(this,arguments)}finally{m=T}}}})(Ay);Ty.exports=Ay;var Ak=Ty.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 Dy=b,nn=Ak;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Py=new Set,Pa={};function ss(e,t){vo(e,t),vo(e+"Capture",t)}function vo(e,t){for(Pa[e]=t,e=0;e<t.length;e++)Py.add(t[e])}var br=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hf=Object.prototype.hasOwnProperty,Dk=/^[: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]*$/,Fv={},zv={};function Pk(e){return hf.call(zv,e)?!0:hf.call(Fv,e)?!1:Dk.test(e)?zv[e]=!0:(Fv[e]=!0,!1)}function $k(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ok(e,t,n,r){if(t===null||typeof t>"u"||$k(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 Dt(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xt[e]=new Dt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xt[t]=new Dt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xt[e]=new Dt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xt[e]=new Dt(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){xt[e]=new Dt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xt[e]=new Dt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xt[e]=new Dt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xt[e]=new Dt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xt[e]=new Dt(e,5,!1,e.toLowerCase(),null,!1,!1)});var hm=/[\-:]([a-z])/g;function fm(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(hm,fm);xt[t]=new Dt(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(hm,fm);xt[t]=new Dt(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(hm,fm);xt[t]=new Dt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!1,!1)});xt.xlinkHref=new Dt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xt[e]=new Dt(e,1,!1,e.toLowerCase(),null,!0,!0)});function pm(e,t,n,r){var i=xt.hasOwnProperty(t)?xt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ok(t,n,i,r)&&(n=null),r||i===null?Pk(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Dr=Dy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gl=Symbol.for("react.element"),Ls=Symbol.for("react.portal"),Ms=Symbol.for("react.fragment"),mm=Symbol.for("react.strict_mode"),ff=Symbol.for("react.profiler"),$y=Symbol.for("react.provider"),Oy=Symbol.for("react.context"),gm=Symbol.for("react.forward_ref"),pf=Symbol.for("react.suspense"),mf=Symbol.for("react.suspense_list"),vm=Symbol.for("react.memo"),Ur=Symbol.for("react.lazy"),Ny=Symbol.for("react.offscreen"),Hv=Symbol.iterator;function Yo(e){return e===null||typeof e!="object"?null:(e=Hv&&e[Hv]||e["@@iterator"],typeof e=="function"?e:null)}var Qe=Object.assign,uh;function fa(e){if(uh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);uh=t&&t[1]||""}return`
`+uh+e}var dh=!1;function hh(e,t){if(!e||dh)return"";dh=!0;var n=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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
`),o=r.stack.split(`
`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{dh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fa(e):""}function Nk(e){switch(e.tag){case 5:return fa(e.type);case 16:return fa("Lazy");case 13:return fa("Suspense");case 19:return fa("SuspenseList");case 0:case 2:case 15:return e=hh(e.type,!1),e;case 11:return e=hh(e.type.render,!1),e;case 1:return e=hh(e.type,!0),e;default:return""}}function gf(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 Ms:return"Fragment";case Ls:return"Portal";case ff:return"Profiler";case mm:return"StrictMode";case pf:return"Suspense";case mf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Oy:return(e.displayName||"Context")+".Consumer";case $y:return(e._context.displayName||"Context")+".Provider";case gm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vm:return t=e.displayName||null,t!==null?t:gf(e.type)||"Memo";case Ur:t=e._payload,e=e._init;try{return gf(e(t))}catch{}}return null}function Ik(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 gf(t);case 8:return t===mm?"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 fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Iy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jk(e){var t=Iy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yl(e){e._valueTracker||(e._valueTracker=jk(e))}function jy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Iy(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function lu(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 vf(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=fi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function By(e,t){t=t.checked,t!=null&&pm(e,"checked",t,!1)}function _f(e,t){By(e,t);var n=fi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yf(e,t.type,n):t.hasOwnProperty("defaultValue")&&yf(e,t.type,fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wv(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yf(e,t,n){(t!=="number"||lu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pa=Array.isArray;function zs(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+fi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function xf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vv(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(pa(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:fi(n)}}function Fy(e,t){var n=fi(t.value),r=fi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Kv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function zy(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 wf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?zy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xl,Hy=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xl=Xl||document.createElement("div"),Xl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $a(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xa={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},Bk=["Webkit","ms","Moz","O"];Object.keys(xa).forEach(function(e){Bk.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xa[t]=xa[e]})});function Uy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xa.hasOwnProperty(e)&&xa[e]?(""+t).trim():t+"px"}function Wy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Uy(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Fk=Qe({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 bf(e,t){if(t){if(Fk[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function Sf(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 Cf=null;function _m(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kf=null,Hs=null,Us=null;function qv(e){if(e=bl(e)){if(typeof kf!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=pd(t),kf(e.stateNode,e.type,t))}}function Vy(e){Hs?Us?Us.push(e):Us=[e]:Hs=e}function Ky(){if(Hs){var e=Hs,t=Us;if(Us=Hs=null,qv(e),t)for(e=0;e<t.length;e++)qv(t[e])}}function qy(e,t){return e(t)}function Gy(){}var fh=!1;function Yy(e,t,n){if(fh)return e(t,n);fh=!0;try{return qy(e,t,n)}finally{fh=!1,(Hs!==null||Us!==null)&&(Gy(),Ky())}}function Oa(e,t){var n=e.stateNode;if(n===null)return null;var r=pd(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var Ef=!1;if(br)try{var Xo={};Object.defineProperty(Xo,"passive",{get:function(){Ef=!0}}),window.addEventListener("test",Xo,Xo),window.removeEventListener("test",Xo,Xo)}catch{Ef=!1}function zk(e,t,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var wa=!1,cu=null,uu=!1,Rf=null,Hk={onError:function(e){wa=!0,cu=e}};function Uk(e,t,n,r,i,o,a,s,l){wa=!1,cu=null,zk.apply(Hk,arguments)}function Wk(e,t,n,r,i,o,a,s,l){if(Uk.apply(this,arguments),wa){if(wa){var c=cu;wa=!1,cu=null}else throw Error(ee(198));uu||(uu=!0,Rf=c)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Xy(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 Gv(e){if(os(e)!==e)throw Error(ee(188))}function Vk(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Gv(i),e;if(o===r)return Gv(i),t;o=o.sibling}throw Error(ee(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function Qy(e){return e=Vk(e),e!==null?Jy(e):null}function Jy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Jy(e);if(t!==null)return t;e=e.sibling}return null}var Zy=nn.unstable_scheduleCallback,Yv=nn.unstable_cancelCallback,Kk=nn.unstable_shouldYield,qk=nn.unstable_requestPaint,Ze=nn.unstable_now,Gk=nn.unstable_getCurrentPriorityLevel,ym=nn.unstable_ImmediatePriority,ex=nn.unstable_UserBlockingPriority,du=nn.unstable_NormalPriority,Yk=nn.unstable_LowPriority,tx=nn.unstable_IdlePriority,ud=null,er=null;function Xk(e){if(er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(ud,e,void 0,(e.current.flags&128)===128)}catch{}}var On=Math.clz32?Math.clz32:Zk,Qk=Math.log,Jk=Math.LN2;function Zk(e){return e>>>=0,e===0?32:31-(Qk(e)/Jk|0)|0}var Ql=64,Jl=4194304;function ma(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 hu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=ma(s):(o&=a,o!==0&&(r=ma(o)))}else a=n&~i,a!==0?r=ma(a):o!==0&&(r=ma(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-On(t),i=1<<n,r|=e[n],t&=~i;return r}function eE(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 tE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-On(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=eE(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function Lf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function nx(){var e=Ql;return Ql<<=1,!(Ql&4194240)&&(Ql=64),e}function ph(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-On(t),e[t]=n}function nE(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-On(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function xm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-On(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ie=0;function rx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ix,wm,sx,ox,ax,Mf=!1,Zl=[],si=null,oi=null,ai=null,Na=new Map,Ia=new Map,Vr=[],rE="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 Xv(e,t){switch(e){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Na.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ia.delete(t.pointerId)}}function Qo(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=bl(t),t!==null&&wm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function iE(e,t,n,r,i){switch(t){case"focusin":return si=Qo(si,e,t,n,r,i),!0;case"dragenter":return oi=Qo(oi,e,t,n,r,i),!0;case"mouseover":return ai=Qo(ai,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return Na.set(o,Qo(Na.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Ia.set(o,Qo(Ia.get(o)||null,e,t,n,r,i)),!0}return!1}function lx(e){var t=Di(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=Xy(n),t!==null){e.blockedOn=t,ax(e.priority,function(){sx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Cf=r,n.target.dispatchEvent(r),Cf=null}else return t=bl(n),t!==null&&wm(t),e.blockedOn=n,!1;t.shift()}return!0}function Qv(e,t,n){jc(e)&&n.delete(t)}function sE(){Mf=!1,si!==null&&jc(si)&&(si=null),oi!==null&&jc(oi)&&(oi=null),ai!==null&&jc(ai)&&(ai=null),Na.forEach(Qv),Ia.forEach(Qv)}function Jo(e,t){e.blockedOn===t&&(e.blockedOn=null,Mf||(Mf=!0,nn.unstable_scheduleCallback(nn.unstable_NormalPriority,sE)))}function ja(e){function t(i){return Jo(i,e)}if(0<Zl.length){Jo(Zl[0],e);for(var n=1;n<Zl.length;n++){var r=Zl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(si!==null&&Jo(si,e),oi!==null&&Jo(oi,e),ai!==null&&Jo(ai,e),Na.forEach(t),Ia.forEach(t),n=0;n<Vr.length;n++)r=Vr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Vr.length&&(n=Vr[0],n.blockedOn===null);)lx(n),n.blockedOn===null&&Vr.shift()}var Ws=Dr.ReactCurrentBatchConfig,fu=!0;function oE(e,t,n,r){var i=Ie,o=Ws.transition;Ws.transition=null;try{Ie=1,bm(e,t,n,r)}finally{Ie=i,Ws.transition=o}}function aE(e,t,n,r){var i=Ie,o=Ws.transition;Ws.transition=null;try{Ie=4,bm(e,t,n,r)}finally{Ie=i,Ws.transition=o}}function bm(e,t,n,r){if(fu){var i=Tf(e,t,n,r);if(i===null)Ch(e,t,r,pu,n),Xv(e,r);else if(iE(i,e,t,n,r))r.stopPropagation();else if(Xv(e,r),t&4&&-1<rE.indexOf(e)){for(;i!==null;){var o=bl(i);if(o!==null&&ix(o),o=Tf(e,t,n,r),o===null&&Ch(e,t,r,pu,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Ch(e,t,r,null,n)}}var pu=null;function Tf(e,t,n,r){if(pu=null,e=_m(r),e=Di(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Xy(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return pu=e,null}function cx(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(Gk()){case ym:return 1;case ex:return 4;case du:case Yk:return 16;case tx:return 536870912;default:return 16}default:return 16}}var ni=null,Sm=null,Bc=null;function ux(){if(Bc)return Bc;var e,t=Sm,n=t.length,r,i="value"in ni?ni.value:ni.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return Bc=i.slice(e,1<r?1-r:void 0)}function Fc(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 ec(){return!0}function Jv(){return!1}function sn(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ec:Jv,this.isPropagationStopped=Jv,this}return Qe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ec)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ec)},persist:function(){},isPersistent:ec}),t}var Po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cm=sn(Po),wl=Qe({},Po,{view:0,detail:0}),lE=sn(wl),mh,gh,Zo,dd=Qe({},wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:km,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!==Zo&&(Zo&&e.type==="mousemove"?(mh=e.screenX-Zo.screenX,gh=e.screenY-Zo.screenY):gh=mh=0,Zo=e),mh)},movementY:function(e){return"movementY"in e?e.movementY:gh}}),Zv=sn(dd),cE=Qe({},dd,{dataTransfer:0}),uE=sn(cE),dE=Qe({},wl,{relatedTarget:0}),vh=sn(dE),hE=Qe({},Po,{animationName:0,elapsedTime:0,pseudoElement:0}),fE=sn(hE),pE=Qe({},Po,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mE=sn(pE),gE=Qe({},Po,{data:0}),e0=sn(gE),vE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_E={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"},yE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yE[e])?!!t[e]:!1}function km(){return xE}var wE=Qe({},wl,{key:function(e){if(e.key){var t=vE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_E[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:km,charCode:function(e){return e.type==="keypress"?Fc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),bE=sn(wE),SE=Qe({},dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),t0=sn(SE),CE=Qe({},wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:km}),kE=sn(CE),EE=Qe({},Po,{propertyName:0,elapsedTime:0,pseudoElement:0}),RE=sn(EE),LE=Qe({},dd,{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}),ME=sn(LE),TE=[9,13,27,32],Em=br&&"CompositionEvent"in window,ba=null;br&&"documentMode"in document&&(ba=document.documentMode);var AE=br&&"TextEvent"in window&&!ba,dx=br&&(!Em||ba&&8<ba&&11>=ba),n0=" ",r0=!1;function hx(e,t){switch(e){case"keyup":return TE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ts=!1;function DE(e,t){switch(e){case"compositionend":return fx(t);case"keypress":return t.which!==32?null:(r0=!0,n0);case"textInput":return e=t.data,e===n0&&r0?null:e;default:return null}}function PE(e,t){if(Ts)return e==="compositionend"||!Em&&hx(e,t)?(e=ux(),Bc=Sm=ni=null,Ts=!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 dx&&t.locale!=="ko"?null:t.data;default:return null}}var $E={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 i0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$E[e.type]:t==="textarea"}function px(e,t,n,r){Vy(r),t=mu(t,"onChange"),0<t.length&&(n=new Cm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Sa=null,Ba=null;function OE(e){kx(e,0)}function hd(e){var t=Ps(e);if(jy(t))return e}function NE(e,t){if(e==="change")return t}var mx=!1;if(br){var _h;if(br){var yh="oninput"in document;if(!yh){var s0=document.createElement("div");s0.setAttribute("oninput","return;"),yh=typeof s0.oninput=="function"}_h=yh}else _h=!1;mx=_h&&(!document.documentMode||9<document.documentMode)}function o0(){Sa&&(Sa.detachEvent("onpropertychange",gx),Ba=Sa=null)}function gx(e){if(e.propertyName==="value"&&hd(Ba)){var t=[];px(t,Ba,e,_m(e)),Yy(OE,t)}}function IE(e,t,n){e==="focusin"?(o0(),Sa=t,Ba=n,Sa.attachEvent("onpropertychange",gx)):e==="focusout"&&o0()}function jE(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hd(Ba)}function BE(e,t){if(e==="click")return hd(t)}function FE(e,t){if(e==="input"||e==="change")return hd(t)}function zE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jn=typeof Object.is=="function"?Object.is:zE;function Fa(e,t){if(jn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!hf.call(t,i)||!jn(e[i],t[i]))return!1}return!0}function a0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function l0(e,t){var n=a0(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=a0(n)}}function vx(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vx(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _x(){for(var e=window,t=lu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=lu(e.document)}return t}function Rm(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 HE(e){var t=_x(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vx(n.ownerDocument.documentElement,n)){if(r!==null&&Rm(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=l0(n,o);var a=l0(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var UE=br&&"documentMode"in document&&11>=document.documentMode,As=null,Af=null,Ca=null,Df=!1;function c0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Df||As==null||As!==lu(r)||(r=As,"selectionStart"in r&&Rm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ca&&Fa(Ca,r)||(Ca=r,r=mu(Af,"onSelect"),0<r.length&&(t=new Cm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=As)))}function tc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ds={animationend:tc("Animation","AnimationEnd"),animationiteration:tc("Animation","AnimationIteration"),animationstart:tc("Animation","AnimationStart"),transitionend:tc("Transition","TransitionEnd")},xh={},yx={};br&&(yx=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function fd(e){if(xh[e])return xh[e];if(!Ds[e])return e;var t=Ds[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in yx)return xh[e]=t[n];return e}var xx=fd("animationend"),wx=fd("animationiteration"),bx=fd("animationstart"),Sx=fd("transitionend"),Cx=new Map,u0="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 yi(e,t){Cx.set(e,t),ss(t,[e])}for(var wh=0;wh<u0.length;wh++){var bh=u0[wh],WE=bh.toLowerCase(),VE=bh[0].toUpperCase()+bh.slice(1);yi(WE,"on"+VE)}yi(xx,"onAnimationEnd");yi(wx,"onAnimationIteration");yi(bx,"onAnimationStart");yi("dblclick","onDoubleClick");yi("focusin","onFocus");yi("focusout","onBlur");yi(Sx,"onTransitionEnd");vo("onMouseEnter",["mouseout","mouseover"]);vo("onMouseLeave",["mouseout","mouseover"]);vo("onPointerEnter",["pointerout","pointerover"]);vo("onPointerLeave",["pointerout","pointerover"]);ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ss("onBeforeInput",["compositionend","keypress","textInput","paste"]);ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ga="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(" "),KE=new Set("cancel close invalid load scroll toggle".split(" ").concat(ga));function d0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Wk(r,t,void 0,e),e.currentTarget=null}function kx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;d0(i,s,c),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;d0(i,s,c),o=l}}}if(uu)throw e=Rf,uu=!1,Rf=null,e}function We(e,t){var n=t[If];n===void 0&&(n=t[If]=new Set);var r=e+"__bubble";n.has(r)||(Ex(t,e,2,!1),n.add(r))}function Sh(e,t,n){var r=0;t&&(r|=4),Ex(n,e,r,t)}var nc="_reactListening"+Math.random().toString(36).slice(2);function za(e){if(!e[nc]){e[nc]=!0,Py.forEach(function(n){n!=="selectionchange"&&(KE.has(n)||Sh(n,!1,e),Sh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nc]||(t[nc]=!0,Sh("selectionchange",!1,t))}}function Ex(e,t,n,r){switch(cx(t)){case 1:var i=oE;break;case 4:i=aE;break;default:i=bm}n=i.bind(null,t,n,e),i=void 0,!Ef||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Ch(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Di(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}Yy(function(){var c=o,p=_m(n),u=[];e:{var m=Cx.get(e);if(m!==void 0){var g=Cm,x=e;switch(e){case"keypress":if(Fc(n)===0)break e;case"keydown":case"keyup":g=bE;break;case"focusin":x="focus",g=vh;break;case"focusout":x="blur",g=vh;break;case"beforeblur":case"afterblur":g=vh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Zv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=uE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=kE;break;case xx:case wx:case bx:g=fE;break;case Sx:g=RE;break;case"scroll":g=lE;break;case"wheel":g=ME;break;case"copy":case"cut":case"paste":g=mE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=t0}var y=(t&4)!==0,h=!y&&e==="scroll",f=y?m!==null?m+"Capture":null:m;y=[];for(var d=c,v;d!==null;){v=d;var S=v.stateNode;if(v.tag===5&&S!==null&&(v=S,f!==null&&(S=Oa(d,f),S!=null&&y.push(Ha(d,S,v)))),h)break;d=d.return}0<y.length&&(m=new g(m,x,null,n,p),u.push({event:m,listeners:y}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&n!==Cf&&(x=n.relatedTarget||n.fromElement)&&(Di(x)||x[Sr]))break e;if((g||m)&&(m=p.window===p?p:(m=p.ownerDocument)?m.defaultView||m.parentWindow:window,g?(x=n.relatedTarget||n.toElement,g=c,x=x?Di(x):null,x!==null&&(h=os(x),x!==h||x.tag!==5&&x.tag!==6)&&(x=null)):(g=null,x=c),g!==x)){if(y=Zv,S="onMouseLeave",f="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(y=t0,S="onPointerLeave",f="onPointerEnter",d="pointer"),h=g==null?m:Ps(g),v=x==null?m:Ps(x),m=new y(S,d+"leave",g,n,p),m.target=h,m.relatedTarget=v,S=null,Di(p)===c&&(y=new y(f,d+"enter",x,n,p),y.target=v,y.relatedTarget=h,S=y),h=S,g&&x)t:{for(y=g,f=x,d=0,v=y;v;v=gs(v))d++;for(v=0,S=f;S;S=gs(S))v++;for(;0<d-v;)y=gs(y),d--;for(;0<v-d;)f=gs(f),v--;for(;d--;){if(y===f||f!==null&&y===f.alternate)break t;y=gs(y),f=gs(f)}y=null}else y=null;g!==null&&h0(u,m,g,y,!1),x!==null&&h!==null&&h0(u,h,x,y,!0)}}e:{if(m=c?Ps(c):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var k=NE;else if(i0(m))if(mx)k=FE;else{k=jE;var C=IE}else(g=m.nodeName)&&g.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(k=BE);if(k&&(k=k(e,c))){px(u,k,n,p);break e}C&&C(e,m,c),e==="focusout"&&(C=m._wrapperState)&&C.controlled&&m.type==="number"&&yf(m,"number",m.value)}switch(C=c?Ps(c):window,e){case"focusin":(i0(C)||C.contentEditable==="true")&&(As=C,Af=c,Ca=null);break;case"focusout":Ca=Af=As=null;break;case"mousedown":Df=!0;break;case"contextmenu":case"mouseup":case"dragend":Df=!1,c0(u,n,p);break;case"selectionchange":if(UE)break;case"keydown":case"keyup":c0(u,n,p)}var R;if(Em)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 Ts?hx(e,n)&&(w="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(w="onCompositionStart");w&&(dx&&n.locale!=="ko"&&(Ts||w!=="onCompositionStart"?w==="onCompositionEnd"&&Ts&&(R=ux()):(ni=p,Sm="value"in ni?ni.value:ni.textContent,Ts=!0)),C=mu(c,w),0<C.length&&(w=new e0(w,e,null,n,p),u.push({event:w,listeners:C}),R?w.data=R:(R=fx(n),R!==null&&(w.data=R)))),(R=AE?DE(e,n):PE(e,n))&&(c=mu(c,"onBeforeInput"),0<c.length&&(p=new e0("onBeforeInput","beforeinput",null,n,p),u.push({event:p,listeners:c}),p.data=R))}kx(u,t)})}function Ha(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mu(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Oa(e,n),o!=null&&r.unshift(Ha(e,o,i)),o=Oa(e,t),o!=null&&r.push(Ha(e,o,i))),e=e.return}return r}function gs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function h0(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&c!==null&&(s=c,i?(l=Oa(n,o),l!=null&&a.unshift(Ha(n,l,s))):i||(l=Oa(n,o),l!=null&&a.push(Ha(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var qE=/\r\n?/g,GE=/\u0000|\uFFFD/g;function f0(e){return(typeof e=="string"?e:""+e).replace(qE,`
`).replace(GE,"")}function rc(e,t,n){if(t=f0(t),f0(e)!==t&&n)throw Error(ee(425))}function gu(){}var Pf=null,$f=null;function Of(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 Nf=typeof setTimeout=="function"?setTimeout:void 0,YE=typeof clearTimeout=="function"?clearTimeout:void 0,p0=typeof Promise=="function"?Promise:void 0,XE=typeof queueMicrotask=="function"?queueMicrotask:typeof p0<"u"?function(e){return p0.resolve(null).then(e).catch(QE)}:Nf;function QE(e){setTimeout(function(){throw e})}function kh(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ja(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ja(t)}function li(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 m0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $o=Math.random().toString(36).slice(2),Xn="__reactFiber$"+$o,Ua="__reactProps$"+$o,Sr="__reactContainer$"+$o,If="__reactEvents$"+$o,JE="__reactListeners$"+$o,ZE="__reactHandles$"+$o;function Di(e){var t=e[Xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sr]||n[Xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=m0(e);e!==null;){if(n=e[Xn])return n;e=m0(e)}return t}e=n,n=e.parentNode}return null}function bl(e){return e=e[Xn]||e[Sr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ps(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function pd(e){return e[Ua]||null}var jf=[],$s=-1;function xi(e){return{current:e}}function Ke(e){0>$s||(e.current=jf[$s],jf[$s]=null,$s--)}function ze(e,t){$s++,jf[$s]=e.current,e.current=t}var pi={},Et=xi(pi),Ft=xi(!1),Xi=pi;function _o(e,t){var n=e.type.contextTypes;if(!n)return pi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function zt(e){return e=e.childContextTypes,e!=null}function vu(){Ke(Ft),Ke(Et)}function g0(e,t,n){if(Et.current!==pi)throw Error(ee(168));ze(Et,t),ze(Ft,n)}function Rx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ee(108,Ik(e)||"Unknown",i));return Qe({},n,r)}function _u(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pi,Xi=Et.current,ze(Et,e),ze(Ft,Ft.current),!0}function v0(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=Rx(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,Ke(Ft),Ke(Et),ze(Et,e)):Ke(Ft),ze(Ft,n)}var mr=null,md=!1,Eh=!1;function Lx(e){mr===null?mr=[e]:mr.push(e)}function e3(e){md=!0,Lx(e)}function wi(){if(!Eh&&mr!==null){Eh=!0;var e=0,t=Ie;try{var n=mr;for(Ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}mr=null,md=!1}catch(i){throw mr!==null&&(mr=mr.slice(e+1)),Zy(ym,wi),i}finally{Ie=t,Eh=!1}}return null}var Os=[],Ns=0,yu=null,xu=0,dn=[],hn=0,Qi=null,yr=1,xr="";function Ri(e,t){Os[Ns++]=xu,Os[Ns++]=yu,yu=e,xu=t}function Mx(e,t,n){dn[hn++]=yr,dn[hn++]=xr,dn[hn++]=Qi,Qi=e;var r=yr;e=xr;var i=32-On(r)-1;r&=~(1<<i),n+=1;var o=32-On(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,yr=1<<32-On(t)+i|n<<i|r,xr=o+e}else yr=1<<o|n<<i|r,xr=e}function Lm(e){e.return!==null&&(Ri(e,1),Mx(e,1,0))}function Mm(e){for(;e===yu;)yu=Os[--Ns],Os[Ns]=null,xu=Os[--Ns],Os[Ns]=null;for(;e===Qi;)Qi=dn[--hn],dn[hn]=null,xr=dn[--hn],dn[hn]=null,yr=dn[--hn],dn[hn]=null}var en=null,Qt=null,Ge=!1,Pn=null;function Tx(e,t){var n=gn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function _0(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,en=e,Qt=li(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,en=e,Qt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qi!==null?{id:yr,overflow:xr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,en=e,Qt=null,!0):!1;default:return!1}}function Bf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ff(e){if(Ge){var t=Qt;if(t){var n=t;if(!_0(e,t)){if(Bf(e))throw Error(ee(418));t=li(n.nextSibling);var r=en;t&&_0(e,t)?Tx(r,n):(e.flags=e.flags&-4097|2,Ge=!1,en=e)}}else{if(Bf(e))throw Error(ee(418));e.flags=e.flags&-4097|2,Ge=!1,en=e}}}function y0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;en=e}function ic(e){if(e!==en)return!1;if(!Ge)return y0(e),Ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Of(e.type,e.memoizedProps)),t&&(t=Qt)){if(Bf(e))throw Ax(),Error(ee(418));for(;t;)Tx(e,t),t=li(t.nextSibling)}if(y0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qt=li(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qt=null}}else Qt=en?li(e.stateNode.nextSibling):null;return!0}function Ax(){for(var e=Qt;e;)e=li(e.nextSibling)}function yo(){Qt=en=null,Ge=!1}function Tm(e){Pn===null?Pn=[e]:Pn.push(e)}var t3=Dr.ReactCurrentBatchConfig;function Ln(e,t){if(e&&e.defaultProps){t=Qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var wu=xi(null),bu=null,Is=null,Am=null;function Dm(){Am=Is=bu=null}function Pm(e){var t=wu.current;Ke(wu),e._currentValue=t}function zf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vs(e,t){bu=e,Am=Is=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Bt=!0),e.firstContext=null)}function xn(e){var t=e._currentValue;if(Am!==e)if(e={context:e,memoizedValue:t,next:null},Is===null){if(bu===null)throw Error(ee(308));Is=e,bu.dependencies={lanes:0,firstContext:e}}else Is=Is.next=e;return t}var Pi=null;function $m(e){Pi===null?Pi=[e]:Pi.push(e)}function Dx(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,$m(t)):(n.next=i.next,i.next=n),t.interleaved=n,Cr(e,r)}function Cr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Wr=!1;function Om(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Px(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 wr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ci(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,De&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Cr(e,n)}return i=r.interleaved,i===null?(t.next=t,$m(r)):(t.next=i.next,i.next=t),r.interleaved=t,Cr(e,n)}function zc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xm(e,n)}}function x0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Su(e,t,n,r){var i=e.updateQueue;Wr=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,a===null?o=c:a.next=c,a=l;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==a&&(s===null?p.firstBaseUpdate=c:s.next=c,p.lastBaseUpdate=l))}if(o!==null){var u=i.baseState;a=0,p=c=l=null,s=o;do{var m=s.lane,g=s.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,y=s;switch(m=t,g=n,y.tag){case 1:if(x=y.payload,typeof x=="function"){u=x.call(g,u,m);break e}u=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=y.payload,m=typeof x=="function"?x.call(g,u,m):x,m==null)break e;u=Qe({},u,m);break e;case 2:Wr=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,m=i.effects,m===null?i.effects=[s]:m.push(s))}else g={eventTime:g,lane:m,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(c=p=g,l=u):p=p.next=g,a|=m;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(p===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Zi|=a,e.lanes=a,e.memoizedState=u}}function w0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ee(191,i));i.call(r)}}}var $x=new Dy.Component().refs;function Hf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gd={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tt(),i=di(e),o=wr(r,i);o.payload=t,n!=null&&(o.callback=n),t=ci(e,o,i),t!==null&&(Nn(t,e,i,r),zc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tt(),i=di(e),o=wr(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=ci(e,o,i),t!==null&&(Nn(t,e,i,r),zc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),r=di(e),i=wr(n,r);i.tag=2,t!=null&&(i.callback=t),t=ci(e,i,r),t!==null&&(Nn(t,e,r,n),zc(t,e,r))}};function b0(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!Fa(n,r)||!Fa(i,o):!0}function Ox(e,t,n){var r=!1,i=pi,o=t.contextType;return typeof o=="object"&&o!==null?o=xn(o):(i=zt(t)?Xi:Et.current,r=t.contextTypes,o=(r=r!=null)?_o(e,i):pi),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gd,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function S0(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&gd.enqueueReplaceState(t,t.state,null)}function Uf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=$x,Om(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=xn(o):(o=zt(t)?Xi:Et.current,i.context=_o(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(Hf(e,t,o,n),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&&gd.enqueueReplaceState(i,i.state,null),Su(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ea(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;s===$x&&(s=i.refs={}),a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function sc(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function C0(e){var t=e._init;return t(e._payload)}function Nx(e){function t(f,d){if(e){var v=f.deletions;v===null?(f.deletions=[d],f.flags|=16):v.push(d)}}function n(f,d){if(!e)return null;for(;d!==null;)t(f,d),d=d.sibling;return null}function r(f,d){for(f=new Map;d!==null;)d.key!==null?f.set(d.key,d):f.set(d.index,d),d=d.sibling;return f}function i(f,d){return f=hi(f,d),f.index=0,f.sibling=null,f}function o(f,d,v){return f.index=v,e?(v=f.alternate,v!==null?(v=v.index,v<d?(f.flags|=2,d):v):(f.flags|=2,d)):(f.flags|=1048576,d)}function a(f){return e&&f.alternate===null&&(f.flags|=2),f}function s(f,d,v,S){return d===null||d.tag!==6?(d=Ph(v,f.mode,S),d.return=f,d):(d=i(d,v),d.return=f,d)}function l(f,d,v,S){var k=v.type;return k===Ms?p(f,d,v.props.children,S,v.key):d!==null&&(d.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ur&&C0(k)===d.type)?(S=i(d,v.props),S.ref=ea(f,d,v),S.return=f,S):(S=qc(v.type,v.key,v.props,null,f.mode,S),S.ref=ea(f,d,v),S.return=f,S)}function c(f,d,v,S){return d===null||d.tag!==4||d.stateNode.containerInfo!==v.containerInfo||d.stateNode.implementation!==v.implementation?(d=$h(v,f.mode,S),d.return=f,d):(d=i(d,v.children||[]),d.return=f,d)}function p(f,d,v,S,k){return d===null||d.tag!==7?(d=qi(v,f.mode,S,k),d.return=f,d):(d=i(d,v),d.return=f,d)}function u(f,d,v){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Ph(""+d,f.mode,v),d.return=f,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Gl:return v=qc(d.type,d.key,d.props,null,f.mode,v),v.ref=ea(f,null,d),v.return=f,v;case Ls:return d=$h(d,f.mode,v),d.return=f,d;case Ur:var S=d._init;return u(f,S(d._payload),v)}if(pa(d)||Yo(d))return d=qi(d,f.mode,v,null),d.return=f,d;sc(f,d)}return null}function m(f,d,v,S){var k=d!==null?d.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return k!==null?null:s(f,d,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Gl:return v.key===k?l(f,d,v,S):null;case Ls:return v.key===k?c(f,d,v,S):null;case Ur:return k=v._init,m(f,d,k(v._payload),S)}if(pa(v)||Yo(v))return k!==null?null:p(f,d,v,S,null);sc(f,v)}return null}function g(f,d,v,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return f=f.get(v)||null,s(d,f,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Gl:return f=f.get(S.key===null?v:S.key)||null,l(d,f,S,k);case Ls:return f=f.get(S.key===null?v:S.key)||null,c(d,f,S,k);case Ur:var C=S._init;return g(f,d,v,C(S._payload),k)}if(pa(S)||Yo(S))return f=f.get(v)||null,p(d,f,S,k,null);sc(d,S)}return null}function x(f,d,v,S){for(var k=null,C=null,R=d,w=d=0,E=null;R!==null&&w<v.length;w++){R.index>w?(E=R,R=null):E=R.sibling;var L=m(f,R,v[w],S);if(L===null){R===null&&(R=E);break}e&&R&&L.alternate===null&&t(f,R),d=o(L,d,w),C===null?k=L:C.sibling=L,C=L,R=E}if(w===v.length)return n(f,R),Ge&&Ri(f,w),k;if(R===null){for(;w<v.length;w++)R=u(f,v[w],S),R!==null&&(d=o(R,d,w),C===null?k=R:C.sibling=R,C=R);return Ge&&Ri(f,w),k}for(R=r(f,R);w<v.length;w++)E=g(R,f,w,v[w],S),E!==null&&(e&&E.alternate!==null&&R.delete(E.key===null?w:E.key),d=o(E,d,w),C===null?k=E:C.sibling=E,C=E);return e&&R.forEach(function(M){return t(f,M)}),Ge&&Ri(f,w),k}function y(f,d,v,S){var k=Yo(v);if(typeof k!="function")throw Error(ee(150));if(v=k.call(v),v==null)throw Error(ee(151));for(var C=k=null,R=d,w=d=0,E=null,L=v.next();R!==null&&!L.done;w++,L=v.next()){R.index>w?(E=R,R=null):E=R.sibling;var M=m(f,R,L.value,S);if(M===null){R===null&&(R=E);break}e&&R&&M.alternate===null&&t(f,R),d=o(M,d,w),C===null?k=M:C.sibling=M,C=M,R=E}if(L.done)return n(f,R),Ge&&Ri(f,w),k;if(R===null){for(;!L.done;w++,L=v.next())L=u(f,L.value,S),L!==null&&(d=o(L,d,w),C===null?k=L:C.sibling=L,C=L);return Ge&&Ri(f,w),k}for(R=r(f,R);!L.done;w++,L=v.next())L=g(R,f,w,L.value,S),L!==null&&(e&&L.alternate!==null&&R.delete(L.key===null?w:L.key),d=o(L,d,w),C===null?k=L:C.sibling=L,C=L);return e&&R.forEach(function(D){return t(f,D)}),Ge&&Ri(f,w),k}function h(f,d,v,S){if(typeof v=="object"&&v!==null&&v.type===Ms&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Gl:e:{for(var k=v.key,C=d;C!==null;){if(C.key===k){if(k=v.type,k===Ms){if(C.tag===7){n(f,C.sibling),d=i(C,v.props.children),d.return=f,f=d;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Ur&&C0(k)===C.type){n(f,C.sibling),d=i(C,v.props),d.ref=ea(f,C,v),d.return=f,f=d;break e}n(f,C);break}else t(f,C);C=C.sibling}v.type===Ms?(d=qi(v.props.children,f.mode,S,v.key),d.return=f,f=d):(S=qc(v.type,v.key,v.props,null,f.mode,S),S.ref=ea(f,d,v),S.return=f,f=S)}return a(f);case Ls:e:{for(C=v.key;d!==null;){if(d.key===C)if(d.tag===4&&d.stateNode.containerInfo===v.containerInfo&&d.stateNode.implementation===v.implementation){n(f,d.sibling),d=i(d,v.children||[]),d.return=f,f=d;break e}else{n(f,d);break}else t(f,d);d=d.sibling}d=$h(v,f.mode,S),d.return=f,f=d}return a(f);case Ur:return C=v._init,h(f,d,C(v._payload),S)}if(pa(v))return x(f,d,v,S);if(Yo(v))return y(f,d,v,S);sc(f,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,d!==null&&d.tag===6?(n(f,d.sibling),d=i(d,v),d.return=f,f=d):(n(f,d),d=Ph(v,f.mode,S),d.return=f,f=d),a(f)):n(f,d)}return h}var xo=Nx(!0),Ix=Nx(!1),Sl={},tr=xi(Sl),Wa=xi(Sl),Va=xi(Sl);function $i(e){if(e===Sl)throw Error(ee(174));return e}function Nm(e,t){switch(ze(Va,t),ze(Wa,e),ze(tr,Sl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wf(t,e)}Ke(tr),ze(tr,t)}function wo(){Ke(tr),Ke(Wa),Ke(Va)}function jx(e){$i(Va.current);var t=$i(tr.current),n=wf(t,e.type);t!==n&&(ze(Wa,e),ze(tr,n))}function Im(e){Wa.current===e&&(Ke(tr),Ke(Wa))}var Ye=xi(0);function Cu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 Rh=[];function jm(){for(var e=0;e<Rh.length;e++)Rh[e]._workInProgressVersionPrimary=null;Rh.length=0}var Hc=Dr.ReactCurrentDispatcher,Lh=Dr.ReactCurrentBatchConfig,Ji=0,Xe=null,ct=null,mt=null,ku=!1,ka=!1,Ka=0,n3=0;function wt(){throw Error(ee(321))}function Bm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jn(e[n],t[n]))return!1;return!0}function Fm(e,t,n,r,i,o){if(Ji=o,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hc.current=e===null||e.memoizedState===null?o3:a3,e=n(r,i),ka){o=0;do{if(ka=!1,Ka=0,25<=o)throw Error(ee(301));o+=1,mt=ct=null,t.updateQueue=null,Hc.current=l3,e=n(r,i)}while(ka)}if(Hc.current=Eu,t=ct!==null&&ct.next!==null,Ji=0,mt=ct=Xe=null,ku=!1,t)throw Error(ee(300));return e}function zm(){var e=Ka!==0;return Ka=0,e}function Wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Xe.memoizedState=mt=e:mt=mt.next=e,mt}function wn(){if(ct===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=mt===null?Xe.memoizedState:mt.next;if(t!==null)mt=t,ct=e;else{if(e===null)throw Error(ee(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},mt===null?Xe.memoizedState=mt=e:mt=mt.next=e}return mt}function qa(e,t){return typeof t=="function"?t(e):t}function Mh(e){var t=wn(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=ct,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,c=o;do{var p=c.lane;if((Ji&p)===p)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(s=l=u,a=r):l=l.next=u,Xe.lanes|=p,Zi|=p}c=c.next}while(c!==null&&c!==o);l===null?a=r:l.next=s,jn(r,t.memoizedState)||(Bt=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Xe.lanes|=o,Zi|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Th(e){var t=wn(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);jn(o,t.memoizedState)||(Bt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bx(){}function Fx(e,t){var n=Xe,r=wn(),i=t(),o=!jn(r.memoizedState,i);if(o&&(r.memoizedState=i,Bt=!0),r=r.queue,Hm(Ux.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||mt!==null&&mt.memoizedState.tag&1){if(n.flags|=2048,Ga(9,Hx.bind(null,n,r,i,t),void 0,null),gt===null)throw Error(ee(349));Ji&30||zx(n,t,i)}return i}function zx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Hx(e,t,n,r){t.value=n,t.getSnapshot=r,Wx(t)&&Vx(e)}function Ux(e,t,n){return n(function(){Wx(t)&&Vx(e)})}function Wx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jn(e,n)}catch{return!0}}function Vx(e){var t=Cr(e,1);t!==null&&Nn(t,e,1,-1)}function k0(e){var t=Wn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:e},t.queue=e,e=e.dispatch=s3.bind(null,Xe,e),[t.memoizedState,e]}function Ga(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Xe.updateQueue,t===null?(t={lastEffect:null,stores:null},Xe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Kx(){return wn().memoizedState}function Uc(e,t,n,r){var i=Wn();Xe.flags|=e,i.memoizedState=Ga(1|t,n,void 0,r===void 0?null:r)}function vd(e,t,n,r){var i=wn();r=r===void 0?null:r;var o=void 0;if(ct!==null){var a=ct.memoizedState;if(o=a.destroy,r!==null&&Bm(r,a.deps)){i.memoizedState=Ga(t,n,o,r);return}}Xe.flags|=e,i.memoizedState=Ga(1|t,n,o,r)}function E0(e,t){return Uc(8390656,8,e,t)}function Hm(e,t){return vd(2048,8,e,t)}function qx(e,t){return vd(4,2,e,t)}function Gx(e,t){return vd(4,4,e,t)}function Yx(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 Xx(e,t,n){return n=n!=null?n.concat([e]):null,vd(4,4,Yx.bind(null,t,e),n)}function Um(){}function Qx(e,t){var n=wn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Jx(e,t){var n=wn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Zx(e,t,n){return Ji&21?(jn(n,t)||(n=nx(),Xe.lanes|=n,Zi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bt=!0),e.memoizedState=n)}function r3(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var r=Lh.transition;Lh.transition={};try{e(!1),t()}finally{Ie=n,Lh.transition=r}}function ew(){return wn().memoizedState}function i3(e,t,n){var r=di(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},tw(e))nw(t,n);else if(n=Dx(e,t,n,r),n!==null){var i=Tt();Nn(n,e,r,i),rw(n,t,r)}}function s3(e,t,n){var r=di(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(tw(e))nw(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,jn(s,a)){var l=t.interleaved;l===null?(i.next=i,$m(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Dx(e,t,i,r),n!==null&&(i=Tt(),Nn(n,e,r,i),rw(n,t,r))}}function tw(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function nw(e,t){ka=ku=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function rw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xm(e,n)}}var Eu={readContext:xn,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useInsertionEffect:wt,useLayoutEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useMutableSource:wt,useSyncExternalStore:wt,useId:wt,unstable_isNewReconciler:!1},o3={readContext:xn,useCallback:function(e,t){return Wn().memoizedState=[e,t===void 0?null:t],e},useContext:xn,useEffect:E0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Uc(4194308,4,Yx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Uc(4,2,e,t)},useMemo:function(e,t){var n=Wn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=i3.bind(null,Xe,e),[r.memoizedState,e]},useRef:function(e){var t=Wn();return e={current:e},t.memoizedState=e},useState:k0,useDebugValue:Um,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=k0(!1),t=e[0];return e=r3.bind(null,e[1]),Wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Xe,i=Wn();if(Ge){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),gt===null)throw Error(ee(349));Ji&30||zx(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,E0(Ux.bind(null,r,o,e),[e]),r.flags|=2048,Ga(9,Hx.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Wn(),t=gt.identifierPrefix;if(Ge){var n=xr,r=yr;n=(r&~(1<<32-On(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ka++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=n3++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},a3={readContext:xn,useCallback:Qx,useContext:xn,useEffect:Hm,useImperativeHandle:Xx,useInsertionEffect:qx,useLayoutEffect:Gx,useMemo:Jx,useReducer:Mh,useRef:Kx,useState:function(){return Mh(qa)},useDebugValue:Um,useDeferredValue:function(e){var t=wn();return Zx(t,ct.memoizedState,e)},useTransition:function(){var e=Mh(qa)[0],t=wn().memoizedState;return[e,t]},useMutableSource:Bx,useSyncExternalStore:Fx,useId:ew,unstable_isNewReconciler:!1},l3={readContext:xn,useCallback:Qx,useContext:xn,useEffect:Hm,useImperativeHandle:Xx,useInsertionEffect:qx,useLayoutEffect:Gx,useMemo:Jx,useReducer:Th,useRef:Kx,useState:function(){return Th(qa)},useDebugValue:Um,useDeferredValue:function(e){var t=wn();return ct===null?t.memoizedState=e:Zx(t,ct.memoizedState,e)},useTransition:function(){var e=Th(qa)[0],t=wn().memoizedState;return[e,t]},useMutableSource:Bx,useSyncExternalStore:Fx,useId:ew,unstable_isNewReconciler:!1};function bo(e,t){try{var n="",r=t;do n+=Nk(r),r=r.return;while(r);var i=n}catch(o){i=`
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Ah(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Wf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var c3=typeof WeakMap=="function"?WeakMap:Map;function iw(e,t,n){n=wr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Lu||(Lu=!0,ep=r),Wf(e,t)},n}function sw(e,t,n){n=wr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Wf(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Wf(e,t),typeof r!="function"&&(ui===null?ui=new Set([this]):ui.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function R0(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new c3;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=S3.bind(null,e,t,n),t.then(e,e))}function L0(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 M0(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=wr(-1,1),t.tag=2,ci(n,t,1))),n.lanes|=1),e)}var u3=Dr.ReactCurrentOwner,Bt=!1;function Mt(e,t,n,r){t.child=e===null?Ix(t,null,n,r):xo(t,e.child,n,r)}function T0(e,t,n,r,i){n=n.render;var o=t.ref;return Vs(t,i),r=Fm(e,t,n,r,o,i),n=zm(),e!==null&&!Bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,kr(e,t,i)):(Ge&&n&&Lm(t),t.flags|=1,Mt(e,t,r,i),t.child)}function A0(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Qm(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,ow(e,t,o,r,i)):(e=qc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:Fa,n(a,r)&&e.ref===t.ref)return kr(e,t,i)}return t.flags|=1,e=hi(o,r),e.ref=t.ref,e.return=t,t.child=e}function ow(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Fa(o,r)&&e.ref===t.ref)if(Bt=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Bt=!0);else return t.lanes=e.lanes,kr(e,t,i)}return Vf(e,t,n,r,i)}function aw(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(Bs,Yt),Yt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(Bs,Yt),Yt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ze(Bs,Yt),Yt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ze(Bs,Yt),Yt|=r;return Mt(e,t,i,n),t.child}function lw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vf(e,t,n,r,i){var o=zt(n)?Xi:Et.current;return o=_o(t,o),Vs(t,i),n=Fm(e,t,n,r,o,i),r=zm(),e!==null&&!Bt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,kr(e,t,i)):(Ge&&r&&Lm(t),t.flags|=1,Mt(e,t,n,i),t.child)}function D0(e,t,n,r,i){if(zt(n)){var o=!0;_u(t)}else o=!1;if(Vs(t,i),t.stateNode===null)Wc(e,t),Ox(t,n,r),Uf(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=xn(c):(c=zt(n)?Xi:Et.current,c=_o(t,c));var p=n.getDerivedStateFromProps,u=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function";u||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==c)&&S0(t,a,r,c),Wr=!1;var m=t.memoizedState;a.state=m,Su(t,r,a,i),l=t.memoizedState,s!==r||m!==l||Ft.current||Wr?(typeof p=="function"&&(Hf(t,n,p,r),l=t.memoizedState),(s=Wr||b0(t,n,s,r,m,l,c))?(u||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Px(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Ln(t.type,s),a.props=c,u=t.pendingProps,m=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=xn(l):(l=zt(n)?Xi:Et.current,l=_o(t,l));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==u||m!==l)&&S0(t,a,r,l),Wr=!1,m=t.memoizedState,a.state=m,Su(t,r,a,i);var x=t.memoizedState;s!==u||m!==x||Ft.current||Wr?(typeof g=="function"&&(Hf(t,n,g,r),x=t.memoizedState),(c=Wr||b0(t,n,c,r,m,x,l)||!1)?(p||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,x,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,x,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),a.props=r,a.state=x,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Kf(e,t,n,r,o,i)}function Kf(e,t,n,r,i,o){lw(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&v0(t,n,!1),kr(e,t,o);r=t.stateNode,u3.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=xo(t,e.child,null,o),t.child=xo(t,null,s,o)):Mt(e,t,s,o),t.memoizedState=r.state,i&&v0(t,n,!0),t.child}function cw(e){var t=e.stateNode;t.pendingContext?g0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&g0(e,t.context,!1),Nm(e,t.containerInfo)}function P0(e,t,n,r,i){return yo(),Tm(i),t.flags|=256,Mt(e,t,n,r),t.child}var qf={dehydrated:null,treeContext:null,retryLane:0};function Gf(e){return{baseLanes:e,cachePool:null,transitions:null}}function uw(e,t,n){var r=t.pendingProps,i=Ye.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ze(Ye,i&1),e===null)return Ff(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):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=xd(a,r,0,null),e=qi(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Gf(n),t.memoizedState=qf,e):Wm(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return d3(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=hi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=hi(s,o):(o=qi(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?Gf(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=qf,r}return o=e.child,e=o.sibling,r=hi(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wm(e,t){return t=xd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function oc(e,t,n,r){return r!==null&&Tm(r),xo(t,e.child,null,n),e=Wm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function d3(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Ah(Error(ee(422))),oc(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=xd({mode:"visible",children:r.children},i,0,null),o=qi(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&xo(t,e.child,null,a),t.child.memoizedState=Gf(a),t.memoizedState=qf,o);if(!(t.mode&1))return oc(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(ee(419)),r=Ah(o,r,void 0),oc(e,t,a,r)}if(s=(a&e.childLanes)!==0,Bt||s){if(r=gt,r!==null){switch(a&-a){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&(r.suspendedLanes|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Cr(e,i),Nn(r,e,i,-1))}return Xm(),r=Ah(Error(ee(421))),oc(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=C3.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Qt=li(i.nextSibling),en=t,Ge=!0,Pn=null,e!==null&&(dn[hn++]=yr,dn[hn++]=xr,dn[hn++]=Qi,yr=e.id,xr=e.overflow,Qi=t),t=Wm(t,r.children),t.flags|=4096,t)}function $0(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zf(e.return,t,n)}function Dh(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function dw(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Mt(e,t,r.children,n),r=Ye.current,r&2)r=r&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&&$0(e,n,t);else if(e.tag===19)$0(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ze(Ye,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Cu(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dh(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Cu(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dh(t,!0,n,null,o);break;case"together":Dh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function kr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function h3(e,t,n){switch(t.tag){case 3:cw(t),yo();break;case 5:jx(t);break;case 1:zt(t.type)&&_u(t);break;case 4:Nm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ze(wu,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ze(Ye,Ye.current&1),t.flags|=128,null):n&t.child.childLanes?uw(e,t,n):(ze(Ye,Ye.current&1),e=kr(e,t,n),e!==null?e.sibling:null);ze(Ye,Ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return dw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ze(Ye,Ye.current),r)break;return null;case 22:case 23:return t.lanes=0,aw(e,t,n)}return kr(e,t,n)}var hw,Yf,fw,pw;hw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yf=function(){};fw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,$i(tr.current);var o=null;switch(n){case"input":i=vf(e,i),r=vf(e,r),o=[];break;case"select":i=Qe({},i,{value:void 0}),r=Qe({},r,{value:void 0}),o=[];break;case"textarea":i=xf(e,i),r=xf(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=gu)}bf(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Pa.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(s=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(l!=null||s!=null))if(c==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Pa.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&We("scroll",e),o||s===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};pw=function(e,t,n,r){n!==r&&(t.flags|=4)};function ta(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function f3(e,t,n){var r=t.pendingProps;switch(Mm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return zt(t.type)&&vu(),bt(t),null;case 3:return r=t.stateNode,wo(),Ke(Ft),Ke(Et),jm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ic(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pn!==null&&(rp(Pn),Pn=null))),Yf(e,t),bt(t),null;case 5:Im(t);var i=$i(Va.current);if(n=t.type,e!==null&&t.stateNode!=null)fw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return bt(t),null}if(e=$i(tr.current),ic(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Xn]=t,r[Ua]=o,e=(t.mode&1)!==0,n){case"dialog":We("cancel",r),We("close",r);break;case"iframe":case"object":case"embed":We("load",r);break;case"video":case"audio":for(i=0;i<ga.length;i++)We(ga[i],r);break;case"source":We("error",r);break;case"img":case"image":case"link":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"input":Uv(r,o),We("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},We("invalid",r);break;case"textarea":Vv(r,o),We("invalid",r)}bf(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&rc(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&rc(r.textContent,s,e),i=["children",""+s]):Pa.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&We("scroll",r)}switch(n){case"input":Yl(r),Wv(r,o,!0);break;case"textarea":Yl(r),Kv(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=gu)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=zy(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Xn]=t,e[Ua]=r,hw(e,t,!1,!1),t.stateNode=e;e:{switch(a=Sf(n,r),n){case"dialog":We("cancel",e),We("close",e),i=r;break;case"iframe":case"object":case"embed":We("load",e),i=r;break;case"video":case"audio":for(i=0;i<ga.length;i++)We(ga[i],e);i=r;break;case"source":We("error",e),i=r;break;case"img":case"image":case"link":We("error",e),We("load",e),i=r;break;case"details":We("toggle",e),i=r;break;case"input":Uv(e,r),i=vf(e,r),We("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qe({},r,{value:void 0}),We("invalid",e);break;case"textarea":Vv(e,r),i=xf(e,r),We("invalid",e);break;default:i=r}bf(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?Wy(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Hy(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&$a(e,l):typeof l=="number"&&$a(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Pa.hasOwnProperty(o)?l!=null&&o==="onScroll"&&We("scroll",e):l!=null&&pm(e,o,l,a))}switch(n){case"input":Yl(e),Wv(e,r,!1);break;case"textarea":Yl(e),Kv(e);break;case"option":r.value!=null&&e.setAttribute("value",""+fi(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?zs(e,!!r.multiple,o,!1):r.defaultValue!=null&&zs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=gu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return bt(t),null;case 6:if(e&&t.stateNode!=null)pw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=$i(Va.current),$i(tr.current),ic(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xn]=t,(o=r.nodeValue!==n)&&(e=en,e!==null))switch(e.tag){case 3:rc(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rc(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xn]=t,t.stateNode=r}return bt(t),null;case 13:if(Ke(Ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ge&&Qt!==null&&t.mode&1&&!(t.flags&128))Ax(),yo(),t.flags|=98560,o=!1;else if(o=ic(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ee(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ee(317));o[Xn]=t}else yo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bt(t),o=!1}else Pn!==null&&(rp(Pn),Pn=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ye.current&1?dt===0&&(dt=3):Xm())),t.updateQueue!==null&&(t.flags|=4),bt(t),null);case 4:return wo(),Yf(e,t),e===null&&za(t.stateNode.containerInfo),bt(t),null;case 10:return Pm(t.type._context),bt(t),null;case 17:return zt(t.type)&&vu(),bt(t),null;case 19:if(Ke(Ye),o=t.memoizedState,o===null)return bt(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)ta(o,!1);else{if(dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Cu(e),a!==null){for(t.flags|=128,ta(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===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=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ze(Ye,Ye.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ze()>So&&(t.flags|=128,r=!0,ta(o,!1),t.lanes=4194304)}else{if(!r)if(e=Cu(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ta(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Ge)return bt(t),null}else 2*Ze()-o.renderingStartTime>So&&n!==1073741824&&(t.flags|=128,r=!0,ta(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ze(),t.sibling=null,n=Ye.current,ze(Ye,r?n&1|2:n&1),t):(bt(t),null);case 22:case 23:return Ym(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Yt&1073741824&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function p3(e,t){switch(Mm(t),t.tag){case 1:return zt(t.type)&&vu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wo(),Ke(Ft),Ke(Et),jm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Im(t),null;case 13:if(Ke(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));yo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(Ye),null;case 4:return wo(),null;case 10:return Pm(t.type._context),null;case 22:case 23:return Ym(),null;case 24:return null;default:return null}}var ac=!1,kt=!1,m3=typeof WeakSet=="function"?WeakSet:Set,ae=null;function js(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function Xf(e,t,n){try{n()}catch(r){Je(e,t,r)}}var O0=!1;function g3(e,t){if(Pf=fu,e=_x(),Rm(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,c=0,p=0,u=e,m=null;t:for(;;){for(var g;u!==n||i!==0&&u.nodeType!==3||(s=a+i),u!==o||r!==0&&u.nodeType!==3||(l=a+r),u.nodeType===3&&(a+=u.nodeValue.length),(g=u.firstChild)!==null;)m=u,u=g;for(;;){if(u===e)break t;if(m===n&&++c===i&&(s=a),m===o&&++p===r&&(l=a),(g=u.nextSibling)!==null)break;u=m,m=u.parentNode}u=g}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for($f={focusedElem:e,selectionRange:n},fu=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var y=x.memoizedProps,h=x.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?y:Ln(t.type,y),h);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(S){Je(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return x=O0,O0=!1,x}function Ea(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Xf(t,n,o)}i=i.next}while(i!==r)}}function _d(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Qf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mw(e){var t=e.alternate;t!==null&&(e.alternate=null,mw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xn],delete t[Ua],delete t[If],delete t[JE],delete t[ZE])),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 gw(e){return e.tag===5||e.tag===3||e.tag===4}function N0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gw(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 Jf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gu));else if(r!==4&&(e=e.child,e!==null))for(Jf(e,t,n),e=e.sibling;e!==null;)Jf(e,t,n),e=e.sibling}function Zf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Zf(e,t,n),e=e.sibling;e!==null;)Zf(e,t,n),e=e.sibling}var _t=null,Tn=!1;function Nr(e,t,n){for(n=n.child;n!==null;)vw(e,t,n),n=n.sibling}function vw(e,t,n){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(ud,n)}catch{}switch(n.tag){case 5:kt||js(n,t);case 6:var r=_t,i=Tn;_t=null,Nr(e,t,n),_t=r,Tn=i,_t!==null&&(Tn?(e=_t,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):_t.removeChild(n.stateNode));break;case 18:_t!==null&&(Tn?(e=_t,n=n.stateNode,e.nodeType===8?kh(e.parentNode,n):e.nodeType===1&&kh(e,n),ja(e)):kh(_t,n.stateNode));break;case 4:r=_t,i=Tn,_t=n.stateNode.containerInfo,Tn=!0,Nr(e,t,n),_t=r,Tn=i;break;case 0:case 11:case 14:case 15:if(!kt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Xf(n,t,a),i=i.next}while(i!==r)}Nr(e,t,n);break;case 1:if(!kt&&(js(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Je(n,t,s)}Nr(e,t,n);break;case 21:Nr(e,t,n);break;case 22:n.mode&1?(kt=(r=kt)||n.memoizedState!==null,Nr(e,t,n),kt=r):Nr(e,t,n);break;default:Nr(e,t,n)}}function I0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new m3),t.forEach(function(r){var i=k3.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Rn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:_t=s.stateNode,Tn=!1;break e;case 3:_t=s.stateNode.containerInfo,Tn=!0;break e;case 4:_t=s.stateNode.containerInfo,Tn=!0;break e}s=s.return}if(_t===null)throw Error(ee(160));vw(o,a,i),_t=null,Tn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Je(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_w(t,e),t=t.sibling}function _w(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rn(t,e),Un(e),r&4){try{Ea(3,e,e.return),_d(3,e)}catch(y){Je(e,e.return,y)}try{Ea(5,e,e.return)}catch(y){Je(e,e.return,y)}}break;case 1:Rn(t,e),Un(e),r&512&&n!==null&&js(n,n.return);break;case 5:if(Rn(t,e),Un(e),r&512&&n!==null&&js(n,n.return),e.flags&32){var i=e.stateNode;try{$a(i,"")}catch(y){Je(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&By(i,o),Sf(s,a);var c=Sf(s,o);for(a=0;a<l.length;a+=2){var p=l[a],u=l[a+1];p==="style"?Wy(i,u):p==="dangerouslySetInnerHTML"?Hy(i,u):p==="children"?$a(i,u):pm(i,p,u,c)}switch(s){case"input":_f(i,o);break;case"textarea":Fy(i,o);break;case"select":var m=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?zs(i,!!o.multiple,g,!1):m!==!!o.multiple&&(o.defaultValue!=null?zs(i,!!o.multiple,o.defaultValue,!0):zs(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ua]=o}catch(y){Je(e,e.return,y)}}break;case 6:if(Rn(t,e),Un(e),r&4){if(e.stateNode===null)throw Error(ee(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(y){Je(e,e.return,y)}}break;case 3:if(Rn(t,e),Un(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ja(t.containerInfo)}catch(y){Je(e,e.return,y)}break;case 4:Rn(t,e),Un(e);break;case 13:Rn(t,e),Un(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(qm=Ze())),r&4&&I0(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(kt=(c=kt)||p,Rn(t,e),kt=c):Rn(t,e),Un(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(ae=e,p=e.child;p!==null;){for(u=ae=p;ae!==null;){switch(m=ae,g=m.child,m.tag){case 0:case 11:case 14:case 15:Ea(4,m,m.return);break;case 1:js(m,m.return);var x=m.stateNode;if(typeof x.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(y){Je(r,n,y)}}break;case 5:js(m,m.return);break;case 22:if(m.memoizedState!==null){B0(u);continue}}g!==null?(g.return=m,ae=g):B0(u)}p=p.sibling}e:for(p=null,u=e;;){if(u.tag===5){if(p===null){p=u;try{i=u.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=u.stateNode,l=u.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=Uy("display",a))}catch(y){Je(e,e.return,y)}}}else if(u.tag===6){if(p===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(y){Je(e,e.return,y)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;p===u&&(p=null),u=u.return}p===u&&(p=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:Rn(t,e),Un(e),r&4&&I0(e);break;case 21:break;default:Rn(t,e),Un(e)}}function Un(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(gw(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&($a(i,""),r.flags&=-33);var o=N0(e);Zf(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=N0(e);Jf(e,s,a);break;default:throw Error(ee(161))}}catch(l){Je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function v3(e,t,n){ae=e,yw(e)}function yw(e,t,n){for(var r=(e.mode&1)!==0;ae!==null;){var i=ae,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ac;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||kt;s=ac;var c=kt;if(ac=a,(kt=l)&&!c)for(ae=i;ae!==null;)a=ae,l=a.child,a.tag===22&&a.memoizedState!==null?F0(i):l!==null?(l.return=a,ae=l):F0(i);for(;o!==null;)ae=o,yw(o),o=o.sibling;ae=i,ac=s,kt=c}j0(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ae=o):j0(e)}}function j0(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:kt||_d(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!kt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ln(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&w0(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}w0(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var u=p.dehydrated;u!==null&&ja(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}kt||t.flags&512&&Qf(t)}catch(m){Je(t,t.return,m)}}if(t===e){ae=null;break}if(n=t.sibling,n!==null){n.return=t.return,ae=n;break}ae=t.return}}function B0(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ae=n;break}ae=t.return}}function F0(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{_d(4,t)}catch(l){Je(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Je(t,i,l)}}var o=t.return;try{Qf(t)}catch(l){Je(t,o,l)}break;case 5:var a=t.return;try{Qf(t)}catch(l){Je(t,a,l)}}}catch(l){Je(t,t.return,l)}if(t===e){ae=null;break}var s=t.sibling;if(s!==null){s.return=t.return,ae=s;break}ae=t.return}}var _3=Math.ceil,Ru=Dr.ReactCurrentDispatcher,Vm=Dr.ReactCurrentOwner,vn=Dr.ReactCurrentBatchConfig,De=0,gt=null,nt=null,yt=0,Yt=0,Bs=xi(0),dt=0,Ya=null,Zi=0,yd=0,Km=0,Ra=null,jt=null,qm=0,So=1/0,fr=null,Lu=!1,ep=null,ui=null,lc=!1,ri=null,Mu=0,La=0,tp=null,Vc=-1,Kc=0;function Tt(){return De&6?Ze():Vc!==-1?Vc:Vc=Ze()}function di(e){return e.mode&1?De&2&&yt!==0?yt&-yt:t3.transition!==null?(Kc===0&&(Kc=nx()),Kc):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:cx(e.type)),e):1}function Nn(e,t,n,r){if(50<La)throw La=0,tp=null,Error(ee(185));xl(e,n,r),(!(De&2)||e!==gt)&&(e===gt&&(!(De&2)&&(yd|=n),dt===4&&Kr(e,yt)),Ht(e,r),n===1&&De===0&&!(t.mode&1)&&(So=Ze()+500,md&&wi()))}function Ht(e,t){var n=e.callbackNode;tE(e,t);var r=hu(e,e===gt?yt:0);if(r===0)n!==null&&Yv(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Yv(n),t===1)e.tag===0?e3(z0.bind(null,e)):Lx(z0.bind(null,e)),XE(function(){!(De&6)&&wi()}),n=null;else{switch(rx(r)){case 1:n=ym;break;case 4:n=ex;break;case 16:n=du;break;case 536870912:n=tx;break;default:n=du}n=Rw(n,xw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function xw(e,t){if(Vc=-1,Kc=0,De&6)throw Error(ee(327));var n=e.callbackNode;if(Ks()&&e.callbackNode!==n)return null;var r=hu(e,e===gt?yt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Tu(e,r);else{t=r;var i=De;De|=2;var o=bw();(gt!==e||yt!==t)&&(fr=null,So=Ze()+500,Ki(e,t));do try{w3();break}catch(s){ww(e,s)}while(!0);Dm(),Ru.current=o,De=i,nt!==null?t=0:(gt=null,yt=0,t=dt)}if(t!==0){if(t===2&&(i=Lf(e),i!==0&&(r=i,t=np(e,i))),t===1)throw n=Ya,Ki(e,0),Kr(e,r),Ht(e,Ze()),n;if(t===6)Kr(e,r);else{if(i=e.current.alternate,!(r&30)&&!y3(i)&&(t=Tu(e,r),t===2&&(o=Lf(e),o!==0&&(r=o,t=np(e,o))),t===1))throw n=Ya,Ki(e,0),Kr(e,r),Ht(e,Ze()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:Li(e,jt,fr);break;case 3:if(Kr(e,r),(r&130023424)===r&&(t=qm+500-Ze(),10<t)){if(hu(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Tt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Nf(Li.bind(null,e,jt,fr),t);break}Li(e,jt,fr);break;case 4:if(Kr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-On(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_3(r/1960))-r,10<r){e.timeoutHandle=Nf(Li.bind(null,e,jt,fr),r);break}Li(e,jt,fr);break;case 5:Li(e,jt,fr);break;default:throw Error(ee(329))}}}return Ht(e,Ze()),e.callbackNode===n?xw.bind(null,e):null}function np(e,t){var n=Ra;return e.current.memoizedState.isDehydrated&&(Ki(e,t).flags|=256),e=Tu(e,t),e!==2&&(t=jt,jt=n,t!==null&&rp(t)),e}function rp(e){jt===null?jt=e:jt.push.apply(jt,e)}function y3(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!jn(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Kr(e,t){for(t&=~Km,t&=~yd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-On(t),r=1<<n;e[n]=-1,t&=~r}}function z0(e){if(De&6)throw Error(ee(327));Ks();var t=hu(e,0);if(!(t&1))return Ht(e,Ze()),null;var n=Tu(e,t);if(e.tag!==0&&n===2){var r=Lf(e);r!==0&&(t=r,n=np(e,r))}if(n===1)throw n=Ya,Ki(e,0),Kr(e,t),Ht(e,Ze()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Li(e,jt,fr),Ht(e,Ze()),null}function Gm(e,t){var n=De;De|=1;try{return e(t)}finally{De=n,De===0&&(So=Ze()+500,md&&wi())}}function es(e){ri!==null&&ri.tag===0&&!(De&6)&&Ks();var t=De;De|=1;var n=vn.transition,r=Ie;try{if(vn.transition=null,Ie=1,e)return e()}finally{Ie=r,vn.transition=n,De=t,!(De&6)&&wi()}}function Ym(){Yt=Bs.current,Ke(Bs)}function Ki(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YE(n)),nt!==null)for(n=nt.return;n!==null;){var r=n;switch(Mm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&vu();break;case 3:wo(),Ke(Ft),Ke(Et),jm();break;case 5:Im(r);break;case 4:wo();break;case 13:Ke(Ye);break;case 19:Ke(Ye);break;case 10:Pm(r.type._context);break;case 22:case 23:Ym()}n=n.return}if(gt=e,nt=e=hi(e.current,null),yt=Yt=t,dt=0,Ya=null,Km=yd=Zi=0,jt=Ra=null,Pi!==null){for(t=0;t<Pi.length;t++)if(n=Pi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}Pi=null}return e}function ww(e,t){do{var n=nt;try{if(Dm(),Hc.current=Eu,ku){for(var r=Xe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ku=!1}if(Ji=0,mt=ct=Xe=null,ka=!1,Ka=0,Vm.current=null,n===null||n.return===null){dt=1,Ya=t,nt=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=yt,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,p=s,u=p.tag;if(!(p.mode&1)&&(u===0||u===11||u===15)){var m=p.alternate;m?(p.updateQueue=m.updateQueue,p.memoizedState=m.memoizedState,p.lanes=m.lanes):(p.updateQueue=null,p.memoizedState=null)}var g=L0(a);if(g!==null){g.flags&=-257,M0(g,a,s,o,t),g.mode&1&&R0(o,c,t),t=g,l=c;var x=t.updateQueue;if(x===null){var y=new Set;y.add(l),t.updateQueue=y}else x.add(l);break e}else{if(!(t&1)){R0(o,c,t),Xm();break e}l=Error(ee(426))}}else if(Ge&&s.mode&1){var h=L0(a);if(h!==null){!(h.flags&65536)&&(h.flags|=256),M0(h,a,s,o,t),Tm(bo(l,s));break e}}o=l=bo(l,s),dt!==4&&(dt=2),Ra===null?Ra=[o]:Ra.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var f=iw(o,l,t);x0(o,f);break e;case 1:s=l;var d=o.type,v=o.stateNode;if(!(o.flags&128)&&(typeof d.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ui===null||!ui.has(v)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=sw(o,s,t);x0(o,S);break e}}o=o.return}while(o!==null)}Cw(n)}catch(k){t=k,nt===n&&n!==null&&(nt=n=n.return);continue}break}while(!0)}function bw(){var e=Ru.current;return Ru.current=Eu,e===null?Eu:e}function Xm(){(dt===0||dt===3||dt===2)&&(dt=4),gt===null||!(Zi&268435455)&&!(yd&268435455)||Kr(gt,yt)}function Tu(e,t){var n=De;De|=2;var r=bw();(gt!==e||yt!==t)&&(fr=null,Ki(e,t));do try{x3();break}catch(i){ww(e,i)}while(!0);if(Dm(),De=n,Ru.current=r,nt!==null)throw Error(ee(261));return gt=null,yt=0,dt}function x3(){for(;nt!==null;)Sw(nt)}function w3(){for(;nt!==null&&!Kk();)Sw(nt)}function Sw(e){var t=Ew(e.alternate,e,Yt);e.memoizedProps=e.pendingProps,t===null?Cw(e):nt=t,Vm.current=null}function Cw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=p3(n,t),n!==null){n.flags&=32767,nt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dt=6,nt=null;return}}else if(n=f3(n,t,Yt),n!==null){nt=n;return}if(t=t.sibling,t!==null){nt=t;return}nt=t=e}while(t!==null);dt===0&&(dt=5)}function Li(e,t,n){var r=Ie,i=vn.transition;try{vn.transition=null,Ie=1,b3(e,t,n,r)}finally{vn.transition=i,Ie=r}return null}function b3(e,t,n,r){do Ks();while(ri!==null);if(De&6)throw Error(ee(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ee(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(nE(e,o),e===gt&&(nt=gt=null,yt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||lc||(lc=!0,Rw(du,function(){return Ks(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=vn.transition,vn.transition=null;var a=Ie;Ie=1;var s=De;De|=4,Vm.current=null,g3(e,n),_w(n,e),HE($f),fu=!!Pf,$f=Pf=null,e.current=n,v3(n),qk(),De=s,Ie=a,vn.transition=o}else e.current=n;if(lc&&(lc=!1,ri=e,Mu=i),o=e.pendingLanes,o===0&&(ui=null),Xk(n.stateNode),Ht(e,Ze()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Lu)throw Lu=!1,e=ep,ep=null,e;return Mu&1&&e.tag!==0&&Ks(),o=e.pendingLanes,o&1?e===tp?La++:(La=0,tp=e):La=0,wi(),null}function Ks(){if(ri!==null){var e=rx(Mu),t=vn.transition,n=Ie;try{if(vn.transition=null,Ie=16>e?16:e,ri===null)var r=!1;else{if(e=ri,ri=null,Mu=0,De&6)throw Error(ee(331));var i=De;for(De|=4,ae=e.current;ae!==null;){var o=ae,a=o.child;if(ae.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var c=s[l];for(ae=c;ae!==null;){var p=ae;switch(p.tag){case 0:case 11:case 15:Ea(8,p,o)}var u=p.child;if(u!==null)u.return=p,ae=u;else for(;ae!==null;){p=ae;var m=p.sibling,g=p.return;if(mw(p),p===c){ae=null;break}if(m!==null){m.return=g,ae=m;break}ae=g}}}var x=o.alternate;if(x!==null){var y=x.child;if(y!==null){x.child=null;do{var h=y.sibling;y.sibling=null,y=h}while(y!==null)}}ae=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,ae=a;else e:for(;ae!==null;){if(o=ae,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ea(9,o,o.return)}var f=o.sibling;if(f!==null){f.return=o.return,ae=f;break e}ae=o.return}}var d=e.current;for(ae=d;ae!==null;){a=ae;var v=a.child;if(a.subtreeFlags&2064&&v!==null)v.return=a,ae=v;else e:for(a=d;ae!==null;){if(s=ae,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:_d(9,s)}}catch(k){Je(s,s.return,k)}if(s===a){ae=null;break e}var S=s.sibling;if(S!==null){S.return=s.return,ae=S;break e}ae=s.return}}if(De=i,wi(),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(ud,e)}catch{}r=!0}return r}finally{Ie=n,vn.transition=t}}return!1}function H0(e,t,n){t=bo(n,t),t=iw(e,t,1),e=ci(e,t,1),t=Tt(),e!==null&&(xl(e,1,t),Ht(e,t))}function Je(e,t,n){if(e.tag===3)H0(e,e,n);else for(;t!==null;){if(t.tag===3){H0(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ui===null||!ui.has(r))){e=bo(n,e),e=sw(t,e,1),t=ci(t,e,1),e=Tt(),t!==null&&(xl(t,1,e),Ht(t,e));break}}t=t.return}}function S3(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tt(),e.pingedLanes|=e.suspendedLanes&n,gt===e&&(yt&n)===n&&(dt===4||dt===3&&(yt&130023424)===yt&&500>Ze()-qm?Ki(e,0):Km|=n),Ht(e,t)}function kw(e,t){t===0&&(e.mode&1?(t=Jl,Jl<<=1,!(Jl&130023424)&&(Jl=4194304)):t=1);var n=Tt();e=Cr(e,t),e!==null&&(xl(e,t,n),Ht(e,n))}function C3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kw(e,n)}function k3(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),kw(e,n)}var Ew;Ew=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ft.current)Bt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Bt=!1,h3(e,t,n);Bt=!!(e.flags&131072)}else Bt=!1,Ge&&t.flags&1048576&&Mx(t,xu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Wc(e,t),e=t.pendingProps;var i=_o(t,Et.current);Vs(t,n),i=Fm(null,t,r,e,i,n);var o=zm();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,zt(r)?(o=!0,_u(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Om(t),i.updater=gd,t.stateNode=i,i._reactInternals=t,Uf(t,r,e,n),t=Kf(null,t,r,!0,o,n)):(t.tag=0,Ge&&o&&Lm(t),Mt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Wc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=R3(r),e=Ln(r,e),i){case 0:t=Vf(null,t,r,e,n);break e;case 1:t=D0(null,t,r,e,n);break e;case 11:t=T0(null,t,r,e,n);break e;case 14:t=A0(null,t,r,Ln(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ln(r,i),Vf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ln(r,i),D0(e,t,r,i,n);case 3:e:{if(cw(t),e===null)throw Error(ee(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Px(e,t),Su(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=bo(Error(ee(423)),t),t=P0(e,t,r,n,i);break e}else if(r!==i){i=bo(Error(ee(424)),t),t=P0(e,t,r,n,i);break e}else for(Qt=li(t.stateNode.containerInfo.firstChild),en=t,Ge=!0,Pn=null,n=Ix(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yo(),r===i){t=kr(e,t,n);break e}Mt(e,t,r,n)}t=t.child}return t;case 5:return jx(t),e===null&&Ff(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Of(r,i)?a=null:o!==null&&Of(r,o)&&(t.flags|=32),lw(e,t),Mt(e,t,a,n),t.child;case 6:return e===null&&Ff(t),null;case 13:return uw(e,t,n);case 4:return Nm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xo(t,null,r,n):Mt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ln(r,i),T0(e,t,r,i,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,ze(wu,r._currentValue),r._currentValue=a,o!==null)if(jn(o.value,a)){if(o.children===i.children&&!Ft.current){t=kr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=wr(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?l.next=l:(l.next=p.next,p.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),zf(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ee(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),zf(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Mt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Vs(t,n),i=xn(i),r=r(i),t.flags|=1,Mt(e,t,r,n),t.child;case 14:return r=t.type,i=Ln(r,t.pendingProps),i=Ln(r.type,i),A0(e,t,r,i,n);case 15:return ow(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ln(r,i),Wc(e,t),t.tag=1,zt(r)?(e=!0,_u(t)):e=!1,Vs(t,n),Ox(t,r,i),Uf(t,r,i,n),Kf(null,t,r,!0,e,n);case 19:return dw(e,t,n);case 22:return aw(e,t,n)}throw Error(ee(156,t.tag))};function Rw(e,t){return Zy(e,t)}function E3(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,n,r){return new E3(e,t,n,r)}function Qm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function R3(e){if(typeof e=="function")return Qm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gm)return 11;if(e===vm)return 14}return 2}function hi(e,t){var n=e.alternate;return n===null?(n=gn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qc(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")Qm(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ms:return qi(n.children,i,o,t);case mm:a=8,i|=8;break;case ff:return e=gn(12,n,t,i|2),e.elementType=ff,e.lanes=o,e;case pf:return e=gn(13,n,t,i),e.elementType=pf,e.lanes=o,e;case mf:return e=gn(19,n,t,i),e.elementType=mf,e.lanes=o,e;case Ny:return xd(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $y:a=10;break e;case Oy:a=9;break e;case gm:a=11;break e;case vm:a=14;break e;case Ur:a=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=gn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function qi(e,t,n,r){return e=gn(7,e,r,t),e.lanes=n,e}function xd(e,t,n,r){return e=gn(22,e,r,t),e.elementType=Ny,e.lanes=n,e.stateNode={isHidden:!1},e}function Ph(e,t,n){return e=gn(6,e,null,t),e.lanes=n,e}function $h(e,t,n){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function L3(e,t,n,r,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=ph(0),this.expirationTimes=ph(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ph(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jm(e,t,n,r,i,o,a,s,l){return e=new L3(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=gn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Om(o),e}function M3(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ls,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Lw(e){if(!e)return pi;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(zt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(zt(n))return Rx(e,n,t)}return t}function Mw(e,t,n,r,i,o,a,s,l){return e=Jm(n,r,!0,e,i,o,a,s,l),e.context=Lw(null),n=e.current,r=Tt(),i=di(n),o=wr(r,i),o.callback=t??null,ci(n,o,i),e.current.lanes=i,xl(e,i,r),Ht(e,r),e}function wd(e,t,n,r){var i=t.current,o=Tt(),a=di(i);return n=Lw(n),t.context===null?t.context=n:t.pendingContext=n,t=wr(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ci(i,t,a),e!==null&&(Nn(e,i,a,o),zc(e,i,a)),a}function Au(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 U0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zm(e,t){U0(e,t),(e=e.alternate)&&U0(e,t)}function T3(){return null}var Tw=typeof reportError=="function"?reportError:function(e){console.error(e)};function eg(e){this._internalRoot=e}bd.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));wd(e,t,null,null)};bd.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;es(function(){wd(null,e,null,null)}),t[Sr]=null}};function bd(e){this._internalRoot=e}bd.prototype.unstable_scheduleHydration=function(e){if(e){var t=ox();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Vr.length&&t!==0&&t<Vr[n].priority;n++);Vr.splice(n,0,e),n===0&&lx(e)}};function tg(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function W0(){}function A3(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=Au(a);o.call(c)}}var a=Mw(t,r,e,0,null,!1,!1,"",W0);return e._reactRootContainer=a,e[Sr]=a.current,za(e.nodeType===8?e.parentNode:e),es(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var c=Au(l);s.call(c)}}var l=Jm(e,0,!1,null,null,!1,!1,"",W0);return e._reactRootContainer=l,e[Sr]=l.current,za(e.nodeType===8?e.parentNode:e),es(function(){wd(t,l,n,r)}),l}function Cd(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=Au(a);s.call(l)}}wd(t,a,e,i)}else a=A3(n,t,e,i,r);return Au(a)}ix=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ma(t.pendingLanes);n!==0&&(xm(t,n|1),Ht(t,Ze()),!(De&6)&&(So=Ze()+500,wi()))}break;case 13:es(function(){var r=Cr(e,1);if(r!==null){var i=Tt();Nn(r,e,1,i)}}),Zm(e,1)}};wm=function(e){if(e.tag===13){var t=Cr(e,134217728);if(t!==null){var n=Tt();Nn(t,e,134217728,n)}Zm(e,134217728)}};sx=function(e){if(e.tag===13){var t=di(e),n=Cr(e,t);if(n!==null){var r=Tt();Nn(n,e,t,r)}Zm(e,t)}};ox=function(){return Ie};ax=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}};kf=function(e,t,n){switch(t){case"input":if(_f(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=pd(r);if(!i)throw Error(ee(90));jy(r),_f(r,i)}}}break;case"textarea":Fy(e,n);break;case"select":t=n.value,t!=null&&zs(e,!!n.multiple,t,!1)}};qy=Gm;Gy=es;var D3={usingClientEntryPoint:!1,Events:[bl,Ps,pd,Vy,Ky,Gm]},na={findFiberByHostInstance:Di,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},P3={bundleType:na.bundleType,version:na.version,rendererPackageName:na.rendererPackageName,rendererConfig:na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Qy(e),e===null?null:e.stateNode},findFiberByHostInstance:na.findFiberByHostInstance||T3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cc.isDisabled&&cc.supportsFiber)try{ud=cc.inject(P3),er=cc}catch{}}rn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D3;rn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tg(t))throw Error(ee(200));return M3(e,t,null,n)};rn.createRoot=function(e,t){if(!tg(e))throw Error(ee(299));var n=!1,r="",i=Tw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Jm(e,1,!1,null,null,n,!1,r,i),e[Sr]=t.current,za(e.nodeType===8?e.parentNode:e),new eg(t)};rn.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(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=Qy(t),e=e===null?null:e.stateNode,e};rn.flushSync=function(e){return es(e)};rn.hydrate=function(e,t,n){if(!Sd(t))throw Error(ee(200));return Cd(null,e,t,!0,n)};rn.hydrateRoot=function(e,t,n){if(!tg(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=Tw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Mw(t,null,e,1,n??null,i,!1,o,a),e[Sr]=t.current,za(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new bd(t)};rn.render=function(e,t,n){if(!Sd(t))throw Error(ee(200));return Cd(null,e,t,!1,n)};rn.unmountComponentAtNode=function(e){if(!Sd(e))throw Error(ee(40));return e._reactRootContainer?(es(function(){Cd(null,null,e,!1,function(){e._reactRootContainer=null,e[Sr]=null})}),!0):!1};rn.unstable_batchedUpdates=Gm;rn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Sd(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return Cd(e,t,n,!1,r)};rn.version="18.2.0-next-9e3b772b8-20220608";function Aw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Aw)}catch(e){console.error(e)}}Aw(),My.exports=rn;var bi=My.exports;const Dw=ld(bi);var V0=bi;df.createRoot=V0.createRoot,df.hydrateRoot=V0.hydrateRoot;function Er(e,t,n,r){const i=b.useRef(t);$3(()=>{i.current=t},[t]),b.useEffect(()=>{var o;const a=(o=n==null?void 0:n.current)!==null&&o!==void 0?o:window;if(!(a&&a.addEventListener))return;const s=l=>i.current(l);return a.addEventListener(e,s,r),()=>{a.removeEventListener(e,s,r)}},[e,n,r])}const $3=typeof window<"u"?b.useLayoutEffect:b.useEffect;function O3(e,t,n="mousedown"){Er(n,r=>{const i=e==null?void 0:e.current;!i||i.contains(r.target)||t(r)})}var Pw={exports:{}},$w={};/**
 * @license React
 * use-sync-external-store-shim.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 Co=b;function N3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var I3=typeof Object.is=="function"?Object.is:N3,j3=Co.useState,B3=Co.useEffect,F3=Co.useLayoutEffect,z3=Co.useDebugValue;function H3(e,t){var n=t(),r=j3({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return F3(function(){i.value=n,i.getSnapshot=t,Oh(i)&&o({inst:i})},[e,n,t]),B3(function(){return Oh(i)&&o({inst:i}),e(function(){Oh(i)&&o({inst:i})})},[e]),z3(n),n}function Oh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!I3(e,n)}catch{return!0}}function U3(e,t){return t()}var W3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?U3:H3;$w.useSyncExternalStore=Co.useSyncExternalStore!==void 0?Co.useSyncExternalStore:W3;Pw.exports=$w;var V3=Pw.exports;const{useEffect:K3,useLayoutEffect:q3,useRef:G3,useInsertionEffect:Y3}=Ey,X3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q3=X3?q3:K3,J3=Y3||Q3,Ow=e=>{const t=G3([e,(...n)=>t[0](...n)]).current;return J3(()=>{t[0]=e}),t[1]},Z3=(e="",t=location.pathname)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",e4=(e,t="")=>e[0]==="~"?e.slice(1):t+e,t4="popstate",ng="pushState",rg="replaceState",n4="hashchange",K0=[t4,ng,rg,n4],r4=e=>{for(const t of K0)addEventListener(t,e);return()=>{for(const t of K0)removeEventListener(t,e)}},i4=(e,t)=>V3.useSyncExternalStore(r4,e,t),q0=()=>location.pathname,s4=({ssrPath:e}={})=>i4(q0,e?()=>e:q0),ig=(e,{replace:t=!1}={})=>history[t?rg:ng](null,"",e),o4=(e={})=>[Z3(e.base,s4(e)),Ow((t,n)=>ig(e4(t,e.base),n))];if(typeof history<"u")for(const e of[ng,rg]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}function a4(e=c4){let t={};const n=r=>t[r]||(t[r]=e(r));return(r,i)=>{const{regexp:o,keys:a}=n(r||""),s=o.exec(i);return s?[!0,a.reduce((c,p,u)=>(c[p.name]=s[u+1],c),{})]:[!1,null]}}const G0=e=>e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),l4=(e,t,n)=>{let r=e?"((?:[^\\/]+?)(?:\\/(?:[^\\/]+?))*)":"([^\\/]+?)";return t&&n&&(r="(?:\\/"+r+")"),r+(t?"?":"")},c4=e=>{const t=/:([A-Za-z0-9_]+)([?+*]?)/g;let n=null,r=0,i=[],o="";for(;(n=t.exec(e))!==null;){const[a,s,l]=n,c=l==="+"||l==="*",p=l==="?"||l==="*",u=p&&e[n.index-1]==="/"?1:0,m=e.substring(r,n.index-u);i.push({name:s}),r=t.lastIndex,o+=G0(m)+l4(c,p,u)}return o+=G0(e.substring(r)),{keys:i,regexp:new RegExp("^"+o+"(?:\\/)?$","i")}},u4={hook:o4,matcher:a4(),base:""},d4=b.createContext(u4),kd=()=>b.useContext(d4),Ed=e=>e.hook(e),Cl=()=>Ed(kd()),kl=e=>{const t=kd(),[n]=Ed(t);return t.matcher(e,n)},h4=b.createContext({params:{}}),Y0=(e,t)=>b.createElement(h4.Provider,{value:{params:e},children:t}),Ti=({path:e,match:t,component:n,children:r})=>{const i=kl(e),[o,a]=t||i;return o?n?Y0(a,b.createElement(n,{params:a})):Y0(a,typeof r=="function"?r(a):r):null},ts=b.forwardRef((e,t)=>{const n=kd(),[,r]=Ed(n),{to:i,href:o=i,children:a,onClick:s}=e,l=Ow(u=>{u.ctrlKey||u.metaKey||u.altKey||u.shiftKey||u.button!==0||(s&&s(u),u.defaultPrevented||(u.preventDefault(),r(i||o,e)))}),c={href:o[0]==="~"?o.slice(1):n.base+o,onClick:l,to:null,ref:t},p=b.isValidElement(a)?a:b.createElement("a",e);return b.cloneElement(p,c)}),ip=e=>Array.isArray(e)?[].concat(...e.map(t=>t&&t.type===b.Fragment?ip(t.props.children):ip(t))):[e],Nw=({children:e,location:t})=>{const n=kd(),r=n.matcher,[i]=Ed(n);for(const o of ip(e)){let a=0;if(b.isValidElement(o)&&(a=o.props.path?r(o.props.path,t||i):[!0,{}])[0])return b.cloneElement(o,{match:a})}return null};function Iw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Iw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function f4(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Iw(e))&&(r&&(r+=" "),r+=t);return r}const sg="-";function p4(e){const t=g4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(a){const s=a.split(sg);return s[0]===""&&s.length!==1&&s.shift(),jw(s,t)||m4(a)}function o(a,s){const l=n[a]||[];return s&&r[a]?[...l,...r[a]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function jw(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?jw(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(sg);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId}const X0=/^\[(.+)\]$/;function m4(e){if(X0.test(e)){const t=X0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function g4(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _4(Object.entries(e.classGroups),n).forEach(([o,a])=>{sp(a,r,o,t)}),r}function sp(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Q0(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(v4(i)){sp(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,a])=>{sp(a,Q0(t,o),n,r)})})}function Q0(e,t){let n=e;return t.split(sg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function v4(e){return e.isThemeGetter}function _4(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[n,i]}):e}function y4(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,a){n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return i(o,a),a},set(o,a){n.has(o)?n.set(o,a):i(o,a)}}}const Bw="!";function x4(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(a){const s=[];let l=0,c=0,p;for(let y=0;y<a.length;y++){let h=a[y];if(l===0){if(h===r&&(n||a.slice(y,y+i)===t)){s.push(a.slice(c,y)),c=y+i;continue}if(h==="/"){p=y;continue}}h==="["?l++:h==="]"&&l--}const u=s.length===0?a:a.substring(c),m=u.startsWith(Bw),g=m?u.substring(1):u,x=p&&p>c?p-c:void 0;return{modifiers:s,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:x}}}function w4(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function b4(e){return{cache:y4(e.cacheSize),splitModifiers:x4(e),...p4(e)}}const S4=/\s+/;function C4(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(S4).map(a=>{const{modifiers:s,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:p}=n(a);let u=r(p?c.substring(0,p):c),m=!!p;if(!u){if(!p)return{isTailwindClass:!1,originalClassName:a};if(u=r(c),!u)return{isTailwindClass:!1,originalClassName:a};m=!1}const g=w4(s).join(":");return{isTailwindClass:!0,modifierId:l?g+Bw:g,classGroupId:u,originalClassName:a,hasPostfixModifier:m}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:s,classGroupId:l,hasPostfixModifier:c}=a,p=s+l;return o.has(p)?!1:(o.add(p),i(l,c).forEach(u=>o.add(s+u)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function k4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Fw(t))&&(r&&(r+=" "),r+=n);return r}function Fw(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Fw(e[r]))&&(n&&(n+=" "),n+=t);return n}function E4(e,...t){let n,r,i,o=a;function a(l){const c=t.reduce((p,u)=>u(p),e());return n=b4(c),r=n.cache.get,i=n.cache.set,o=s,s(l)}function s(l){const c=r(l);if(c)return c;const p=C4(l,n);return i(l,p),p}return function(){return o(k4.apply(null,arguments))}}function Ue(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const zw=/^\[(?:([a-z-]+):)?(.+)\]$/i,R4=/^\d+\/\d+$/,L4=new Set(["px","full","screen"]),M4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,A4=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ur(e){return Oi(e)||L4.has(e)||R4.test(e)}function Ir(e){return Oo(e,"length",F4)}function Oi(e){return!!e&&!Number.isNaN(Number(e))}function uc(e){return Oo(e,"number",Oi)}function ra(e){return!!e&&Number.isInteger(Number(e))}function P4(e){return e.endsWith("%")&&Oi(e.slice(0,-1))}function we(e){return zw.test(e)}function jr(e){return M4.test(e)}const $4=new Set(["length","size","percentage"]);function O4(e){return Oo(e,$4,Hw)}function N4(e){return Oo(e,"position",Hw)}const I4=new Set(["image","url"]);function j4(e){return Oo(e,I4,H4)}function B4(e){return Oo(e,"",z4)}function ia(){return!0}function Oo(e,t,n){const r=zw.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function F4(e){return T4.test(e)}function Hw(){return!1}function z4(e){return A4.test(e)}function H4(e){return D4.test(e)}function U4(){const e=Ue("colors"),t=Ue("spacing"),n=Ue("blur"),r=Ue("brightness"),i=Ue("borderColor"),o=Ue("borderRadius"),a=Ue("borderSpacing"),s=Ue("borderWidth"),l=Ue("contrast"),c=Ue("grayscale"),p=Ue("hueRotate"),u=Ue("invert"),m=Ue("gap"),g=Ue("gradientColorStops"),x=Ue("gradientColorStopPositions"),y=Ue("inset"),h=Ue("margin"),f=Ue("opacity"),d=Ue("padding"),v=Ue("saturate"),S=Ue("scale"),k=Ue("sepia"),C=Ue("skew"),R=Ue("space"),w=Ue("translate"),E=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",we,t],D=()=>[we,t],P=()=>["",ur,Ir],$=()=>["auto",Oi,we],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],B=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",we],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Oi,uc],z=()=>[Oi,we];return{cacheSize:500,separator:":",theme:{colors:[ia],spacing:[ur,Ir],blur:["none","",jr,we],brightness:j(),borderColor:[e],borderRadius:["none","","full",jr,we],borderSpacing:D(),borderWidth:P(),contrast:j(),grayscale:A(),hueRotate:z(),invert:A(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[P4,Ir],inset:M(),margin:M(),opacity:j(),padding:D(),saturate:j(),scale:j(),sepia:A(),skew:z(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",we]}],container:["container"],columns:[{columns:[jr]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...O(),we]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ra,we]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",we]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ra,we]}],"grid-cols":[{"grid-cols":[ia]}],"col-start-end":[{col:["auto",{span:["full",ra,we]},we]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[ia]}],"row-start-end":[{row:["auto",{span:[ra,we]},we]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",we]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",we]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[d]}],px:[{px:[d]}],py:[{py:[d]}],ps:[{ps:[d]}],pe:[{pe:[d]}],pt:[{pt:[d]}],pr:[{pr:[d]}],pb:[{pb:[d]}],pl:[{pl:[d]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",we,t]}],"min-w":[{"min-w":[we,t,"min","max","fit"]}],"max-w":[{"max-w":[we,t,"none","full","min","max","fit","prose",{screen:[jr]},jr]}],h:[{h:[we,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[we,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[we,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[we,t,"auto","min","max","fit"]}],"font-size":[{text:["base",jr,Ir]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",uc]}],"font-family":[{font:[ia]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",we]}],"line-clamp":[{"line-clamp":["none",Oi,uc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,we]}],"list-image":[{"list-image":["none",we]}],"list-style-type":[{list:["none","disc","decimal",we]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[f]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,Ir]}],"underline-offset":[{"underline-offset":["auto",ur,we]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[f]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...O(),N4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",O4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},j4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[f]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[f]}],"divide-style":[{divide:F()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[ur,we]}],"outline-w":[{outline:[ur,Ir]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[f]}],"ring-offset-w":[{"ring-offset":[ur,Ir]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",jr,B4]}],"shadow-color":[{shadow:[ia]}],opacity:[{opacity:[f]}],"mix-blend":[{"mix-blend":U()}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",jr,we]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[f]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",we]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",we]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",we]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[ra,we]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",we]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ur,Ir,uc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const W4=E4(U4);var Du={en:{y:function(e){return"year"+(e===1?"":"s")},mo:function(e){return"month"+(e===1?"":"s")},w:function(e){return"week"+(e===1?"":"s")},d:function(e){return"day"+(e===1?"":"s")},h:function(e){return"hour"+(e===1?"":"s")},m:function(e){return"minute"+(e===1?"":"s")},s:function(e){return"second"+(e===1?"":"s")},ms:function(e){return"millisecond"+(e===1?"":"s")},decimal:"."},shortEn:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}};function Uw(e){var t=function(r,i){var o=Z0({},t,i||{});return K4(r,o)};return Z0(t,{language:"en",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},e)}var Rd=Uw({});function V4(e){var t=[e.language];if(nr(e,"fallbacks"))if(q4(e.fallbacks)&&e.fallbacks.length)t=t.concat(e.fallbacks);else throw new Error("fallbacks must be an array with at least one element");for(var n=0;n<t.length;n++){var r=t[n];if(nr(e.languages,r))return e.languages[r];if(nr(Du,r))return Du[r]}throw new Error("No language found.")}function K4(e,t){var n,r,i;e=Math.abs(e);var o=V4(t),a=[],s,l,c;for(n=0,r=t.units.length;n<r;n++){if(s=t.units[n],l=t.unitMeasures[s],n+1===r)if(nr(t,"maxDecimalPoints")){var p=Math.pow(10,t.maxDecimalPoints),u=e/l;c=parseFloat((Math.floor(p*u)/p).toFixed(t.maxDecimalPoints))}else c=e/l;else c=Math.floor(e/l);a.push({unitCount:c,unitName:s}),e-=c*l}var m=0;for(n=0;n<a.length;n++)if(a[n].unitCount){m=n;break}if(t.round){var g,x;for(n=a.length-1;n>=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)x=a[n-1],g=t.unitMeasures[x.unitName]/t.unitMeasures[i.unitName],(i.unitCount%g===0||t.largest&&t.largest-1<n-m)&&(x.unitCount+=i.unitCount/g,i.unitCount=0)}var y=[];for(n=0,a.length;n<r&&(i=a[n],i.unitCount&&y.push(J0(i.unitCount,i.unitName,o,t)),y.length!==t.largest);n++);if(y.length){var h;if(nr(t,"delimiter")?h=t.delimiter:nr(o,"delimiter")?h=o.delimiter:h=", ",!t.conjunction||y.length===1)return y.join(h);if(y.length===2)return y.join(t.conjunction);if(y.length>2)return y.slice(0,-1).join(h)+(t.serialComma?",":"")+t.conjunction+y.slice(-1)}else return J0(0,t.units[t.units.length-1],o,t)}function J0(e,t,n,r){var i;nr(r,"decimal")?i=r.decimal:nr(n,"decimal")?i=n.decimal:i=".";var o;typeof n._formatCount=="function"?o=n._formatCount(e,i):o=e.toString().replace(".",i);var a=n[t],s;return typeof a=="function"?s=a(e):s=a,n._numberFirst?s+r.spacer+o:o+r.spacer+s}function Z0(e){for(var t,n=1;n<arguments.length;n++){t=arguments[n];for(var r in t)nr(t,r)&&(e[r]=t[r])}return e}var q4=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function nr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Rd.getSupportedLanguages=function(){var t=[];for(var n in Du)nr(Du,n)&&n!=="gr"&&t.push(n);return t};Rd.humanizer=Uw;const ir=Object.create(null);ir.open="0";ir.close="1";ir.ping="2";ir.pong="3";ir.message="4";ir.upgrade="5";ir.noop="6";const Gc=Object.create(null);Object.keys(ir).forEach(e=>{Gc[ir[e]]=e});const op={type:"error",data:"parser error"},Ww=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Vw=typeof ArrayBuffer=="function",Kw=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,og=({type:e,data:t},n,r)=>Ww&&t instanceof Blob?n?r(t):e_(t,r):Vw&&(t instanceof ArrayBuffer||Kw(t))?n?r(t):e_(new Blob([t]),r):r(ir[e]+(t||"")),e_=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function t_(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Nh;function G4(e,t){if(Ww&&e.data instanceof Blob)return e.data.arrayBuffer().then(t_).then(t);if(Vw&&(e.data instanceof ArrayBuffer||Kw(e.data)))return t(t_(e.data));og(e,!1,n=>{Nh||(Nh=new TextEncoder),t(Nh.encode(n))})}const n_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",va=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<n_.length;e++)va[n_.charCodeAt(e)]=e;const Y4=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),p=new Uint8Array(c);for(r=0;r<n;r+=4)o=va[e.charCodeAt(r)],a=va[e.charCodeAt(r+1)],s=va[e.charCodeAt(r+2)],l=va[e.charCodeAt(r+3)],p[i++]=o<<2|a>>4,p[i++]=(a&15)<<4|s>>2,p[i++]=(s&3)<<6|l&63;return c},X4=typeof ArrayBuffer=="function",ag=(e,t)=>{if(typeof e!="string")return{type:"message",data:qw(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Q4(e.substring(1),t)}:Gc[n]?e.length>1?{type:Gc[n],data:e.substring(1)}:{type:Gc[n]}:op},Q4=(e,t)=>{if(X4){const n=Y4(e);return qw(n,t)}else return{base64:!0,data:e}},qw=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Gw="",J4=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{og(o,!1,s=>{r[a]=s,++i===n&&t(r.join(Gw))})})},Z4=(e,t)=>{const n=e.split(Gw),r=[];for(let i=0;i<n.length;i++){const o=ag(n[i],t);if(r.push(o),o.type==="error")break}return r};function e6(){return new TransformStream({transform(e,t){G4(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Ih;function dc(e){return e.reduce((t,n)=>t+n.length,0)}function hc(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function t6(e,t){Ih||(Ih=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(r===0){if(dc(n)<1)break;const l=hc(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(dc(n)<2)break;const l=hc(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(dc(n)<8)break;const l=hc(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),p=c.getUint32(0);if(p>Math.pow(2,21)-1){s.enqueue(op);break}i=p*Math.pow(2,32)+c.getUint32(4),r=3}else{if(dc(n)<i)break;const l=hc(n,i);s.enqueue(ag(o?l:Ih.decode(l),t)),r=0}if(i===0||i>e){s.enqueue(op);break}}}})}const Yw=4;function rt(e){if(e)return n6(e)}function n6(e){for(var t in rt.prototype)e[t]=rt.prototype[t];return e}rt.prototype.on=rt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};rt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};rt.prototype.off=rt.prototype.removeListener=rt.prototype.removeAllListeners=rt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};rt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};rt.prototype.emitReserved=rt.prototype.emit;rt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};rt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const fn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function Xw(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const r6=fn.setTimeout,i6=fn.clearTimeout;function Ld(e,t){t.useNativeTimers?(e.setTimeoutFn=r6.bind(fn),e.clearTimeoutFn=i6.bind(fn)):(e.setTimeoutFn=fn.setTimeout.bind(fn),e.clearTimeoutFn=fn.clearTimeout.bind(fn))}const s6=1.33;function o6(e){return typeof e=="string"?a6(e):Math.ceil((e.byteLength||e.size)*s6)}function a6(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function l6(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function c6(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class u6 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class lg extends rt{constructor(t){super(),this.writable=!1,Ld(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new u6(t,n,r)),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 n=ag(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=l6(t);return n.length?"?"+n:""}}const Qw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ap=64,d6={};let r_=0,fc=0,i_;function s_(e){let t="";do t=Qw[e%ap]+t,e=Math.floor(e/ap);while(e>0);return t}function Jw(){const e=s_(+new Date);return e!==i_?(r_=0,i_=e):e+"."+s_(r_++)}for(;fc<ap;fc++)d6[Qw[fc]]=fc;let Zw=!1;try{Zw=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const h6=Zw;function eb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||h6))return new XMLHttpRequest}catch{}if(!t)try{return new fn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function f6(){}const p6=function(){return new eb({xdomain:!1}).responseType!=null}();class m6 extends lg{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=p6&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Z4(t,this.socket.binaryType).forEach(n),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,J4(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Jw()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new rr(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.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",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class rr extends rt{constructor(t,n){super(),Ld(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=Xw(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new eb(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=rr.requestsCount++,rr.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=f6,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete rr.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()}}rr.requestsCount=0;rr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",o_);else if(typeof addEventListener=="function"){const e="onpagehide"in fn?"pagehide":"unload";addEventListener(e,o_,!1)}}function o_(){for(let e in rr.requests)rr.requests.hasOwnProperty(e)&&rr.requests[e].abort()}const cg=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),pc=fn.WebSocket||fn.MozWebSocket,a_=!0,g6="arraybuffer",l_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class v6 extends lg{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=l_?{}:Xw(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=a_&&!l_?n?new pc(t,n):new pc(t):new pc(t,n,r)}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 n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;og(r,this.supportsBinary,o=>{const a={};try{a_&&this.ws.send(o)}catch{}i&&cg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Jw()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!pc}}class _6 extends lg{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=t6(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=e6();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),o())}).catch(s=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&cg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const y6={websocket:v6,webtransport:_6,polling:m6},x6=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,w6=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function lp(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=x6.exec(e||""),o={},a=14;for(;a--;)o[w6[a]]=i[a]||"";return n!=-1&&r!=-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=b6(o,o.path),o.queryKey=S6(o,o.query),o}function b6(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function S6(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let tb=class Rs extends rt{constructor(t,n={}){super(),this.binaryType=g6,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=lp(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=lp(n.host).host),Ld(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=c6(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(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"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Yw,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new y6[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Rs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}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",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Rs.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Rs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,p(),n.close(),n=null)}const a=u=>{const m=new Error("probe error: "+u);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function c(u){n&&u.name!==n.name&&o()}const p=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Rs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);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.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),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 n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=o6(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};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()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Rs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};tb.protocol=Yw;function C6(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=lp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const k6=typeof ArrayBuffer=="function",E6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,nb=Object.prototype.toString,R6=typeof Blob=="function"||typeof Blob<"u"&&nb.call(Blob)==="[object BlobConstructor]",L6=typeof File=="function"||typeof File<"u"&&nb.call(File)==="[object FileConstructor]";function ug(e){return k6&&(e instanceof ArrayBuffer||E6(e))||R6&&e instanceof Blob||L6&&e instanceof File}function Yc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Yc(e[n]))return!0;return!1}if(ug(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Yc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Yc(e[n]))return!0;return!1}function M6(e){const t=[],n=e.data,r=e;return r.data=cp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function cp(e,t){if(!e)return e;if(ug(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=cp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=cp(e[r],t));return n}return e}function T6(e,t){return e.data=up(e.data,t),delete e.attachments,e}function up(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 n=0;n<e.length;n++)e[n]=up(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=up(e[n],t));return e}const A6=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],D6=5;var Me;(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"})(Me||(Me={}));class P6{constructor(t){this.replacer=t}encode(t){return(t.type===Me.EVENT||t.type===Me.ACK)&&Yc(t)?this.encodeAsBinary({type:t.type===Me.EVENT?Me.BINARY_EVENT:Me.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Me.BINARY_EVENT||t.type===Me.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=M6(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function c_(e){return Object.prototype.toString.call(e)==="[object Object]"}class dg extends rt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Me.BINARY_EVENT;r||n.type===Me.BINARY_ACK?(n.type=r?Me.EVENT:Me.ACK,this.reconstructor=new $6(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(ug(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Me[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Me.BINARY_EVENT||r.type===Me.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(dg.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Me.CONNECT:return c_(n);case Me.DISCONNECT:return n===void 0;case Me.CONNECT_ERROR:return typeof n=="string"||c_(n);case Me.EVENT:case Me.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&A6.indexOf(n[0])===-1);case Me.ACK:case Me.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class $6{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=T6(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const O6=Object.freeze(Object.defineProperty({__proto__:null,Decoder:dg,Encoder:P6,get PacketType(){return Me},protocol:D6},Symbol.toStringTag,{value:"Module"}));function An(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const N6=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class rb extends rt{constructor(t,n,r){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=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[An(t,"open",this.onopen.bind(this)),An(t,"packet",this.onpacket.bind(this)),An(t,"error",this.onerror.bind(this)),An(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,...n){if(N6.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Me.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.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:Me.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,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Me.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 Me.EVENT:case Me.BINARY_EVENT:this.onevent(t);break;case Me.ACK:case Me.BINARY_ACK:this.onack(t);break;case Me.DISCONNECT:this.ondisconnect();break;case Me.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.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 n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Me.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}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:Me.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 n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,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 n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function No(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}No.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};No.prototype.reset=function(){this.attempts=0};No.prototype.setMin=function(e){this.ms=e};No.prototype.setMax=function(e){this.max=e};No.prototype.setJitter=function(e){this.jitter=e};class dp extends rt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ld(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new No({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||O6;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.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 tb(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=An(n,"open",function(){r.onopen(),t&&t()}),o=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},a=An(n,"error",o);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(An(t,"ping",this.onping.bind(this)),An(t,"data",this.ondata.bind(this)),An(t,"error",this.onerror.bind(this)),An(t,"close",this.onclose.bind(this)),An(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){cg(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new rb(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],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"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),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 n=this.backoff.duration();this._reconnecting=!0;const r=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()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const sa={};function Ma(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=C6(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=sa[i]&&o in sa[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new dp(r,t):(sa[i]||(sa[i]=new dp(r,t)),l=sa[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ma,{Manager:dp,Socket:rb,io:Ma,connect:Ma});const I6=new Date().getFullYear();function Q(...e){return W4(f4(e))}function j6(e){if(typeof e!="string"||!e)return!1;const t=new URL(e,window.location.href);return e.startsWith("/")&&!e.startsWith("//")&&t.hostname===window.location.hostname}const B6=e=>{const t=/^[ \t]*(?=\S)/gm,n=e.substring(e.indexOf(`
`)).match(t);if(!n)return e;const r=n.reduce((o,a)=>Math.min(o,a.length),1/0),i=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(i,"")},Pu=Rd.humanizer({round:!0}),F6=Rd.humanizer({round:!0,spacer:"",language:"shortEn"}),z6=(e,t="long")=>new Date(e*1e3).toLocaleDateString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{dateStyle:t}),Fs=(e,t="long",n="medium")=>new Date(e*1e3).toLocaleString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{dateStyle:t,timeStyle:n}),hp=e=>{const t=new Date(e*1e3),n=t.getFullYear()!==I6;return t.toLocaleString((window==null?void 0:window.nuiSystemLanguages)??navigator.language,{year:n?"numeric":void 0,month:n?"numeric":"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})},ib=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?Ma({...t,path:"/socket.io"}):Ma("monitor",{...t,path:"/WebPipe/socket.io"})},Io=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},Xa=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),Io(r))},hg=b.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Q("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));hg.displayName="Card";const Md=b.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Q("flex flex-col space-y-1.5 p-6",e),...t}));Md.displayName="CardHeader";const fg=b.forwardRef(({className:e,...t},n)=>_.jsx("h3",{ref:n,className:Q("text-2xl font-semibold leading-none tracking-tight",e),...t}));fg.displayName="CardTitle";const sb=b.forwardRef(({className:e,...t},n)=>_.jsx("p",{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));sb.displayName="CardDescription";const El=b.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Q("p-6 pt-0",e),...t}));El.displayName="CardContent";const jo=b.forwardRef(({className:e,...t},n)=>_.jsx("div",{ref:n,className:Q("flex items-center p-6 pt-0",e),...t}));jo.displayName="CardFooter";var ob={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u_=tt.createContext&&tt.createContext(ob),H6=["attr","size","title"];function U6(e,t){if(e==null)return{};var n=W6(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function W6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function $u(){return $u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$u.apply(this,arguments)}function d_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ou(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d_(Object(n),!0).forEach(function(r){V6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V6(e,t,n){return t=K6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K6(e){var t=q6(e,"string");return typeof t=="symbol"?t:String(t)}function q6(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ab(e){return e&&e.map((t,n)=>tt.createElement(t.tag,Ou({key:n},t.attr),ab(t.child)))}function lb(e){return t=>tt.createElement(G6,$u({attr:Ou({},e.attr)},t),ab(e.child))}function G6(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=U6(e,H6),s=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),tt.createElement("svg",$u({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Ou(Ou({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&tt.createElement("title",null,o),e.children)};return u_!==void 0?tt.createElement(u_.Consumer,null,n=>t(n)):t(ob)}function Y6(e){return lb({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(e)}function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function X6(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Rl(...e){return t=>e.forEach(n=>X6(n,t))}function Se(...e){return b.useCallback(Rl(...e),e)}const mi=b.forwardRef((e,t)=>{const{children:n,...r}=e,i=b.Children.toArray(n),o=i.find(Q6);if(o){const a=o.props.children,s=i.map(l=>l===o?b.Children.count(a)>1?b.Children.only(null):b.isValidElement(a)?a.props.children:null:l);return b.createElement(fp,Y({},r,{ref:t}),b.isValidElement(a)?b.cloneElement(a,void 0,s):null)}return b.createElement(fp,Y({},r,{ref:t}),n)});mi.displayName="Slot";const fp=b.forwardRef((e,t)=>{const{children:n,...r}=e;return b.isValidElement(n)?b.cloneElement(n,{...J6(r,n.props),ref:t?Rl(t,n.ref):n.ref}):b.Children.count(n)>1?b.Children.only(null):null});fp.displayName="SlotClone";const pg=({children:e})=>b.createElement(b.Fragment,null,e);function Q6(e){return b.isValidElement(e)&&e.type===pg}function J6(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function cb(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=cb(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Z6(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=cb(e))&&(r&&(r+=" "),r+=t);return r}const h_=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,f_=Z6,Si=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return f_(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(c=>{const p=n==null?void 0:n[c],u=o==null?void 0:o[c];if(p===null)return null;const m=h_(p)||h_(u);return i[c][m]}),s=n&&Object.entries(n).reduce((c,p)=>{let[u,m]=p;return m===void 0||(c[u]=m),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,p)=>{let{class:u,className:m,...g}=p;return Object.entries(g).every(x=>{let[y,h]=x;return Array.isArray(h)?h.includes({...o,...s}[y]):{...o,...s}[y]===h})?[...c,u,m]:c},[]);return f_(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},Ll=Si("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/75",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/75",warning:"bg-warning text-warning-foreground hover:bg-warning/75",success:"bg-success text-success-foreground hover:bg-success/75",info:"bg-info text-info-foreground hover:bg-info/75",outline:"border border-foreground hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/75",ghost:"hover:bg-primary hover:text-primary-foreground",link:"text-accent underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",inline:"h-5 px-1.5 rounded-sm text-xs tracking-wider",xs:"h-7 rounded-sm px-2 text-sm",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ee=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const a=r?mi:"button";return _.jsx(a,{className:Q(Ll({variant:t,size:n,className:e})),ref:o,...i})});Ee.displayName="Button";const eR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fe=eR.reduce((e,t)=>{const n=b.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?mi:t;return b.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),b.createElement(s,Y({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Nu(e,t){e&&bi.flushSync(()=>e.dispatchEvent(t))}const st=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{};function tR(e,t){return b.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const ht=e=>{const{present:t,children:n}=e,r=nR(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),o=Se(r.ref,i.ref);return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:o}):null};ht.displayName="Presence";function nR(e){const[t,n]=b.useState(),r=b.useRef({}),i=b.useRef(e),o=b.useRef("none"),a=e?"mounted":"unmounted",[s,l]=tR(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=mc(r.current);o.current=s==="mounted"?c:"none"},[s]),st(()=>{const c=r.current,p=i.current;if(p!==e){const m=o.current,g=mc(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(p&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),st(()=>{if(t){const c=u=>{const g=mc(r.current).includes(u.animationName);u.target===t&&g&&bi.flushSync(()=>l("ANIMATION_END"))},p=u=>{u.target===t&&(o.current=mc(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:b.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function mc(e){return(e==null?void 0:e.animationName)||"none"}function rR(e,t){const n=b.createContext(t);function r(o){const{children:a,...s}=o,l=b.useMemo(()=>s,Object.values(s));return b.createElement(n.Provider,{value:l},a)}function i(o){const a=b.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,i]}function Vt(e,t=[]){let n=[];function r(o,a){const s=b.createContext(a),l=n.length;n=[...n,a];function c(u){const{scope:m,children:g,...x}=u,y=(m==null?void 0:m[e][l])||s,h=b.useMemo(()=>x,Object.values(x));return b.createElement(y.Provider,{value:h},g)}function p(u,m){const g=(m==null?void 0:m[e][l])||s,x=b.useContext(g);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,p]}const i=()=>{const o=n.map(a=>b.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return b.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,iR(i,...t)]}function iR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(o)[`__scope${c}`];return{...s,...u}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Be(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const sR=b.createContext(void 0);function Bo(e){const t=b.useContext(sR);return e||t||"ltr"}function pp(e,[t,n]){return Math.min(n,Math.max(t,e))}function ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function oR(e,t){return b.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const ub="ScrollArea",[db,mz]=Vt(ub),[aR,Sn]=db(ub),lR=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...a}=e,[s,l]=b.useState(null),[c,p]=b.useState(null),[u,m]=b.useState(null),[g,x]=b.useState(null),[y,h]=b.useState(null),[f,d]=b.useState(0),[v,S]=b.useState(0),[k,C]=b.useState(!1),[R,w]=b.useState(!1),E=Se(t,M=>l(M)),L=Bo(i);return b.createElement(aR,{scope:n,type:r,dir:L,scrollHideDelay:o,scrollArea:s,viewport:c,onViewportChange:p,content:u,onContentChange:m,scrollbarX:g,onScrollbarXChange:x,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:h,scrollbarYEnabled:R,onScrollbarYEnabledChange:w,onCornerWidthChange:d,onCornerHeightChange:S},b.createElement(fe.div,Y({dir:L},a,{ref:E,style:{position:"relative","--radix-scroll-area-corner-width":f+"px","--radix-scroll-area-corner-height":v+"px",...e.style}})))}),cR="ScrollAreaViewport",uR=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...i}=e,o=Sn(cR,n),a=b.useRef(null),s=Se(t,a,o.onViewportChange);return b.createElement(b.Fragment,null,b.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),b.createElement(fe.div,Y({"data-radix-scroll-area-viewport":""},i,{ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style}}),b.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Pr="ScrollAreaScrollbar",hb=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Sn(Pr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s=e.orientation==="horizontal";return b.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),i.type==="hover"?b.createElement(dR,Y({},r,{ref:t,forceMount:n})):i.type==="scroll"?b.createElement(hR,Y({},r,{ref:t,forceMount:n})):i.type==="auto"?b.createElement(fb,Y({},r,{ref:t,forceMount:n})):i.type==="always"?b.createElement(mg,Y({},r,{ref:t})):null}),dR=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Sn(Pr,e.__scopeScrollArea),[o,a]=b.useState(!1);return b.useEffect(()=>{const s=i.scrollArea;let l=0;if(s){const c=()=>{window.clearTimeout(l),a(!0)},p=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",c),s.addEventListener("pointerleave",p),()=>{window.clearTimeout(l),s.removeEventListener("pointerenter",c),s.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),b.createElement(ht,{present:n||o},b.createElement(fb,Y({"data-state":o?"visible":"hidden"},r,{ref:t})))}),hR=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Sn(Pr,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Ad(()=>l("SCROLL_END"),100),[s,l]=oR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(s==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[s,i.scrollHideDelay,l]),b.useEffect(()=>{const c=i.viewport,p=o?"scrollLeft":"scrollTop";if(c){let u=c[p];const m=()=>{const g=c[p];u!==g&&(l("SCROLL"),a()),u=g};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[i.viewport,o,l,a]),b.createElement(ht,{present:n||s!=="hidden"},b.createElement(mg,Y({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:ne(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ne(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),fb=b.forwardRef((e,t)=>{const n=Sn(Pr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=b.useState(!1),s=e.orientation==="horizontal",l=Ad(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?c:p)}},10);return ko(n.viewport,l),ko(n.content,l),b.createElement(ht,{present:r||o},b.createElement(mg,Y({"data-state":o?"visible":"hidden"},i,{ref:t})))}),mg=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Sn(Pr,e.__scopeScrollArea),o=b.useRef(null),a=b.useRef(0),[s,l]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=vb(s.viewport,s.content),p={...r,sizes:s,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:m=>a.current=m};function u(m,g){return xR(m,a.current,s,g)}return n==="horizontal"?b.createElement(fR,Y({},p,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollLeft,g=p_(m,s,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=u(m,i.dir))}})):n==="vertical"?b.createElement(pR,Y({},p,{ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollTop,g=p_(m,s);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=u(m))}})):null}),fR=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Sn(Pr,e.__scopeScrollArea),[a,s]=b.useState(),l=b.useRef(null),c=Se(t,l,o.onScrollbarXChange);return b.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),b.createElement(mb,Y({"data-orientation":"horizontal"},i,{ref:c,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Td(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,u)=>{if(o.viewport){const m=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),yb(m,u)&&p.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Iu(a.paddingLeft),paddingEnd:Iu(a.paddingRight)}})}}))}),pR=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=Sn(Pr,e.__scopeScrollArea),[a,s]=b.useState(),l=b.useRef(null),c=Se(t,l,o.onScrollbarYChange);return b.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),b.createElement(mb,Y({"data-orientation":"vertical"},i,{ref:c,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Td(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,u)=>{if(o.viewport){const m=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),yb(m,u)&&p.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Iu(a.paddingTop),paddingEnd:Iu(a.paddingBottom)}})}}))}),[mR,pb]=db(Pr),mb=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:p,onResize:u,...m}=e,g=Sn(Pr,n),[x,y]=b.useState(null),h=Se(t,E=>y(E)),f=b.useRef(null),d=b.useRef(""),v=g.viewport,S=r.content-r.viewport,k=Be(p),C=Be(l),R=Ad(u,10);function w(E){if(f.current){const L=E.clientX-f.current.left,M=E.clientY-f.current.top;c({x:L,y:M})}}return b.useEffect(()=>{const E=L=>{const M=L.target;(x==null?void 0:x.contains(M))&&k(L,S)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[v,x,S,k]),b.useEffect(C,[r,C]),ko(x,R),ko(g.content,R),b.createElement(mR,{scope:n,scrollbar:x,hasThumb:i,onThumbChange:Be(o),onThumbPointerUp:Be(a),onThumbPositionChange:C,onThumbPointerDown:Be(s)},b.createElement(fe.div,Y({},m,{ref:h,style:{position:"absolute",...m.style},onPointerDown:ne(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),f.current=x.getBoundingClientRect(),d.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),w(E))}),onPointerMove:ne(e.onPointerMove,w),onPointerUp:ne(e.onPointerUp,E=>{const L=E.target;L.hasPointerCapture(E.pointerId)&&L.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=d.current,g.viewport&&(g.viewport.style.scrollBehavior=""),f.current=null})})))}),mp="ScrollAreaThumb",gR=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pb(mp,e.__scopeScrollArea);return b.createElement(ht,{present:n||i.hasThumb},b.createElement(vR,Y({ref:t},r)))}),vR=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=Sn(mp,n),a=pb(mp,n),{onThumbPositionChange:s}=a,l=Se(t,u=>a.onThumbChange(u)),c=b.useRef(),p=Ad(()=>{c.current&&(c.current(),c.current=void 0)},100);return b.useEffect(()=>{const u=o.viewport;if(u){const m=()=>{if(p(),!c.current){const g=wR(u,s);c.current=g,s()}};return s(),u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[o.viewport,p,s]),b.createElement(fe.div,Y({"data-state":a.hasThumb?"visible":"hidden"},i,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ne(e.onPointerDownCapture,u=>{const g=u.target.getBoundingClientRect(),x=u.clientX-g.left,y=u.clientY-g.top;a.onThumbPointerDown({x,y})}),onPointerUp:ne(e.onPointerUp,a.onThumbPointerUp)}))}),gb="ScrollAreaCorner",_R=b.forwardRef((e,t)=>{const n=Sn(gb,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?b.createElement(yR,Y({},e,{ref:t})):null}),yR=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Sn(gb,n),[o,a]=b.useState(0),[s,l]=b.useState(0),c=!!(o&&s);return ko(i.scrollbarX,()=>{var p;const u=((p=i.scrollbarX)===null||p===void 0?void 0:p.offsetHeight)||0;i.onCornerHeightChange(u),l(u)}),ko(i.scrollbarY,()=>{var p;const u=((p=i.scrollbarY)===null||p===void 0?void 0:p.offsetWidth)||0;i.onCornerWidthChange(u),a(u)}),c?b.createElement(fe.div,Y({},r,{ref:t,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Iu(e){return e?parseInt(e,10):0}function vb(e,t){const n=e/t;return isNaN(n)?0:n}function Td(e){const t=vb(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function xR(e,t,n,r="ltr"){const i=Td(n),o=i/2,a=t||o,s=i-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-s,p=n.content-n.viewport,u=r==="ltr"?[0,p]:[p*-1,0];return _b([l,c],u)(e)}function p_(e,t,n="ltr"){const r=Td(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=o-r,l=n==="ltr"?[0,a]:[a*-1,0],c=pp(e,l);return _b([0,a],[0,s])(c)}function _b(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function yb(e,t){return e>0&&e<t}const wR=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Ad(e,t){const n=Be(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ko(e,t){const n=Be(t);st(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const xb=lR,bR=uR,SR=_R,Bn=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(xb,{ref:r,className:Q("relative overflow-hidden",e),...n,children:[_.jsx(bR,{className:"h-full w-full rounded-[inherit]",children:t}),_.jsx(wb,{}),_.jsx(SR,{})]}));Bn.displayName=xb.displayName;const wb=b.forwardRef(({className:e,orientation:t="vertical",...n},r)=>_.jsx(hb,{ref:r,orientation:t,className:Q("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:_.jsx(gR,{className:"relative flex-1 rounded-full bg-border"})}));wb.displayName=hb.displayName;function CR({error:e}){const t=()=>{window.location.reload()};return _.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:_.jsx(bb,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:_.jsx(Ee,{variant:"outline",onClick:t,children:"Refresh"})})})}function kR({error:e,resetErrorBoundary:t}){return _.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:_.jsx(bb,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:_.jsx(Ee,{variant:"outline",onClick:t,children:"Go Back"})})})}function bb(e){return _.jsxs(hg,{className:"max-w-xl",children:[_.jsxs(Md,{children:[_.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[_.jsx(Y6,{className:"inline-block mr-2"}),e.title]}),_.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),_.jsxs(El,{children:[_.jsxs("p",{className:"truncate",children:["Page: ",_.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),_.jsxs("p",{children:["Versions: ",_.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),_.jsxs("p",{children:["Message: ",_.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),_.jsx("p",{children:"Stack:"}),_.jsx("pre",{className:"mt-1",children:_.jsx(Bn,{className:`p-2 border border-red-800 rounded-sm 
                                font-mono text-muted-foreground text-xs text-red-800
                                h-32 w-full`,children:e.error.stack})})]}),_.jsxs(jo,{className:"flex flex-row justify-between",children:[e.resetButton,_.jsx(Ee,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:_.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}var ot={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let ER=0;function Pe(e,t){const n=`atom${++ER}`,r={toString:()=>n};return typeof e=="function"?r.read=e:(r.init=e,r.read=function(i){return i(this)},r.write=function(i,o,a){return o(this,typeof a=="function"?a(i(this)):a)}),t&&(r.write=t),r}const jh=e=>"init"in e,Bh=e=>!!e.write,ju=new WeakMap,RR=(e,t)=>{ju.set(e,t),e.catch(()=>{}).finally(()=>ju.delete(e))},m_=(e,t)=>{const n=ju.get(e);n&&(ju.delete(e),n(t))},g_=(e,t)=>{e.status="fulfilled",e.value=t},v_=(e,t)=>{e.status="rejected",e.reason=t},LR=e=>typeof(e==null?void 0:e.then)=="function",oa=(e,t)=>!!e&&"v"in e&&"v"in t&&Object.is(e.v,t.v),__=(e,t)=>!!e&&"e"in e&&"e"in t&&Object.is(e.e,t.e),vs=e=>!!e&&"v"in e&&e.v instanceof Promise,MR=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,gc=e=>{if("e"in e)throw e.e;return e.v},TR=()=>{const e=new WeakMap,t=new WeakMap,n=new Map;let r,i;(ot?"production":void 0)!=="production"&&(r=new Set,i=new Set);const o=w=>e.get(w),a=(w,E)=>{(ot?"production":void 0)!=="production"&&Object.freeze(E);const L=e.get(w);if(e.set(w,E),n.has(w)||n.set(w,L),vs(L)){const M="v"in E?E.v instanceof Promise?E.v:Promise.resolve(E.v):Promise.reject(E.e);L.v!==M&&m_(L.v,M)}},s=(w,E,L)=>{const M=new Map;let D=!1;L.forEach((P,$)=>{!P&&$===w&&(P=E),P?(M.set($,P),E.d.get($)!==P&&(D=!0)):(ot?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(D||E.d.size!==M.size)&&(E.d=M)},l=(w,E,L)=>{const M=o(w),D={d:(M==null?void 0:M.d)||new Map,v:E};if(L&&s(w,D,L),oa(M,D)&&M.d===D.d)return M;if(vs(M)&&vs(D)&&MR(M,D)){if(M.d===D.d)return M;D.v=M.v}return a(w,D),D},c=(w,E,L,M)=>{if(LR(E)){let D;const P=()=>{const O=o(w);if(!vs(O)||O.v!==$)return;const F=l(w,$,L);t.has(w)&&O.d!==F.d&&k(w,F,O.d)},$=new Promise((O,F)=>{let U=!1;E.then(B=>{U||(U=!0,g_($,B),O(B),P())},B=>{U||(U=!0,v_($,B),F(B),P())}),D=B=>{U||(U=!0,B.then(A=>g_($,A),A=>v_($,A)),O(B))}});return $.orig=E,$.status="pending",RR($,O=>{O&&D(O),M==null||M()}),l(w,$,L)}return l(w,E,L)},p=(w,E,L)=>{const M=o(w),D={d:(M==null?void 0:M.d)||new Map,e:E};return L&&s(w,D,L),__(M,D)&&M.d===D.d?M:(a(w,D),D)},u=(w,E)=>{const L=o(w);if(!E&&L&&(t.has(w)||Array.from(L.d).every(([U,B])=>{if(U===w)return!0;const A=u(U);return A===B||oa(A,B)})))return L;const M=new Map;let D=!0;const P=U=>{if(U===w){const A=o(U);if(A)return M.set(U,A),gc(A);if(jh(U))return M.set(U,void 0),U.init;throw new Error("no atom init")}const B=u(U);return M.set(U,B),gc(B)};let $,O;const F={get signal(){return $||($=new AbortController),$.signal},get setSelf(){return(ot?"production":void 0)!=="production"&&!Bh(w)&&console.warn("setSelf function cannot be used with read-only atom"),!O&&Bh(w)&&(O=(...U)=>{if((ot?"production":void 0)!=="production"&&D&&console.warn("setSelf function cannot be called in sync"),!D)return d(w,...U)}),O}};try{const U=w.read(P,F);return c(w,U,M,()=>$==null?void 0:$.abort())}catch(U){return p(w,U,M)}finally{D=!1}},m=w=>gc(u(w)),g=w=>{let E=t.get(w);return E||(E=v(w)),E},x=(w,E)=>!E.l.size&&(!E.t.size||E.t.size===1&&E.t.has(w)),y=w=>{const E=t.get(w);E&&x(w,E)&&S(w)},h=w=>{const E=new Map,L=new WeakMap,M=$=>{var O;const F=new Set((O=t.get($))==null?void 0:O.t);return n.forEach((U,B)=>{var A;(A=o(B))!=null&&A.d.has($)&&F.add(B)}),F},D=$=>{M($).forEach(O=>{O!==$&&(E.set(O,(E.get(O)||new Set).add($)),L.set(O,(L.get(O)||0)+1),D(O))})};D(w);const P=$=>{M($).forEach(O=>{var F;if(O!==$){let U=L.get(O);if(U&&L.set(O,--U),!U){let B=!!((F=E.get(O))!=null&&F.size);if(B){const A=o(O),T=u(O,!0);B=!oa(A,T)}B||E.forEach(A=>A.delete(O))}P(O)}})};P(w)},f=(w,...E)=>{let L=!0;const M=$=>gc(u($)),D=($,...O)=>{let F;if($===w){if(!jh($))throw new Error("atom not writable");const U=o($),B=c($,O[0]);oa(U,B)||h($)}else F=f($,...O);if(!L){const U=C();(ot?"production":void 0)!=="production"&&r.forEach(B=>B({type:"async-write",flushed:U}))}return F},P=w.write(M,D,...E);return L=!1,P},d=(w,...E)=>{const L=f(w,...E),M=C();return(ot?"production":void 0)!=="production"&&r.forEach(D=>D({type:"write",flushed:M})),L},v=(w,E,L)=>{var M;const D=L||[];(M=o(w))==null||M.d.forEach(($,O)=>{const F=t.get(O);F?F.t.add(w):O!==w&&v(O,w,D)}),u(w);const P={t:new Set(E&&[E]),l:new Set};if(t.set(w,P),(ot?"production":void 0)!=="production"&&i.add(w),Bh(w)&&w.onMount){const{onMount:$}=w;D.push(()=>{const O=$((...F)=>d(w,...F));O&&(P.u=O)})}return L||D.forEach($=>$()),P},S=w=>{var E;const L=(E=t.get(w))==null?void 0:E.u;L&&L(),t.delete(w),(ot?"production":void 0)!=="production"&&i.delete(w);const M=o(w);M?(vs(M)&&m_(M.v),M.d.forEach((D,P)=>{if(P!==w){const $=t.get(P);$&&($.t.delete(w),x(P,$)&&S(P))}})):(ot?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",w)},k=(w,E,L)=>{const M=new Set(E.d.keys());L==null||L.forEach((D,P)=>{if(M.has(P)){M.delete(P);return}const $=t.get(P);$&&($.t.delete(w),x(P,$)&&S(P))}),M.forEach(D=>{const P=t.get(D);P?P.t.add(w):t.has(w)&&v(D,w)})},C=()=>{let w;for((ot?"production":void 0)!=="production"&&(w=new Set);n.size;){const E=Array.from(n);n.clear(),E.forEach(([L,M])=>{const D=o(L);if(D){const P=t.get(L);P&&D.d!==(M==null?void 0:M.d)&&k(L,D,M==null?void 0:M.d),P&&!(!vs(M)&&(oa(M,D)||__(M,D)))&&(P.l.forEach($=>$()),(ot?"production":void 0)!=="production"&&w.add(L))}else(ot?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((ot?"production":void 0)!=="production")return w},R=(w,E)=>{const L=g(w),M=C(),D=L.l;return D.add(E),(ot?"production":void 0)!=="production"&&r.forEach(P=>P({type:"sub",flushed:M})),()=>{D.delete(E),y(w),(ot?"production":void 0)!=="production"&&r.forEach(P=>P({type:"unsub"}))}};return(ot?"production":void 0)!=="production"?{get:m,set:d,sub:R,dev_subscribe_store:(w,E)=>{if(E!==2)throw new Error("The current StoreListener revision is 2.");return r.add(w),()=>{r.delete(w)}},dev_get_mounted_atoms:()=>i.values(),dev_get_atom_state:w=>e.get(w),dev_get_mounted:w=>t.get(w),dev_restore_atoms:w=>{for(const[L,M]of w)jh(L)&&(c(L,M),h(L));const E=C();r.forEach(L=>L({type:"restore",flushed:E}))}}:{get:m,set:d,sub:R}};let Fh;(ot?"production":void 0)!=="production"&&(typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__=="number"?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1);const AR=()=>(Fh||((ot?"production":void 0)!=="production"&&globalThis.__NUMBER_OF_JOTAI_INSTANCES__!==1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),Fh=TR()),Fh);var DR={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const PR=b.createContext(void 0),Sb=e=>{const t=b.useContext(PR);return(e==null?void 0:e.store)||t||AR()},$R=e=>typeof(e==null?void 0:e.then)=="function",OR=tt.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function qe(e,t){const n=Sb(t),[[r,i,o],a]=b.useReducer(c=>{const p=n.get(e);return Object.is(c[0],p)&&c[1]===n&&c[2]===e?c:[p,n,e]},void 0,()=>[n.get(e),n,e]);let s=r;(i!==n||o!==e)&&(a(),s=n.get(e));const l=t==null?void 0:t.delay;return b.useEffect(()=>{const c=n.sub(e,()=>{if(typeof l=="number"){setTimeout(a,l);return}a()});return a(),c},[n,e,l]),b.useDebugValue(s),$R(s)?OR(s):s}function Ne(e,t){const n=Sb(t);return b.useCallback((...i)=>{if((DR?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function Ut(e,t){return[qe(e,t),Ne(e,t)]}function Cb(e){const t=Pe(()=>({mounted:!1,inProgress:0,promise:void 0,cleanup:void 0})),n=Pe(0),r=Pe(null,(o,a,s)=>{const l=o(t);s?(l.mounted=!0,a(n,c=>c+1)):(l.cleanup==null||l.cleanup(),l.cleanup=void 0,l.mounted=!1)});r.onMount=o=>(o(!0),()=>o(!1));const i=Pe((o,{setSelf:a})=>{o(n);const s=o(t);return!s.mounted||s.inProgress?s.promise:(++s.inProgress,s.promise=Promise.resolve().then(()=>{try{if(!s.mounted)return;s.cleanup==null||s.cleanup(),s.cleanup=e(o,a)}finally{--s.inProgress,s.promise=void 0}}))},(o,a,...s)=>{const l=o(t);++l.inProgress;try{return a(...s)}finally{--l.inProgress}});return Pe(o=>{o(r),o(i)})}const kb=""+new URL("favicon_default.svg",import.meta.url).href,NR=""+new URL("favicon_online.svg",import.meta.url).href,IR=""+new URL("favicon_partial.svg",import.meta.url).href,jR=""+new URL("favicon_offline.svg",import.meta.url).href,as=Pe(null),Eb=Pe(e=>{var t;return((t=e(as))==null?void 0:t.server.name)??"unconfigured"}),Rb=Pe(e=>{var t;return(t=e(as))==null?void 0:t.server.configPendingStep}),BR=Pe(e=>{var t;return((t=e(as))==null?void 0:t.server.instantiated)??!1}),FR=()=>Ne(as),Lb=()=>qe(as),gg=Pe([]),Dd=Pe(e=>e(gg).length),Mb=Pe(null),zR=()=>{const e=Ne(gg),t=Ne(Mb);return n=>{const r=n.findIndex(i=>i.type==="fullPlayerlist");r>0&&(n=n.slice(r));for(const i of n)i.type==="fullPlayerlist"?(e(i.playerlist),t(i.mutex)):i.type==="playerJoining"?e(o=>[...o,i]):i.type==="playerDropped"?e(o=>o.filter(a=>a.netid!==i.netid)):console.error("Unknown playerlist event type",i)}},Tb=Pe(0),vg=()=>{const e=Ne(Tb);return()=>e(Math.random())},Ab=Pe(!1),Bu="txAdmin",_a=document.getElementById("favicon"),Db=Pe(Bu),_g=()=>{const e=Ne(Db);return t=>{t?e(t):(e(Bu),document.title=Bu,_a.href=kb)}},HR=Cb((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(Db),r=e(as),i=e(Dd);r?(r.server.status==="ONLINE"?_a.href=NR:r.server.status==="PARTIAL"?_a.href=IR:_a.href=jR,document.title=`(${i}) ${r.server.name} · ${n}`):(_a.href=kb,document.title=Bu)});function _r(e,t,n){var r=n||{},i=r.noTrailing,o=i===void 0?!1:i,a=r.noLeading,s=a===void 0?!1:a,l=r.debounceMode,c=l===void 0?void 0:l,p,u=!1,m=0;function g(){p&&clearTimeout(p)}function x(h){var f=h||{},d=f.upcomingOnly,v=d===void 0?!1:d;g(),u=!v}function y(){for(var h=arguments.length,f=new Array(h),d=0;d<h;d++)f[d]=arguments[d];var v=this,S=Date.now()-m;if(u)return;function k(){m=Date.now(),t.apply(v,f)}function C(){p=void 0}!s&&c&&!p&&k(),g(),c===void 0&&S>e?s?(m=Date.now(),o||(p=setTimeout(c?C:k,e))):k():o!==!0&&(p=setTimeout(c?C:k,c===void 0?e-S:e))}return y.cancel=x,y}function UR(e,t,n){var r=n||{},i=r.atBegin,o=i===void 0?!1:i;return _r(e,t,{debounceMode:o!==!1})}const WR=150,y_=_r(WR,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function Pb(e){return e.code==="KeyK"&&e.ctrlKey?(y_("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.ctrlKey&&e.shiftKey&&window.txConsts.showAdvanced?(y_("toggleLightMode"),!0):!1}function $b(e){Pb(e)&&e.preventDefault()}function St({legacyUrl:e}){const t=b.useRef(null),n=location.search??"",r=location.hash??"";return b.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",$b))},[]),_.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function $n({children:e,className:t,...n}){return _.jsx("code",{className:Q("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}function VR({params:e}){return _g()("Not Found"),_.jsx("div",{className:"w-full flex items-center justify-center",children:_.jsxs("div",{className:"text-center",children:[_.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),_.jsxs("p",{className:"mt-2",children:["The page ",_.jsxs($n,{children:["/",e.fullPath]})," does not seem to be correct."]}),_.jsx(ts,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var KR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),se=(e,t)=>{const n=b.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:s="",children:l,...c},p)=>b.createElement("svg",{ref:p,...KR,width:i,height:i,stroke:r,strokeWidth:a?Number(o)*24/Number(i):o,className:["lucide",`lucide-${qR(e)}`,s].join(" "),...c},[...t.map(([u,m])=>b.createElement(u,m)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GR=se("ActivitySquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M17 12h-2l-2 5-2-10-2 5H7",key:"15hlnc"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YR=se("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XR=se("AlertOctagon",[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fu=se("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QR=se("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JR=se("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZR=se("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eL=se("BookMarked",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["polyline",{points:"10 2 10 10 13 7 16 10 16 2",key:"13o6vz"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tL=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nL=se("CalendarPlus",[["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}],["line",{x1:"19",x2:"19",y1:"16",y2:"22",key:"1ttwzi"}],["line",{x1:"16",x2:"22",y1:"19",y2:"19",key:"1g9955"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rL=se("CaseSensitive",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["circle",{cx:"18",cy:"12",r:"3",key:"1kchzo"}],["path",{d:"M21 9v6",key:"anns31"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iL=se("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yg=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ml=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sL=se("ChevronRightCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oL=se("ChevronRightSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aL=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lL=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cL=se("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gp=se("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uL=se("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dL=se("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hL=se("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fL=se("Dna",[["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m17 6-2.5-2.5",key:"5cdfhj"}],["path",{d:"m14 8-1-1",key:"15nbz5"}],["path",{d:"m7 18 2.5 2.5",key:"16tu1a"}],["path",{d:"m3.5 14.5.5.5",key:"hapbhd"}],["path",{d:"m20 9 .5.5",key:"1n7z02"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m10 16 1.5 1.5",key:"11lckj"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x_=se("DownloadCloud",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m8 17 4 4 4-4",key:"1ul180"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Eo=se("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pL=se("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mL=se("FileDown",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gL=se("FilePen",[["path",{d:"M4 13.5V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2h-5.5",key:"1bg6eb"}],["path",{d:"M14 2v6h6",key:"1kof46"}],["path",{d:"M10.4 12.6a2 2 0 0 1 3 3L8 21l-4 1 1-4Z",key:"hnx206"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vL=se("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _L=se("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zu=se("Gavel",[["path",{d:"m14.5 12.5-8 8a2.119 2.119 0 1 1-3-3l8-8",key:"15492f"}],["path",{d:"m16 16 6-6",key:"vzrcl6"}],["path",{d:"m8 8 6-6",key:"18bi4p"}],["path",{d:"m9 7 8 8",key:"5jnvq1"}],["path",{d:"m21 11-8-8",key:"z4y7zo"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yL=se("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xL=se("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xg=se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wL=se("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",key:"1kog09"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bL=se("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wg=se("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fn=se("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SL=se("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CL=se("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kL=se("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EL=se("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RL=se("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LL=se("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ML=se("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TL=se("PersonStanding",[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["path",{d:"m9 20 3-6 3 6",key:"se2kox"}],["path",{d:"m6 8 6 2 6-2",key:"4o3us4"}],["path",{d:"M12 10v4",key:"1kjpxc"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AL=se("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DL=se("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PL=se("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $L=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OL=se("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NL=se("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IL=se("Regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jL=se("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BL=se("Scroll",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FL=se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zL=se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ob=se("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HL=se("SquareUserRound",[["path",{d:"M18 21a6 6 0 0 0-12 0",key:"kaz2du"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UL=se("StarOff",[["path",{d:"M8.34 8.34 2 9.27l5 4.87L5.82 21 12 17.77 18.18 21l-.59-3.43",key:"16m0ql"}],["path",{d:"M18.42 12.76 22 9.27l-6.91-1L12 2l-1.44 2.91",key:"1vt8nq"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WL=se("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VL=se("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KL=se("TimerOff",[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7",key:"10he05"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2",key:"15f7sh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M12 12v-2",key:"fwoke6"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qL=se("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GL=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nb=se("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11",key:"llx8ln"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w_=se("UserRoundPlus",[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bg=se("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YL=se("WholeWord",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XL=se("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $r=se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.309.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QL=se("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),it=b.forwardRef(({className:e,type:t,...n},r)=>_.jsx("input",{type:t,className:Q("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 placeholder:opacity-50","bg-black/5 dark:bg-black/30",e),ref:r,...n}));it.displayName="Input";var Ib={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,s,l){var c=this&&this.__decorate||function(d,v,S,k){var C,R=arguments.length,w=R<3?v:k===null?k=Object.getOwnPropertyDescriptor(v,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,v,S,k);else for(var E=d.length-1;E>=0;E--)(C=d[E])&&(w=(R<3?C(w):R>3?C(v,S,w):C(v,S))||w);return R>3&&w&&Object.defineProperty(v,S,w),w},p=this&&this.__param||function(d,v){return function(S,k){v(S,k,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=l(9042),m=l(9924),g=l(844),x=l(4725),y=l(2585),h=l(3656);let f=s.AccessibilityManager=class extends g.Disposable{constructor(d,v,S,k){super(),this._terminal=d,this._coreBrowserService=S,this._renderService=k,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let C=0;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);if(this._topBoundaryFocusListener=C=>this._handleBoundaryFocus(C,0),this._bottomBoundaryFocusListener=C=>this._handleBoundaryFocus(C,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=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.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(C=>this._handleResize(C.rows))),this.register(this._terminal.onRender(C=>this._refreshRows(C.start,C.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(C=>this._handleChar(C))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(C=>this._handleTab(C))),this.register(this._terminal.onKey(C=>this._handleKey(C.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let v=0;v<d;v++)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+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,v){this._liveRegionDebouncer.refresh(d,v,this._terminal.rows)}_renderRows(d,v){const S=this._terminal.buffer,k=S.lines.length.toString();for(let C=d;C<=v;C++){const R=S.lines.get(S.ydisp+C),w=[],E=(R==null?void 0:R.translateToString(!0,void 0,void 0,w))||"",L=(S.ydisp+C+1).toString(),M=this._rowElements[C];M&&(E.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=E,this._rowColumns.set(M,w)),M.setAttribute("aria-posinset",L),M.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,v){const S=d.target,k=this._rowElements[v===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==k)return;let C,R;if(v===0?(C=S,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(C=this._rowElements.shift(),R=S,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:d.anchorNode,offset:d.anchorOffset},S={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===S.node&&v.offset>S.offset)&&([v,S]=[S,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const k=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(k)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:k,offset:((E=k.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(S.node))return;const C=({node:L,offset:M})=>{const D=L instanceof Text?L.parentNode:L;let P=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(D);if(!$)return console.warn("columns is null. Race condition?"),null;let O=M<$.length?$[M]:$.slice(-1)[0]+1;return O>=this._terminal.cols&&(++P,O=0),{row:P,column:O}},R=C(v),w=C(S);if(R&&w){if(R.row>w.row||R.row===w.row&&R.column>=w.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(w.row-R.row)*this._terminal.cols-R.column+w.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);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=this._coreBrowserService.mainDocument.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`}};s.AccessibilityManager=f=c([p(1,y.IInstantiationService),p(2,x.ICoreBrowserService),p(3,x.IRenderService)],f)},3614:(a,s)=>{function l(m){return m.replace(/\r?\n/g,"\r")}function c(m,g){return g?"\x1B[200~"+m+"\x1B[201~":m}function p(m,g,x,y){m=c(m=l(m),x.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(m,!0),g.value=""}function u(m,g,x){const y=x.getBoundingClientRect(),h=m.clientX-y.left-10,f=m.clientY-y.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${h}px`,g.style.top=`${f}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=l,s.bracketTextForPaste=c,s.copyHandler=function(m,g){m.clipboardData&&m.clipboardData.setData("text/plain",g.selectionText),m.preventDefault()},s.handlePasteEvent=function(m,g,x,y){m.stopPropagation(),m.clipboardData&&p(m.clipboardData.getData("text/plain"),g,x,y)},s.paste=p,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(m,g,x,y,h){u(m,g,x),h&&y.rightClickSelect(m),g.value=y.selectionText,g.select()}},7239:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=l(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,m){this._css.set(p,u,m)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,m){this._color.set(p,u,m)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(l,c,p,u){l.addEventListener(c,p,u);let m=!1;return{dispose:()=>{m||(m=!0,l.removeEventListener(c,p,u))}}}},6465:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var S,k=arguments.length,C=k<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(S=h[R])&&(C=(k<3?S(C):k>3?S(f,d,C):S(f,d))||C);return k>3&&C&&Object.defineProperty(f,d,C),C},p=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const u=l(3656),m=l(8460),g=l(844),x=l(2585);let y=s.Linkifier2=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(h){super(),this._bufferService=h,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var f;this._lastMouseEvent=void 0,this._linkProviders.length=0,(f=this._activeProviderReplies)==null||f.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(h){return this._linkProviders.push(h),{dispose:()=>{const f=this._linkProviders.indexOf(h);f!==-1&&this._linkProviders.splice(f,1)}}}attachToDom(h,f,d){this._element=h,this._mouseService=f,this._renderService=d,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){if(this._lastMouseEvent=h,!this._element||!this._mouseService)return;const f=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const d=h.composedPath();for(let v=0;v<d.length;v++){const S=d[v];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,f){var v,S;this._activeProviderReplies&&f||((v=this._activeProviderReplies)==null||v.forEach(k=>{k==null||k.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let d=!1;for(const[k,C]of this._linkProviders.entries())f?(S=this._activeProviderReplies)!=null&&S.get(k)&&(d=this._checkLinkProviderResult(k,h,d)):C.provideLinks(h.y,R=>{var E,L;if(this._isMouseOut)return;const w=R==null?void 0:R.map(M=>({link:M}));(E=this._activeProviderReplies)==null||E.set(k,w),d=this._checkLinkProviderResult(k,h,d),((L=this._activeProviderReplies)==null?void 0:L.size)===this._linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,f){const d=new Set;for(let v=0;v<f.size;v++){const S=f.get(v);if(S)for(let k=0;k<S.length;k++){const C=S[k],R=C.link.range.start.y<h?0:C.link.range.start.x,w=C.link.range.end.y>h?this._bufferService.cols:C.link.range.end.x;for(let E=R;E<=w;E++){if(d.has(E)){S.splice(k--,1);break}d.add(E)}}}}_checkLinkProviderResult(h,f,d){var k;if(!this._activeProviderReplies)return d;const v=this._activeProviderReplies.get(h);let S=!1;for(let C=0;C<h;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(S=!0);if(!S&&v){const C=v.find(R=>this._linkAtPosition(R.link,f));C&&(d=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviders.length&&!d)for(let C=0;C<this._activeProviderReplies.size;C++){const R=(k=this._activeProviderReplies.get(C))==null?void 0:k.find(w=>this._linkAtPosition(w.link,f));if(R){d=!0,this._handleNewLink(R);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._element||!this._mouseService||!this._currentLink)return;const f=this._positionFromMouseEvent(h,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,f){this._element&&this._currentLink&&this._lastMouseEvent&&(!h||!f||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(h.link,f)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.pointerCursor},set:d=>{var v,S;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&((S=this._element)==null||S.classList.toggle("xterm-cursor-pointer",d)))}},underline:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.underline},set:d=>{var v,S,k;(v=this._currentLink)!=null&&v.state&&((k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,d))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(d=>{if(!this._currentLink)return;const v=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(v,S),this._lastMouseEvent&&this._element)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(h,f,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(d,f.text)}_fireUnderlineEvent(h,f){const d=h.range,v=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-v-1,d.end.x,d.end.y-v-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(h,f,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(d,f.text)}_linkAtPosition(h,f){const d=h.range.start.y*this._bufferService.cols+h.range.start.x,v=h.range.end.y*this._bufferService.cols+h.range.end.x,S=f.y*this._bufferService.cols+f.x;return d<=S&&S<=v}_positionFromMouseEvent(h,f,d){const v=d.getCoords(h,f,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,f,d,v,S){return{x1:h,y1:f,x2:d,y2:v,cols:this._bufferService.cols,fg:S}}};s.Linkifier2=y=c([p(0,x.IBufferService)],y)},9042:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,s,l){var c=this&&this.__decorate||function(y,h,f,d){var v,S=arguments.length,k=S<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,h,f,d);else for(var C=y.length-1;C>=0;C--)(v=y[C])&&(k=(S<3?v(k):S>3?v(h,f,k):v(h,f))||k);return S>3&&k&&Object.defineProperty(h,f,k),k},p=this&&this.__param||function(y,h){return function(f,d){h(f,d,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=l(511),m=l(2585);let g=s.OscLinkProvider=class{constructor(y,h,f){this._bufferService=y,this._optionsService=h,this._oscLinkService=f}provideLinks(y,h){var E;const f=this._bufferService.buffer.lines.get(y-1);if(!f)return void h(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,S=new u.CellData,k=f.getTrimmedLength();let C=-1,R=-1,w=!1;for(let L=0;L<k;L++)if(R!==-1||f.hasContent(L)){if(f.loadCell(L,S),S.hasExtendedAttrs()&&S.extended.urlId){if(R===-1){R=L,C=S.extended.urlId;continue}w=S.extended.urlId!==C}else R!==-1&&(w=!0);if(w||R!==-1&&L===k-1){const M=(E=this._oscLinkService.getLinkData(C))==null?void 0:E.uri;if(M){const D={start:{x:R+1,y},end:{x:L+(w||L!==k-1?0:1),y}};let P=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const $=new URL(M);["http:","https:"].includes($.protocol)||(P=!0)}catch{P=!0}P||d.push({text:M,range:D,activate:($,O)=>v?v.activate($,O,D):x(0,O),hover:($,O)=>{var F;return(F=v==null?void 0:v.hover)==null?void 0:F.call(v,$,O,D)},leave:($,O)=>{var F;return(F=v==null?void 0:v.leave)==null?void 0:F.call(v,$,O,D)}})}w=!1,S.hasExtendedAttrs()&&S.extended.urlId?(R=L,C=S.extended.urlId):(R=-1,C=-1)}}h(d)}};function x(y,h){if(confirm(`Do you want to navigate to ${h}?

WARNING: This link could potentially be dangerous`)){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=g=c([p(0,m.IBufferService),p(1,m.IOptionsService),p(2,m.IOscLinkService)],g)},6193:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(l,c,p){this._rowCount=p,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.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 l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=l(3614),p=l(3656),u=l(6465),m=l(9042),g=l(3730),x=l(1680),y=l(3107),h=l(5744),f=l(2950),d=l(1296),v=l(428),S=l(4269),k=l(5114),C=l(8934),R=l(3230),w=l(9312),E=l(4725),L=l(6731),M=l(8055),D=l(8969),P=l(8460),$=l(844),O=l(6114),F=l(8437),U=l(2584),B=l(7399),A=l(5941),T=l(9074),j=l(2585),z=l(5435),N=l(4567);class X extends D.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(H={}){super(H),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.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(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(T.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((W,I)=>this.refresh(W,I))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(W=>this._reportWindowsOptions(W))),this.register(this._inputHandler.onColor(W=>this._handleColorEvent(W))),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(W=>this._afterResize(W.cols,W.rows))),this.register((0,$.toDisposable)(()=>{var W,I;this._customKeyEventHandler=void 0,(I=(W=this.element)==null?void 0:W.parentNode)==null||I.removeChild(this.element)}))}_handleColorEvent(H){if(this._themeService)for(const W of H){let I,K="";switch(W.index){case 256:I="foreground",K="10";break;case 257:I="background",K="11";break;case 258:I="cursor",K="12";break;default:I="ansi",K="4;"+W.index}switch(W.type){case 0:const J=M.color.toColorRGB(I==="ansi"?this._themeService.colors.ansi[W.index]:this._themeService.colors[I]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${K};${(0,A.toRgbString)(J)}${U.C1_ESCAPED.ST}`);break;case 1:if(I==="ansi")this._themeService.modifyColors(q=>q.ansi[W.index]=M.rgba.toColor(...W.color));else{const q=I;this._themeService.modifyColors(he=>he[q]=M.rgba.toColor(...W.color))}break;case 2:this._themeService.restoreColor(W.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(H){H?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(N.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(H){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var H;return(H=this.textarea)==null?void 0:H.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.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 H=this.buffer.ybase+this.buffer.y,W=this.buffer.lines.get(H);if(!W)return;const I=Math.min(this.buffer.x,this.cols-1),K=this._renderService.dimensions.css.cell.height,J=W.getWidth(I),q=this._renderService.dimensions.css.cell.width*J,he=this.buffer.y*this._renderService.dimensions.css.cell.height,de=I*this._renderService.dimensions.css.cell.width;this.textarea.style.left=de+"px",this.textarea.style.top=he+"px",this.textarea.style.width=q+"px",this.textarea.style.height=K+"px",this.textarea.style.lineHeight=K+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",W=>{this.hasSelection()&&(0,c.copyHandler)(W,this._selectionService)}));const H=W=>(0,c.handlePasteEvent)(W,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",H)),this.register((0,p.addDisposableDomListener)(this.element,"paste",H)),O.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",W=>{W.button===2&&(0,c.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",W=>{(0,c.rightClickHandler)(W,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),O.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",W=>{W.button===1&&(0,c.moveTextAreaUnderMouseCursor)(W,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",H=>this._keyUp(H),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",H=>this._keyDown(H),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",H=>this._keyPress(H),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",H=>this._compositionHelper.compositionupdate(H))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",H=>this._inputEvent(H),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(H){var I;if(!H)throw new Error("Terminal requires a parent element.");if(H.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((I=this.element)==null?void 0:I.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=H.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),H.appendChild(this.element);const W=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",K=>this.updateCursorStyle(K))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),O.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.register(this._instantiationService.createInstance(k.CoreBrowserService,this.textarea,H.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",K=>this._handleTextAreaFocus(K))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.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(S.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(K=>this._onRender.fire(K))),this.onResize(K=>this._renderService.resize(K.cols,K.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(f.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);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(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(K=>this.scrollLines(K.amount,K.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(K=>this.scrollLines(K.amount,K.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(K=>this._renderService.handleSelectionChanged(K.start,K.end,K.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(K=>{this.textarea.value=K,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(K=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.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,p.addDisposableDomListener)(this.element,"mousedown",K=>this._selectionService.handleMouseDown(K))),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(N.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",K=>this._handleScreenReaderModeOptionChange(K))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",K=>{!this._overviewRulerRenderer&&K&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier2)}bindMouse(){const H=this,W=this.element;function I(q){const he=H._mouseService.getMouseReportCoords(q,H.screenElement);if(!he)return!1;let de,ce;switch(q.overrideType||q.type){case"mousemove":ce=32,q.buttons===void 0?(de=3,q.button!==void 0&&(de=q.button<3?q.button:3)):de=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":ce=0,de=q.button<3?q.button:3;break;case"mousedown":ce=1,de=q.button<3?q.button:3;break;case"wheel":if(H._customWheelEventHandler&&H._customWheelEventHandler(q)===!1||H.viewport.getLinesScrolled(q)===0)return!1;ce=q.deltaY<0?0:1,de=4;break;default:return!1}return!(ce===void 0||de===void 0||de>4)&&H.coreMouseService.triggerMouseEvent({col:he.col,row:he.row,x:he.x,y:he.y,button:de,action:ce,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const K={mouseup:null,wheel:null,mousedrag:null,mousemove:null},J={mouseup:q=>(I(q),q.buttons||(this._document.removeEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.removeEventListener("mousemove",K.mousedrag)),this.cancel(q)),wheel:q=>(I(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&I(q)},mousemove:q=>{q.buttons||I(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?K.mousemove||(W.addEventListener("mousemove",J.mousemove),K.mousemove=J.mousemove):(W.removeEventListener("mousemove",K.mousemove),K.mousemove=null),16&q?K.wheel||(W.addEventListener("wheel",J.wheel,{passive:!1}),K.wheel=J.wheel):(W.removeEventListener("wheel",K.wheel),K.wheel=null),2&q?K.mouseup||(K.mouseup=J.mouseup):(this._document.removeEventListener("mouseup",K.mouseup),K.mouseup=null),4&q?K.mousedrag||(K.mousedrag=J.mousedrag):(this._document.removeEventListener("mousemove",K.mousedrag),K.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(W,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return I(q),K.mouseup&&this._document.addEventListener("mouseup",K.mouseup),K.mousedrag&&this._document.addEventListener("mousemove",K.mousedrag),this.cancel(q)})),this.register((0,p.addDisposableDomListener)(W,"wheel",q=>{if(!K.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const he=this.viewport.getLinesScrolled(q);if(he===0)return;const de=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let ce="";for(let Ae=0;Ae<Math.abs(he);Ae++)ce+=de;return this.coreService.triggerDataEvent(ce,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,p.addDisposableDomListener)(W,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,p.addDisposableDomListener)(W,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(H,W){var I;(I=this._renderService)==null||I.refreshRows(H,W)}updateCursorStyle(H){var W;(W=this._selectionService)!=null&&W.shouldColumnSelect(H)?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(H,W,I=0){var K;I===1?(super.scrollLines(H,W,I),this.refresh(0,this.rows-1)):(K=this.viewport)==null||K.scrollLines(H)}paste(H){(0,c.paste)(H,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(H){this._customKeyEventHandler=H}attachCustomWheelEventHandler(H){this._customWheelEventHandler=H}registerLinkProvider(H){return this.linkifier2.registerLinkProvider(H)}registerCharacterJoiner(H){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const W=this._characterJoinerService.register(H);return this.refresh(0,this.rows-1),W}deregisterCharacterJoiner(H){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(H)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(H){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+H)}registerDecoration(H){return this._decorationService.registerDecoration(H)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(H,W,I){this._selectionService.setSelection(H,W,I)}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 H;(H=this._selectionService)==null||H.clearSelection()}selectAll(){var H;(H=this._selectionService)==null||H.selectAll()}selectLines(H,W){var I;(I=this._selectionService)==null||I.selectLines(H,W)}_keyDown(H){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1)return!1;const W=this.browser.isMac&&this.options.macOptionIsMeta&&H.altKey;if(!W&&!this._compositionHelper.keydown(H))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;W||H.key!=="Dead"&&H.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const I=(0,B.evaluateKeyboardEvent)(H,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(H),I.type===3||I.type===2){const K=this.rows-1;return this.scrollLines(I.type===2?-K:K),this.cancel(H,!0)}return I.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,H)||(I.cancel&&this.cancel(H,!0),!I.key||!!(H.key&&!H.ctrlKey&&!H.altKey&&!H.metaKey&&H.key.length===1&&H.key.charCodeAt(0)>=65&&H.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(I.key!==U.C0.ETX&&I.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:I.key,domEvent:H}),this._showCursor(),this.coreService.triggerDataEvent(I.key,!0),!this.optionsService.rawOptions.screenReaderMode||H.altKey||H.ctrlKey?this.cancel(H,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(H,W){const I=H.isMac&&!this.options.macOptionIsMeta&&W.altKey&&!W.ctrlKey&&!W.metaKey||H.isWindows&&W.altKey&&W.ctrlKey&&!W.metaKey||H.isWindows&&W.getModifierState("AltGraph");return W.type==="keypress"?I:I&&(!W.keyCode||W.keyCode>47)}_keyUp(H){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1||(function(W){return W.keyCode===16||W.keyCode===17||W.keyCode===18}(H)||this.focus(),this.updateCursorStyle(H),this._keyPressHandled=!1)}_keyPress(H){let W;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(H)===!1)return!1;if(this.cancel(H),H.charCode)W=H.charCode;else if(H.which===null||H.which===void 0)W=H.keyCode;else{if(H.which===0||H.charCode===0)return!1;W=H.which}return!(!W||(H.altKey||H.ctrlKey||H.metaKey)&&!this._isThirdLevelShift(this.browser,H)||(W=String.fromCharCode(W),this._onKey.fire({key:W,domEvent:H}),this._showCursor(),this.coreService.triggerDataEvent(W,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(H){if(H.data&&H.inputType==="insertText"&&(!H.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const W=H.data;return this.coreService.triggerDataEvent(W,!0),this.cancel(H),!0}return!1}resize(H,W){H!==this.cols||W!==this.rows?super.resize(H,W):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(H,W){var I,K;(I=this._charSizeService)==null||I.measure(),(K=this.viewport)==null||K.syncScrollArea(!0)}clear(){var H;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 W=1;W<this.rows;W++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(H=this.viewport)==null||H.reset(),this.refresh(0,this.rows-1)}}reset(){var W,I;this.options.rows=this.rows,this.options.cols=this.cols;const H=this._customKeyEventHandler;this._setup(),super.reset(),(W=this._selectionService)==null||W.reset(),this._decorationService.reset(),(I=this.viewport)==null||I.reset(),this._customKeyEventHandler=H,this.refresh(0,this.rows-1)}clearTextureAtlas(){var H;(H=this._renderService)==null||H.clearTextureAtlas()}_reportFocus(){var H;(H=this.element)!=null&&H.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(H){if(this._renderService)switch(H){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const W=this._renderService.dimensions.css.canvas.width.toFixed(0),I=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${I};${W}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const K=this._renderService.dimensions.css.cell.width.toFixed(0),J=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${J};${K}t`)}}cancel(H,W){if(this.options.cancelEvents||W)return H.preventDefault(),H.stopPropagation(),!1}}s.Terminal=X},9924:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(l,c=1e3){this._renderCallback=l,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,c,p){this._rowCount=p,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=u-this._lastRefreshMs,g=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c)}}},1680:function(a,s,l){var c=this&&this.__decorate||function(f,d,v,S){var k,C=arguments.length,R=C<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,d,v,S);else for(var w=f.length-1;w>=0;w--)(k=f[w])&&(R=(C<3?k(R):C>3?k(d,v,R):k(d,v))||R);return C>3&&R&&Object.defineProperty(d,v,R),R},p=this&&this.__param||function(f,d){return function(v,S){d(v,S,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=l(3656),m=l(4725),g=l(8460),x=l(844),y=l(2585);let h=s.Viewport=class extends x.Disposable{constructor(f,d,v,S,k,C,R,w){super(),this._viewportElement=f,this._scrollArea=d,this._bufferService=v,this._optionsService=S,this._charSizeService=k,this._renderService=C,this._coreBrowserService=R,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 g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.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(f){this._viewportElement.style.backgroundColor=f.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(f){if(f)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._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const f=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==f&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=f),this._refreshAnimationFrame=null}syncScrollArea(f=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(f);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(f)}_handleScroll(f){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 d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const f=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(f*(this._smoothScrollState.target-this._smoothScrollState.origin)),f<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(f,d){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&v<this._lastRecordedBufferHeight)||(f.cancelable&&f.preventDefault(),!1)}handleWheel(f){const d=this._getPixelsScrolled(f);return d!==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+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}scrollLines(f){if(f!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=f*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!1})}_getPixelsScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(f,d){var w;let v,S="";const k=[],C=d??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let E=f;E<C;E++){const L=R.get(E);if(!L)continue;const M=(w=R.get(E+1))==null?void 0:w.isWrapped;if(S+=L.translateToString(!M),!M||E===R.length-1){const D=document.createElement("div");D.textContent=S,k.push(D),S.length>0&&(v=D),S=""}}return{bufferElements:k,cursorElement:v}}getLinesScrolled(f){if(f.deltaY===0||f.shiftKey)return 0;let d=this._applyScrollModifier(f.deltaY,f);return f.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):f.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(f,d){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&d.altKey||v==="ctrl"&&d.ctrlKey||v==="shift"&&d.shiftKey?f*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:f*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(f){this._lastTouchY=f.touches[0].pageY}handleTouchMove(f){const d=this._lastTouchY-f.touches[0].pageY;return this._lastTouchY=f.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(f,d))}};s.Viewport=h=c([p(2,y.IBufferService),p(3,y.IOptionsService),p(4,m.ICharSizeService),p(5,m.IRenderService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],h)},3107:function(a,s,l){var c=this&&this.__decorate||function(y,h,f,d){var v,S=arguments.length,k=S<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,h,f,d);else for(var C=y.length-1;C>=0;C--)(v=y[C])&&(k=(S<3?v(k):S>3?v(h,f,k):v(h,f))||k);return S>3&&k&&Object.defineProperty(h,f,k),k},p=this&&this.__param||function(y,h){return function(f,d){h(f,d,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=l(4725),m=l(844),g=l(2585);let x=s.BufferDecorationRenderer=class extends m.Disposable{constructor(y,h,f,d,v){super(),this._screenElement=y,this._bufferService=h,this._coreBrowserService=f,this._decorationService=d,this._renderService=v,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(this._coreBrowserService.onDprChange(()=>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(S=>this._removeDecoration(S))),this.register((0,m.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 y of this._decorationService.decorations)this._renderDecoration(y);this._dimensionsChanged=!1}_renderDecoration(y){this._refreshStyle(y),this._dimensionsChanged&&this._refreshXPosition(y)}_createElement(y){var d;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((d=y==null?void 0:y.options)==null?void 0:d.layer)==="top"),h.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const f=y.options.x??0;return f&&f>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(y,h),h}_refreshStyle(y){const h=y.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let f=this._decorationElements.get(y);f||(f=this._createElement(y),y.element=f,this._decorationElements.set(y,f),this._container.appendChild(f),y.onDispose(()=>{this._decorationElements.delete(y),f.remove()})),f.style.top=h*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(f)}}_refreshXPosition(y,h=y.element){if(!h)return;const f=y.options.x??0;(y.options.anchor||"left")==="right"?h.style.right=f?f*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=f?f*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var h;(h=this._decorationElements.get(y))==null||h.remove(),this._decorationElements.delete(y),y.dispose()}};s.BufferDecorationRenderer=x=c([p(1,g.IBufferService),p(2,u.ICoreBrowserService),p(3,g.IDecorationService),p(4,u.IRenderService)],x)},5871:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.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(l){if(l.options.overviewRulerOptions){for(const c of this._zones)if(c.color===l.options.overviewRulerOptions.color&&c.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,l.marker.line))return;if(this._lineAdjacentToZone(c,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(c,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,c){return c>=l.startBufferLine&&c<=l.endBufferLine}_lineAdjacentToZone(l,c,p){return c>=l.startBufferLine-this._linePadding[p||"full"]&&c<=l.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(l,c){l.startBufferLine=Math.min(l.startBufferLine,c),l.endBufferLine=Math.max(l.endBufferLine,c)}}},5744:function(a,s,l){var c=this&&this.__decorate||function(v,S,k,C){var R,w=arguments.length,E=w<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,k):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,S,k,C);else for(var L=v.length-1;L>=0;L--)(R=v[L])&&(E=(w<3?R(E):w>3?R(S,k,E):R(S,k))||E);return w>3&&E&&Object.defineProperty(S,k,E),E},p=this&&this.__param||function(v,S){return function(k,C){S(k,C,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=l(5871),m=l(4725),g=l(844),x=l(2585),y={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let d=s.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,S,k,C,R,w,E){var M;super(),this._viewportElement=v,this._screenElement=S,this._bufferService=k,this._decorationService=C,this._renderService=R,this._optionsService=w,this._coreBrowserService=E,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var D;(D=this._canvas)==null||D.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(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=v,h.center=S,h.right=v,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=h.left,f.right=h.left+h.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);y.left=S,y.center=S,y.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*y.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._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const S of v)S.position!=="full"&&this._renderColorZone(S);for(const S of v)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(f[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-y[v.position||"full"]/2),h[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[v.position||"full"]))}_queueRefresh(v,S){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=d=c([p(2,x.IBufferService),p(3,x.IDecorationService),p(4,m.IRenderService),p(5,x.IOptionsService),p(6,m.ICoreBrowserService)],d)},2950:function(a,s,l){var c=this&&this.__decorate||function(y,h,f,d){var v,S=arguments.length,k=S<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,f):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,h,f,d);else for(var C=y.length-1;C>=0;C--)(v=y[C])&&(k=(S<3?v(k):S>3?v(h,f,k):v(h,f))||k);return S>3&&k&&Object.defineProperty(h,f,k),k},p=this&&this.__param||function(y,h){return function(f,d){h(f,d,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=l(4725),m=l(2585),g=l(2584);let x=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,h,f,d,v,S){this._textarea=y,this._compositionView=h,this._bufferService=f,this._optionsService=d,this._coreService=v,this._renderService=S,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 h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let f;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,f=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),f.length>0&&this._coreService.triggerDataEvent(f,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,f=h.replace(y,"");this._dataAlreadySent=f,h.length>y.length?this._coreService.triggerDataEvent(f,!0):h.length<y.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):h.length===y.length&&h!==y&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),f=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=f+"px",this._compositionView.style.lineHeight=f+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=x=c([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,m.ICoreService),p(5,u.IRenderService)],x)},9806:(a,s)=>{function l(c,p,u){const m=u.getBoundingClientRect(),g=c.getComputedStyle(u),x=parseInt(g.getPropertyValue("padding-left")),y=parseInt(g.getPropertyValue("padding-top"));return[p.clientX-m.left-x,p.clientY-m.top-y]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=l,s.getCoords=function(c,p,u,m,g,x,y,h,f){if(!x)return;const d=l(c,p,u);return d?(d[0]=Math.ceil((d[0]+(f?y/2:0))/y),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),m+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),g),d):void 0}},9504:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=l(2584);function p(h,f,d,v){const S=h-u(h,d),k=f-u(f,d),C=Math.abs(S-k)-function(R,w,E){let L=0;const M=R-u(R,E),D=w-u(w,E);for(let P=0;P<Math.abs(M-D);P++){const $=m(R,w)==="A"?-1:1,O=E.buffer.lines.get(M+$*P);O!=null&&O.isWrapped&&L++}return L}(h,f,d);return y(C,x(m(h,f),v))}function u(h,f){let d=0,v=f.buffer.lines.get(h),S=v==null?void 0:v.isWrapped;for(;S&&h>=0&&h<f.rows;)d++,v=f.buffer.lines.get(--h),S=v==null?void 0:v.isWrapped;return d}function m(h,f){return h>f?"A":"B"}function g(h,f,d,v,S,k){let C=h,R=f,w="";for(;C!==d||R!==v;)C+=S?1:-1,S&&C>k.cols-1?(w+=k.buffer.translateBufferLineToString(R,!1,h,C),C=0,h=0,R++):!S&&C<0&&(w+=k.buffer.translateBufferLineToString(R,!1,0,h+1),C=k.cols-1,h=C,R--);return w+k.buffer.translateBufferLineToString(R,!1,h,C)}function x(h,f){const d=f?"O":"[";return c.C0.ESC+d+h}function y(h,f){h=Math.floor(h);let d="";for(let v=0;v<h;v++)d+=f;return d}s.moveToCellSequence=function(h,f,d,v){const S=d.buffer.x,k=d.buffer.y;if(!d.buffer.hasScrollback)return function(w,E,L,M,D,P){return p(E,M,D,P).length===0?"":y(g(w,E,w,E-u(E,D),!1,D).length,x("D",P))}(S,k,0,f,d,v)+p(k,f,d,v)+function(w,E,L,M,D,P){let $;$=p(E,M,D,P).length>0?M-u(M,D):E;const O=M,F=function(U,B,A,T,j,z){let N;return N=p(A,T,j,z).length>0?T-u(T,j):B,U<A&&N<=T||U>=A&&N<T?"C":"D"}(w,E,L,M,D,P);return y(g(w,$,L,O,F==="C",D).length,x(F,P))}(S,k,h,f,d,v);let C;if(k===f)return C=S>h?"D":"C",y(Math.abs(S-h),x(C,v));C=k>f?"D":"C";const R=Math.abs(k-f);return y(function(w,E){return E.cols-w}(k>f?h:S,d)+(R-1)*d.cols+1+((k>f?S:h)-1),x(C,v))}},1296:function(a,s,l){var c=this&&this.__decorate||function(P,$,O,F){var U,B=arguments.length,A=B<3?$:F===null?F=Object.getOwnPropertyDescriptor($,O):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(P,$,O,F);else for(var T=P.length-1;T>=0;T--)(U=P[T])&&(A=(B<3?U(A):B>3?U($,O,A):U($,O))||A);return B>3&&A&&Object.defineProperty($,O,A),A},p=this&&this.__param||function(P,$){return function(O,F){$(O,F,P)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=l(3787),m=l(2550),g=l(2223),x=l(6171),y=l(6052),h=l(4725),f=l(8055),d=l(8460),v=l(844),S=l(2585),k="xterm-dom-renderer-owner-",C="xterm-rows",R="xterm-fg-",w="xterm-bg-",E="xterm-focus",L="xterm-selection";let M=1,D=s.DomRenderer=class extends v.Disposable{constructor(P,$,O,F,U,B,A,T,j,z,N,X,re){super(),this._terminal=P,this._document=$,this._element=O,this._screenElement=F,this._viewportElement=U,this._helperContainer=B,this._linkifier2=A,this._charSizeService=j,this._optionsService=z,this._bufferService=N,this._coreBrowserService=X,this._themeService=re,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(C),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.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=T.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(k+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,v.toDisposable)(()=>{this._element.classList.remove(k+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${C} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${C} .xterm-dim { color: ${f.color.multiplyOpacity(P.foreground,.5).css};}`,$+=`${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;}`,$+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% {  border-bottom-style: hidden; }}",$+="@keyframes blink_block_"+this._terminalClass+` { 0% {  background-color: ${P.cursor.css};  color: ${P.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${P.cursor.css}; }}`,$+=`${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[O,F]of P.ansi.entries())$+=`${this._terminalSelector} .${R}${O} { color: ${F.css}; }${this._terminalSelector} .${R}${O}.xterm-dim { color: ${f.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${w}${O} { background-color: ${F.css}; }`;$+=`${this._terminalSelector} .${R}${g.INVERTED_DEFAULT_COLOR} { color: ${f.color.opaque(P.background).css}; }${this._terminalSelector} .${R}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${f.color.multiplyOpacity(f.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${w}${g.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,$){for(let O=this._rowElements.length;O<=$;O++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,$){this._refreshRowElements(P,$),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,$,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,$,O),this.renderRows(0,this._bufferService.rows-1),!P||!$)return;this._selectionRenderModel.update(this._terminal,P,$,O);const F=this._selectionRenderModel.viewportStartRow,U=this._selectionRenderModel.viewportEndRow,B=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(B>=this._bufferService.rows||A<0)return;const T=this._document.createDocumentFragment();if(O){const j=P[0]>$[0];T.appendChild(this._createSelectionElement(B,j?$[0]:P[0],j?P[0]:$[0],A-B+1))}else{const j=F===B?P[0]:0,z=B===U?$[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(B,j,z));const N=A-B-1;if(T.appendChild(this._createSelectionElement(B+1,0,this._bufferService.cols,N)),B!==A){const X=U===A?$[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(A,0,X))}}this._selectionContainer.appendChild(T)}_createSelectionElement(P,$,O,F=1){const U=this._document.createElement("div"),B=$*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(O-$);return B+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-B),U.style.height=F*this.dimensions.css.cell.height+"px",U.style.top=P*this.dimensions.css.cell.height+"px",U.style.left=`${B}px`,U.style.width=`${A}px`,U}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 P of this._rowElements)P.replaceChildren()}renderRows(P,$){const O=this._bufferService.buffer,F=O.ybase+O.y,U=Math.min(O.x,this._bufferService.cols-1),B=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=P;j<=$;j++){const z=j+O.ydisp,N=this._rowElements[j],X=O.lines.get(z);if(!N||!X)break;N.replaceChildren(...this._rowFactory.createRow(X,z,z===F,A,T,U,B,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${k}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,$,O,F,U,B){O<0&&(P=0),F<0&&($=0);const A=this._bufferService.rows-1;O=Math.max(Math.min(O,A),0),F=Math.max(Math.min(F,A),0),U=Math.min(U,this._bufferService.cols);const T=this._bufferService.buffer,j=T.ybase+T.y,z=Math.min(T.x,U-1),N=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let H=O;H<=F;++H){const W=H+T.ydisp,I=this._rowElements[H],K=T.lines.get(W);if(!I||!K)break;I.replaceChildren(...this._rowFactory.createRow(K,W,W===j,X,re,z,N,this.dimensions.css.cell.width,this._widthCache,B?H===O?P:0:-1,B?(H===F?$:U)-1:-1))}}};s.DomRenderer=D=c([p(7,S.IInstantiationService),p(8,h.ICharSizeService),p(9,S.IOptionsService),p(10,S.IBufferService),p(11,h.ICoreBrowserService),p(12,h.IThemeService)],D)},3787:function(a,s,l){var c=this&&this.__decorate||function(C,R,w,E){var L,M=arguments.length,D=M<3?R:E===null?E=Object.getOwnPropertyDescriptor(R,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,R,w,E);else for(var P=C.length-1;P>=0;P--)(L=C[P])&&(D=(M<3?L(D):M>3?L(R,w,D):L(R,w))||D);return M>3&&D&&Object.defineProperty(R,w,D),D},p=this&&this.__param||function(C,R){return function(w,E){R(w,E,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=l(2223),m=l(643),g=l(511),x=l(2585),y=l(8055),h=l(4725),f=l(4269),d=l(6171),v=l(3734);let S=s.DomRendererRowFactory=class{constructor(C,R,w,E,L,M,D){this._document=C,this._characterJoinerService=R,this._optionsService=w,this._coreBrowserService=E,this._coreService=L,this._decorationService=M,this._themeService=D,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,R,w){this._selectionStart=C,this._selectionEnd=R,this._columnSelectMode=w}createRow(C,R,w,E,L,M,D,P,$,O,F){const U=[],B=this._characterJoinerService.getJoinedCharacters(R),A=this._themeService.colors;let T,j=C.getNoBgTrimmedLength();w&&j<M+1&&(j=M+1);let z=0,N="",X=0,re=0,H=0,W=!1,I=0,K=!1,J=0;const q=[],he=O!==-1&&F!==-1;for(let de=0;de<j;de++){C.loadCell(de,this._workCell);let ce=this._workCell.getWidth();if(ce===0)continue;let Ae=!1,je=de,ue=this._workCell;if(B.length>0&&de===B[0][0]){Ae=!0;const ge=B.shift();ue=new f.JoinedCellData(this._workCell,C.translateToString(!0,ge[0],ge[1]),ge[1]-ge[0]),je=ge[1]-1,ce=ue.getWidth()}const Rt=this._isCellInSelection(de,R),kn=w&&de===M,ke=he&&de>=O&&de<=F;let _e=!1;this._decorationService.forEachDecorationAtCell(de,R,void 0,ge=>{_e=!0});let Ce=ue.getChars()||m.WHITESPACE_CELL_CHAR;if(Ce===" "&&(ue.isUnderline()||ue.isOverline())&&(Ce=" "),J=ce*P-$.get(Ce,ue.isBold(),ue.isItalic()),T){if(z&&(Rt&&K||!Rt&&!K&&ue.bg===X)&&(Rt&&K&&A.selectionForeground||ue.fg===re)&&ue.extended.ext===H&&ke===W&&J===I&&!kn&&!Ae&&!_e){ue.isInvisible()?N+=m.WHITESPACE_CELL_CHAR:N+=Ce,z++;continue}z&&(T.textContent=N),T=this._document.createElement("span"),z=0,N=""}else T=this._document.createElement("span");if(X=ue.bg,re=ue.fg,H=ue.extended.ext,W=ke,I=J,K=Rt,Ae&&M>=de&&M<=je&&(M=de),!this._coreService.isCursorHidden&&kn&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&q.push("xterm-cursor-blink"),q.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline")}}if(ue.isBold()&&q.push("xterm-bold"),ue.isItalic()&&q.push("xterm-italic"),ue.isDim()&&q.push("xterm-dim"),N=ue.isInvisible()?m.WHITESPACE_CELL_CHAR:ue.getChars()||m.WHITESPACE_CELL_CHAR,ue.isUnderline()&&(q.push(`xterm-underline-${ue.extended.underlineStyle}`),N===" "&&(N=" "),!ue.isUnderlineColorDefault()))if(ue.isUnderlineColorRGB())T.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(ue.getUnderlineColor()).join(",")})`;else{let ge=ue.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ue.isBold()&&ge<8&&(ge+=8),T.style.textDecorationColor=A.ansi[ge].css}ue.isOverline()&&(q.push("xterm-overline"),N===" "&&(N=" ")),ue.isStrikethrough()&&q.push("xterm-strikethrough"),ke&&(T.style.textDecoration="underline");let oe=ue.getFgColor(),Le=ue.getFgColorMode(),G=ue.getBgColor(),Z=ue.getBgColorMode();const pe=!!ue.isInverse();if(pe){const ge=oe;oe=G,G=ge;const En=Le;Le=Z,Z=En}let me,xe,$e,Te=!1;switch(this._decorationService.forEachDecorationAtCell(de,R,void 0,ge=>{ge.options.layer!=="top"&&Te||(ge.backgroundColorRGB&&(Z=50331648,G=ge.backgroundColorRGB.rgba>>8&16777215,me=ge.backgroundColorRGB),ge.foregroundColorRGB&&(Le=50331648,oe=ge.foregroundColorRGB.rgba>>8&16777215,xe=ge.foregroundColorRGB),Te=ge.options.layer==="top")}),!Te&&Rt&&(me=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,G=me.rgba>>8&16777215,Z=50331648,Te=!0,A.selectionForeground&&(Le=50331648,oe=A.selectionForeground.rgba>>8&16777215,xe=A.selectionForeground)),Te&&q.push("xterm-decoration-top"),Z){case 16777216:case 33554432:$e=A.ansi[G],q.push(`xterm-bg-${G}`);break;case 50331648:$e=y.rgba.toColor(G>>16,G>>8&255,255&G),this._addStyle(T,`background-color:#${k((G>>>0).toString(16),"0",6)}`);break;default:pe?($e=A.foreground,q.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):$e=A.background}switch(me||ue.isDim()&&(me=y.color.multiplyOpacity($e,.5)),Le){case 16777216:case 33554432:ue.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(T,$e,A.ansi[oe],ue,me,void 0)||q.push(`xterm-fg-${oe}`);break;case 50331648:const ge=y.rgba.toColor(oe>>16&255,oe>>8&255,255&oe);this._applyMinimumContrast(T,$e,ge,ue,me,xe)||this._addStyle(T,`color:#${k(oe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(T,$e,A.foreground,ue,me,xe)||pe&&q.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}q.length&&(T.className=q.join(" "),q.length=0),kn||Ae||_e?T.textContent=N:z++,J!==this.defaultSpacing&&(T.style.letterSpacing=`${J}px`),U.push(T),de=je}return T&&z&&(T.textContent=N),U}_applyMinimumContrast(C,R,w,E,L,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const D=this._getContrastCache(E);let P;if(L||M||(P=D.getColor(R.rgba,w.rgba)),P===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);P=y.color.ensureContrastRatio(L||R,M||w,$),D.setColor((L||R).rgba,(M||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,R){C.setAttribute("style",`${C.getAttribute("style")||""}${R};`)}_isCellInSelection(C,R){const w=this._selectionStart,E=this._selectionEnd;return!(!w||!E)&&(this._columnSelectMode?w[0]<=E[0]?C>=w[0]&&R>=w[1]&&C<E[0]&&R<=E[1]:C<w[0]&&R>=w[1]&&C>=E[0]&&R<=E[1]:R>w[1]&&R<E[1]||w[1]===E[1]&&R===w[1]&&C>=w[0]&&C<E[0]||w[1]<E[1]&&R===E[1]&&C<E[0]||w[1]<E[1]&&R===w[1]&&C>=w[0])}};function k(C,R,w){for(;C.length<w;)C=R+C;return C}s.DomRendererRowFactory=S=c([p(1,h.ICharacterJoinerService),p(2,x.IOptionsService),p(3,h.ICoreBrowserService),p(4,x.ICoreService),p(5,x.IDecorationService),p(6,h.IThemeService)],S)},2550:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(l,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=l.createElement("span");p.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const g=l.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[p,u,m,g],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(m),this._container.appendChild(g),c.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(l,c,p,u){l===this._font&&c===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=c,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,c,p){let u=0;if(!c&&!p&&l.length===1&&(u=l.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(l,0);let m=l;c&&(m+="B"),p&&(m+="I");let g=this._holey.get(m);if(g===void 0){let x=0;c&&(x|=1),p&&(x|=2),g=this._measure(l,x),this._holey.set(m,g)}return g}_measure(l,c){const p=this._measureElements[c];return p.textContent=l.repeat(32),p.offsetWidth/32}}},2223:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=l(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(a,s)=>{function l(c){return 57508<=c&&c<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},s.isPowerlineGlyph=l,s.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},s.treatGlyphAsBackgroundColor=function(c){return l(c)||function(p){return 9472<=p&&p<=9631}(c)},s.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}}}},s.computeNextVariantOffset=function(c,p,u=0){return(c-(2*Math.round(p)-u))%(2*Math.round(p))}},6052:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,u,m,g=!1){if(this.selectionStart=u,this.selectionEnd=m,!u||!m||u[0]===m[0]&&u[1]===m[1])return void this.clear();const x=p.buffers.active.ydisp,y=u[1]-x,h=m[1]-x,f=Math.max(y,0),d=Math.min(h,p.rows-1);f>=p.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=y,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=m[0])}isCellSelected(p,u,m){return!!this.hasSelection&&(m-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&m>=this.viewportCappedStartRow&&u<this.endCol&&m<=this.viewportCappedEndRow:u<this.startCol&&m>=this.viewportCappedStartRow&&u>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new l}},456:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(l){this._bufferService=l,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 l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,c=this.selectionEnd;return!(!l||!c)&&(l[1]>c[1]||l[1]===c[1]&&l[0]>c[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var S,k=arguments.length,C=k<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(S=h[R])&&(C=(k<3?S(C):k>3?S(f,d,C):S(f,d))||C);return k>3&&C&&Object.defineProperty(f,d,C),C},p=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=l(2585),m=l(8460),g=l(844);let x=s.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,f,d){super(),this._optionsService=d,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new y(h,f,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};s.CharSizeService=x=c([p(2,u.IOptionsService)],x);class y{constructor(f,d,v){this._document=f,this._parentElement=d,this._optionsService=v,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 f={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return f.width!==0&&f.height!==0&&(this._result.width=f.width/32,this._result.height=Math.ceil(f.height)),this._result}}},4269:function(a,s,l){var c=this&&this.__decorate||function(f,d,v,S){var k,C=arguments.length,R=C<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,d,v,S);else for(var w=f.length-1;w>=0;w--)(k=f[w])&&(R=(C<3?k(R):C>3?k(d,v,R):k(d,v))||R);return C>3&&R&&Object.defineProperty(d,v,R),R},p=this&&this.__param||function(f,d){return function(v,S){d(v,S,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=l(3734),m=l(643),g=l(511),x=l(2585);class y extends u.AttributeData{constructor(d,v,S){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=y;let h=s.CharacterJoinerService=class jb{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(d){const v={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(v),v.id}deregister(d){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===d)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(d);if(!v||v.length===0)return[];const S=[],k=v.translateToString(!0);let C=0,R=0,w=0,E=v.getFg(0),L=v.getBg(0);for(let M=0;M<v.getTrimmedLength();M++)if(v.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==L){if(M-C>1){const D=this._getJoinedRanges(k,w,R,v,C);for(let P=0;P<D.length;P++)S.push(D[P])}C=M,w=R,E=this._workCell.fg,L=this._workCell.bg}R+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const M=this._getJoinedRanges(k,w,R,v,C);for(let D=0;D<M.length;D++)S.push(M[D])}return S}_getJoinedRanges(d,v,S,k,C){const R=d.substring(v,S);let w=[];try{w=this._characterJoiners[0].handler(R)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const L=this._characterJoiners[E].handler(R);for(let M=0;M<L.length;M++)jb._mergeRanges(w,L[M])}catch(L){console.error(L)}return this._stringRangesToCellRanges(w,k,C),w}_stringRangesToCellRanges(d,v,S){let k=0,C=!1,R=0,w=d[k];if(w){for(let E=S;E<this._bufferService.cols;E++){const L=v.getWidth(E),M=v.getString(E).length||m.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!C&&w[0]<=R&&(w[0]=E,C=!0),w[1]<=R){if(w[1]=E,w=d[++k],!w)break;w[0]<=R?(w[0]=E,C=!0):C=!1}R+=M}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let S=!1;for(let k=0;k<d.length;k++){const C=d[k];if(S){if(v[1]<=C[0])return d[k-1][1]=v[1],d;if(v[1]<=C[1])return d[k-1][1]=Math.max(v[1],C[1]),d.splice(k,1),d;d.splice(k,1),k--}else{if(v[1]<=C[0])return d.splice(k,0,v),d;if(v[1]<=C[1])return C[0]=Math.min(v[0],C[0]),d;v[0]<C[1]&&(C[0]=Math.min(v[0],C[0]),S=!0)}}return S?d[d.length-1][1]=v[1]:d.push(v),d}};s.CharacterJoinerService=h=c([p(0,x.IBufferService)],h)},5114:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=l(844),p=l(8460),u=l(3656);class m extends c.Disposable{constructor(y,h,f){super(),this._textarea=y,this._window=h,this.mainDocument=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(d=>this._screenDprMonitor.setWindow(d))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(y){this._window!==y&&(this._window=y,this._onWindowChange.fire(this._window))}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}}s.CoreBrowserService=m;class g extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(y){this._parentWindow=y,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var y;this._outerListener&&((y=this._resolutionMediaMatchList)==null||y.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._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},8934:function(a,s,l){var c=this&&this.__decorate||function(x,y,h,f){var d,v=arguments.length,S=v<3?y:f===null?f=Object.getOwnPropertyDescriptor(y,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(x,y,h,f);else for(var k=x.length-1;k>=0;k--)(d=x[k])&&(S=(v<3?d(S):v>3?d(y,h,S):d(y,h))||S);return v>3&&S&&Object.defineProperty(y,h,S),S},p=this&&this.__param||function(x,y){return function(h,f){y(h,f,x)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=l(4725),m=l(9806);let g=s.MouseService=class{constructor(x,y){this._renderService=x,this._charSizeService=y}getCoords(x,y,h,f,d){return(0,m.getCoords)(window,x,y,h,f,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(x,y){const h=(0,m.getCoordsRelativeToElement)(window,x,y);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};s.MouseService=g=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],g)},3230:function(a,s,l){var c=this&&this.__decorate||function(d,v,S,k){var C,R=arguments.length,w=R<3?v:k===null?k=Object.getOwnPropertyDescriptor(v,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,v,S,k);else for(var E=d.length-1;E>=0;E--)(C=d[E])&&(w=(R<3?C(w):R>3?C(v,S,w):C(v,S))||w);return R>3&&w&&Object.defineProperty(v,S,w),w},p=this&&this.__param||function(d,v){return function(S,k){v(S,k,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=l(6193),m=l(4725),g=l(8460),x=l(844),y=l(7226),h=l(2585);let f=s.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,v,S,k,C,R,w,E){super(),this._rowCount=d,this._charSizeService=k,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((L,M)=>this._renderRows(L,M),w),this.register(this._renderDebouncer),this.register(w.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(R.onResize(()=>this._fullRefresh())),this.register(R.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()})),this.register(S.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()})),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(R.buffer.y,R.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(w.window,v),this.register(w.onWindowChange(L=>this._registerIntersectionObserver(L,v)))}_registerIntersectionObserver(d,v){if("IntersectionObserver"in d){const S=new d.IntersectionObserver(k=>this._handleIntersectionChange(k[k.length-1]),{threshold:0});S.observe(v),this._observerDisposable.value=(0,x.toDisposable)(()=>S.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,v,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,v,this._rowCount))}_renderRows(d,v){this._renderer.value&&(d=Math.min(d,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(d,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:v}),this._onRender.fire({start:d,end:v}),this._isNextRenderRedrawOnly=!0)}resize(d,v){this._rowCount=v,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(v=>this.refreshRows(v.start,v.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,v;this._renderer.value&&((v=(d=this._renderer.value).clearTextureAtlas)==null||v.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(d,v)):this._renderer.value.handleResize(d,v),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,v,S){var k;this._selectionState.start=d,this._selectionState.end=v,this._selectionState.columnSelectMode=S,(k=this._renderer.value)==null||k.handleSelectionChanged(d,v,S)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};s.RenderService=f=c([p(2,h.IOptionsService),p(3,m.ICharSizeService),p(4,h.IDecorationService),p(5,h.IBufferService),p(6,m.ICoreBrowserService),p(7,m.IThemeService)],f)},9312:function(a,s,l){var c=this&&this.__decorate||function(w,E,L,M){var D,P=arguments.length,$=P<3?E:M===null?M=Object.getOwnPropertyDescriptor(E,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(w,E,L,M);else for(var O=w.length-1;O>=0;O--)(D=w[O])&&($=(P<3?D($):P>3?D(E,L,$):D(E,L))||$);return P>3&&$&&Object.defineProperty(E,L,$),$},p=this&&this.__param||function(w,E){return function(L,M){E(L,M,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=l(9806),m=l(9504),g=l(456),x=l(4725),y=l(8460),h=l(844),f=l(6114),d=l(4841),v=l(511),S=l(2585),k=" ",C=new RegExp(k,"g");let R=s.SelectionService=class extends h.Disposable{constructor(w,E,L,M,D,P,$,O,F){super(),this._element=w,this._screenElement=E,this._linkifier=L,this._bufferService=M,this._coreService=D,this._mouseService=P,this._optionsService=$,this._renderService=O,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.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=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.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,M=[];if(this._activeSelectionMode===3){if(w[0]===E[0])return"";const D=w[0]<E[0]?w[0]:E[0],P=w[0]<E[0]?E[0]:w[0];for(let $=w[1];$<=E[1];$++){const O=L.translateBufferLineToString($,!0,D,P);M.push(O)}}else{const D=w[1]===E[1]?E[0]:void 0;M.push(L.translateBufferLineToString(w[1],!0,w[0],D));for(let P=w[1]+1;P<=E[1]-1;P++){const $=L.lines.get(P),O=L.translateBufferLineToString(P,!0);$!=null&&$.isWrapped?M[M.length-1]+=O:M.push(O)}if(w[1]!==E[1]){const P=L.lines.get(E[1]),$=L.translateBufferLineToString(E[1],!0,0,E[0]);P&&P.isWrapped?M[M.length-1]+=$:M.push($)}}return M.map(D=>D.replace(C," ")).join(f.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())),f.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,M=this._model.finalSelectionEnd;return!!(L&&M&&E)&&this._areCoordsInSelection(E,L,M)}isCellInSelection(w,E){const L=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!L||!M)&&this._areCoordsInSelection([w,E],L,M)}_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 D,P;const L=(P=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:P.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(w);return!!M&&(this._selectWordAt(M,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,u.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 f.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&&!(f.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 M=L.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&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 M=(0,m.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!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 M=0;E>=M;M++){const D=w.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:D>1&&E!==M&&(L+=D-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,M=!0){if(w[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,P=D.lines.get(w[1]);if(!P)return;const $=D.translateBufferLineToString(w[1],!1);let O=this._convertViewportColToCharacterIndex(P,w[0]),F=O;const U=w[0]-O;let B=0,A=0,T=0,j=0;if($.charAt(O)===" "){for(;O>0&&$.charAt(O-1)===" ";)O--;for(;F<$.length&&$.charAt(F+1)===" ";)F++}else{let X=w[0],re=w[0];P.getWidth(X)===0&&(B++,X--),P.getWidth(re)===2&&(A++,re++);const H=P.getString(re).length;for(H>1&&(j+=H-1,F+=H-1);X>0&&O>0&&!this._isCharWordSeparator(P.loadCell(X-1,this._workCell));){P.loadCell(X-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(B++,X--):W>1&&(T+=W-1,O-=W-1),O--,X--}for(;re<P.length&&F+1<$.length&&!this._isCharWordSeparator(P.loadCell(re+1,this._workCell));){P.loadCell(re+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,re++):W>1&&(j+=W-1,F+=W-1),F++,re++}}F++;let z=O+U-B+T,N=Math.min(this._bufferService.cols,F-O+B+A-T-j);if(E||$.slice(O,F).trim()!==""){if(L&&z===0&&P.getCodePoint(0)!==32){const X=D.lines.get(w[1]-1);if(X&&P.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(re){const H=this._bufferService.cols-re.start;z-=H,N+=H}}}if(M&&z+N===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const X=D.lines.get(w[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const re=this._getWordAt([0,w[1]+1],!1,!1,!0);re&&(N+=re.length)}}return{start:z,length:N}}}_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,d.getRangeLength)(L,this._bufferService.cols)}};s.SelectionService=R=c([p(3,S.IBufferService),p(4,S.ICoreService),p(5,x.IMouseService),p(6,S.IOptionsService),p(7,x.IRenderService),p(8,x.ICoreBrowserService)],R)},4725:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=l(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(a,s,l){var c=this&&this.__decorate||function(R,w,E,L){var M,D=arguments.length,P=D<3?w:L===null?L=Object.getOwnPropertyDescriptor(w,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(R,w,E,L);else for(var $=R.length-1;$>=0;$--)(M=R[$])&&(P=(D<3?M(P):D>3?M(w,E,P):M(w,E))||P);return D>3&&P&&Object.defineProperty(w,E,P),P},p=this&&this.__param||function(R,w){return function(E,L){w(E,L,R)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),m=l(8055),g=l(8460),x=l(844),y=l(2585),h=m.css.toColor("#ffffff"),f=m.css.toColor("#000000"),d=m.css.toColor("#ffffff"),v=m.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let E=0;E<216;E++){const L=w[E/36%6|0],M=w[E/6%6|0],D=w[E%6];R.push({css:m.channels.toCss(L,M,D),rgba:m.channels.toRgba(L,M,D)})}for(let E=0;E<24;E++){const L=8+10*E;R.push({css:m.channels.toCss(L,L,L),rgba:m.channels.toRgba(L,L,L)})}return R})());let k=s.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:f,cursor:d,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:m.color.blend(f,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:m.color.blend(f,S),ansi:s.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(R={}){const w=this._colors;if(w.foreground=C(R.foreground,h),w.background=C(R.background,f),w.cursor=C(R.cursor,d),w.cursorAccent=C(R.cursorAccent,v),w.selectionBackgroundTransparent=C(R.selectionBackground,S),w.selectionBackgroundOpaque=m.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=C(R.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=m.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=R.selectionForeground?C(R.selectionForeground,m.NULL_COLOR):void 0,w.selectionForeground===m.NULL_COLOR&&(w.selectionForeground=void 0),m.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=m.color.opacity(w.selectionBackgroundTransparent,.3)),m.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=m.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=s.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=C(R.black,s.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=C(R.red,s.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=C(R.green,s.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=C(R.yellow,s.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=C(R.blue,s.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=C(R.magenta,s.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=C(R.cyan,s.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=C(R.white,s.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=C(R.brightBlack,s.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=C(R.brightRed,s.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=C(R.brightGreen,s.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=C(R.brightYellow,s.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=C(R.brightBlue,s.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=C(R.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=C(R.brightCyan,s.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=C(R.brightWhite,s.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const E=Math.min(w.ansi.length-16,R.extendedAnsi.length);for(let L=0;L<E;L++)w.ansi[L+16]=C(R.extendedAnsi[L],s.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(R){R(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(R,w){if(R!==void 0)try{return m.css.toColor(R)}catch{}return w}s.ThemeService=k=c([p(0,y.IOptionsService)],k)},6349:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=l(8460),p=l(844);class u extends p.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.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(g){if(this._maxLength===g)return;const x=new Array(g);for(let y=0;y<Math.min(g,this.length);y++)x[y]=this._array[this._getCyclicIndex(y)];this._array=x,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let x=this._length;x<g;x++)this._array[x]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,x){this._array[this._getCyclicIndex(g)]=x}push(g){this._array[this._getCyclicIndex(this._length)]=g,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(g,x,...y){if(x){for(let h=g;h<this._length-x;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+x)];this._length-=x,this.onDeleteEmitter.fire({index:g,amount:x})}for(let h=this._length-1;h>=g;h--)this._array[this._getCyclicIndex(h+y.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<y.length;h++)this._array[this._getCyclicIndex(g+h)]=y[h];if(y.length&&this.onInsertEmitter.fire({index:g,amount:y.length}),this._length+y.length>this._maxLength){const h=this._length+y.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=y.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,x,y){if(!(x<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+y<0)throw new Error("Cannot shift elements in list beyond index 0");if(y>0){for(let f=x-1;f>=0;f--)this.set(g+f+y,this.get(g+f));const h=g+x+y-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<x;h++)this.set(g+h+y,this.get(g+h))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}s.CircularList=u},1439:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function l(c,p=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const m in c)u[m]=p<=1?c[m]:c[m]&&l(c[m],p-1);return u}},8055:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const c=l(6114);let p=0,u=0,m=0,g=0;var x,y,h,f,d;function v(k){const C=k.toString(16);return C.length<2?"0"+C:C}function S(k,C){return k<C?(C+.05)/(k+.05):(k+.05)/(C+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(k){k.toCss=function(C,R,w,E){return E!==void 0?`#${v(C)}${v(R)}${v(w)}${v(E)}`:`#${v(C)}${v(R)}${v(w)}`},k.toRgba=function(C,R,w,E=255){return(C<<24|R<<16|w<<8|E)>>>0}}(x||(s.channels=x={})),function(k){function C(R,w){return g=Math.round(255*w),[p,u,m]=d.toChannels(R.rgba),{css:x.toCss(p,u,m,g),rgba:x.toRgba(p,u,m,g)}}k.blend=function(R,w){if(g=(255&w.rgba)/255,g===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,L=w.rgba>>16&255,M=w.rgba>>8&255,D=R.rgba>>24&255,P=R.rgba>>16&255,$=R.rgba>>8&255;return p=D+Math.round((E-D)*g),u=P+Math.round((L-P)*g),m=$+Math.round((M-$)*g),{css:x.toCss(p,u,m),rgba:x.toRgba(p,u,m)}},k.isOpaque=function(R){return(255&R.rgba)==255},k.ensureContrastRatio=function(R,w,E){const L=d.ensureContrastRatio(R.rgba,w.rgba,E);if(L)return d.toColor(L>>24&255,L>>16&255,L>>8&255)},k.opaque=function(R){const w=(255|R.rgba)>>>0;return[p,u,m]=d.toChannels(w),{css:x.toCss(p,u,m),rgba:w}},k.opacity=C,k.multiplyOpacity=function(R,w){return g=255&R.rgba,C(R,g*w/255)},k.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}}(y||(s.color=y={})),function(k){let C,R;if(!c.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",R=C.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),m=parseInt(w.slice(3,4).repeat(2),16),d.toColor(p,u,m);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),m=parseInt(w.slice(3,4).repeat(2),16),g=parseInt(w.slice(4,5).repeat(2),16),d.toColor(p,u,m,g);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 p=parseInt(E[1]),u=parseInt(E[2]),m=parseInt(E[3]),g=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),d.toColor(p,u,m,g);if(!C||!R)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=R,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[p,u,m,g]=C.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(p,u,m,g),css:w}}}(h||(s.css=h={})),function(k){function C(R,w,E){const L=R/255,M=w/255,D=E/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}k.relativeLuminance=function(R){return C(R>>16&255,R>>8&255,255&R)},k.relativeLuminance2=C}(f||(s.rgb=f={})),function(k){function C(w,E,L){const M=w>>24&255,D=w>>16&255,P=w>>8&255;let $=E>>24&255,O=E>>16&255,F=E>>8&255,U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));for(;U<L&&($>0||O>0||F>0);)$-=Math.max(0,Math.ceil(.1*$)),O-=Math.max(0,Math.ceil(.1*O)),F-=Math.max(0,Math.ceil(.1*F)),U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));return($<<24|O<<16|F<<8|255)>>>0}function R(w,E,L){const M=w>>24&255,D=w>>16&255,P=w>>8&255;let $=E>>24&255,O=E>>16&255,F=E>>8&255,U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));for(;U<L&&($<255||O<255||F<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),O=Math.min(255,O+Math.ceil(.1*(255-O))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));return($<<24|O<<16|F<<8|255)>>>0}k.blend=function(w,E){if(g=(255&E)/255,g===1)return E;const L=E>>24&255,M=E>>16&255,D=E>>8&255,P=w>>24&255,$=w>>16&255,O=w>>8&255;return p=P+Math.round((L-P)*g),u=$+Math.round((M-$)*g),m=O+Math.round((D-O)*g),x.toRgba(p,u,m)},k.ensureContrastRatio=function(w,E,L){const M=f.relativeLuminance(w>>8),D=f.relativeLuminance(E>>8);if(S(M,D)<L){if(D<M){const O=C(w,E,L),F=S(M,f.relativeLuminance(O>>8));if(F<L){const U=R(w,E,L);return F>S(M,f.relativeLuminance(U>>8))?O:U}return O}const P=R(w,E,L),$=S(M,f.relativeLuminance(P>>8));if($<L){const O=C(w,E,L);return $>S(M,f.relativeLuminance(O>>8))?P:O}return P}},k.reduceLuminance=C,k.increaseLuminance=R,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,E,L,M){return{css:x.toCss(w,E,L,M),rgba:x.toRgba(w,E,L,M)}}}(d||(s.rgba=d={})),s.toPaddedHex=v,s.contrastRatio=S},8969:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=l(844),p=l(2585),u=l(4348),m=l(7866),g=l(744),x=l(7302),y=l(6975),h=l(8460),f=l(1753),d=l(1480),v=l(7994),S=l(9282),k=l(5435),C=l(5981),R=l(2660);let w=!1;class E extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(M=>{var D;(D=this._onScrollApi)==null||D.fire(M.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(M){for(const D in M)this.optionsService.options[D]=M[D]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new x.OptionsService(M)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(f.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.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(D=>{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(D=>{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((D,P)=>this._inputHandler.parse(D,P))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,D){this._writeBuffer.write(M,D)}writeSync(M,D){this._logService.logLevel<=p.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(M,D)}resize(M,D){isNaN(M)||isNaN(D)||(M=Math.max(M,g.MINIMUM_COLS),D=Math.max(D,g.MINIMUM_ROWS),this._bufferService.resize(M,D))}scroll(M,D=!1){this._bufferService.scroll(M,D)}scrollLines(M,D,P){this._bufferService.scrollLines(M,D,P)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const D=M-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(M,D){return this._inputHandler.registerEscHandler(M,D)}registerDcsHandler(M,D){return this._inputHandler.registerDcsHandler(M,D)}registerCsiHandler(M,D){return this._inputHandler.registerCsiHandler(M,D)}registerOscHandler(M,D){return this._inputHandler.registerOscHandler(M,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?M=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const D of M)D.dispose()})}}}s.CoreTerminal=E},8460:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,c){return l(p=>c.fire(p))},s.runAndSubscribe=function(l,c){return c(void 0),l(p=>c(p))}},5435:function(a,s,l){var c=this&&this.__decorate||function(B,A,T,j){var z,N=arguments.length,X=N<3?A:j===null?j=Object.getOwnPropertyDescriptor(A,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(B,A,T,j);else for(var re=B.length-1;re>=0;re--)(z=B[re])&&(X=(N<3?z(X):N>3?z(A,T,X):z(A,T))||X);return N>3&&X&&Object.defineProperty(A,T,X),X},p=this&&this.__param||function(B,A){return function(T,j){A(T,j,B)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=l(2584),m=l(7116),g=l(2015),x=l(844),y=l(482),h=l(8437),f=l(8460),d=l(643),v=l(511),S=l(3734),k=l(2585),C=l(1480),R=l(6242),w=l(6351),E=l(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function D(B,A){if(B>24)return A.setWinLines||!1;switch(B){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var P;(function(B){B[B.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",B[B.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(s.WindowsOptionsReportType=P={}));let $=0;class O extends x.Disposable{getAttrData(){return this._curAttrData}constructor(A,T,j,z,N,X,re,H,W=new g.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=T,this._coreService=j,this._logService=z,this._optionsService=N,this._oscLinkService=X,this._coreMouseService=re,this._unicodeService=H,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new f.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new f.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new f.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new f.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new f.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new f.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new f.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new f.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new f.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new f.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new f.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(I=>this._activeBuffer=I.activeBuffer)),this._parser.setCsiHandlerFallback((I,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(I),params:K.toArray()})}),this._parser.setEscHandlerFallback(I=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(I)})}),this._parser.setExecuteHandlerFallback(I=>{this._logService.debug("Unknown EXECUTE code: ",{code:I})}),this._parser.setOscHandlerFallback((I,K,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:I,action:K,data:J})}),this._parser.setDcsHandlerFallback((I,K,J)=>{K==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(I),action:K,payload:J})}),this._parser.setPrintHandler((I,K,J)=>this.print(I,K,J)),this._parser.registerCsiHandler({final:"@"},I=>this.insertChars(I)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},I=>this.scrollLeft(I)),this._parser.registerCsiHandler({final:"A"},I=>this.cursorUp(I)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},I=>this.scrollRight(I)),this._parser.registerCsiHandler({final:"B"},I=>this.cursorDown(I)),this._parser.registerCsiHandler({final:"C"},I=>this.cursorForward(I)),this._parser.registerCsiHandler({final:"D"},I=>this.cursorBackward(I)),this._parser.registerCsiHandler({final:"E"},I=>this.cursorNextLine(I)),this._parser.registerCsiHandler({final:"F"},I=>this.cursorPrecedingLine(I)),this._parser.registerCsiHandler({final:"G"},I=>this.cursorCharAbsolute(I)),this._parser.registerCsiHandler({final:"H"},I=>this.cursorPosition(I)),this._parser.registerCsiHandler({final:"I"},I=>this.cursorForwardTab(I)),this._parser.registerCsiHandler({final:"J"},I=>this.eraseInDisplay(I,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},I=>this.eraseInDisplay(I,!0)),this._parser.registerCsiHandler({final:"K"},I=>this.eraseInLine(I,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},I=>this.eraseInLine(I,!0)),this._parser.registerCsiHandler({final:"L"},I=>this.insertLines(I)),this._parser.registerCsiHandler({final:"M"},I=>this.deleteLines(I)),this._parser.registerCsiHandler({final:"P"},I=>this.deleteChars(I)),this._parser.registerCsiHandler({final:"S"},I=>this.scrollUp(I)),this._parser.registerCsiHandler({final:"T"},I=>this.scrollDown(I)),this._parser.registerCsiHandler({final:"X"},I=>this.eraseChars(I)),this._parser.registerCsiHandler({final:"Z"},I=>this.cursorBackwardTab(I)),this._parser.registerCsiHandler({final:"`"},I=>this.charPosAbsolute(I)),this._parser.registerCsiHandler({final:"a"},I=>this.hPositionRelative(I)),this._parser.registerCsiHandler({final:"b"},I=>this.repeatPrecedingCharacter(I)),this._parser.registerCsiHandler({final:"c"},I=>this.sendDeviceAttributesPrimary(I)),this._parser.registerCsiHandler({prefix:">",final:"c"},I=>this.sendDeviceAttributesSecondary(I)),this._parser.registerCsiHandler({final:"d"},I=>this.linePosAbsolute(I)),this._parser.registerCsiHandler({final:"e"},I=>this.vPositionRelative(I)),this._parser.registerCsiHandler({final:"f"},I=>this.hVPosition(I)),this._parser.registerCsiHandler({final:"g"},I=>this.tabClear(I)),this._parser.registerCsiHandler({final:"h"},I=>this.setMode(I)),this._parser.registerCsiHandler({prefix:"?",final:"h"},I=>this.setModePrivate(I)),this._parser.registerCsiHandler({final:"l"},I=>this.resetMode(I)),this._parser.registerCsiHandler({prefix:"?",final:"l"},I=>this.resetModePrivate(I)),this._parser.registerCsiHandler({final:"m"},I=>this.charAttributes(I)),this._parser.registerCsiHandler({final:"n"},I=>this.deviceStatus(I)),this._parser.registerCsiHandler({prefix:"?",final:"n"},I=>this.deviceStatusPrivate(I)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},I=>this.softReset(I)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},I=>this.setCursorStyle(I)),this._parser.registerCsiHandler({final:"r"},I=>this.setScrollRegion(I)),this._parser.registerCsiHandler({final:"s"},I=>this.saveCursor(I)),this._parser.registerCsiHandler({final:"t"},I=>this.windowOptions(I)),this._parser.registerCsiHandler({final:"u"},I=>this.restoreCursor(I)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},I=>this.insertColumns(I)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},I=>this.deleteColumns(I)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},I=>this.selectProtected(I)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},I=>this.requestMode(I,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},I=>this.requestMode(I,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new R.OscHandler(I=>(this.setTitle(I),this.setIconName(I),!0))),this._parser.registerOscHandler(1,new R.OscHandler(I=>this.setIconName(I))),this._parser.registerOscHandler(2,new R.OscHandler(I=>this.setTitle(I))),this._parser.registerOscHandler(4,new R.OscHandler(I=>this.setOrReportIndexedColor(I))),this._parser.registerOscHandler(8,new R.OscHandler(I=>this.setHyperlink(I))),this._parser.registerOscHandler(10,new R.OscHandler(I=>this.setOrReportFgColor(I))),this._parser.registerOscHandler(11,new R.OscHandler(I=>this.setOrReportBgColor(I))),this._parser.registerOscHandler(12,new R.OscHandler(I=>this.setOrReportCursorColor(I))),this._parser.registerOscHandler(104,new R.OscHandler(I=>this.restoreIndexedColor(I))),this._parser.registerOscHandler(110,new R.OscHandler(I=>this.restoreFgColor(I))),this._parser.registerOscHandler(111,new R.OscHandler(I=>this.restoreBgColor(I))),this._parser.registerOscHandler(112,new R.OscHandler(I=>this.restoreCursorColor(I))),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 I in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:I},()=>this.selectCharset("("+I)),this._parser.registerEscHandler({intermediates:")",final:I},()=>this.selectCharset(")"+I)),this._parser.registerEscHandler({intermediates:"*",final:I},()=>this.selectCharset("*"+I)),this._parser.registerEscHandler({intermediates:"+",final:I},()=>this.selectCharset("+"+I)),this._parser.registerEscHandler({intermediates:"-",final:I},()=>this.selectCharset("-"+I)),this._parser.registerEscHandler({intermediates:".",final:I},()=>this.selectCharset("."+I)),this._parser.registerEscHandler({intermediates:"/",final:I},()=>this.selectCharset("/"+I));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(I=>(this._logService.error("Parsing error: ",I),I)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler((I,K)=>this.requestStatusString(I,K)))}_preserveStack(A,T,j,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=j,this._parseStack.position=z}_logSlowResolvingAsync(A){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([A,new Promise((T,j)=>setTimeout(()=>j("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,T){let j,z=this._activeBuffer.x,N=this._activeBuffer.y,X=0;const re=this._parseStack.paused;if(re){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(j),j;z=this._parseStack.cursorStartX,N=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>M&&(X=this._parseStack.position+M)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,I=>String.fromCharCode(I)).join("")}"`),typeof A=="string"?A.split("").map(I=>I.charCodeAt(0)):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(A.length,M))),re||this._dirtyRowTracker.clearRange(),A.length>M)for(let I=X;I<A.length;I+=M){const K=I+M<A.length?I+M:A.length,J=typeof A=="string"?this._stringDecoder.decode(A.substring(I,K),this._parseBuffer):this._utf8Decoder.decode(A.subarray(I,K),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,J))return this._preserveStack(z,N,J,I),this._logSlowResolvingAsync(j),j}else if(!re){const I=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,I))return this._preserveStack(z,N,I,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===z&&this._activeBuffer.y===N||this._onCursorMove.fire();const H=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(H,this._bufferService.rows-1))}print(A,T,j){let z,N;const X=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,H=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,I=this._coreService.modes.insertMode,K=this._curAttrData;let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-T>0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let q=this._parser.precedingJoinState;for(let he=T;he<j;++he){if(z=A[he],z<127&&X){const je=X[String.fromCharCode(z)];je&&(z=je.charCodeAt(0))}const de=this._unicodeService.charProperties(z,q);N=C.UnicodeService.extractWidth(de);const ce=C.UnicodeService.extractShouldJoin(de),Ae=ce?C.UnicodeService.extractWidth(q):0;if(q=de,re&&this._onA11yChar.fire((0,y.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+N-Ae>H){if(W){const je=J;let ue=this._activeBuffer.x-Ae;for(this._activeBuffer.x=Ae,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),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ae>0&&J instanceof h.BufferLine&&J.copyCellsFrom(je,ue,0,Ae,!1);ue<H;)je.setCellFromCodepoint(ue++,0,1,K)}else if(this._activeBuffer.x=H-1,N===2)continue}if(ce&&this._activeBuffer.x){const je=J.getWidth(this._activeBuffer.x-1)?1:2;J.addCodepointToCell(this._activeBuffer.x-je,z,N);for(let ue=N-Ae;--ue>=0;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(I&&(J.insertCells(this._activeBuffer.x,N-Ae,this._activeBuffer.getNullCell(K)),J.getWidth(H-1)===2&&J.setCellFromCodepoint(H-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,K)),J.setCellFromCodepoint(this._activeBuffer.x++,z,N,K),N>0)for(;--N;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=q,this._activeBuffer.x<H&&j-T>0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,T){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,T):this._parser.registerCsiHandler(A,j=>!D(j.params[0],this._optionsService.rawOptions.windowOptions)||T(j))}registerDcsHandler(A,T){return this._parser.registerDcsHandler(A,new w.DcsHandler(T))}registerEscHandler(A,T){return this._parser.registerEscHandler(A,T)}registerOscHandler(A,T){return this._parser.registerOscHandler(A,new R.OscHandler(T))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=A,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+T)}cursorUp(A){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const T=A.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=A.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=A.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const T=A.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,T,j,z=!1,N=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);X.replaceCells(T,j,this._activeBuffer.getNullCell(this._eraseAttrData()),N),z&&(X.isWrapped=!1)}_resetBufferLine(A,T=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),j.isWrapped=!1)}eraseInDisplay(A,T=!1){let j;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);j<this._bufferService.rows;j++)this._resetBufferLine(j,T);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,T);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(A,T=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let T=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,N=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;T--;)this._activeBuffer.lines.splice(N-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(A){this._restrictCursor();let T=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;T--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(A){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let T=A.params[0]||1;for(;T--;)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(A){let T=A.params[0]||1;for(;T--;)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(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=A.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=A.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=A.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=A.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);z.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const T=this._parser.precedingJoinState;if(!T)return!0;const j=A.params[0]||1,z=C.UnicodeService.extractWidth(T),N=this._activeBuffer.x-z,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(N),re=new Uint32Array(X.length*j);let H=0;for(let I=0;I<X.length;){const K=X.codePointAt(I)||0;re[H++]=K,I+=K>65535?2:1}let W=H;for(let I=1;I<j;++I)re.copyWithin(W,0,H),W+=H;return this.print(re,0,W),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let T=0;T<A.length;T++)switch(A.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let T=0;T<A.length;T++)switch(A.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(A){for(let T=0;T<A.length;T++)switch(A.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let T=0;T<A.length;T++)switch(A.params[T]){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(),A.params[T]===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(A,T){const j=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:N}=this._coreMouseService,X=this._coreService,{buffers:re,cols:H}=this._bufferService,{active:W,alt:I}=re,K=this._optionsService.rawOptions,J=ce=>ce?1:2,q=A.params[0];return he=q,de=T?q===2?4:q===4?J(X.modes.insertMode):q===12?3:q===20?J(K.convertEol):0:q===1?J(j.applicationCursorKeys):q===3?K.windowOptions.setWinLines?H===80?2:H===132?1:0:0:q===6?J(j.origin):q===7?J(j.wraparound):q===8?3:q===9?J(z==="X10"):q===12?J(K.cursorBlink):q===25?J(!X.isCursorHidden):q===45?J(j.reverseWraparound):q===66?J(j.applicationKeypad):q===67?4:q===1e3?J(z==="VT200"):q===1002?J(z==="DRAG"):q===1003?J(z==="ANY"):q===1004?J(j.sendFocus):q===1005?4:q===1006?J(N==="SGR"):q===1015?4:q===1016?J(N==="SGR_PIXELS"):q===1048?1:q===47||q===1047||q===1049?J(W===I):q===2004?J(j.bracketedPasteMode):0,X.triggerDataEvent(`${u.C0.ESC}[${T?"":"?"}${he};${de}$y`),!0;var he,de}_updateAttrColor(A,T,j,z,N){return T===2?(A|=50331648,A&=-16777216,A|=S.AttributeData.fromColorRGB([j,z,N])):T===5&&(A&=-50331904,A|=33554432|255&j),A}_extractColor(A,T,j){const z=[0,0,-1,0,0,0];let N=0,X=0;do{if(z[X+N]=A.params[T+X],A.hasSubParams(T+X)){const re=A.getSubParams(T+X);let H=0;do z[1]===5&&(N=1),z[X+H+1+N]=re[H];while(++H<re.length&&H+X+1+N<z.length);break}if(z[1]===5&&X+N>=2||z[1]===2&&X+N>=5)break;z[1]&&(N=1)}while(++X+T<A.length&&X+N<z.length);for(let re=2;re<z.length;++re)z[re]===-1&&(z[re]=0);switch(z[0]){case 38:j.fg=this._updateAttrColor(j.fg,z[1],z[3],z[4],z[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,z[1],z[3],z[4],z[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,z[1],z[3],z[4],z[5])}return X}_processUnderline(A,T){T.extended=T.extended.clone(),(!~A||A>5)&&(A=1),T.extended.underlineStyle=A,T.fg|=268435456,A===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(A){A.fg=h.DEFAULT_ATTR_DATA.fg,A.bg=h.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=A.length;let j;const z=this._curAttrData;for(let N=0;N<T;N++)j=A.params[N],j>=30&&j<=37?(z.fg&=-50331904,z.fg|=16777216|j-30):j>=40&&j<=47?(z.bg&=-50331904,z.bg|=16777216|j-40):j>=90&&j<=97?(z.fg&=-50331904,z.fg|=16777224|j-90):j>=100&&j<=107?(z.bg&=-50331904,z.bg|=16777224|j-100):j===0?this._processSGR0(z):j===1?z.fg|=134217728:j===3?z.bg|=67108864:j===4?(z.fg|=268435456,this._processUnderline(A.hasSubParams(N)?A.getSubParams(N)[0]:1,z)):j===5?z.fg|=536870912:j===7?z.fg|=67108864:j===8?z.fg|=1073741824:j===9?z.fg|=2147483648:j===2?z.bg|=134217728:j===21?this._processUnderline(2,z):j===22?(z.fg&=-134217729,z.bg&=-134217729):j===23?z.bg&=-67108865:j===24?(z.fg&=-268435457,this._processUnderline(0,z)):j===25?z.fg&=-536870913:j===27?z.fg&=-67108865:j===28?z.fg&=-1073741825:j===29?z.fg&=2147483647:j===39?(z.fg&=-67108864,z.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):j===49?(z.bg&=-67108864,z.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?N+=this._extractColor(A,N,z):j===53?z.bg|=1073741824:j===55?z.bg&=-1073741825:j===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):j===100?(z.fg&=-67108864,z.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${T};${j}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const T=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${T};${j}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.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(A){const T=A.params[0]||1;switch(T){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 j=T%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(A){const T=A.params[0]||1;let j;return(A.length<2||(j=A.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(A){if(!D(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const T=[],j=A.split(";");for(;j.length>1;){const z=j.shift(),N=j.shift();if(/^\d+$/.exec(z)){const X=parseInt(z);if(U(X))if(N==="?")T.push({type:0,index:X});else{const re=(0,E.parseColor)(N);re&&T.push({type:1,index:X,color:re})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(A){const T=A.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(A,T){this._getCurrentLinkId()&&this._finishHyperlink();const j=A.split(":");let z;const N=j.findIndex(X=>X.startsWith("id="));return N!==-1&&(z=j[N].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,T){const j=A.split(";");for(let z=0;z<j.length&&!(T>=this._specialColors.length);++z,++T)if(j[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const N=(0,E.parseColor)(j[z]);N&&this._onColor.fire([{type:1,index:this._specialColors[T],color:N}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const T=[],j=A.split(";");for(let z=0;z<j.length;++z)if(/^\d+$/.exec(j[z])){const N=parseInt(j[z]);U(N)&&T.push({type:2,index:N})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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,m.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(L[A[0]],m.CHARSETS[A[1]]||m.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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new v.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const j=this._activeBuffer.ybase+this._activeBuffer.y+T,z=this._activeBuffer.lines.get(j);z&&(z.fill(A),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,T){const j=this._bufferService.buffer,z=this._optionsService.rawOptions;return(N=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${N}${u.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,T){this._dirtyRowTracker.markRangeDirty(A,T)}}s.InputHandler=O;let F=class{constructor(B){this._bufferService=B,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(B){B<this.start?this.start=B:B>this.end&&(this.end=B)}markRangeDirty(B,A){B>A&&($=B,B=A,A=$),B<this.start&&(this.start=B),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(B){return 0<=B&&B<256}F=c([p(0,k.IBufferService)],F)},844:(a,s)=>{function l(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=l,s.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(p,u,m){this._data[p]||(this._data[p]={}),this._data[p][u]=m}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=l,s.FourKeyMap=class{constructor(){this._data=new l}set(c,p,u,m,g){this._data.get(c,p)||this._data.set(c,p,new l),this._data.get(c,p).set(u,m,g)}get(c,p,u,m){var g;return(g=this._data.get(c,p))==null?void 0:g.get(u,m)}clear(){this._data.clear()}}},6114:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u";const l=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=l.includes("Firefox"),s.isLegacyEdge=l.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(l),s.getSafariVersion=function(){if(!s.isSafari)return 0;const p=l.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let l=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(l=this._search(this._getKey(c)),this._array.splice(l,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const p=this._getKey(c);if(p===void 0||(l=this._search(p),l===-1)||this._getKey(this._array[l])!==p)return!1;do if(this._array[l]===c)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===p);return!1}*getKeyIterator(c){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===c)}forEachByKey(c,p){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do p(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let p=0,u=this._array.length-1;for(;u>=p;){let m=p+u>>1;const g=this._getKey(this._array[m]);if(g>c)u=m-1;else{if(!(g<c)){for(;m>0&&this._getKey(this._array[m-1])===c;)m--;return m}p=m+1}}return p}}},7226:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=l(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let x=0,y=0,h=g.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),y=Math.max(x,y),f=g.timeRemaining(),1.5*y>f)return h-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-x))}ms`),void this._start();h=f}this.clear()}}class u extends p{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const x=Date.now()+g;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=l(643);s.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),m=u==null?void 0:u.get(p.cols-1),g=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);g&&m&&(g.isWrapped=m[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&m[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,m=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=m}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=l(6349),p=l(7226),u=l(3734),m=l(8437),g=l(4634),x=l(511),y=l(643),h=l(4863),f=l(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(d,v,S){this._hasScrollback=d,this._optionsService=v,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=f.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,v){return new m.BufferLine(this._bufferService.cols,this.getNullCell(d),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const v=d+this._optionsService.rawOptions.scrollback;return v>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:v}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=m.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,v){const S=this.getNullCell(m.DEFAULT_ATTR_DATA);let k=0;const C=this._getCorrectBufferLength(v);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<d)for(let w=0;w<this.lines.length;w++)k+=+this.lines.get(w).resize(d,S);let R=0;if(this._rows<v)for(let w=this._rows;w<v;w++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(d,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(d,S)));else for(let w=this._rows;w>v;w--)this.lines.length>v+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,d-1),this.y=Math.min(this.y,v-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(d,v),this._cols>d))for(let R=0;R<this.lines.length;R++)k+=+this.lines.get(R).resize(d,S);this._cols=d,this._rows=v,this._memoryCleanupQueue.clear(),k>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,v){this._cols!==d&&(d>this._cols?this._reflowLarger(d,v):this._reflowSmaller(d,v))}_reflowLarger(d,v){const S=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(S.length>0){const k=(0,g.reflowLargerCreateNewLayout)(this.lines,S);(0,g.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(d,v,k.countRemoved)}}_reflowLargerAdjustViewport(d,v,S){const k=this.getNullCell(m.DEFAULT_ATTR_DATA);let C=S;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new m.BufferLine(d,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(d,v){const S=this.getNullCell(m.DEFAULT_ATTR_DATA),k=[];let C=0;for(let R=this.lines.length-1;R>=0;R--){let w=this.lines.get(R);if(!w||!w.isWrapped&&w.getTrimmedLength()<=d)continue;const E=[w];for(;w.isWrapped&&R>0;)w=this.lines.get(--R),E.unshift(w);const L=this.ybase+this.y;if(L>=R&&L<R+E.length)continue;const M=E[E.length-1].getTrimmedLength(),D=(0,g.reflowSmallerGetNewLineLengths)(E,this._cols,d),P=D.length-E.length;let $;$=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 O=[];for(let j=0;j<P;j++){const z=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);O.push(z)}O.length>0&&(k.push({start:R+E.length+C,newLines:O}),C+=O.length),E.push(...O);let F=D.length-1,U=D[F];U===0&&(F--,U=D[F]);let B=E.length-P-1,A=M;for(;B>=0;){const j=Math.min(A,U);if(E[F]===void 0)break;if(E[F].copyCellsFrom(E[B],A-j,U-j,j,!0),U-=j,U===0&&(F--,U=D[F]),A-=j,A===0){B--;const z=Math.max(B,0);A=(0,g.getWrappedLineTrimmedLength)(E,z,this._cols)}}for(let j=0;j<E.length;j++)D[j]<d&&E[j].setCell(D[j],S);let T=P-$;for(;T-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+v-1)}if(k.length>0){const R=[],w=[];for(let F=0;F<this.lines.length;F++)w.push(this.lines.get(F));const E=this.lines.length;let L=E-1,M=0,D=k[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let P=0;for(let F=Math.min(this.lines.maxLength-1,E+C-1);F>=0;F--)if(D&&D.start>L+P){for(let U=D.newLines.length-1;U>=0;U--)this.lines.set(F--,D.newLines[U]);F++,R.push({index:L+1,amount:D.newLines.length}),P+=D.newLines.length,D=k[++M]}else this.lines.set(F,w[L--]);let $=0;for(let F=R.length-1;F>=0;F--)R[F].index+=$,this.lines.onInsertEmitter.fire(R[F]),$+=R[F].amount;const O=Math.max(0,E+C-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(d,v,S=0,k){const C=this.lines.get(d);return C?C.translateToString(v,S,k):""}getWrappedRangeForLine(d){let v=d,S=d;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:v,last:S}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===d&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const v=new h.Marker(d);return this.markers.push(v),v.register(this.lines.onTrim(S=>{v.line-=S,v.line<0&&v.dispose()})),v.register(this.lines.onInsert(S=>{v.line>=S.index&&(v.line+=S.amount)})),v.register(this.lines.onDelete(S=>{v.line>=S.index&&v.line<S.index+S.amount&&v.dispose(),v.line>S.index&&(v.line-=S.amount)})),v.register(v.onDispose(()=>this._removeMarker(v))),v}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=l(3734),p=l(511),u=l(643),m=l(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let g=0;class x{constructor(h,f,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const v=f||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let S=0;S<h;++S)this.setCell(S,v);this.length=h}get(h){const f=this._data[3*h+0],d=2097151&f;return[this._data[3*h+1],2097152&f?this._combined[h]:d?(0,m.stringFromCodePoint)(d):"",f>>22,2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):d]}set(h,f){this._data[3*h+1]=f[u.CHAR_DATA_ATTR_INDEX],f[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=f[1],this._data[3*h+0]=2097152|h|f[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&f}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const f=this._data[3*h+0];return 2097152&f?this._combined[h]:2097151&f?(0,m.stringFromCodePoint)(2097151&f):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,f){return g=3*h,f.content=this._data[g+0],f.fg=this._data[g+1],f.bg=this._data[g+2],2097152&f.content&&(f.combinedData=this._combined[h]),268435456&f.bg&&(f.extended=this._extendedAttrs[h]),f}setCell(h,f){2097152&f.content&&(this._combined[h]=f.combinedData),268435456&f.bg&&(this._extendedAttrs[h]=f.extended),this._data[3*h+0]=f.content,this._data[3*h+1]=f.fg,this._data[3*h+2]=f.bg}setCellFromCodepoint(h,f,d,v){268435456&v.bg&&(this._extendedAttrs[h]=v.extended),this._data[3*h+0]=f|d<<22,this._data[3*h+1]=v.fg,this._data[3*h+2]=v.bg}addCodepointToCell(h,f,d){let v=this._data[3*h+0];2097152&v?this._combined[h]+=(0,m.stringFromCodePoint)(f):2097151&v?(this._combined[h]=(0,m.stringFromCodePoint)(2097151&v)+(0,m.stringFromCodePoint)(f),v&=-2097152,v|=2097152):v=f|4194304,d&&(v&=-12582913,v|=d<<22),this._data[3*h+0]=v}insertCells(h,f,d){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length-h){const v=new p.CellData;for(let S=this.length-h-f-1;S>=0;--S)this.setCell(h+f+S,this.loadCell(h+S,v));for(let S=0;S<f;++S)this.setCell(h+S,d)}else for(let v=h;v<this.length;++v)this.setCell(v,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(h,f,d){if(h%=this.length,f<this.length-h){const v=new p.CellData;for(let S=0;S<this.length-h-f;++S)this.setCell(h+S,this.loadCell(h+f+S,v));for(let S=this.length-f;S<this.length;++S)this.setCell(S,d)}else for(let v=h;v<this.length;++v)this.setCell(v,d);h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodepoint(h,0,1,d)}replaceCells(h,f,d,v=!1){if(v)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&!this.isProtected(f)&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.isProtected(h)||this.setCell(h,d),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),f<this.length&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f,0,1,d);h<f&&h<this.length;)this.setCell(h++,d)}resize(h,f){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const v=new Uint32Array(d);v.set(this._data),this._data=v}for(let v=this.length;v<h;++v)this.setCell(v,f)}else{this._data=this._data.subarray(0,d);const v=Object.keys(this._combined);for(let k=0;k<v.length;k++){const C=parseInt(v[k],10);C>=h&&delete this._combined[C]}const S=Object.keys(this._extendedAttrs);for(let k=0;k<S.length;k++){const C=parseInt(S[k],10);C>=h&&delete this._extendedAttrs[C]}}return this.length=h,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,f=!1){if(f)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,h);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const f in h._combined)this._combined[f]=h._combined[f];this._extendedAttrs={};for(const f in h._extendedAttrs)this._extendedAttrs[f]=h._extendedAttrs[f];this.isWrapped=h.isWrapped}clone(){const h=new x(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const f in this._combined)h._combined[f]=this._combined[f];for(const f in this._extendedAttrs)h._extendedAttrs[f]=this._extendedAttrs[f];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,f,d,v,S){const k=h._data;if(S)for(let R=v-1;R>=0;R--){for(let w=0;w<3;w++)this._data[3*(d+R)+w]=k[3*(f+R)+w];268435456&k[3*(f+R)+2]&&(this._extendedAttrs[d+R]=h._extendedAttrs[f+R])}else for(let R=0;R<v;R++){for(let w=0;w<3;w++)this._data[3*(d+R)+w]=k[3*(f+R)+w];268435456&k[3*(f+R)+2]&&(this._extendedAttrs[d+R]=h._extendedAttrs[f+R])}const C=Object.keys(h._combined);for(let R=0;R<C.length;R++){const w=parseInt(C[R],10);w>=f&&(this._combined[w-f+d]=h._combined[w])}}translateToString(h,f,d,v){f=f??0,d=d??this.length,h&&(d=Math.min(d,this.getTrimmedLength())),v&&(v.length=0);let S="";for(;f<d;){const k=this._data[3*f+0],C=2097151&k,R=2097152&k?this._combined[f]:C?(0,m.stringFromCodePoint)(C):u.WHITESPACE_CELL_CHAR;if(S+=R,v)for(let w=0;w<R.length;++w)v.push(f);f+=k>>22||1}return v&&v.push(f),S}}s.BufferLine=x},4841:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(l,c){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return c*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(a,s)=>{function l(c,p,u){if(p===c.length-1)return c[p].getTrimmedLength();const m=!c[p].hasContent(u-1)&&c[p].getWidth(u-1)===1,g=c[p+1].getWidth(0)===2;return m&&g?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,p,u,m,g){const x=[];for(let y=0;y<c.length-1;y++){let h=y,f=c.get(++h);if(!f.isWrapped)continue;const d=[c.get(y)];for(;h<c.length&&f.isWrapped;)d.push(f),f=c.get(++h);if(m>=y&&m<h){y+=d.length-1;continue}let v=0,S=l(d,v,p),k=1,C=0;for(;k<d.length;){const w=l(d,k,p),E=w-C,L=u-S,M=Math.min(E,L);d[v].copyCellsFrom(d[k],C,S,M,!1),S+=M,S===u&&(v++,S=0),C+=M,C===w&&(k++,C=0),S===0&&v!==0&&d[v-1].getWidth(u-1)===2&&(d[v].copyCellsFrom(d[v-1],u-1,S++,1,!1),d[v-1].setCell(u-1,g))}d[v].replaceCells(S,u,g);let R=0;for(let w=d.length-1;w>0&&(w>v||d[w].getTrimmedLength()===0);w--)R++;R>0&&(x.push(y+d.length-R),x.push(R)),y+=d.length-1}return x},s.reflowLargerCreateNewLayout=function(c,p){const u=[];let m=0,g=p[m],x=0;for(let y=0;y<c.length;y++)if(g===y){const h=p[++m];c.onDeleteEmitter.fire({index:y-x,amount:h}),y+=h-1,x+=h,g=p[++m]}else u.push(y);return{layout:u,countRemoved:x}},s.reflowLargerApplyNewLayout=function(c,p){const u=[];for(let m=0;m<p.length;m++)u.push(c.get(p[m]));for(let m=0;m<u.length;m++)c.set(m,u[m]);c.length=p.length},s.reflowSmallerGetNewLineLengths=function(c,p,u){const m=[],g=c.map((f,d)=>l(c,d,p)).reduce((f,d)=>f+d);let x=0,y=0,h=0;for(;h<g;){if(g-h<u){m.push(g-h);break}x+=u;const f=l(c,y,p);x>f&&(x-=f,y++);const d=c[y].getWidth(x-1)===2;d&&x--;const v=d?u-1:u;m.push(v),h+=v}return m},s.getWrappedLineTrimmedLength=l},5295:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=l(8460),p=l(844),u=l(9092);class m extends p.Disposable{constructor(x,y){super(),this._optionsService=x,this._bufferService=y,this._onBufferActivate=this.register(new c.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,y){this._normal.resize(x,y),this._alt.resize(x,y),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}s.BufferSet=m},511:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=l(482),p=l(643),u=l(3734);class m extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const y=new m;return y.setFromCharData(x),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(x[p.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(x[p.CHAR_DATA_CHAR_INDEX].length===2){const h=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|x[p.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[p.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=x[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=m},643:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=l(8460),p=l(844);class u{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}s.Marker=u,u._nextId=1},7116:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.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:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,s)=>{var l,c,p;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT="	",u.LF=`
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(l||(s.C0=l={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(c||(s.C1=c={})),function(u){u.ST=`${l.ESC}\\`}(p||(s.C1_ESCAPED=p={}))},7399:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=l(2584),p={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:["'",'"']};s.evaluateKeyboardEvent=function(u,m,g,x){const y={type:0,cancel:!1,key:void 0},h=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?y.key=m?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?y.key=m?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?y.key=m?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(y.key=m?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(u.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,u.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(u.metaKey)break;h?(y.key=c.C0.ESC+"[1;"+(h+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(g?"b":"[1;5D"))):y.key=m?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;h?(y.key=c.C0.ESC+"[1;"+(h+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(g?"f":"[1;5C"))):y.key=m?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;h?(y.key=c.C0.ESC+"[1;"+(h+1)+"A",g||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=m?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;h?(y.key=c.C0.ESC+"[1;"+(h+1)+"B",g||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=m?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=h?c.C0.ESC+"[3;"+(h+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=h?c.C0.ESC+"[1;"+(h+1)+"H":m?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=h?c.C0.ESC+"[1;"+(h+1)+"F":m?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?y.type=2:u.ctrlKey?y.key=c.C0.ESC+"[5;"+(h+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?y.type=3:u.ctrlKey?y.key=c.C0.ESC+"[6;"+(h+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=h?c.C0.ESC+"[1;"+(h+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=h?c.C0.ESC+"[1;"+(h+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=h?c.C0.ESC+"[1;"+(h+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=h?c.C0.ESC+"[1;"+(h+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=h?c.C0.ESC+"[15;"+(h+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=h?c.C0.ESC+"[17;"+(h+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=h?c.C0.ESC+"[18;"+(h+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=h?c.C0.ESC+"[19;"+(h+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=h?c.C0.ESC+"[20;"+(h+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=h?c.C0.ESC+"[21;"+(h+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=h?c.C0.ESC+"[23;"+(h+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=h?c.C0.ESC+"[24;"+(h+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(g&&!x||!u.altKey||u.metaKey)!g||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?y.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(y.key=c.C0.US),u.key==="@"&&(y.key=c.C0.NUL)):u.keyCode===65&&(y.type=1);else{const f=p[u.keyCode],d=f==null?void 0:f[u.shiftKey?1:0];if(d)y.key=c.C0.ESC+d;else if(u.keyCode>=65&&u.keyCode<=90){const v=u.ctrlKey?u.keyCode-64:u.keyCode+32;let S=String.fromCharCode(v);u.shiftKey&&(S=S.toUpperCase()),y.key=c.C0.ESC+S}else if(u.keyCode===32)y.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let v=u.code.slice(3,4);u.shiftKey||(v=v.toLowerCase()),y.key=c.C0.ESC+v,y.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?y.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?y.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?y.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?y.key=c.C0.DEL:u.keyCode===219?y.key=c.C0.ESC:u.keyCode===220?y.key=c.C0.FS:u.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},s.utf32ToString=function(l,c=0,p=l.length){let u="";for(let m=c;m<p;++m){let g=l[m];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const p=l.length;if(!p)return 0;let u=0,m=0;if(this._interim){const g=l.charCodeAt(m++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=m;g<p;++g){const x=l.charCodeAt(g);if(55296<=x&&x<=56319){if(++g>=p)return this._interim=x,u;const y=l.charCodeAt(g);56320<=y&&y<=57343?c[u++]=1024*(x-55296)+y-56320+65536:(c[u++]=x,c[u++]=y)}else x!==65279&&(c[u++]=x)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const p=l.length;if(!p)return 0;let u,m,g,x,y=0,h=0,f=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let C,R=0;for(;(C=63&this.interim[++R])&&R<4;)k<<=6,k|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-R;for(;f<E;){if(f>=p)return 0;if(C=l[f++],(192&C)!=128){f--,S=!0;break}this.interim[R++]=C,k<<=6,k|=63&C}S||(w===2?k<128?f--:c[y++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[y++]=k):k<65536||k>1114111||(c[y++]=k)),this.interim.fill(0)}const d=p-4;let v=f;for(;v<p;){for(;!(!(v<d)||128&(u=l[v])||128&(m=l[v+1])||128&(g=l[v+2])||128&(x=l[v+3]));)c[y++]=u,c[y++]=m,c[y++]=g,c[y++]=x,v+=4;if(u=l[v++],u<128)c[y++]=u;else if((224&u)==192){if(v>=p)return this.interim[0]=u,y;if(m=l[v++],(192&m)!=128){v--;continue}if(h=(31&u)<<6|63&m,h<128){v--;continue}c[y++]=h}else if((240&u)==224){if(v>=p)return this.interim[0]=u,y;if(m=l[v++],(192&m)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=m,y;if(g=l[v++],(192&g)!=128){v--;continue}if(h=(15&u)<<12|(63&m)<<6|63&g,h<2048||h>=55296&&h<=57343||h===65279)continue;c[y++]=h}else if((248&u)==240){if(v>=p)return this.interim[0]=u,y;if(m=l[v++],(192&m)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=m,y;if(g=l[v++],(192&g)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=m,this.interim[2]=g,y;if(x=l[v++],(192&x)!=128){v--;continue}if(h=(7&u)<<18|(63&m)<<12|(63&g)<<6|63&x,h<65536||h>1114111)continue;c[y++]=h}}return y}}},225:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=l(1480),p=[[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]],u=[[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;s.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 g=0;g<p.length;++g)m.fill(0,p[g][0],p[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:function(x,y){let h,f=0,d=y.length-1;if(x<y[0][0]||x>y[d][1])return!1;for(;d>=f;)if(h=f+d>>1,x>y[h][1])f=h+1;else{if(!(x<y[h][0]))return!0;d=h-1}return!1}(g,u)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,x){let y=this.wcwidth(g),h=y===0&&x!==0;if(h){const f=c.UnicodeService.extractWidth(x);f===0?h=!1:f>y&&(y=f)}return c.UnicodeService.createPropertyValue(0,y,h)}}},5981:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=l(8460),p=l(844);class u extends p.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let y;for(this._isSyncWriting=!0;y=this._writeBuffer.shift();){this._action(y);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,x){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+=g.length,this._writeBuffer.push(g),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(x)}_innerWrite(g=0,x=!0){const y=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],f=this._action(h,x);if(f){const v=S=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,S)):this._innerWrite(y,S);return void f.catch(S=>(queueMicrotask(()=>{throw S}),Promise.resolve(!1))).then(v)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=h.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()}}s.WriteBuffer=u},5941:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const l=/^([\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})$/,c=/^[\da-f]+$/;function p(u,m){const g=u.toString(16),x=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}s.parseColor=function(u){if(!u)return;let m=u.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=l.exec(m);if(g){const x=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/x*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/x*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/x*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),c.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,x=[0,0,0];for(let y=0;y<3;++y){const h=parseInt(m.slice(g*y,g*y+g),16);x[y]=g===1?h<<4:g===2?h:g===3?h>>4:h>>8}return x}},s.toRgbString=function(u,m=16){const[g,x,y]=u;return`rgb:${p(g,m)}/${p(x,m)}/${p(y,m)}`}},5770:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=l(482),p=l(8742),u=l(5770),m=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(x,y){this._handlers[x]===void 0&&(this._handlers[x]=[]);const h=this._handlers[x];return h.push(y),{dispose:()=>{const f=h.indexOf(y);f!==-1&&h.splice(f,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(x,y){if(this.reset(),this._ident=x,this._active=this._handlers[x]||m,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(x,y,h){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(x,y,h);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(x,y,h))}unhook(x,y=!0){if(this._active.length){let h=!1,f=this._active.length-1,d=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,h=y,d=this._stack.fallThrough,this._stack.paused=!1),!d&&h===!1){for(;f>=0&&(h=this._active[f].unhook(x),h!==!0);f--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,h;f--}for(;f>=0;f--)if(h=this._active[f].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",x);this._active=m,this._ident=0}};const g=new p.Params;g.addParam(0),s.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=g,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():g,this._data="",this._hitLimit=!1}put(x,y,h){this._hitLimit||(this._data+=(0,c.utf32ToString)(x,y,h),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let y=!1;if(this._hitLimit)y=!1;else if(x&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(h=>(this._params=g,this._data="",this._hitLimit=!1,h));return this._params=g,this._data="",this._hitLimit=!1,y}}},2015:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=l(844),p=l(8742),u=l(6242),m=l(6351);class g{constructor(f){this.table=new Uint8Array(f)}setDefault(f,d){this.table.fill(f<<4|d)}add(f,d,v,S){this.table[d<<8|f]=v<<4|S}addMany(f,d,v,S){for(let k=0;k<f.length;k++)this.table[d<<8|f[k]]=v<<4|S}}s.TransitionTable=g;const x=160;s.VT500_TRANSITION_TABLE=function(){const h=new g(4095),f=Array.apply(null,Array(256)).map((R,w)=>w),d=(R,w)=>f.slice(R,w),v=d(32,127),S=d(0,24);S.push(25),S.push.apply(S,d(28,32));const k=d(0,14);let C;for(C in h.setDefault(1,0),h.addMany(v,0,2,0),k)h.addMany([24,26,153,154],C,3,0),h.addMany(d(128,144),C,3,0),h.addMany(d(144,152),C,3,0),h.add(156,C,0,0),h.add(27,C,11,1),h.add(157,C,4,8),h.addMany([152,158,159],C,0,7),h.add(155,C,11,3),h.add(144,C,11,9);return h.addMany(S,0,3,0),h.addMany(S,1,3,1),h.add(127,1,0,1),h.addMany(S,8,0,8),h.addMany(S,3,3,3),h.add(127,3,0,3),h.addMany(S,4,3,4),h.add(127,4,0,4),h.addMany(S,6,3,6),h.addMany(S,5,3,5),h.add(127,5,0,5),h.addMany(S,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(v,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(d(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(v,7,0,7),h.addMany(S,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(d(64,127),3,7,0),h.addMany(d(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(d(48,60),4,8,4),h.addMany(d(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(d(32,64),6,0,6),h.add(127,6,0,6),h.addMany(d(64,127),6,0,0),h.addMany(d(32,48),3,9,5),h.addMany(d(32,48),5,9,5),h.addMany(d(48,64),5,0,6),h.addMany(d(64,127),5,7,0),h.addMany(d(32,48),4,9,5),h.addMany(d(32,48),1,9,2),h.addMany(d(32,48),2,9,2),h.addMany(d(48,127),2,10,0),h.addMany(d(48,80),1,10,0),h.addMany(d(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(d(96,127),1,10,0),h.add(80,1,11,9),h.addMany(S,9,0,9),h.add(127,9,0,9),h.addMany(d(28,32),9,0,9),h.addMany(d(32,48),9,9,12),h.addMany(d(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(S,11,0,11),h.addMany(d(32,128),11,0,11),h.addMany(d(28,32),11,0,11),h.addMany(S,10,0,10),h.add(127,10,0,10),h.addMany(d(28,32),10,0,10),h.addMany(d(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(d(32,48),10,9,12),h.addMany(S,12,0,12),h.add(127,12,0,12),h.addMany(d(28,32),12,0,12),h.addMany(d(32,48),12,9,12),h.addMany(d(48,64),12,0,11),h.addMany(d(64,127),12,12,13),h.addMany(d(64,127),10,12,13),h.addMany(d(64,127),9,12,13),h.addMany(S,13,13,13),h.addMany(v,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(x,0,2,0),h.add(x,8,5,8),h.add(x,6,0,6),h.add(x,11,0,11),h.add(x,13,13,13),h}();class y extends c.Disposable{constructor(f=s.VT500_TRANSITION_TABLE){super(),this._transitions=f,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,v,S)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,v)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(f,d=[64,126]){let v=0;if(f.prefix){if(f.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=f.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(f.intermediates){if(f.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;k<f.intermediates.length;++k){const C=f.intermediates.charCodeAt(k);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=C}}if(f.final.length!==1)throw new Error("final must be a single byte");const S=f.final.charCodeAt(0);if(d[0]>S||S>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return v<<=8,v|=S,v}identToString(f){const d=[];for(;f;)d.push(String.fromCharCode(255&f)),f>>=8;return d.reverse().join("")}setPrintHandler(f){this._printHandler=f}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(f,d){const v=this._identifier(f,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const S=this._escHandlers[v];return S.push(d),{dispose:()=>{const k=S.indexOf(d);k!==-1&&S.splice(k,1)}}}clearEscHandler(f){this._escHandlers[this._identifier(f,[48,126])]&&delete this._escHandlers[this._identifier(f,[48,126])]}setEscHandlerFallback(f){this._escHandlerFb=f}setExecuteHandler(f,d){this._executeHandlers[f.charCodeAt(0)]=d}clearExecuteHandler(f){this._executeHandlers[f.charCodeAt(0)]&&delete this._executeHandlers[f.charCodeAt(0)]}setExecuteHandlerFallback(f){this._executeHandlerFb=f}registerCsiHandler(f,d){const v=this._identifier(f);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const S=this._csiHandlers[v];return S.push(d),{dispose:()=>{const k=S.indexOf(d);k!==-1&&S.splice(k,1)}}}clearCsiHandler(f){this._csiHandlers[this._identifier(f)]&&delete this._csiHandlers[this._identifier(f)]}setCsiHandlerFallback(f){this._csiHandlerFb=f}registerDcsHandler(f,d){return this._dcsParser.registerHandler(this._identifier(f),d)}clearDcsHandler(f){this._dcsParser.clearHandler(this._identifier(f))}setDcsHandlerFallback(f){this._dcsParser.setHandlerFallback(f)}registerOscHandler(f,d){return this._oscParser.registerHandler(f,d)}clearOscHandler(f){this._oscParser.clearHandler(f)}setOscHandlerFallback(f){this._oscParser.setHandlerFallback(f)}setErrorHandler(f){this._errorHandler=f}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.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(f,d,v,S,k){this._parseStack.state=f,this._parseStack.handlers=d,this._parseStack.handlerPos=v,this._parseStack.transition=S,this._parseStack.chunkPos=k}parse(f,d,v){let S,k=0,C=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(v===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(v===!1&&E>-1){for(;E>=0&&(S=w[E](this._params),S!==!0);E--)if(S instanceof Promise)return this._parseStack.handlerPos=E,S}this._parseStack.handlers=[];break;case 4:if(v===!1&&E>-1){for(;E>=0&&(S=w[E](),S!==!0);E--)if(S instanceof Promise)return this._parseStack.handlerPos=E,S}this._parseStack.handlers=[];break;case 6:if(k=f[this._parseStack.chunkPos],S=this._dcsParser.unhook(k!==24&&k!==26,v),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=f[this._parseStack.chunkPos],S=this._oscParser.end(k!==24&&k!==26,v),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=R;w<d;++w){switch(k=f[w],C=this._transitions.table[this.currentState<<8|(k<160?k:x)],C>>4){case 2:for(let P=w+1;;++P){if(P>=d||(k=f[P])<32||k>126&&k<x){this._printHandler(f,w,P),w=P-1;break}if(++P>=d||(k=f[P])<32||k>126&&k<x){this._printHandler(f,w,P),w=P-1;break}if(++P>=d||(k=f[P])<32||k>126&&k<x){this._printHandler(f,w,P),w=P-1;break}if(++P>=d||(k=f[P])<32||k>126&&k<x){this._printHandler(f,w,P),w=P-1;break}}break;case 3:this._executeHandlers[k]?this._executeHandlers[k]():this._executeHandlerFb(k),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:k,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|k];let L=E?E.length-1:-1;for(;L>=0&&(S=E[L](this._params),S!==!0);L--)if(S instanceof Promise)return this._preserveStack(3,E,L,C,w),S;L<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingJoinState=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++w<d&&(k=f[w])>47&&k<60);w--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const M=this._escHandlers[this._collect<<8|k];let D=M?M.length-1:-1;for(;D>=0&&(S=M[D](),S!==!0);D--)if(S instanceof Promise)return this._preserveStack(4,M,D,C,w),S;D<0&&this._escHandlerFb(this._collect<<8|k),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|k,this._params);break;case 13:for(let P=w+1;;++P)if(P>=d||(k=f[P])===24||k===26||k===27||k>127&&k<x){this._dcsParser.put(f,w,P),w=P-1;break}break;case 14:if(S=this._dcsParser.unhook(k!==24&&k!==26),S)return this._preserveStack(6,[],0,C,w),S;k===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=w+1;;P++)if(P>=d||(k=f[P])<32||k>127&&k<x){this._oscParser.put(f,w,P),w=P-1;break}break;case 6:if(S=this._oscParser.end(k!==24&&k!==26),S)return this._preserveStack(5,[],0,C,w),S;k===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}s.EscapeSequenceParser=y},6242:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=l(5770),p=l(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const x=this._handlers[m];return x.push(g),{dispose:()=>{const y=x.indexOf(g);y!==-1&&x.splice(y,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,g,x){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(m,g,x);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(m,g,x))}start(){this.reset(),this._state=1}put(m,g,x){if(this._state!==3){if(this._state===1)for(;g<x;){const y=m[g++];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&&x-g>0&&this._put(m,g,x)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,y=this._active.length-1,h=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,x=g,h=this._stack.fallThrough,this._stack.paused=!1),!h&&x===!1){for(;y>=0&&(x=this._active[y].end(m),x!==!0);y--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,x;y--}for(;y>=0;y--)if(x=this._active[y].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",m);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,x){this._hitLimit||(this._data+=(0,p.utf32ToString)(m,g,x),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,g}}},8742:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const l=2147483647;class c{static fromArray(u){const m=new c;if(!u.length)return m;for(let g=Array.isArray(u[0])?1:0;g<u.length;++g){const x=u[g];if(Array.isArray(x))for(let y=0;y<x.length;++y)m.addSubParam(x[y]);else m.addParam(x)}return m}constructor(u=32,m=32){if(this.maxLength=u,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let m=0;m<this.length;++m){u.push(this.params[m]);const g=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];x-g>0&&u.push(Array.prototype.slice.call(this._subParams,g,x))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const m=this._subParamsIdx[u]>>8,g=255&this._subParamsIdx[u];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const u={};for(let m=0;m<this.length;++m){const g=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];x-g>0&&(u[m]=this._subParams.slice(g,x))}return u}addDigit(u){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,x=g[m-1];g[m-1]=~x?Math.min(10*x+u,l):u}}s.Params=c},5741:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,c){const p={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(p),c.dispose=()=>this._wrappedAddonDispose(p),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===l){c=p;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(c,1)}}},8771:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=l(3785),p=l(511);s.BufferApiView=class{constructor(u,m){this._buffer=u,this.type=m}init(u){return this._buffer=u,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(u){const m=this._buffer.lines.get(u);if(m)return new c.BufferLineApiView(m)}getNullCell(){return new p.CellData}}},3785:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=l(511);s.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new c.CellData)}translateToString(p,u,m){return this._line.translateToString(p,u,m)}}},8285:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=l(8771),p=l(8460),u=l(844);class m extends u.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}s.BufferNamespaceApi=m},7975:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,c){return this._core.registerCsiHandler(l,p=>c(p.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(p,u)=>c(p,u.toArray()))}addDcsHandler(l,c){return this.registerDcsHandler(l,c)}registerEscHandler(l,c){return this._core.registerEscHandler(l,c)}addEscHandler(l,c){return this.registerEscHandler(l,c)}registerOscHandler(l,c){return this._core.registerOscHandler(l,c)}addOscHandler(l,c){return this.registerOscHandler(l,c)}}},7090:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var S,k=arguments.length,C=k<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(S=h[R])&&(C=(k<3?S(C):k>3?S(f,d,C):S(f,d))||C);return k>3&&C&&Object.defineProperty(f,d,C),C},p=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=l(8460),m=l(844),g=l(5295),x=l(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let y=s.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(h,this))}resize(h,f){this.cols=h,this.rows=f,this.buffers.resize(h,f),this._onResize.fire({cols:h,rows:f})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,f=!1){const d=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===h.fg&&v.getBg(0)===h.bg||(v=d.getBlankLine(h,f),this._cachedBlankLine=v),v.isWrapped=f;const S=d.ybase+d.scrollTop,k=d.ybase+d.scrollBottom;if(d.scrollTop===0){const C=d.lines.isFull;k===d.lines.length-1?C?d.lines.recycle().copyFrom(v):d.lines.push(v.clone()):d.lines.splice(k+1,0,v.clone()),C?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const C=k-S+1;d.lines.shiftElements(S+1,C-1,-1),d.lines.set(k,v.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(h,f,d){const v=this.buffer;if(h<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else h+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const S=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+h,v.ybase),0),S!==v.ydisp&&(f||this._onScroll.fire(v.ydisp))}};s.BufferService=y=c([p(0,x.IOptionsService)],y)},7994:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,c){this._charsets[l]=c,this.glevel===l&&(this.charset=c)}}},1753:function(a,s,l){var c=this&&this.__decorate||function(v,S,k,C){var R,w=arguments.length,E=w<3?S:C===null?C=Object.getOwnPropertyDescriptor(S,k):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,S,k,C);else for(var L=v.length-1;L>=0;L--)(R=v[L])&&(E=(w<3?R(E):w>3?R(S,k,E):R(S,k))||E);return w>3&&E&&Object.defineProperty(S,k,E),E},p=this&&this.__param||function(v,S){return function(k,C){S(k,C,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=l(2585),m=l(8460),g=l(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function y(v,S){let k=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(k|=64,k|=v.action):(k|=3&v.button,4&v.button&&(k|=64),8&v.button&&(k|=128),v.action===32?k|=32:v.action!==0||S||(k|=3)),k}const h=String.fromCharCode,f={DEFAULT:v=>{const S=[y(v,!1)+32,v.col+32,v.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${h(S[0])}${h(S[1])}${h(S[2])}`},SGR:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${y(v,!0)};${v.col};${v.row}${S}`},SGR_PIXELS:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${y(v,!0)};${v.x};${v.y}${S}`}};let d=s.CoreMouseService=class extends g.Disposable{constructor(v,S){super(),this._bufferService=v,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(x))this.addProtocol(k,x[k]);for(const k of Object.keys(f))this.addEncoding(k,f[k]);this.reset()}addProtocol(v,S){this._protocols[v]=S}addEncoding(v,S){this._encodings[v]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const S=this._encodings[this._activeEncoding](v);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,S,k){if(k){if(v.x!==S.x||v.y!==S.y)return!1}else if(v.col!==S.col||v.row!==S.row)return!1;return v.button===S.button&&v.action===S.action&&v.ctrl===S.ctrl&&v.alt===S.alt&&v.shift===S.shift}};s.CoreMouseService=d=c([p(0,u.IBufferService),p(1,u.ICoreService)],d)},6975:function(a,s,l){var c=this&&this.__decorate||function(d,v,S,k){var C,R=arguments.length,w=R<3?v:k===null?k=Object.getOwnPropertyDescriptor(v,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(d,v,S,k);else for(var E=d.length-1;E>=0;E--)(C=d[E])&&(w=(R<3?C(w):R>3?C(v,S,w):C(v,S))||w);return R>3&&w&&Object.defineProperty(v,S,w),w},p=this&&this.__param||function(d,v){return function(S,k){v(S,k,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=l(1439),m=l(8460),g=l(844),x=l(2585),y=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let f=s.CoreService=class extends g.Disposable{constructor(d,v,S){super(),this._bufferService=d,this._logService=v,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(y),this.decPrivateModes=(0,u.clone)(h)}reset(){this.modes=(0,u.clone)(y),this.decPrivateModes=(0,u.clone)(h)}triggerDataEvent(d,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,()=>d.split("").map(k=>k.charCodeAt(0))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,()=>d.split("").map(v=>v.charCodeAt(0))),this._onBinary.fire(d))}};s.CoreService=f=c([p(0,x.IBufferService),p(1,x.ILogService),p(2,x.IOptionsService)],f)},9074:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=l(8055),p=l(8460),u=l(844),m=l(6106);let g=0,x=0;class y extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(d=>d==null?void 0:d.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(d){if(d.marker.isDisposed)return;const v=new h(d);if(v){const S=v.marker.onDispose(()=>v.dispose());v.onDispose(()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),S.dispose())}),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,v,S){let k=0,C=0;for(const R of this._decorations.getKeyIterator(v))k=R.options.x??0,C=k+(R.options.width??1),d>=k&&d<C&&(!S||(R.options.layer??"bottom")===S)&&(yield R)}forEachDecorationAtCell(d,v,S,k){this._decorations.forEachByKey(v,C=>{g=C.options.x??0,x=g+(C.options.width??1),d>=g&&d<x&&(!S||(C.options.layer??"bottom")===S)&&k(C)})}}s.DecorationService=y;class h extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=l(2585),p=l(8343);class u{constructor(...g){this._entries=new Map;for(const[x,y]of g)this.set(x,y)}set(g,x){const y=this._entries.get(g);return this._entries.set(g,x),y}forEach(g){for(const[x,y]of this._entries.entries())g(x,y)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const x=(0,p.getServiceDependencies)(m).sort((f,d)=>f.index-d.index),y=[];for(const f of x){const d=this._services.get(f.id);if(!d)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${f.id}.`);y.push(d)}const h=x.length>0?x[0].index:g.length;if(g.length!==h)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${h+1} conflicts with ${g.length} static arguments`);return new m(...g,...y)}}},7866:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var S,k=arguments.length,C=k<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(S=h[R])&&(C=(k<3?S(C):k>3?S(f,d,C):S(f,d))||C);return k>3&&C&&Object.defineProperty(f,d,C),C},p=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=l(844),m=l(2585),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let x,y=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};s.LogService=y=c([p(0,m.IOptionsService)],y),s.setTraceLogger=function(h){x=h},s.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...S){if(x.logLevel!==m.LogLevelEnum.TRACE)return v.apply(this,S);x.trace(`GlyphRenderer#${v.name}(${S.map(C=>JSON.stringify(C)).join(", ")})`);const k=v.apply(this,S);return x.trace(`GlyphRenderer#${v.name} return`,k),k}}},7302:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=l(8460),p=l(844),u=l(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,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:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends p.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h={...s.DEFAULT_OPTIONS};for(const f in y)if(f in h)try{const d=y[f];h[f]=this._sanitizeAndValidateOption(f,d)}catch(d){console.error(d)}this.rawOptions=h,this.options={...h},this._setupOptions(),this.register((0,p.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(y,h){return this.onOptionChange(f=>{f===y&&h(this.rawOptions[y])})}onMultipleOptionChange(y,h){return this.onOptionChange(f=>{y.indexOf(f)!==-1&&h()})}_setupOptions(){const y=f=>{if(!(f in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);return this.rawOptions[f]},h=(f,d)=>{if(!(f in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${f}"`);d=this._sanitizeAndValidateOption(f,d),this.rawOptions[f]!==d&&(this.rawOptions[f]=d,this._onOptionChange.fire(f))};for(const f in this.rawOptions){const d={get:y.bind(this,f),set:h.bind(this,f)};Object.defineProperty(this.options,f,d)}}_sanitizeAndValidateOption(y,h){switch(y){case"cursorStyle":if(h||(h=s.DEFAULT_OPTIONS[y]),!function(f){return f==="block"||f==="underline"||f==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${y}`);break;case"wordSeparator":h||(h=s.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=m.includes(h)?h:s.DEFAULT_OPTIONS[y];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${y} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${y} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}s.OptionsService=g},2660:function(a,s,l){var c=this&&this.__decorate||function(g,x,y,h){var f,d=arguments.length,v=d<3?x:h===null?h=Object.getOwnPropertyDescriptor(x,y):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(g,x,y,h);else for(var S=g.length-1;S>=0;S--)(f=g[S])&&(v=(d<3?f(v):d>3?f(x,y,v):f(x,y))||v);return d>3&&v&&Object.defineProperty(x,y,v),v},p=this&&this.__param||function(g,x){return function(y,h){x(y,h,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=l(2585);let m=s.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const x=this._bufferService.buffer;if(g.id===void 0){const S=x.addMarker(x.ybase+x.y),k={data:g,id:this._nextId++,lines:[S]};return S.onDispose(()=>this._removeMarkerFromLink(k,S)),this._dataByLinkId.set(k.id,k),k.id}const y=g,h=this._getEntryIdKey(y),f=this._entriesWithId.get(h);if(f)return this.addLineToLink(f.id,x.ybase+x.y),f.id;const d=x.addMarker(x.ybase+x.y),v={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(v,d)),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(g,x){const y=this._dataByLinkId.get(g);if(y&&y.lines.every(h=>h.line!==x)){const h=this._bufferService.buffer.addMarker(x);y.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(y,h))}}getLinkData(g){var x;return(x=this._dataByLinkId.get(g))==null?void 0:x.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,x){const y=g.lines.indexOf(x);y!==-1&&(g.lines.splice(y,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};s.OscLinkService=m=c([p(0,u.IBufferService)],m)},8343:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const l="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(p){return p[c]||[]},s.createDecorator=function(p){if(s.serviceRegistry.has(p))return s.serviceRegistry.get(p);const u=function(m,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,h,f){h[l]===h?h[c].push({id:y,index:f}):(h[c]=[{id:y,index:f}],h[l]=h)})(u,m,x)};return u.toString=()=>p,s.serviceRegistry.set(p,u),u}},2585:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=l(8343);var p;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(s.LogLevelEnum=p={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=l(8460),p=l(225);class u{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,x,y=!1){return(16777215&g)<<3|(3&x)<<1|(y?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const g=new p.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let x=0,y=0;const h=g.length;for(let f=0;f<h;++f){let d=g.charCodeAt(f);if(55296<=d&&d<=56319){if(++f>=h)return x+this.wcwidth(d);const k=g.charCodeAt(f);56320<=k&&k<=57343?d=1024*(d-55296)+k-56320+65536:x+=this.wcwidth(k)}const v=this.charProperties(d,y);let S=u.extractWidth(v);u.extractShouldJoin(v)&&(S-=u.extractWidth(y)),x+=S,y=v}return x}charProperties(g,x){return this._activeProvider.charProperties(g,x)}}s.UnicodeService=u}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const s=i(9042),l=i(3236),c=i(844),p=i(5741),u=i(8285),m=i(7975),g=i(7090),x=["cols","rows"];class y extends c.Disposable{constructor(f){super(),this._core=this.register(new l.Terminal(f)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const d=S=>this._core.options[S],v=(S,k)=>{this._checkReadonlyOptions(S),this._core.options[S]=k};for(const S in this._core.options){const k={get:d.bind(this,S),set:v.bind(this,S)};Object.defineProperty(this._publicOptions,S,k)}}_checkReadonlyOptions(f){if(x.includes(f))throw new Error(`Option "${f}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const d in f)this._publicOptions[d]=f[d]}blur(){this._core.blur()}focus(){this._core.focus()}resize(f,d){this._verifyIntegers(f,d),this._core.resize(f,d)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}attachCustomWheelEventHandler(f){this._core.attachCustomWheelEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.registerMarker(f)}registerDecoration(f){return this._checkProposedApi(),this._verifyPositiveIntegers(f.x??0,f.width??0,f.height??0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,d,v){this._verifyIntegers(f,d,v),this._core.select(f,d,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,d){this._verifyIntegers(f,d),this._core.selectLines(f,d)}dispose(){super.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,d){this._core.write(f,d)}writeln(f,d){this._core.write(f),this._core.write(`\r
`,d)}paste(f){this._core.paste(f)}refresh(f,d){this._verifyIntegers(f,d),this._core.refresh(f,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){this._addonManager.loadAddon(this,f)}static get strings(){return s}_verifyIntegers(...f){for(const d of f)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const d of f)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}a.Terminal=y})(),o})())})(Ib);var JL=Ib.exports,Bb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={903:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const c=l(274),p=l(627),u=l(237),m=l(860),g=l(374),x=l(296),y=l(345),h=l(859),f=l(399),d=l(855);class v extends h.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var C;return(C=this._charAtlas)==null?void 0:C.pages[0].canvas}constructor(C,R,w,E,L,M,D,P,$,O){super(),this._terminal=C,this._container=R,this._alpha=L,this._themeService=M,this._bufferService=D,this._optionsService=P,this._decorationService=$,this._coreBrowserService=O,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,x.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new h.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new y.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${w}-layer`),this._canvas.style.zIndex=E.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(F=>{this._refreshCharAtlas(F),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,h.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,g.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(C,R){}handleSelectionChanged(C,R,w=!1){this._selectionModel.update(this._terminal._core,C,R,w)}_setTransparency(C){if(C===this._alpha)return;const R=this._canvas;this._alpha=C,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,R),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(C){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,p.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,C,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,y.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let R=0;R<this._charAtlas.pages.length;R++)this._bitmapGenerator[R]=new S(this._charAtlas.pages[R].canvas)}}resize(C){this._deviceCellWidth=C.device.cell.width,this._deviceCellHeight=C.device.cell.height,this._deviceCharWidth=C.device.char.width,this._deviceCharHeight=C.device.char.height,this._deviceCharLeft=C.device.char.left,this._deviceCharTop=C.device.char.top,this._canvas.width=C.device.canvas.width,this._canvas.height=C.device.canvas.height,this._canvas.style.width=`${C.css.canvas.width}px`,this._canvas.style.height=`${C.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var C;(C=this._charAtlas)==null||C.clearTexture()}_fillCells(C,R,w,E){this._ctx.fillRect(C*this._deviceCellWidth,R*this._deviceCellHeight,w*this._deviceCellWidth,E*this._deviceCellHeight)}_fillMiddleLineAtCells(C,R,w=1){const E=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(C*this._deviceCellWidth,(R+1)*this._deviceCellHeight-E-this._coreBrowserService.dpr,w*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(C,R,w=1,E=0){this._ctx.fillRect(C*this._deviceCellWidth,(R+1)*this._deviceCellHeight+E-this._coreBrowserService.dpr-1,w*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(C,R,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const E=this._coreBrowserService.dpr;this._ctx.lineWidth=E;for(let L=0;L<w;L++){const M=(C+L)*this._deviceCellWidth,D=(C+L+.5)*this._deviceCellWidth,P=(C+L+1)*this._deviceCellWidth,$=(R+1)*this._deviceCellHeight-E-1,O=$-E,F=$+E;this._ctx.moveTo(M,$),this._ctx.bezierCurveTo(M,O,D,O,D,$),this._ctx.bezierCurveTo(D,F,P,F,P,$)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(C,R,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const E=this._coreBrowserService.dpr;this._ctx.lineWidth=E,this._ctx.setLineDash([2*E,E]);const L=C*this._deviceCellWidth,M=(R+1)*this._deviceCellHeight-E-1;this._ctx.moveTo(L,M);for(let D=0;D<w;D++){const P=(C+w+D)*this._deviceCellWidth;this._ctx.lineTo(P,M)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(C,R,w=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const E=this._coreBrowserService.dpr;this._ctx.lineWidth=E,this._ctx.setLineDash([4*E,3*E]);const L=C*this._deviceCellWidth,M=(C+w)*this._deviceCellWidth,D=(R+1)*this._deviceCellHeight-E-1;this._ctx.moveTo(L,D),this._ctx.lineTo(M,D),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(C,R,w){this._ctx.fillRect(C*this._deviceCellWidth,R*this._deviceCellHeight,this._coreBrowserService.dpr*w,this._deviceCellHeight)}_strokeRectAtCell(C,R,w,E){const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.strokeRect(C*this._deviceCellWidth+L/2,R*this._deviceCellHeight+L/2,w*this._deviceCellWidth-L,E*this._deviceCellHeight-L)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(C,R,w,E){this._alpha?this._ctx.clearRect(C*this._deviceCellWidth,R*this._deviceCellHeight,w*this._deviceCellWidth,E*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(C*this._deviceCellWidth,R*this._deviceCellHeight,w*this._deviceCellWidth,E*this._deviceCellHeight))}_fillCharTrueColor(C,R,w){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=u.TEXT_BASELINE,this._clipRow(w);let E=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(E=(0,m.tryDrawCustomChar)(this._ctx,C.getChars(),R*this._deviceCellWidth,w*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),E||this._ctx.fillText(C.getChars(),R*this._deviceCellWidth+this._deviceCharLeft,w*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(C,R,w){var M,D,P,$;const E=C.getChars();if(this._cellColorResolver.resolve(C,R,this._bufferService.buffer.ydisp+w,this._deviceCellWidth),!this._charAtlas)return;let L;L=E&&E.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(E,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(C.getCode()||d.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),L.size.x&&L.size.y&&(this._ctx.save(),this._clipRow(w),this._bitmapGenerator[L.texturePage]&&this._charAtlas.pages[L.texturePage].canvas!==this._bitmapGenerator[L.texturePage].canvas&&((D=(M=this._bitmapGenerator[L.texturePage])==null?void 0:M.bitmap)==null||D.close(),delete this._bitmapGenerator[L.texturePage]),this._charAtlas.pages[L.texturePage].version!==((P=this._bitmapGenerator[L.texturePage])==null?void 0:P.version)&&(this._bitmapGenerator[L.texturePage]||(this._bitmapGenerator[L.texturePage]=new S(this._charAtlas.pages[L.texturePage].canvas)),this._bitmapGenerator[L.texturePage].refresh(),this._bitmapGenerator[L.texturePage].version=this._charAtlas.pages[L.texturePage].version),this._ctx.drawImage((($=this._bitmapGenerator[L.texturePage])==null?void 0:$.bitmap)||this._charAtlas.pages[L.texturePage].canvas,L.texturePosition.x,L.texturePosition.y,L.size.x,L.size.y,R*this._deviceCellWidth+this._deviceCharLeft-L.offset.x,w*this._deviceCellHeight+this._deviceCharTop-L.offset.y,L.size.x,L.size.y),this._ctx.restore())}_clipRow(C){this._ctx.beginPath(),this._ctx.rect(0,C*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(C,R){return`${R?"italic":""} ${C?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}s.BaseRenderLayer=v;class S{get bitmap(){return this._bitmap}constructor(C){this.canvas=C,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var C;(C=this._bitmap)==null||C.close(),this._bitmap=void 0,f.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var C;this._state===0&&((C=this._bitmap)==null||C.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(R=>{this._state===2?this.refresh():this._bitmap=R,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CanvasRenderer=void 0;const c=l(627),p=l(56),u=l(374),m=l(345),g=l(859),x=l(873),y=l(43),h=l(630),f=l(744);class d extends g.Disposable{constructor(S,k,C,R,w,E,L,M,D,P,$){super(),this._terminal=S,this._screenElement=k,this._bufferService=R,this._charSizeService=w,this._optionsService=E,this._coreBrowserService=D,this._themeService=$,this._observerDisposable=this.register(new g.MutableDisposable),this._onRequestRedraw=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new m.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new m.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const O=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new f.TextRenderLayer(this._terminal,this._screenElement,0,O,this._bufferService,this._optionsService,L,P,this._coreBrowserService,$),new h.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,P,this._optionsService,$),new y.LinkRenderLayer(this._terminal,this._screenElement,2,C,this._bufferService,this._optionsService,P,this._coreBrowserService,$),new x.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,M,this._coreBrowserService,P,$)];for(const F of this._renderLayers)(0,m.forwardEvent)(F.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,u.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,p.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(F,U)=>this._setCanvasDevicePixelDimensions(F,U)),this.register(this._coreBrowserService.onWindowChange(F=>{this._observerDisposable.value=(0,p.observeDevicePixelDimensions)(this._renderLayers[0].canvas,F,(U,B)=>this._setCanvasDevicePixelDimensions(U,B))})),this.register((0,g.toDisposable)(()=>{for(const F of this._renderLayers)F.dispose();(0,c.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(S,k){this._updateDimensions();for(const C of this._renderLayers)C.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(S=>S.handleBlur())}handleFocus(){this._runOperation(S=>S.handleFocus())}handleSelectionChanged(S,k,C=!1){this._runOperation(R=>R.handleSelectionChanged(S,k,C)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(S=>S.handleCursorMove())}clear(){this._runOperation(S=>S.reset())}_runOperation(S){for(const k of this._renderLayers)S(k)}renderRows(S,k){for(const C of this._renderLayers)C.handleGridChanged(S,k)}clearTextureAtlas(){for(const S of this._renderLayers)S.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*S),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/S),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(S,k){this.dimensions.device.canvas.height=k,this.dimensions.device.canvas.width=S;for(const C of this._renderLayers)C.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}s.CanvasRenderer=d},873:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorRenderLayer=void 0;const c=l(457),p=l(859),u=l(399),m=l(782),g=l(903);class x extends g.BaseRenderLayer{constructor(h,f,d,v,S,k,C,R,w,E){super(h,f,"cursor",d,!0,E,S,k,w,R),this._onRequestRedraw=v,this._coreService=C,this._cursorBlinkStateManager=this.register(new p.MutableDisposable),this._cell=new m.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(k.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(h){super.resize(h),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var h;this._clearCursor(),(h=this._cursorBlinkStateManager.value)==null||h.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var h;(h=this._cursorBlinkStateManager.value)==null||h.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var h;(h=this._cursorBlinkStateManager.value)==null||h.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new c.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var h;(h=this._cursorBlinkStateManager.value)==null||h.restartBlinkAnimation()}handleGridChanged(h,f){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(h){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const f=this._bufferService.buffer.ybase+this._bufferService.buffer.y,d=f-this._bufferService.buffer.ydisp;if(d<0||d>=this._bufferService.rows)return void this._clearCursor();const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(f).loadCell(v,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const S=this._optionsService.rawOptions.cursorStyle,k=this._optionsService.rawOptions.cursorInactiveStyle;return k&&k!=="none"&&this._cursorRenderers[k](v,d,this._cell),this._ctx.restore(),this._state.x=v,this._state.y=d,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===v&&this._state.y===d&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](v,d,this._cell),this._ctx.restore(),this._state.x=v,this._state.y=d,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(u.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(h,f,d){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(h,f,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(h,f,d){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(h,f,d.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(d,h,f),this._ctx.restore()}_renderUnderlineCursor(h,f,d){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(h,f),this._ctx.restore()}_renderOutlineCursor(h,f,d){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(h,f,d.getWidth(),1),this._ctx.restore()}}s.CursorRenderLayer=x},574:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GridCache=void 0,s.GridCache=class{constructor(){this.cache=[]}resize(l,c){for(let p=0;p<l;p++){this.cache.length<=p&&this.cache.push([]);for(let u=this.cache[p].length;u<c;u++)this.cache[p].push(void 0);this.cache[p].length=c}this.cache.length=l}clear(){for(let l=0;l<this.cache.length;l++)for(let c=0;c<this.cache[l].length;c++)this.cache[l][c]=void 0}}},43:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const c=l(197),p=l(237),u=l(903);class m extends u.BaseRenderLayer{constructor(x,y,h,f,d,v,S,k,C){super(x,y,"link",h,!0,C,d,v,S,k),this.register(f.onShowLinkUnderline(R=>this._handleShowLinkUnderline(R))),this.register(f.onHideLinkUnderline(R=>this._handleHideLinkUnderline(R)))}resize(x){super.resize(x),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const x=this._state.y2-this._state.y1-1;x>0&&this._clearCells(0,this._state.y1+1,this._state.cols,x),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(x){if(x.fg===p.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:x.fg&&(0,c.is256Color)(x.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[x.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,x.y1===x.y2)this._fillBottomLineAtCells(x.x1,x.y1,x.x2-x.x1);else{this._fillBottomLineAtCells(x.x1,x.y1,x.cols-x.x1);for(let y=x.y1+1;y<x.y2;y++)this._fillBottomLineAtCells(0,y,x.cols);this._fillBottomLineAtCells(0,x.y2,x.x2)}this._state=x}_handleHideLinkUnderline(x){this._clearCurrentLink()}}s.LinkRenderLayer=m},630:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionRenderLayer=void 0;const c=l(903);class p extends c.BaseRenderLayer{constructor(m,g,x,y,h,f,d,v){super(m,g,"selection",x,!0,v,y,d,f,h),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(m){super.resize(m),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(m,g,x){super.handleSelectionChanged(m,g,x),this._redrawSelection(m,g,x)}_redrawSelection(m,g,x){if(!this._didStateChange(m,g,x,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!m||!g)return void this._clearState();const y=m[1]-this._bufferService.buffer.ydisp,h=g[1]-this._bufferService.buffer.ydisp,f=Math.max(y,0),d=Math.min(h,this._bufferService.rows-1);if(f>=this._bufferService.rows||d<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,x){const v=m[0],S=g[0]-v,k=d-f+1;this._fillCells(v,f,S,k)}else{const v=y===f?m[0]:0,S=f===h?g[0]:this._bufferService.cols;this._fillCells(v,f,S-v,1);const k=Math.max(d-f-1,0);if(this._fillCells(0,f+1,this._bufferService.cols,k),f!==d){const C=h===d?g[0]:this._bufferService.cols;this._fillCells(0,d,C,1)}}this._state.start=[m[0],m[1]],this._state.end=[g[0],g[1]],this._state.columnSelectMode=x,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(m,g,x,y){return!this._areCoordinatesEqual(m,this._state.start)||!this._areCoordinatesEqual(g,this._state.end)||x!==this._state.columnSelectMode||y!==this._state.ydisp}_areCoordinatesEqual(m,g){return!(!m||!g)&&m[0]===g[0]&&m[1]===g[1]}}s.SelectionRenderLayer=p},744:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextRenderLayer=void 0;const c=l(577),p=l(147),u=l(782),m=l(855),g=l(903),x=l(574);class y extends g.BaseRenderLayer{constructor(f,d,v,S,k,C,R,w,E,L){super(f,d,"text",v,S,L,k,C,w,E),this._characterJoinerService=R,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new u.CellData,this._state=new x.GridCache,this.register(C.onSpecificOptionChange("allowTransparency",M=>this._setTransparency(M)))}resize(f){super.resize(f);const d=this._getFont(!1,!1);this._characterWidth===f.device.char.width&&this._characterFont===d||(this._characterWidth=f.device.char.width,this._characterFont=d,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(f,d,v){for(let S=f;S<=d;S++){const k=S+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(k),R=this._characterJoinerService.getJoinedCharacters(k);for(let w=0;w<this._bufferService.cols;w++){C.loadCell(w,this._workCell);let E=this._workCell,L=!1,M=w;if(E.getWidth()!==0){if(R.length>0&&w===R[0][0]){L=!0;const D=R.shift();E=new c.JoinedCellData(this._workCell,C.translateToString(!0,D[0],D[1]),D[1]-D[0]),M=D[1]-1}!L&&this._isOverlapping(E)&&M<C.length-1&&C.getCodePoint(M+1)===m.NULL_CELL_CODE&&(E.content&=-12582913,E.content|=8388608),v(E,w,S),w=M}}}}_drawBackground(f,d){const v=this._ctx,S=this._bufferService.cols;let k=0,C=0,R=null;v.save(),this._forEachCell(f,d,(w,E,L)=>{let M=null;w.isInverse()?M=w.isFgDefault()?this._themeService.colors.foreground.css:w.isFgRGB()?`rgb(${p.AttributeData.toColorRGB(w.getFgColor()).join(",")})`:this._themeService.colors.ansi[w.getFgColor()].css:w.isBgRGB()?M=`rgb(${p.AttributeData.toColorRGB(w.getBgColor()).join(",")})`:w.isBgPalette()&&(M=this._themeService.colors.ansi[w.getBgColor()].css);let D=!1;this._decorationService.forEachDecorationAtCell(E,this._bufferService.buffer.ydisp+L,void 0,P=>{P.options.layer!=="top"&&D||(P.backgroundColorRGB&&(M=P.backgroundColorRGB.css),D=P.options.layer==="top")}),R===null&&(k=E,C=L),L!==C?(v.fillStyle=R||"",this._fillCells(k,C,S-k,1),k=E,C=L):R!==M&&(v.fillStyle=R||"",this._fillCells(k,C,E-k,1),k=E,C=L),R=M}),R!==null&&(v.fillStyle=R,this._fillCells(k,C,S-k,1)),v.restore()}_drawForeground(f,d){this._forEachCell(f,d,(v,S,k)=>this._drawChars(v,S,k))}handleGridChanged(f,d){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,f,this._bufferService.cols,d-f+1),this._drawBackground(f,d),this._drawForeground(f,d))}_isOverlapping(f){if(f.getWidth()!==1||f.getCode()<256)return!1;const d=f.getChars();if(this._characterOverlapCache.hasOwnProperty(d))return this._characterOverlapCache[d];this._ctx.save(),this._ctx.font=this._characterFont;const v=Math.floor(this._ctx.measureText(d).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[d]=v,v}}s.TextRenderLayer=y},274:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const c=l(855),p=l(160),u=l(374);let m,g=0,x=0,y=!1,h=!1,f=!1,d=0;s.CellColorResolver=class{constructor(v,S,k,C,R,w){this._terminal=v,this._optionService=S,this._selectionRenderModel=k,this._decorationService=C,this._coreBrowserService=R,this._themeService=w,this.result={fg:0,bg:0,ext:0}}resolve(v,S,k,C){if(this.result.bg=v.bg,this.result.fg=v.fg,this.result.ext=268435456&v.bg?v.extended.ext:0,x=0,g=0,h=!1,y=!1,f=!1,m=this._themeService.colors,d=0,v.getCode()!==c.NULL_CELL_CODE&&v.extended.underlineStyle===4){const R=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=S*C%(2*Math.round(R))}if(this._decorationService.forEachDecorationAtCell(S,k,"bottom",R=>{R.backgroundColorRGB&&(x=R.backgroundColorRGB.rgba>>8&16777215,h=!0),R.foregroundColorRGB&&(g=R.foregroundColorRGB.rgba>>8&16777215,y=!0)}),f=this._selectionRenderModel.isCellSelected(this._terminal,S,k),f){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:x=(16777215&this.result.fg)<<8|255;break;default:x=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:x=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:x=-256&this.result.bg|255}x=p.rgba.blend(x,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else x=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(h=!0,m.selectionForeground&&(g=m.selectionForeground.rgba>>8&16777215,y=!0),(0,u.treatGlyphAsBackgroundColor)(v.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))g=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:g=-256&this.result.bg|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:g=(16777215&this.result.fg)<<8|255;break;default:g=this._themeService.colors.foreground.rgba}g=p.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}y=!0}}this._decorationService.forEachDecorationAtCell(S,k,"top",R=>{R.backgroundColorRGB&&(x=R.backgroundColorRGB.rgba>>8&16777215,h=!0),R.foregroundColorRGB&&(g=R.foregroundColorRGB.rgba>>8&16777215,y=!0)}),h&&(x=f?-16777216&v.bg&-134217729|x|50331648:-16777216&v.bg|x|50331648),y&&(g=-16777216&v.fg&-67108865|g|50331648),67108864&this.result.fg&&(h&&!y&&(g=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&m.background.rgba>>8|50331648,y=!0),!h&&y&&(x=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&m.foreground.rgba>>8|50331648,h=!0)),m=void 0,this.result.bg=h?x:this.result.bg,this.result.fg=y?g:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const c=l(509),p=l(197),u=[];s.acquireTextureAtlas=function(m,g,x,y,h,f,d,v){const S=(0,p.generateConfig)(y,h,f,d,g,x,v);for(let R=0;R<u.length;R++){const w=u[R],E=w.ownedBy.indexOf(m);if(E>=0){if((0,p.configEquals)(w.config,S))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),u.splice(R,1)):w.ownedBy.splice(E,1);break}}for(let R=0;R<u.length;R++){const w=u[R];if((0,p.configEquals)(w.config,S))return w.ownedBy.push(m),w.atlas}const k=m._core,C={atlas:new c.TextureAtlas(document,S,k.unicodeService),config:S,ownedBy:[m]};return u.push(C),C.atlas},s.removeTerminalFromCache=function(m){for(let g=0;g<u.length;g++){const x=u[g].ownedBy.indexOf(m);if(x!==-1){u[g].ownedBy.length===1?(u[g].atlas.dispose(),u.splice(g,1)):u[g].ownedBy.splice(x,1);break}}}},197:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const c=l(160);s.generateConfig=function(p,u,m,g,x,y,h){const f={foreground:y.foreground,background:y.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:y.ansi.slice(),contrastCache:y.contrastCache,halfContrastCache:y.halfContrastCache};return{customGlyphs:x.customGlyphs,devicePixelRatio:h,letterSpacing:x.letterSpacing,lineHeight:x.lineHeight,deviceCellWidth:p,deviceCellHeight:u,deviceCharWidth:m,deviceCharHeight:g,fontFamily:x.fontFamily,fontSize:x.fontSize,fontWeight:x.fontWeight,fontWeightBold:x.fontWeightBold,allowTransparency:x.allowTransparency,drawBoldTextInBrightColors:x.drawBoldTextInBrightColors,minimumContrastRatio:x.minimumContrastRatio,colors:f}},s.configEquals=function(p,u){for(let m=0;m<p.colors.ansi.length;m++)if(p.colors.ansi[m].rgba!==u.colors.ansi[m].rgba)return!1;return p.devicePixelRatio===u.devicePixelRatio&&p.customGlyphs===u.customGlyphs&&p.lineHeight===u.lineHeight&&p.letterSpacing===u.letterSpacing&&p.fontFamily===u.fontFamily&&p.fontSize===u.fontSize&&p.fontWeight===u.fontWeight&&p.fontWeightBold===u.fontWeightBold&&p.allowTransparency===u.allowTransparency&&p.deviceCharWidth===u.deviceCharWidth&&p.deviceCharHeight===u.deviceCharHeight&&p.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&p.minimumContrastRatio===u.minimumContrastRatio&&p.colors.foreground.rgba===u.colors.foreground.rgba&&p.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(p){return(50331648&p)==16777216||(50331648&p)==33554432}},237:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=l(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const c=l(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const p={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(y,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"║":{1:(y,h)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╒":{1:(y,h)=>`M.5,1 L.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╓":{1:(y,h)=>`M${.5-y},1 L${.5-y},.5 L1,.5 M${.5+y},.5 L${.5+y},1`},"╔":{1:(y,h)=>`M1,${.5-h} L${.5-y},${.5-h} L${.5-y},1 M1,${.5+h} L${.5+y},${.5+h} L${.5+y},1`},"╕":{1:(y,h)=>`M0,${.5-h} L.5,${.5-h} L.5,1 M0,${.5+h} L.5,${.5+h}`},"╖":{1:(y,h)=>`M${.5+y},1 L${.5+y},.5 L0,.5 M${.5-y},.5 L${.5-y},1`},"╗":{1:(y,h)=>`M0,${.5+h} L${.5-y},${.5+h} L${.5-y},1 M0,${.5-h} L${.5+y},${.5-h} L${.5+y},1`},"╘":{1:(y,h)=>`M.5,0 L.5,${.5+h} L1,${.5+h} M.5,${.5-h} L1,${.5-h}`},"╙":{1:(y,h)=>`M1,.5 L${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╚":{1:(y,h)=>`M1,${.5-h} L${.5+y},${.5-h} L${.5+y},0 M1,${.5+h} L${.5-y},${.5+h} L${.5-y},0`},"╛":{1:(y,h)=>`M0,${.5+h} L.5,${.5+h} L.5,0 M0,${.5-h} L.5,${.5-h}`},"╜":{1:(y,h)=>`M0,.5 L${.5+y},.5 L${.5+y},0 M${.5-y},.5 L${.5-y},0`},"╝":{1:(y,h)=>`M0,${.5-h} L${.5-y},${.5-h} L${.5-y},0 M0,${.5+h} L${.5+y},${.5+h} L${.5+y},0`},"╞":{1:(y,h)=>`M.5,0 L.5,1 M.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╟":{1:(y,h)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1 M${.5+y},.5 L1,.5`},"╠":{1:(y,h)=>`M${.5-y},0 L${.5-y},1 M1,${.5+h} L${.5+y},${.5+h} L${.5+y},1 M1,${.5-h} L${.5+y},${.5-h} L${.5+y},0`},"╡":{1:(y,h)=>`M.5,0 L.5,1 M0,${.5-h} L.5,${.5-h} M0,${.5+h} L.5,${.5+h}`},"╢":{1:(y,h)=>`M0,.5 L${.5-y},.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╣":{1:(y,h)=>`M${.5+y},0 L${.5+y},1 M0,${.5+h} L${.5-y},${.5+h} L${.5-y},1 M0,${.5-h} L${.5-y},${.5-h} L${.5-y},0`},"╤":{1:(y,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h} M.5,${.5+h} L.5,1`},"╥":{1:(y,h)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},1 M${.5+y},.5 L${.5+y},1`},"╦":{1:(y,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L${.5-y},${.5+h} L${.5-y},1 M1,${.5+h} L${.5+y},${.5+h} L${.5+y},1`},"╧":{1:(y,h)=>`M.5,0 L.5,${.5-h} M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╨":{1:(y,h)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╩":{1:(y,h)=>`M0,${.5+h} L1,${.5+h} M0,${.5-h} L${.5-y},${.5-h} L${.5-y},0 M1,${.5-h} L${.5+y},${.5-h} L${.5+y},0`},"╪":{1:(y,h)=>`M.5,0 L.5,1 M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╫":{1:(y,h)=>`M0,.5 L1,.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╬":{1:(y,h)=>`M0,${.5+h} L${.5-y},${.5+h} L${.5-y},1 M1,${.5+h} L${.5+y},${.5+h} L${.5+y},1 M0,${.5-h} L${.5-y},${.5-h} L${.5-y},0 M1,${.5-h} L${.5+y},${.5-h} L${.5+y},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(y,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,1,.5`},"╮":{1:(y,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,0,.5`},"╯":{1:(y,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,0,.5`},"╰":{1:(y,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(y,h,f,d,v,S,k,C){const R=s.blockElementDefinitions[h];if(R)return function(M,D,P,$,O,F){for(let U=0;U<D.length;U++){const B=D[U],A=O/8,T=F/8;M.fillRect(P+B.x*A,$+B.y*T,B.w*A,B.h*T)}}(y,R,f,d,v,S),!0;const w=p[h];if(w)return function(M,D,P,$,O,F){let U=u.get(D);U||(U=new Map,u.set(D,U));const B=M.fillStyle;if(typeof B!="string")throw new Error(`Unexpected fillStyle type "${B}"`);let A=U.get(B);if(!A){const T=D[0].length,j=D.length,z=M.canvas.ownerDocument.createElement("canvas");z.width=T,z.height=j;const N=(0,c.throwIfFalsy)(z.getContext("2d")),X=new ImageData(T,j);let re,H,W,I;if(B.startsWith("#"))re=parseInt(B.slice(1,3),16),H=parseInt(B.slice(3,5),16),W=parseInt(B.slice(5,7),16),I=B.length>7&&parseInt(B.slice(7,9),16)||1;else{if(!B.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${B}" when drawing pattern glyph`);[re,H,W,I]=B.substring(5,B.length-1).split(",").map(K=>parseFloat(K))}for(let K=0;K<j;K++)for(let J=0;J<T;J++)X.data[4*(K*T+J)]=re,X.data[4*(K*T+J)+1]=H,X.data[4*(K*T+J)+2]=W,X.data[4*(K*T+J)+3]=D[K][J]*(255*I);N.putImageData(X,0,0),A=(0,c.throwIfFalsy)(M.createPattern(z,null)),U.set(B,A)}M.fillStyle=A,M.fillRect(P,$,O,F)}(y,w,f,d,v,S),!0;const E=s.boxDrawingDefinitions[h];if(E)return function(M,D,P,$,O,F,U){M.strokeStyle=M.fillStyle;for(const[B,A]of Object.entries(D)){let T;M.beginPath(),M.lineWidth=U*Number.parseInt(B),T=typeof A=="function"?A(.15,.15/F*O):A;for(const j of T.split(" ")){const z=j[0],N=g[z];if(!N){console.error(`Could not find drawing instructions for "${z}"`);continue}const X=j.substring(1).split(",");X[0]&&X[1]&&N(M,x(X,O,F,P,$,!0,U))}M.stroke(),M.closePath()}}(y,E,f,d,v,S,C),!0;const L=s.powerlineDefinitions[h];return!!L&&(function(M,D,P,$,O,F,U,B){const A=new Path2D;A.rect(P,$,O,F),M.clip(A),M.beginPath();const T=U/12;M.lineWidth=B*T;for(const j of D.d.split(" ")){const z=j[0],N=g[z];if(!N){console.error(`Could not find drawing instructions for "${z}"`);continue}const X=j.substring(1).split(",");X[0]&&X[1]&&N(M,x(X,O,F,P,$,!1,B,(D.leftPadding??0)*(T/2),(D.rightPadding??0)*(T/2)))}D.type===1?(M.strokeStyle=M.fillStyle,M.stroke()):M.fill(),M.closePath()}(y,L,f,d,v,S,k,C),!0)};const u=new Map;function m(y,h,f=0){return Math.max(Math.min(y,h),f)}const g={C:(y,h)=>y.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]),L:(y,h)=>y.lineTo(h[0],h[1]),M:(y,h)=>y.moveTo(h[0],h[1])};function x(y,h,f,d,v,S,k,C=0,R=0){const w=y.map(E=>parseFloat(E)||parseInt(E));if(w.length<2)throw new Error("Too few arguments for instruction");for(let E=0;E<w.length;E+=2)w[E]*=h-C*k-R*k,S&&w[E]!==0&&(w[E]=m(Math.round(w[E]+.5)-.5,h,0)),w[E]+=d+C*k;for(let E=1;E<w.length;E+=2)w[E]*=f,S&&w[E]!==0&&(w[E]=m(Math.round(w[E]+.5)-.5,f,0)),w[E]+=v;return w}},56:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const c=l(859);s.observeDevicePixelDimensions=function(p,u,m){let g=new u.ResizeObserver(x=>{const y=x.find(d=>d.target===p);if(!y)return;if(!("devicePixelContentBoxSize"in y))return g==null||g.disconnect(),void(g=void 0);const h=y.devicePixelContentBoxSize[0].inlineSize,f=y.devicePixelContentBoxSize[0].blockSize;h>0&&f>0&&m(h,f)});try{g.observe(p,{box:["device-pixel-content-box"]})}catch{g.disconnect(),g=void 0}return(0,c.toDisposable)(()=>g==null?void 0:g.disconnect())}},374:(a,s)=>{function l(c){return 57508<=c&&c<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},s.isPowerlineGlyph=l,s.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},s.treatGlyphAsBackgroundColor=function(c){return l(c)||function(p){return 9472<=p&&p<=9631}(c)},s.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}}}},s.computeNextVariantOffset=function(c,p,u=0){return(c-(2*Math.round(p)-u))%(2*Math.round(p))}},296:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class l{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,u,m,g=!1){if(this.selectionStart=u,this.selectionEnd=m,!u||!m||u[0]===m[0]&&u[1]===m[1])return void this.clear();const x=p.buffers.active.ydisp,y=u[1]-x,h=m[1]-x,f=Math.max(y,0),d=Math.min(h,p.rows-1);f>=p.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=y,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=m[0])}isCellSelected(p,u,m){return!!this.hasSelection&&(m-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&m>=this.viewportCappedStartRow&&u<this.endCol&&m<=this.viewportCappedEndRow:u<this.startCol&&m>=this.viewportCappedStartRow&&u>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new l}},509:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const c=l(237),p=l(860),u=l(374),m=l(160),g=l(345),x=l(485),y=l(385),h=l(147),f=l(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let v;class S{get pages(){return this._pages}constructor(E,L,M){this._document=E,this._config=L,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new x.FourKeyMap,this._cacheMapCombined=new x.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new g.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new g.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=R(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new y.IdleTaskQueue;for(let L=33;L<126;L++)E.enqueue(()=>{if(!this._cacheMap.get(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const M=this._drawToCache(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(L,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter(U=>2*U.canvas.width<=(S.maxTextureSize||4096)).sort((U,B)=>B.canvas.width!==U.canvas.width?B.canvas.width-U.canvas.width:B.percentageUsed-U.percentageUsed);let M=-1,D=0;for(let U=0;U<L.length;U++)if(L[U].canvas.width!==D)M=U,D=L[U].canvas.width;else if(U-M==3)break;const P=L.slice(M,M+4),$=P.map(U=>U.glyphs[0].texturePage).sort((U,B)=>U>B?1:-1),O=this.pages.length-P.length,F=this._mergePages(P,O);F.version++;for(let U=$.length-1;U>=0;U--)this._deletePage($[U]);this.pages.push(F),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(F.canvas)}const E=new k(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,L){const M=2*E[0].canvas.width,D=new k(this._document,M,E);for(const[P,$]of E.entries()){const O=P*$.canvas.width%M,F=Math.floor(P/2)*$.canvas.height;D.ctx.drawImage($.canvas,O,F);for(const B of $.glyphs)B.texturePage=L,B.sizeClipSpace.x=B.size.x/M,B.sizeClipSpace.y=B.size.y/M,B.texturePosition.x+=O,B.texturePosition.y+=F,B.texturePositionClipSpace.x=B.texturePosition.x/M,B.texturePositionClipSpace.y=B.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire($.canvas);const U=this._activePages.indexOf($);U!==-1&&this._activePages.splice(U,1)}return D}_deletePage(E){this._pages.splice(E,1);for(let L=E;L<this._pages.length;L++){const M=this._pages[L];for(const D of M.glyphs)D.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(E,L,M,D,P){return this._getFromCacheMap(this._cacheMapCombined,E,L,M,D,P)}getRasterizedGlyph(E,L,M,D,P){return this._getFromCacheMap(this._cacheMap,E,L,M,D,P)}_getFromCacheMap(E,L,M,D,P,$=!1){return v=E.get(L,M,D,P),v||(v=this._drawToCache(L,M,D,P,$),E.set(L,M,D,P,v)),v}_getColorFromAnsiIndex(E){if(E>=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,L,M,D){if(this._config.allowTransparency)return m.NULL_COLOR;let P;switch(E){case 16777216:case 33554432:P=this._getColorFromAnsiIndex(L);break;case 50331648:const $=h.AttributeData.toColorRGB(L);P=m.rgba.toColor($[0],$[1],$[2]);break;default:P=M?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return P}_getForegroundColor(E,L,M,D,P,$,O,F,U,B){const A=this._getMinimumContrastColor(E,L,M,D,P,$,O,U,F,B);if(A)return A;let T;switch(P){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&U&&$<8&&($+=8),T=this._getColorFromAnsiIndex($);break;case 50331648:const j=h.AttributeData.toColorRGB($);T=m.rgba.toColor(j[0],j[1],j[2]);break;default:T=O?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(T=m.color.opaque(T)),F&&(T=m.color.multiplyOpacity(T,c.DIM_OPACITY)),T}_resolveBackgroundRgba(E,L,M){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,L,M,D){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,L,M,D,P,$,O,F,U,B){if(this._config.minimumContrastRatio===1||B)return;const A=this._getContrastCache(U),T=A.getColor(E,D);if(T!==void 0)return T||void 0;const j=this._resolveBackgroundRgba(L,M,O),z=this._resolveForegroundRgba(P,$,O,F),N=m.rgba.ensureContrastRatio(j,z,this._config.minimumContrastRatio/(U?2:1));if(!N)return void A.setColor(E,D,null);const X=m.rgba.toColor(N>>24&255,N>>16&255,N>>8&255);return A.setColor(E,D,X),X}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,L,M,D,P=!1){const $=typeof E=="number"?String.fromCharCode(E):E,O=Math.min(this._config.deviceCellWidth*Math.max($.length,2)+4,this._textureSize);this._tmpCanvas.width<O&&(this._tmpCanvas.width=O);const F=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<F&&(this._tmpCanvas.height=F),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=D,this._workAttributeData.isInvisible())return d;const U=!!this._workAttributeData.isBold(),B=!!this._workAttributeData.isInverse(),A=!!this._workAttributeData.isDim(),T=!!this._workAttributeData.isItalic(),j=!!this._workAttributeData.isUnderline(),z=!!this._workAttributeData.isStrikethrough(),N=!!this._workAttributeData.isOverline();let X=this._workAttributeData.getFgColor(),re=this._workAttributeData.getFgColorMode(),H=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(B){const oe=X;X=H,H=oe;const Le=re;re=W,W=Le}const I=this._getBackgroundColor(W,H,B,A);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=I.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const K=U?this._config.fontWeightBold:this._config.fontWeight,J=T?"italic":"";this._tmpCtx.font=`${J} ${K} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const q=$.length===1&&(0,u.isPowerlineGlyph)($.charCodeAt(0)),he=$.length===1&&(0,u.isRestrictedPowerlineGlyph)($.charCodeAt(0)),de=this._getForegroundColor(L,W,H,M,re,X,B,A,U,(0,u.treatGlyphAsBackgroundColor)($.charCodeAt(0)));this._tmpCtx.fillStyle=de.css;const ce=he?0:4;let Ae=!1;this._config.customGlyphs!==!1&&(Ae=(0,p.tryDrawCustomChar)(this._tmpCtx,$,ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let je,ue=!q;if(je=typeof E=="number"?this._unicodeService.wcwidth(E):this._unicodeService.getStringCellWidth(E),j){this._tmpCtx.save();const oe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Le=oe%2==1?.5:0;if(this._tmpCtx.lineWidth=oe,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ue=!1,this._tmpCtx.strokeStyle=`rgb(${h.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ue=!1;let $e=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&$e<8&&($e+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex($e).css}this._tmpCtx.beginPath();const G=ce,Z=Math.ceil(ce+this._config.deviceCharHeight)-Le-(P?2*oe:0),pe=Z+oe,me=Z+2*oe;let xe=this._workAttributeData.getUnderlineVariantOffset();for(let $e=0;$e<je;$e++){this._tmpCtx.save();const Te=G+$e*this._config.deviceCellWidth,ge=G+($e+1)*this._config.deviceCellWidth,En=Te+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Te,Z),this._tmpCtx.lineTo(ge,Z),this._tmpCtx.moveTo(Te,me),this._tmpCtx.lineTo(ge,me);break;case 3:const Hn=oe<=1?me:Math.ceil(ce+this._config.deviceCharHeight-oe/2)-Le,ft=oe<=1?Z:Math.ceil(ce+this._config.deviceCharHeight+oe/2)-Le,cr=new Path2D;cr.rect(Te,Z,this._config.deviceCellWidth,me-Z),this._tmpCtx.clip(cr),this._tmpCtx.moveTo(Te-this._config.deviceCellWidth/2,pe),this._tmpCtx.bezierCurveTo(Te-this._config.deviceCellWidth/2,ft,Te,ft,Te,pe),this._tmpCtx.bezierCurveTo(Te,Hn,En,Hn,En,pe),this._tmpCtx.bezierCurveTo(En,ft,ge,ft,ge,pe),this._tmpCtx.bezierCurveTo(ge,Hn,ge+this._config.deviceCellWidth/2,Hn,ge+this._config.deviceCellWidth/2,pe);break;case 4:const $t=xe===0?0:xe>=oe?2*oe-xe:oe-xe;xe>=oe||$t===0?(this._tmpCtx.setLineDash([Math.round(oe),Math.round(oe)]),this._tmpCtx.moveTo(Te+$t,Z),this._tmpCtx.lineTo(ge,Z)):(this._tmpCtx.setLineDash([Math.round(oe),Math.round(oe)]),this._tmpCtx.moveTo(Te,Z),this._tmpCtx.lineTo(Te+$t,Z),this._tmpCtx.moveTo(Te+$t+oe,Z),this._tmpCtx.lineTo(ge,Z)),xe=(0,u.computeNextVariantOffset)(ge-Te,oe,xe);break;case 5:const nk=.6,rk=.3,oh=ge-Te,Ov=Math.floor(nk*oh),Nv=Math.floor(rk*oh),ik=oh-Ov-Nv;this._tmpCtx.setLineDash([Ov,Nv,ik]),this._tmpCtx.moveTo(Te,Z),this._tmpCtx.lineTo(ge,Z);break;default:this._tmpCtx.moveTo(Te,Z),this._tmpCtx.lineTo(ge,Z)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ae&&this._config.fontSize>=12&&!this._config.allowTransparency&&$!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const $e=this._tmpCtx.measureText($);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in $e&&$e.actualBoundingBoxDescent>0){this._tmpCtx.save();const Te=new Path2D;Te.rect(G,Z-Math.ceil(oe/2),this._config.deviceCellWidth*je,me-Z+Math.ceil(oe/2)),this._tmpCtx.clip(Te),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=I.css,this._tmpCtx.strokeText($,ce,ce+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(N){const oe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Le=oe%2==1?.5:0;this._tmpCtx.lineWidth=oe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ce,ce+Le),this._tmpCtx.lineTo(ce+this._config.deviceCharWidth*je,ce+Le),this._tmpCtx.stroke()}if(Ae||this._tmpCtx.fillText($,ce,ce+this._config.deviceCharHeight),$==="_"&&!this._config.allowTransparency){let oe=C(this._tmpCtx.getImageData(ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight),I,de,ue);if(oe)for(let Le=1;Le<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=I.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText($,ce,ce+this._config.deviceCharHeight-Le),oe=C(this._tmpCtx.getImageData(ce,ce,this._config.deviceCellWidth,this._config.deviceCellHeight),I,de,ue),oe);Le++);}if(z){const oe=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Le=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=oe,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ce,ce+Math.floor(this._config.deviceCharHeight/2)-Le),this._tmpCtx.lineTo(ce+this._config.deviceCharWidth*je,ce+Math.floor(this._config.deviceCharHeight/2)-Le),this._tmpCtx.stroke()}this._tmpCtx.restore();const Rt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let kn;if(kn=this._config.allowTransparency?function(oe){for(let Le=0;Le<oe.data.length;Le+=4)if(oe.data[Le+3]>0)return!1;return!0}(Rt):C(Rt,I,de,ue),kn)return d;const ke=this._findGlyphBoundingBox(Rt,this._workBoundingBox,O,he,Ae,ce);let _e,Ce;for(;;){if(this._activePages.length===0){const oe=this._createNewPage();_e=oe,Ce=oe.currentRow,Ce.height=ke.size.y;break}_e=this._activePages[this._activePages.length-1],Ce=_e.currentRow;for(const oe of this._activePages)ke.size.y<=oe.currentRow.height&&(_e=oe,Ce=oe.currentRow);for(let oe=this._activePages.length-1;oe>=0;oe--)for(const Le of this._activePages[oe].fixedRows)Le.height<=Ce.height&&ke.size.y<=Le.height&&(_e=this._activePages[oe],Ce=Le);if(Ce.y+ke.size.y>=_e.canvas.height||Ce.height>ke.size.y+2){let oe=!1;if(_e.currentRow.y+_e.currentRow.height+ke.size.y>=_e.canvas.height){let Le;for(const G of this._activePages)if(G.currentRow.y+G.currentRow.height+ke.size.y<G.canvas.height){Le=G;break}if(Le)_e=Le;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&Ce.y+ke.size.y<=_e.canvas.height&&Ce.height>=ke.size.y&&Ce.x+ke.size.x<=_e.canvas.width)oe=!0;else{const G=this._createNewPage();_e=G,Ce=G.currentRow,Ce.height=ke.size.y,oe=!0}}oe||(_e.currentRow.height>0&&_e.fixedRows.push(_e.currentRow),Ce={x:0,y:_e.currentRow.y+_e.currentRow.height,height:ke.size.y},_e.fixedRows.push(Ce),_e.currentRow={x:0,y:Ce.y+Ce.height,height:0})}if(Ce.x+ke.size.x<=_e.canvas.width)break;Ce===_e.currentRow?(Ce.x=0,Ce.y+=Ce.height,Ce.height=0):_e.fixedRows.splice(_e.fixedRows.indexOf(Ce),1)}return ke.texturePage=this._pages.indexOf(_e),ke.texturePosition.x=Ce.x,ke.texturePosition.y=Ce.y,ke.texturePositionClipSpace.x=Ce.x/_e.canvas.width,ke.texturePositionClipSpace.y=Ce.y/_e.canvas.height,ke.sizeClipSpace.x/=_e.canvas.width,ke.sizeClipSpace.y/=_e.canvas.height,Ce.height=Math.max(Ce.height,ke.size.y),Ce.x+=ke.size.x,_e.ctx.putImageData(Rt,ke.texturePosition.x-this._workBoundingBox.left,ke.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ke.size.x,ke.size.y),_e.addGlyph(ke),_e.version++,ke}_findGlyphBoundingBox(E,L,M,D,P,$){L.top=0;const O=D?this._config.deviceCellHeight:this._tmpCanvas.height,F=D?this._config.deviceCellWidth:M;let U=!1;for(let B=0;B<O;B++){for(let A=0;A<F;A++){const T=B*this._tmpCanvas.width*4+4*A+3;if(E.data[T]!==0){L.top=B,U=!0;break}}if(U)break}L.left=0,U=!1;for(let B=0;B<$+F;B++){for(let A=0;A<O;A++){const T=A*this._tmpCanvas.width*4+4*B+3;if(E.data[T]!==0){L.left=B,U=!0;break}}if(U)break}L.right=F,U=!1;for(let B=$+F-1;B>=$;B--){for(let A=0;A<O;A++){const T=A*this._tmpCanvas.width*4+4*B+3;if(E.data[T]!==0){L.right=B,U=!0;break}}if(U)break}L.bottom=O,U=!1;for(let B=O-1;B>=0;B--){for(let A=0;A<F;A++){const T=B*this._tmpCanvas.width*4+4*A+3;if(E.data[T]!==0){L.bottom=B,U=!0;break}}if(U)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+$+(D||P?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+$+(D||P?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=S;class k{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(E){this._glyphs.push(E),this._usedPixels+=E.size.x*E.size.y}constructor(E,L,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const D of M)this._glyphs.push(...D.glyphs),this._usedPixels+=D._usedPixels;this.canvas=R(E,L,L),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function C(w,E,L,M){const D=E.rgba>>>24,P=E.rgba>>>16&255,$=E.rgba>>>8&255,O=L.rgba>>>24,F=L.rgba>>>16&255,U=L.rgba>>>8&255,B=Math.floor((Math.abs(D-O)+Math.abs(P-F)+Math.abs($-U))/12);let A=!0;for(let T=0;T<w.data.length;T+=4)w.data[T]===D&&w.data[T+1]===P&&w.data[T+2]===$||M&&Math.abs(w.data[T]-D)+Math.abs(w.data[T+1]-P)+Math.abs(w.data[T+2]-$)<B?w.data[T+3]=0:A=!1;return A}function R(w,E,L){const M=w.createElement("canvas");return M.width=E,M.height=L,M}},577:function(a,s,l){var c=this&&this.__decorate||function(f,d,v,S){var k,C=arguments.length,R=C<3?d:S===null?S=Object.getOwnPropertyDescriptor(d,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,d,v,S);else for(var w=f.length-1;w>=0;w--)(k=f[w])&&(R=(C<3?k(R):C>3?k(d,v,R):k(d,v))||R);return C>3&&R&&Object.defineProperty(d,v,R),R},p=this&&this.__param||function(f,d){return function(v,S){d(v,S,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=l(147),m=l(855),g=l(782),x=l(97);class y extends u.AttributeData{constructor(d,v,S){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=y;let h=s.CharacterJoinerService=class Fb{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(d){const v={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(v),v.id}deregister(d){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===d)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(d);if(!v||v.length===0)return[];const S=[],k=v.translateToString(!0);let C=0,R=0,w=0,E=v.getFg(0),L=v.getBg(0);for(let M=0;M<v.getTrimmedLength();M++)if(v.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==L){if(M-C>1){const D=this._getJoinedRanges(k,w,R,v,C);for(let P=0;P<D.length;P++)S.push(D[P])}C=M,w=R,E=this._workCell.fg,L=this._workCell.bg}R+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const M=this._getJoinedRanges(k,w,R,v,C);for(let D=0;D<M.length;D++)S.push(M[D])}return S}_getJoinedRanges(d,v,S,k,C){const R=d.substring(v,S);let w=[];try{w=this._characterJoiners[0].handler(R)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const L=this._characterJoiners[E].handler(R);for(let M=0;M<L.length;M++)Fb._mergeRanges(w,L[M])}catch(L){console.error(L)}return this._stringRangesToCellRanges(w,k,C),w}_stringRangesToCellRanges(d,v,S){let k=0,C=!1,R=0,w=d[k];if(w){for(let E=S;E<this._bufferService.cols;E++){const L=v.getWidth(E),M=v.getString(E).length||m.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!C&&w[0]<=R&&(w[0]=E,C=!0),w[1]<=R){if(w[1]=E,w=d[++k],!w)break;w[0]<=R?(w[0]=E,C=!0):C=!1}R+=M}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let S=!1;for(let k=0;k<d.length;k++){const C=d[k];if(S){if(v[1]<=C[0])return d[k-1][1]=v[1],d;if(v[1]<=C[1])return d[k-1][1]=Math.max(v[1],C[1]),d.splice(k,1),d;d.splice(k,1),k--}else{if(v[1]<=C[0])return d.splice(k,0,v),d;if(v[1]<=C[1])return C[0]=Math.min(v[0],C[0]),d;v[0]<C[1]&&(C[0]=Math.min(v[0],C[0]),S=!0)}}return S?d[d.length-1][1]=v[1]:d.push(v),d}};s.CharacterJoinerService=h=c([p(0,x.IBufferService)],h)},160:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const c=l(399);let p=0,u=0,m=0,g=0;var x,y,h,f,d;function v(k){const C=k.toString(16);return C.length<2?"0"+C:C}function S(k,C){return k<C?(C+.05)/(k+.05):(k+.05)/(C+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(k){k.toCss=function(C,R,w,E){return E!==void 0?`#${v(C)}${v(R)}${v(w)}${v(E)}`:`#${v(C)}${v(R)}${v(w)}`},k.toRgba=function(C,R,w,E=255){return(C<<24|R<<16|w<<8|E)>>>0}}(x||(s.channels=x={})),function(k){function C(R,w){return g=Math.round(255*w),[p,u,m]=d.toChannels(R.rgba),{css:x.toCss(p,u,m,g),rgba:x.toRgba(p,u,m,g)}}k.blend=function(R,w){if(g=(255&w.rgba)/255,g===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,L=w.rgba>>16&255,M=w.rgba>>8&255,D=R.rgba>>24&255,P=R.rgba>>16&255,$=R.rgba>>8&255;return p=D+Math.round((E-D)*g),u=P+Math.round((L-P)*g),m=$+Math.round((M-$)*g),{css:x.toCss(p,u,m),rgba:x.toRgba(p,u,m)}},k.isOpaque=function(R){return(255&R.rgba)==255},k.ensureContrastRatio=function(R,w,E){const L=d.ensureContrastRatio(R.rgba,w.rgba,E);if(L)return d.toColor(L>>24&255,L>>16&255,L>>8&255)},k.opaque=function(R){const w=(255|R.rgba)>>>0;return[p,u,m]=d.toChannels(w),{css:x.toCss(p,u,m),rgba:w}},k.opacity=C,k.multiplyOpacity=function(R,w){return g=255&R.rgba,C(R,g*w/255)},k.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}}(y||(s.color=y={})),function(k){let C,R;if(!c.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",R=C.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),m=parseInt(w.slice(3,4).repeat(2),16),d.toColor(p,u,m);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),m=parseInt(w.slice(3,4).repeat(2),16),g=parseInt(w.slice(4,5).repeat(2),16),d.toColor(p,u,m,g);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 p=parseInt(E[1]),u=parseInt(E[2]),m=parseInt(E[3]),g=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),d.toColor(p,u,m,g);if(!C||!R)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=R,C.fillStyle=w,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[p,u,m,g]=C.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(p,u,m,g),css:w}}}(h||(s.css=h={})),function(k){function C(R,w,E){const L=R/255,M=w/255,D=E/255;return .2126*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))}k.relativeLuminance=function(R){return C(R>>16&255,R>>8&255,255&R)},k.relativeLuminance2=C}(f||(s.rgb=f={})),function(k){function C(w,E,L){const M=w>>24&255,D=w>>16&255,P=w>>8&255;let $=E>>24&255,O=E>>16&255,F=E>>8&255,U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));for(;U<L&&($>0||O>0||F>0);)$-=Math.max(0,Math.ceil(.1*$)),O-=Math.max(0,Math.ceil(.1*O)),F-=Math.max(0,Math.ceil(.1*F)),U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));return($<<24|O<<16|F<<8|255)>>>0}function R(w,E,L){const M=w>>24&255,D=w>>16&255,P=w>>8&255;let $=E>>24&255,O=E>>16&255,F=E>>8&255,U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));for(;U<L&&($<255||O<255||F<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),O=Math.min(255,O+Math.ceil(.1*(255-O))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=S(f.relativeLuminance2($,O,F),f.relativeLuminance2(M,D,P));return($<<24|O<<16|F<<8|255)>>>0}k.blend=function(w,E){if(g=(255&E)/255,g===1)return E;const L=E>>24&255,M=E>>16&255,D=E>>8&255,P=w>>24&255,$=w>>16&255,O=w>>8&255;return p=P+Math.round((L-P)*g),u=$+Math.round((M-$)*g),m=O+Math.round((D-O)*g),x.toRgba(p,u,m)},k.ensureContrastRatio=function(w,E,L){const M=f.relativeLuminance(w>>8),D=f.relativeLuminance(E>>8);if(S(M,D)<L){if(D<M){const O=C(w,E,L),F=S(M,f.relativeLuminance(O>>8));if(F<L){const U=R(w,E,L);return F>S(M,f.relativeLuminance(U>>8))?O:U}return O}const P=R(w,E,L),$=S(M,f.relativeLuminance(P>>8));if($<L){const O=C(w,E,L);return $>S(M,f.relativeLuminance(O>>8))?P:O}return P}},k.reduceLuminance=C,k.increaseLuminance=R,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,E,L,M){return{css:x.toCss(w,E,L,M),rgba:x.toRgba(w,E,L,M)}}}(d||(s.rgba=d={})),s.toPaddedHex=v,s.contrastRatio=S},345:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,c){return l(p=>c.fire(p))},s.runAndSubscribe=function(l,c){return c(void 0),l(p=>c(p))}},859:(a,s)=>{function l(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=l,s.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},485:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(p,u,m){this._data[p]||(this._data[p]={}),this._data[p][u]=m}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=l,s.FourKeyMap=class{constructor(){this._data=new l}set(c,p,u,m,g){this._data.get(c,p)||this._data.set(c,p,new l),this._data.get(c,p).set(u,m,g)}get(c,p,u,m){var g;return(g=this._data.get(c,p))==null?void 0:g.get(u,m)}clear(){this._data.clear()}}},399:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u";const l=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=l.includes("Firefox"),s.isLegacyEdge=l.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(l),s.getSafariVersion=function(){if(!s.isSafari)return 0;const p=l.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(l)},385:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=l(399);class p{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),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(g){this._idleCallback=void 0;let x=0,y=0,h=g.timeRemaining(),f=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),y=Math.max(x,y),f=g.timeRemaining(),1.5*y>f)return h-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-x))}ms`),void this._start();h=f}this.clear()}}class u extends p{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const x=Date.now()+g;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},147:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,m=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=m}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},782:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=l(133),p=l(855),u=l(147);class m extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const y=new m;return y.setFromCharData(x),y}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(x[p.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(x[p.CHAR_DATA_CHAR_INDEX].length===2){const h=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const f=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=f&&f<=57343?this.content=1024*(h-55296)+f-56320+65536|x[p.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=x[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[p.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=x[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=m},855:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},s.utf32ToString=function(l,c=0,p=l.length){let u="";for(let m=c;m<p;++m){let g=l[m];g>65535?(g-=65536,u+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):u+=String.fromCharCode(g)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const p=l.length;if(!p)return 0;let u=0,m=0;if(this._interim){const g=l.charCodeAt(m++);56320<=g&&g<=57343?c[u++]=1024*(this._interim-55296)+g-56320+65536:(c[u++]=this._interim,c[u++]=g),this._interim=0}for(let g=m;g<p;++g){const x=l.charCodeAt(g);if(55296<=x&&x<=56319){if(++g>=p)return this._interim=x,u;const y=l.charCodeAt(g);56320<=y&&y<=57343?c[u++]=1024*(x-55296)+y-56320+65536:(c[u++]=x,c[u++]=y)}else x!==65279&&(c[u++]=x)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const p=l.length;if(!p)return 0;let u,m,g,x,y=0,h=0,f=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let C,R=0;for(;(C=63&this.interim[++R])&&R<4;)k<<=6,k|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-R;for(;f<E;){if(f>=p)return 0;if(C=l[f++],(192&C)!=128){f--,S=!0;break}this.interim[R++]=C,k<<=6,k|=63&C}S||(w===2?k<128?f--:c[y++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[y++]=k):k<65536||k>1114111||(c[y++]=k)),this.interim.fill(0)}const d=p-4;let v=f;for(;v<p;){for(;!(!(v<d)||128&(u=l[v])||128&(m=l[v+1])||128&(g=l[v+2])||128&(x=l[v+3]));)c[y++]=u,c[y++]=m,c[y++]=g,c[y++]=x,v+=4;if(u=l[v++],u<128)c[y++]=u;else if((224&u)==192){if(v>=p)return this.interim[0]=u,y;if(m=l[v++],(192&m)!=128){v--;continue}if(h=(31&u)<<6|63&m,h<128){v--;continue}c[y++]=h}else if((240&u)==224){if(v>=p)return this.interim[0]=u,y;if(m=l[v++],(192&m)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=m,y;if(g=l[v++],(192&g)!=128){v--;continue}if(h=(15&u)<<12|(63&m)<<6|63&g,h<2048||h>=55296&&h<=57343||h===65279)continue;c[y++]=h}else if((248&u)==240){if(v>=p)return this.interim[0]=u,y;if(m=l[v++],(192&m)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=m,y;if(g=l[v++],(192&g)!=128){v--;continue}if(v>=p)return this.interim[0]=u,this.interim[1]=m,this.interim[2]=g,y;if(x=l[v++],(192&x)!=128){v--;continue}if(h=(7&u)<<18|(63&m)<<12|(63&g)<<6|63&x,h<65536||h>1114111)continue;c[y++]=h}}return y}}},776:function(a,s,l){var c=this&&this.__decorate||function(h,f,d,v){var S,k=arguments.length,C=k<3?f:v===null?v=Object.getOwnPropertyDescriptor(f,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(h,f,d,v);else for(var R=h.length-1;R>=0;R--)(S=h[R])&&(C=(k<3?S(C):k>3?S(f,d,C):S(f,d))||C);return k>3&&C&&Object.defineProperty(f,d,C),C},p=this&&this.__param||function(h,f){return function(d,v){f(d,v,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=l(859),m=l(97),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let x,y=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let f=0;f<h.length;f++)typeof h[f]=="function"&&(h[f]=h[f]())}_log(h,f,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+f,...d)}trace(h,...f){var d;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,f)}debug(h,...f){var d;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,f)}info(h,...f){var d;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,f)}warn(h,...f){var d;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,f)}error(h,...f){var d;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,f)}};s.LogService=y=c([p(0,m.IOptionsService)],y),s.setTraceLogger=function(h){x=h},s.traceCall=function(h,f,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...S){if(x.logLevel!==m.LogLevelEnum.TRACE)return v.apply(this,S);x.trace(`GlyphRenderer#${v.name}(${S.map(C=>JSON.stringify(C)).join(", ")})`);const k=v.apply(this,S);return x.trace(`GlyphRenderer#${v.name} return`,k),k}}},726:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const l="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(p){return p[c]||[]},s.createDecorator=function(p){if(s.serviceRegistry.has(p))return s.serviceRegistry.get(p);const u=function(m,g,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,h,f){h[l]===h?h[c].push({id:y,index:f}):(h[c]=[{id:y,index:f}],h[l]=h)})(u,m,x)};return u.toString=()=>p,s.serviceRegistry.set(p,u),u}},97:(a,s,l)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=l(726);var p;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(s.LogLevelEnum=p={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.CanvasAddon=void 0;const s=i(345),l=i(859),c=i(776),p=i(949);class u extends l.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var g;return(g=this._renderer)==null?void 0:g.textureAtlas}activate(g){const x=g._core;if(!g.element)return void this.register(x.onWillOpen(()=>this.activate(g)));this._terminal=g;const y=x.coreService,h=x.optionsService,f=x.screenElement,d=x.linkifier2,v=x,S=v._bufferService,k=v._renderService,C=v._characterJoinerService,R=v._charSizeService,w=v._coreBrowserService,E=v._decorationService,L=v._logService,M=v._themeService;(0,c.setTraceLogger)(L),this._renderer=new p.CanvasRenderer(g,f,d,S,R,h,C,y,w,E,M),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),k.setRenderer(this._renderer),k.handleResize(S.cols,S.rows),this.register((0,l.toDisposable)(()=>{var D;k.setRenderer(this._terminal._core._createRenderer()),k.handleResize(g.cols,g.rows),(D=this._renderer)==null||D.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var g;(g=this._renderer)==null||g.clearTextureAtlas()}}a.CanvasAddon=u})(),o})())})(Bb);var ZL=Bb.exports,zb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.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 a=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(s.getPropertyValue("height")),c=Math.max(0,parseInt(s.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=l-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),m=c-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(m/o.css.cell.width)),rows:Math.max(1,Math.floor(u/o.css.cell.height))}}}})(),n})())})(zb);var e8=zb.exports,Hb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={345:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(l,c){return l(p=>c.fire(p))},s.runAndSubscribe=function(l,c){return c(void 0),l(p=>c(p))}},859:(a,s)=>{function l(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)==null||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=l,s.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.SearchAddon=void 0;const s=i(345),l=i(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class p extends l.Disposable{constructor(m){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new l.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new s.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(m==null?void 0:m.highlightLimit)??1e3}activate(m){this._terminal=m,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,l.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var m;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((m=this._lastSearchOptions)!=null&&m.decorations)&&(this._highlightTimeout=setTimeout(()=>{const g=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(g,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(m){this._selectedDecoration.clear(),(0,l.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),m||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(m,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||m!==this._cachedSearchTerm||x)&&this._highlightAllMatches(m,g);const y=this._findNextAndSelect(m,g);return this._fireResults(g),this._cachedSearchTerm=m,y}_highlightAllMatches(m,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!m||m.length===0)return void this.clearDecorations();g=g||{},this.clearDecorations(!0);const x=[];let y,h=this._find(m,0,0,g);for(;h&&((y==null?void 0:y.row)!==h.row||(y==null?void 0:y.col)!==h.col)&&!(x.length>=this._highlightLimit);)y=h,x.push(y),h=this._find(m,y.col+y.term.length>=this._terminal.cols?y.row+1:y.row,y.col+y.term.length>=this._terminal.cols?0:y.col+1,g);for(const f of x){const d=this._createResultDecoration(f,g.decorations);d&&(this._highlightedLines.add(d.marker.line),this._highlightDecorations.push({decoration:d,match:f,dispose(){d.dispose()}}))}}_find(m,g,x,y){var d;if(!this._terminal||!m||m.length===0)return(d=this._terminal)==null||d.clearSelection(),void this.clearDecorations();if(x>this._terminal.cols)throw new Error(`Invalid col: ${x} to search in terminal of ${this._terminal.cols} cols`);let h;this._initLinesCache();const f={startRow:g,startCol:x};if(h=this._findInLine(m,f,y),!h)for(let v=g+1;v<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=v,f.startCol=0,h=this._findInLine(m,f,y),!h);v++);return h}_findNextAndSelect(m,g){var v;if(!this._terminal||!m||m.length===0)return(v=this._terminal)==null||v.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=0,h=0;x&&(this._cachedSearchTerm===m?(y=x.end.x,h=x.end.y):(y=x.start.x,h=x.start.y)),this._initLinesCache();const f={startRow:h,startCol:y};let d=this._findInLine(m,f,g);if(!d)for(let S=h+1;S<this._terminal.buffer.active.baseY+this._terminal.rows&&(f.startRow=S,f.startCol=0,d=this._findInLine(m,f,g),!d);S++);if(!d&&h!==0)for(let S=0;S<h&&(f.startRow=S,f.startCol=0,d=this._findInLine(m,f,g),!d);S++);return!d&&x&&(f.startRow=x.start.y,f.startCol=0,d=this._findInLine(m,f,g)),this._selectResult(d,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}findPrevious(m,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const x=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||m!==this._cachedSearchTerm||x)&&this._highlightAllMatches(m,g);const y=this._findPreviousAndSelect(m,g);return this._fireResults(g),this._cachedSearchTerm=m,y}_didOptionsChange(m,g){return!!g&&(m.caseSensitive!==g.caseSensitive||m.regex!==g.regex||m.wholeWord!==g.wholeWord)}_fireResults(m){if(m!=null&&m.decorations){let g=-1;if(this._selectedDecoration.value){const x=this._selectedDecoration.value.match;for(let y=0;y<this._highlightDecorations.length;y++){const h=this._highlightDecorations[y].match;if(h.row===x.row&&h.col===x.col&&h.size===x.size){g=y;break}}}this._onDidChangeResults.fire({resultIndex:g,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(m,g){var S;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!m||m.length===0)return(S=this._terminal)==null||S.clearSelection(),this.clearDecorations(),!1;const x=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=this._terminal.buffer.active.baseY+this._terminal.rows-1,h=this._terminal.cols;const f=!0;this._initLinesCache();const d={startRow:y,startCol:h};let v;if(x&&(d.startRow=y=x.start.y,d.startCol=h=x.start.x,this._cachedSearchTerm!==m&&(v=this._findInLine(m,d,g,!1),v||(d.startRow=y=x.end.y,d.startCol=h=x.end.x))),v||(v=this._findInLine(m,d,g,f)),!v){d.startCol=Math.max(d.startCol,this._terminal.cols);for(let k=y-1;k>=0&&(d.startRow=k,v=this._findInLine(m,d,g,f),!v);k--);}if(!v&&y!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let k=this._terminal.buffer.active.baseY+this._terminal.rows-1;k>=y&&(d.startRow=k,v=this._findInLine(m,d,g,f),!v);k--);return this._selectResult(v,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}_initLinesCache(){const m=this._terminal;this._linesCache||(this._linesCache=new Array(m.buffer.active.length),this._cursorMoveListener=m.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=m.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(m,g,x){return(m===0||c.includes(g[m-1]))&&(m+x.length===g.length||c.includes(g[m+x.length]))}_findInLine(m,g,x={},y=!1){var M;const h=this._terminal,f=g.startRow,d=g.startCol,v=h.buffer.active.getLine(f);if(v!=null&&v.isWrapped)return y?void(g.startCol+=h.cols):(g.startRow--,g.startCol+=h.cols,this._findInLine(m,g,x));let S=(M=this._linesCache)==null?void 0:M[f];S||(S=this._translateBufferLineToStringWithWrap(f,!0),this._linesCache&&(this._linesCache[f]=S));const[k,C]=S,R=this._bufferColsToStringOffset(f,d),w=x.caseSensitive?m:m.toLowerCase(),E=x.caseSensitive?k:k.toLowerCase();let L=-1;if(x.regex){const D=RegExp(w,"g");let P;if(y)for(;P=D.exec(E.slice(0,R));)L=D.lastIndex-P[0].length,m=P[0],D.lastIndex-=m.length-1;else P=D.exec(E.slice(R)),P&&P[0].length>0&&(L=R+(D.lastIndex-P[0].length),m=P[0])}else y?R-w.length>=0&&(L=E.lastIndexOf(w,R-w.length)):L=E.indexOf(w,R);if(L>=0){if(x.wholeWord&&!this._isWholeWord(L,E,m))return;let D=0;for(;D<C.length-1&&L>=C[D+1];)D++;let P=D;for(;P<C.length-1&&L+m.length>=C[P+1];)P++;const $=L-C[D],O=L+m.length-C[P],F=this._stringLengthToBufferSize(f+D,$);return{term:m,col:F,row:f+D,size:this._stringLengthToBufferSize(f+P,O)-F+h.cols*(P-D)}}}_stringLengthToBufferSize(m,g){const x=this._terminal.buffer.active.getLine(m);if(!x)return 0;for(let y=0;y<g;y++){const h=x.getCell(y);if(!h)break;const f=h.getChars();f.length>1&&(g-=f.length-1);const d=x.getCell(y+1);d&&d.getWidth()===0&&g++}return g}_bufferColsToStringOffset(m,g){const x=this._terminal;let y=m,h=0,f=x.buffer.active.getLine(y);for(;g>0&&f;){for(let d=0;d<g&&d<x.cols;d++){const v=f.getCell(d);if(!v)break;v.getWidth()&&(h+=v.getCode()===0?1:v.getChars().length)}if(y++,f=x.buffer.active.getLine(y),f&&!f.isWrapped)break;g-=x.cols}return h}_translateBufferLineToStringWithWrap(m,g){var d;const x=this._terminal,y=[],h=[0];let f=x.buffer.active.getLine(m);for(;f;){const v=x.buffer.active.getLine(m+1),S=!!v&&v.isWrapped;let k=f.translateToString(!S&&g);if(S&&v){const C=f.getCell(f.length-1);C&&C.getCode()===0&&C.getWidth()===1&&((d=v.getCell(0))==null?void 0:d.getWidth())===2&&(k=k.slice(0,-1))}if(y.push(k),!S)break;h.push(h[h.length-1]+k.length),m++,f=v}return[y.join(""),h]}_selectResult(m,g,x){const y=this._terminal;if(this._selectedDecoration.clear(),!m)return y.clearSelection(),!1;if(y.select(m.col,m.row,m.size),g){const h=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+m.row);if(h){const f=y.registerDecoration({marker:h,x:m.col,width:m.size,backgroundColor:g.activeMatchBackground,layer:"top",overviewRulerOptions:{color:g.activeMatchColorOverviewRuler}});if(f){const d=[];d.push(h),d.push(f.onRender(v=>this._applyStyles(v,g.activeMatchBorder,!0))),d.push(f.onDispose(()=>(0,l.disposeArray)(d))),this._selectedDecoration.value={decoration:f,match:m,dispose(){f.dispose()}}}}}if(!x&&(m.row>=y.buffer.active.viewportY+y.rows||m.row<y.buffer.active.viewportY)){let h=m.row-y.buffer.active.viewportY;h-=Math.floor(y.rows/2),y.scrollLines(h)}return!0}_applyStyles(m,g,x){m.classList.contains("xterm-find-result-decoration")||(m.classList.add("xterm-find-result-decoration"),g&&(m.style.outline=`1px solid ${g}`)),x&&m.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(m,g){const x=this._terminal,y=x.registerMarker(-x.buffer.active.baseY-x.buffer.active.cursorY+m.row);if(!y)return;const h=x.registerDecoration({marker:y,x:m.col,width:m.size,backgroundColor:g.matchBackground,overviewRulerOptions:this._highlightedLines.has(y.line)?void 0:{color:g.matchOverviewRuler,position:"center"}});if(h){const f=[];f.push(y),f.push(h.onRender(d=>this._applyStyles(d,g.matchBorder,!1))),f.push(h.onDispose(()=>(0,l.disposeArray)(f)))}return h}}a.SearchAddon=p})(),o})())})(Hb);var t8=Hb.exports,Ub={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(c,p,u,m={}){this._terminal=c,this._regex=p,this._handler=u,this._options=m}provideLinks(c,p){const u=l.computeLink(c,this._regex,this._terminal,this._handler);p(this._addCallbacks(u))}_addCallbacks(c){return c.map(p=>(p.leave=this._options.leave,p.hover=(u,m)=>{if(this._options.hover){const{range:g}=p;this._options.hover(u,m,g)}},p))}};class l{static computeLink(p,u,m,g){const x=new RegExp(u.source,(u.flags||"")+"g"),[y,h]=l._getWindowedLineStrings(p-1,m),f=y.join("");let d;const v=[];for(;d=x.exec(f);){const S=d[0];try{const L=new URL(S),M=decodeURI(L.toString());if(S!==M&&S+"/"!==M)continue}catch{continue}const[k,C]=l._mapStrIdx(m,h,0,d.index),[R,w]=l._mapStrIdx(m,k,C,S.length);if(k===-1||C===-1||R===-1||w===-1)continue;const E={start:{x:C+1,y:k+1},end:{x:w,y:R+1}};v.push({range:E,text:S,activate:g})}return v}static _getWindowedLineStrings(p,u){let m,g=p,x=p,y=0,h="";const f=[];if(m=u.buffer.active.getLine(p)){const d=m.translateToString(!0);if(m.isWrapped&&d[0]!==" "){for(y=0;(m=u.buffer.active.getLine(--g))&&y<2048&&(h=m.translateToString(!0),y+=h.length,f.push(h),m.isWrapped&&h.indexOf(" ")===-1););f.reverse()}for(f.push(d),y=0;(m=u.buffer.active.getLine(++x))&&m.isWrapped&&y<2048&&(h=m.translateToString(!0),y+=h.length,f.push(h),h.indexOf(" ")===-1););}return[f,g]}static _mapStrIdx(p,u,m,g){const x=p.buffer.active,y=x.getNullCell();let h=m;for(;g;){const f=x.getLine(u);if(!f)return[-1,-1];for(let d=h;d<f.length;++d){f.getCell(d,y);const v=y.getChars();if(y.getWidth()&&(g-=v.length||1,d===f.length-1&&v==="")){const S=x.getLine(u+1);S&&S.isWrapped&&(S.getCell(0,y),y.getWidth()===2&&(g+=1))}if(g<0)return[u,d]}u++,h=0}return[u,h]}}s.LinkComputer=l}},r={};function i(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var o={};return(()=>{var a=o;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const s=i(6),l=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(p,u){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(p=c,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,m=u.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,m,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),o})())})(Ub);var n8=Ub.exports,Fo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ro=typeof window>"u"||"Deno"in window;function un(){}function r8(e,t){return typeof e=="function"?e(t):e}function vp(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b_(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==Sg(a,t.options))return!1}else if(!Qa(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function S_(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ns(t.options.mutationKey)!==ns(o))return!1}else if(!Qa(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Sg(e,t){return((t==null?void 0:t.queryKeyHashFn)||ns)(e)}function ns(e){return JSON.stringify(e,(t,n)=>_p(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Qa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Qa(e[n],t[n])):!1}function Vb(e,t){if(e===t)return e;const n=C_(e)&&C_(t);if(n||_p(e)&&_p(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{};let s=0;for(let l=0;l<o;l++){const c=n?l:i[l];a[c]=Vb(e[c],t[c]),a[c]===e[c]&&s++}return r===o&&s===r?e:a}return t}function Hu(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function C_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _p(e){if(!k_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!k_(n)||!n.hasOwnProperty("isPrototypeOf"))}function k_(e){return Object.prototype.toString.call(e)==="[object Object]"}function i8(e){return new Promise(t=>{setTimeout(t,e)})}function yp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Vb(e,t):t}function s8(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function o8(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ji,Gr,eo,ay,a8=(ay=class extends Fo{constructor(){super();le(this,ji,void 0);le(this,Gr,void 0);le(this,eo,void 0);ie(this,eo,t=>{if(!Ro&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){V(this,Gr)||this.setEventListener(V(this,eo))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,Gr))==null||t.call(this),ie(this,Gr,void 0))}setEventListener(t){var n;ie(this,eo,t),(n=V(this,Gr))==null||n.call(this),ie(this,Gr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){V(this,ji)!==t&&(ie(this,ji,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof V(this,ji)=="boolean"?V(this,ji):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ji=new WeakMap,Gr=new WeakMap,eo=new WeakMap,ay),Uu=new a8,to,Yr,no,ly,l8=(ly=class extends Fo{constructor(){super();le(this,to,!0);le(this,Yr,void 0);le(this,no,void 0);ie(this,no,t=>{if(!Ro&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){V(this,Yr)||this.setEventListener(V(this,no))}onUnsubscribe(){var t;this.hasListeners()||((t=V(this,Yr))==null||t.call(this),ie(this,Yr,void 0))}setEventListener(t){var n;ie(this,no,t),(n=V(this,Yr))==null||n.call(this),ie(this,Yr,t(this.setOnline.bind(this)))}setOnline(t){V(this,to)!==t&&(ie(this,to,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return V(this,to)}},to=new WeakMap,Yr=new WeakMap,no=new WeakMap,ly),Wu=new l8;function c8(e){return Math.min(1e3*2**e,3e4)}function Pd(e){return(e??"online")==="online"?Wu.isOnline():!0}var Kb=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function zh(e){return e instanceof Kb}function qb(e){let t=!1,n=0,r=!1,i,o,a;const s=new Promise((h,f)=>{o=h,a=f}),l=h=>{var f;r||(g(new Kb(h)),(f=e.abort)==null||f.call(e))},c=()=>{t=!0},p=()=>{t=!1},u=()=>!Uu.isFocused()||e.networkMode!=="always"&&!Wu.isOnline(),m=h=>{var f;r||(r=!0,(f=e.onSuccess)==null||f.call(e,h),i==null||i(),o(h))},g=h=>{var f;r||(r=!0,(f=e.onError)==null||f.call(e,h),i==null||i(),a(h))},x=()=>new Promise(h=>{var f;i=d=>{const v=r||!u();return v&&h(d),v},(f=e.onPause)==null||f.call(e)}).then(()=>{var h;i=void 0,r||(h=e.onContinue)==null||h.call(e)}),y=()=>{if(r)return;let h;try{h=e.fn()}catch(f){h=Promise.reject(f)}Promise.resolve(h).then(m).catch(f=>{var C;if(r)return;const d=e.retry??(Ro?0:3),v=e.retryDelay??c8,S=typeof v=="function"?v(n,f):v,k=d===!0||typeof d=="number"&&n<d||typeof d=="function"&&d(n,f);if(t||!k){g(f);return}n++,(C=e.onFail)==null||C.call(e,n,f),i8(S).then(()=>{if(u())return x()}).then(()=>{t?g(f):y()})})};return Pd(e.networkMode)?y():x().then(y),{promise:s,cancel:l,continue:()=>(i==null?void 0:i())?s:Promise.resolve(),cancelRetry:c,continueRetry:p}}function u8(){let e=[],t=0,n=m=>{m()},r=m=>{m()},i=m=>setTimeout(m,0);const o=m=>{i=m},a=m=>{let g;t++;try{g=m()}finally{t--,t||c()}return g},s=m=>{t?e.push(m):i(()=>{n(m)})},l=m=>(...g)=>{s(()=>{m(...g)})},c=()=>{const m=e;e=[],m.length&&i(()=>{r(()=>{m.forEach(g=>{n(g)})})})};return{batch:a,batchCalls:l,schedule:s,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{r=m},setScheduler:o}}var ut=u8(),Bi,cy,Gb=(cy=class{constructor(){le(this,Bi,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),vp(this.gcTime)&&ie(this,Bi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ro?1/0:5*60*1e3))}clearGcTimeout(){V(this,Bi)&&(clearTimeout(V(this,Bi)),ie(this,Bi,void 0))}},Bi=new WeakMap,cy),ro,io,an,Xr,ln,pt,ol,Fi,so,Xc,Mn,hr,uy,d8=(uy=class extends Gb{constructor(t){super();le(this,so);le(this,Mn);le(this,ro,void 0);le(this,io,void 0);le(this,an,void 0);le(this,Xr,void 0);le(this,ln,void 0);le(this,pt,void 0);le(this,ol,void 0);le(this,Fi,void 0);ie(this,Fi,!1),ie(this,ol,t.defaultOptions),ye(this,so,Xc).call(this,t.options),ie(this,pt,[]),ie(this,an,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ie(this,ro,t.state||h8(this.options)),this.state=V(this,ro),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!V(this,pt).length&&this.state.fetchStatus==="idle"&&V(this,an).remove(this)}setData(t,n){const r=yp(this.state.data,t,this.options);return ye(this,Mn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ye(this,Mn,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=V(this,Xr);return(r=V(this,ln))==null||r.cancel(t),n?n.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(V(this,ro))}isActive(){return V(this,pt).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||V(this,pt).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Wb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=V(this,pt).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=V(this,ln))==null||n.continue()}onOnline(){var n;const t=V(this,pt).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=V(this,ln))==null||n.continue()}addObserver(t){V(this,pt).includes(t)||(V(this,pt).push(t),this.clearGcTimeout(),V(this,an).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){V(this,pt).includes(t)&&(ie(this,pt,V(this,pt).filter(n=>n!==t)),V(this,pt).length||(V(this,ln)&&(V(this,Fi)?V(this,ln).cancel({revert:!0}):V(this,ln).cancelRetry()),this.scheduleGc()),V(this,an).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return V(this,pt).length}invalidate(){this.state.isInvalidated||ye(this,Mn,hr).call(this,{type:"invalidate"})}fetch(t,n){var c,p,u,m;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(V(this,Xr))return(c=V(this,ln))==null||c.continueRetry(),V(this,Xr)}if(t&&ye(this,so,Xc).call(this,t),!this.options.queryFn){const g=V(this,pt).find(x=>x.options.queryFn);g&&ye(this,so,Xc).call(this,g.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(ie(this,Fi,!0),r.signal)})};o(i);const a=()=>this.options.queryFn?(ie(this,Fi,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(s),(p=this.options.behavior)==null||p.onFetch(s,this),ie(this,io,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&ye(this,Mn,hr).call(this,{type:"fetch",meta:(m=s.fetchOptions)==null?void 0:m.meta});const l=g=>{var x,y,h,f;zh(g)&&g.silent||ye(this,Mn,hr).call(this,{type:"error",error:g}),zh(g)||((y=(x=V(this,an).config).onError)==null||y.call(x,g,this),(f=(h=V(this,an).config).onSettled)==null||f.call(h,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return ie(this,ln,qb({fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var x,y,h,f;if(typeof g>"u"){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(g),(y=(x=V(this,an).config).onSuccess)==null||y.call(x,g,this),(f=(h=V(this,an).config).onSettled)==null||f.call(h,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,x)=>{ye(this,Mn,hr).call(this,{type:"failed",failureCount:g,error:x})},onPause:()=>{ye(this,Mn,hr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Mn,hr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),ie(this,Xr,V(this,ln).promise),V(this,Xr)}},ro=new WeakMap,io=new WeakMap,an=new WeakMap,Xr=new WeakMap,ln=new WeakMap,pt=new WeakMap,ol=new WeakMap,Fi=new WeakMap,so=new WeakSet,Xc=function(t){this.options={...V(this,ol),...t},this.updateGcTime(this.options.gcTime)},Mn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Pd(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return zh(i)&&i.revert&&V(this,io)?{...V(this,io),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ut.batch(()=>{V(this,pt).forEach(r=>{r.onQueryUpdate()}),V(this,an).notify({query:this,type:"updated",action:t})})},uy);function h8(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kn,dy,f8=(dy=class extends Fo{constructor(t={}){super();le(this,Kn,void 0);this.config=t,ie(this,Kn,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Sg(i,n);let a=this.get(o);return a||(a=new d8({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){V(this,Kn).has(t.queryHash)||(V(this,Kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=V(this,Kn).get(t.queryHash);n&&(t.destroy(),n===t&&V(this,Kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return V(this,Kn).get(t)}getAll(){return[...V(this,Kn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>b_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>b_(t,r)):n}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kn=new WeakMap,dy),qn,al,qt,oo,Gn,zr,hy,p8=(hy=class extends Gb{constructor(t){super();le(this,Gn);le(this,qn,void 0);le(this,al,void 0);le(this,qt,void 0);le(this,oo,void 0);this.mutationId=t.mutationId,ie(this,al,t.defaultOptions),ie(this,qt,t.mutationCache),ie(this,qn,[]),this.state=t.state||Yb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...V(this,al),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){V(this,qn).includes(t)||(V(this,qn).push(t),this.clearGcTimeout(),V(this,qt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ie(this,qn,V(this,qn).filter(n=>n!==t)),this.scheduleGc(),V(this,qt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){V(this,qn).length||(this.state.status==="pending"?this.scheduleGc():V(this,qt).remove(this))}continue(){var t;return((t=V(this,oo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,l,c,p,u,m,g,x,y,h,f,d,v,S,k,C,R;const n=()=>(ie(this,oo,qb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(w,E)=>{ye(this,Gn,zr).call(this,{type:"failed",failureCount:w,error:E})},onPause:()=>{ye(this,Gn,zr).call(this,{type:"pause"})},onContinue:()=>{ye(this,Gn,zr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),V(this,oo).promise),r=this.state.status==="pending";try{if(!r){ye(this,Gn,zr).call(this,{type:"pending",variables:t}),await((o=(i=V(this,qt).config).onMutate)==null?void 0:o.call(i,t,this));const E=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));E!==this.state.context&&ye(this,Gn,zr).call(this,{type:"pending",context:E,variables:t})}const w=await n();return await((c=(l=V(this,qt).config).onSuccess)==null?void 0:c.call(l,w,t,this.state.context,this)),await((u=(p=this.options).onSuccess)==null?void 0:u.call(p,w,t,this.state.context)),await((g=(m=V(this,qt).config).onSettled)==null?void 0:g.call(m,w,null,this.state.variables,this.state.context,this)),await((y=(x=this.options).onSettled)==null?void 0:y.call(x,w,null,t,this.state.context)),ye(this,Gn,zr).call(this,{type:"success",data:w}),w}catch(w){try{throw await((f=(h=V(this,qt).config).onError)==null?void 0:f.call(h,w,t,this.state.context,this)),await((v=(d=this.options).onError)==null?void 0:v.call(d,w,t,this.state.context)),await((k=(S=V(this,qt).config).onSettled)==null?void 0:k.call(S,void 0,w,this.state.variables,this.state.context,this)),await((R=(C=this.options).onSettled)==null?void 0:R.call(C,void 0,w,t,this.state.context)),w}finally{ye(this,Gn,zr).call(this,{type:"error",error:w})}}}},qn=new WeakMap,al=new WeakMap,qt=new WeakMap,oo=new WeakMap,Gn=new WeakSet,zr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Pd(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ut.batch(()=>{V(this,qn).forEach(r=>{r.onMutationUpdate(t)}),V(this,qt).notify({mutation:this,type:"updated",action:t})})},hy);function Yb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cn,ll,zi,fy,m8=(fy=class extends Fo{constructor(t={}){super();le(this,cn,void 0);le(this,ll,void 0);le(this,zi,void 0);this.config=t,ie(this,cn,[]),ie(this,ll,0)}build(t,n,r){const i=new p8({mutationCache:this,mutationId:++Kl(this,ll)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){V(this,cn).push(t),this.notify({type:"added",mutation:t})}remove(t){ie(this,cn,V(this,cn).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){ut.batch(()=>{V(this,cn).forEach(t=>{this.remove(t)})})}getAll(){return V(this,cn)}find(t){const n={exact:!0,...t};return V(this,cn).find(r=>S_(n,r))}findAll(t={}){return V(this,cn).filter(n=>S_(t,n))}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return ie(this,zi,(V(this,zi)??Promise.resolve()).then(()=>{const t=V(this,cn).filter(n=>n.state.isPaused);return ut.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(un)),Promise.resolve()))}).then(()=>{ie(this,zi,void 0)})),V(this,zi)}},cn=new WeakMap,ll=new WeakMap,zi=new WeakMap,fy);function g8(e){return{onFetch:(t,n)=>{const r=async()=>{var x,y,h,f,d;const i=t.options,o=(h=(y=(x=t.fetchOptions)==null?void 0:x.meta)==null?void 0:y.fetchMore)==null?void 0:h.direction,a=((f=t.state.data)==null?void 0:f.pages)||[],s=((d=t.state.data)==null?void 0:d.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const p=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},u=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),m=async(v,S,k)=>{if(c)return Promise.reject();if(S==null&&v.pages.length)return Promise.resolve(v);const C={queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};p(C);const R=await u(C),{maxPages:w}=t.options,E=k?o8:s8;return{pages:E(v.pages,R,w),pageParams:E(v.pageParams,S,w)}};let g;if(o&&a.length){const v=o==="backward",S=v?v8:E_,k={pages:a,pageParams:s},C=S(i,k);g=await m(k,C,v)}else{g=await m(l,s[0]??i.initialPageParam);const v=e??a.length;for(let S=1;S<v;S++){const k=E_(i,g);g=await m(g,k)}}return g};t.options.persister?t.fetchFn=()=>{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function E_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function v8(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var at,Qr,Jr,ao,lo,Zr,co,uo,py,_8=(py=class{constructor(e={}){le(this,at,void 0);le(this,Qr,void 0);le(this,Jr,void 0);le(this,ao,void 0);le(this,lo,void 0);le(this,Zr,void 0);le(this,co,void 0);le(this,uo,void 0);ie(this,at,e.queryCache||new f8),ie(this,Qr,e.mutationCache||new m8),ie(this,Jr,e.defaultOptions||{}),ie(this,ao,new Map),ie(this,lo,new Map),ie(this,Zr,0)}mount(){Kl(this,Zr)._++,V(this,Zr)===1&&(ie(this,co,Uu.subscribe(()=>{Uu.isFocused()&&(this.resumePausedMutations(),V(this,at).onFocus())})),ie(this,uo,Wu.subscribe(()=>{Wu.isOnline()&&(this.resumePausedMutations(),V(this,at).onOnline())})))}unmount(){var e,t;Kl(this,Zr)._--,V(this,Zr)===0&&((e=V(this,co))==null||e.call(this),ie(this,co,void 0),(t=V(this,uo))==null||t.call(this),ie(this,uo,void 0))}isFetching(e){return V(this,at).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return V(this,Qr).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=V(this,at).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=V(this,at).find({queryKey:e}),i=r==null?void 0:r.state.data,o=r8(t,i);if(typeof o>"u")return;const a=this.defaultQueryOptions({queryKey:e});return V(this,at).build(this,a).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=V(this,at).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=V(this,at);ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=V(this,at),r={type:"active",...e};return ut.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=ut.batch(()=>V(this,at).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(un).catch(un)}invalidateQueries(e={},t={}){return ut.batch(()=>{if(V(this,at).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=ut.batch(()=>V(this,at).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(un)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(un)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=V(this,at).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=g8(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}resumePausedMutations(){return V(this,Qr).resumePausedMutations()}getQueryCache(){return V(this,at)}getMutationCache(){return V(this,Qr)}getDefaultOptions(){return V(this,Jr)}setDefaultOptions(e){ie(this,Jr,e)}setQueryDefaults(e,t){V(this,ao).set(ns(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...V(this,ao).values()];let n={};return t.forEach(r=>{Qa(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){V(this,lo).set(ns(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...V(this,lo).values()];let n={};return t.forEach(r=>{Qa(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...V(this,Jr).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Sg(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...V(this,Jr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){V(this,at).clear(),V(this,Qr).clear()}},at=new WeakMap,Qr=new WeakMap,Jr=new WeakMap,ao=new WeakMap,lo=new WeakMap,Zr=new WeakMap,co=new WeakMap,uo=new WeakMap,py),Nt,Ve,cl,Lt,Hi,ho,Yn,ul,fo,po,Ui,Wi,ei,mo,Vi,ya,dl,xp,hl,wp,fl,bp,pl,Sp,ml,Cp,gl,kp,vl,Ep,ad,Xb,my,y8=(my=class extends Fo{constructor(t,n){super();le(this,Vi);le(this,dl);le(this,hl);le(this,fl);le(this,pl);le(this,ml);le(this,gl);le(this,vl);le(this,ad);le(this,Nt,void 0);le(this,Ve,void 0);le(this,cl,void 0);le(this,Lt,void 0);le(this,Hi,void 0);le(this,ho,void 0);le(this,Yn,void 0);le(this,ul,void 0);le(this,fo,void 0);le(this,po,void 0);le(this,Ui,void 0);le(this,Wi,void 0);le(this,ei,void 0);le(this,mo,new Set);this.options=n,ie(this,Nt,t),ie(this,Yn,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(V(this,Ve).addObserver(this),R_(V(this,Ve),this.options)?ye(this,Vi,ya).call(this):this.updateResult(),ye(this,pl,Sp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rp(V(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rp(V(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,ml,Cp).call(this),ye(this,gl,kp).call(this),V(this,Ve).removeObserver(this)}setOptions(t,n){const r=this.options,i=V(this,Ve);if(this.options=V(this,Nt).defaultQueryOptions(t),Hu(r,this.options)||V(this,Nt).getQueryCache().notify({type:"observerOptionsUpdated",query:V(this,Ve),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),ye(this,vl,Ep).call(this);const o=this.hasListeners();o&&L_(V(this,Ve),i,this.options,r)&&ye(this,Vi,ya).call(this),this.updateResult(n),o&&(V(this,Ve)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ye(this,dl,xp).call(this);const a=ye(this,hl,wp).call(this);o&&(V(this,Ve)!==i||this.options.enabled!==r.enabled||a!==V(this,ei))&&ye(this,fl,bp).call(this,a)}getOptimisticResult(t){const n=V(this,Nt).getQueryCache().build(V(this,Nt),t),r=this.createResult(n,t);return w8(this,r)&&(ie(this,Lt,r),ie(this,ho,this.options),ie(this,Hi,V(this,Ve).state)),r}getCurrentResult(){return V(this,Lt)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(V(this,mo).add(r),t[r])})}),n}getCurrentQuery(){return V(this,Ve)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=V(this,Nt).defaultQueryOptions(t),r=V(this,Nt).getQueryCache().build(V(this,Nt),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ye(this,Vi,ya).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),V(this,Lt)))}createResult(t,n){var C;const r=V(this,Ve),i=this.options,o=V(this,Lt),a=V(this,Hi),s=V(this,ho),c=t!==r?t.state:V(this,cl),{state:p}=t;let{error:u,errorUpdatedAt:m,fetchStatus:g,status:x}=p,y=!1,h;if(n._optimisticResults){const R=this.hasListeners(),w=!R&&R_(t,n),E=R&&L_(t,r,n,i);(w||E)&&(g=Pd(t.options.networkMode)?"fetching":"paused",p.dataUpdatedAt||(x="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof p.data<"u")if(o&&p.data===(a==null?void 0:a.data)&&n.select===V(this,ul))h=V(this,fo);else try{ie(this,ul,n.select),h=n.select(p.data),h=yp(o==null?void 0:o.data,h,n),ie(this,fo,h),ie(this,Yn,null)}catch(R){ie(this,Yn,R)}else h=p.data;if(typeof n.placeholderData<"u"&&typeof h>"u"&&x==="pending"){let R;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))R=o.data;else if(R=typeof n.placeholderData=="function"?n.placeholderData((C=V(this,po))==null?void 0:C.state.data,V(this,po)):n.placeholderData,n.select&&typeof R<"u")try{R=n.select(R),ie(this,Yn,null)}catch(w){ie(this,Yn,w)}typeof R<"u"&&(x="success",h=yp(o==null?void 0:o.data,R,n),y=!0)}V(this,Yn)&&(u=V(this,Yn),h=V(this,fo),m=Date.now(),x="error");const f=g==="fetching",d=x==="pending",v=x==="error",S=d&&f;return{status:x,fetchStatus:g,isPending:d,isSuccess:x==="success",isError:v,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:p.dataUpdatedAt,error:u,errorUpdatedAt:m,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>c.dataUpdateCount||p.errorUpdateCount>c.errorUpdateCount,isFetching:f,isRefetching:f&&!d,isLoadingError:v&&p.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:y,isRefetchError:v&&p.dataUpdatedAt!==0,isStale:Cg(t,n),refetch:this.refetch}}updateResult(t){const n=V(this,Lt),r=this.createResult(V(this,Ve),this.options);if(ie(this,Hi,V(this,Ve).state),ie(this,ho,this.options),V(this,Hi).data!==void 0&&ie(this,po,V(this,Ve)),Hu(r,n))return;ie(this,Lt,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!V(this,mo).size)return!0;const l=new Set(s??V(this,mo));return this.options.throwOnError&&l.add("error"),Object.keys(V(this,Lt)).some(c=>{const p=c;return V(this,Lt)[p]!==n[p]&&l.has(p)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),ye(this,ad,Xb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,pl,Sp).call(this)}},Nt=new WeakMap,Ve=new WeakMap,cl=new WeakMap,Lt=new WeakMap,Hi=new WeakMap,ho=new WeakMap,Yn=new WeakMap,ul=new WeakMap,fo=new WeakMap,po=new WeakMap,Ui=new WeakMap,Wi=new WeakMap,ei=new WeakMap,mo=new WeakMap,Vi=new WeakSet,ya=function(t){ye(this,vl,Ep).call(this);let n=V(this,Ve).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(un)),n},dl=new WeakSet,xp=function(){if(ye(this,ml,Cp).call(this),Ro||V(this,Lt).isStale||!vp(this.options.staleTime))return;const n=Wb(V(this,Lt).dataUpdatedAt,this.options.staleTime)+1;ie(this,Ui,setTimeout(()=>{V(this,Lt).isStale||this.updateResult()},n))},hl=new WeakSet,wp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(V(this,Ve)):this.options.refetchInterval)??!1},fl=new WeakSet,bp=function(t){ye(this,gl,kp).call(this),ie(this,ei,t),!(Ro||this.options.enabled===!1||!vp(V(this,ei))||V(this,ei)===0)&&ie(this,Wi,setInterval(()=>{(this.options.refetchIntervalInBackground||Uu.isFocused())&&ye(this,Vi,ya).call(this)},V(this,ei)))},pl=new WeakSet,Sp=function(){ye(this,dl,xp).call(this),ye(this,fl,bp).call(this,ye(this,hl,wp).call(this))},ml=new WeakSet,Cp=function(){V(this,Ui)&&(clearTimeout(V(this,Ui)),ie(this,Ui,void 0))},gl=new WeakSet,kp=function(){V(this,Wi)&&(clearInterval(V(this,Wi)),ie(this,Wi,void 0))},vl=new WeakSet,Ep=function(){const t=V(this,Nt).getQueryCache().build(V(this,Nt),this.options);if(t===V(this,Ve))return;const n=V(this,Ve);ie(this,Ve,t),ie(this,cl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},ad=new WeakSet,Xb=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(V(this,Lt))}),V(this,Nt).getQueryCache().notify({query:V(this,Ve),type:"observerResultsUpdated"})})},my);function x8(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function R_(e,t){return x8(e,t)||e.state.dataUpdatedAt>0&&Rp(e,t,t.refetchOnMount)}function Rp(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Cg(e,t)}return!1}function L_(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Cg(e,n)}function Cg(e,t){return e.isStaleByTime(t.staleTime)}function w8(e,t){return!Hu(e.getCurrentResult(),t)}var ti,gr,Gt,vr,go,Qc,_l,Lp,gy,b8=(gy=class extends Fo{constructor(n,r){super();le(this,go);le(this,_l);le(this,ti,void 0);le(this,gr,void 0);le(this,Gt,void 0);le(this,vr,void 0);ie(this,gr,void 0),ie(this,ti,n),this.setOptions(r),this.bindMethods(),ye(this,go,Qc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=V(this,ti).defaultMutationOptions(n),Hu(r,this.options)||V(this,ti).getMutationCache().notify({type:"observerOptionsUpdated",mutation:V(this,Gt),observer:this}),(i=V(this,Gt))==null||i.setOptions(this.options),r!=null&&r.mutationKey&&this.options.mutationKey&&ns(r.mutationKey)!==ns(this.options.mutationKey)&&this.reset()}onUnsubscribe(){var n;this.hasListeners()||(n=V(this,Gt))==null||n.removeObserver(this)}onMutationUpdate(n){ye(this,go,Qc).call(this),ye(this,_l,Lp).call(this,n)}getCurrentResult(){return V(this,gr)}reset(){var n;(n=V(this,Gt))==null||n.removeObserver(this),ie(this,Gt,void 0),ye(this,go,Qc).call(this),ye(this,_l,Lp).call(this)}mutate(n,r){var i;return ie(this,vr,r),(i=V(this,Gt))==null||i.removeObserver(this),ie(this,Gt,V(this,ti).getMutationCache().build(V(this,ti),this.options)),V(this,Gt).addObserver(this),V(this,Gt).execute(n)}},ti=new WeakMap,gr=new WeakMap,Gt=new WeakMap,vr=new WeakMap,go=new WeakSet,Qc=function(){var r;const n=((r=V(this,Gt))==null?void 0:r.state)??Yb();ie(this,gr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},_l=new WeakSet,Lp=function(n){ut.batch(()=>{var r,i,o,a,s,l,c,p;if(V(this,vr)&&this.hasListeners()){const u=V(this,gr).variables,m=V(this,gr).context;(n==null?void 0:n.type)==="success"?((i=(r=V(this,vr)).onSuccess)==null||i.call(r,n.data,u,m),(a=(o=V(this,vr)).onSettled)==null||a.call(o,n.data,null,u,m)):(n==null?void 0:n.type)==="error"&&((l=(s=V(this,vr)).onError)==null||l.call(s,n.error,u,m),(p=(c=V(this,vr)).onSettled)==null||p.call(c,void 0,n.error,u,m))}this.listeners.forEach(u=>{u(V(this,gr))})})},gy),Qb=b.createContext(void 0),Jb=e=>{const t=b.useContext(Qb);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},S8=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.createElement(Qb.Provider,{value:e},t)),Zb=b.createContext(!1),C8=()=>b.useContext(Zb);Zb.Provider;function k8(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E8=b.createContext(k8()),R8=()=>b.useContext(E8);function eS(e,t){return typeof e=="function"?e(...t):!!e}var L8=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},M8=e=>{b.useEffect(()=>{e.clearReset()},[e])},T8=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&eS(n,[e.error,r]),A8=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},D8=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,P8=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $8(e,t,n){const r=Jb(n),i=C8(),o=R8(),a=r.defaultQueryOptions(e);a._optimisticResults=i?"isRestoring":"optimistic",A8(a),L8(a,o),M8(o);const[s]=b.useState(()=>new t(r,a)),l=s.getOptimisticResult(a);if(b.useSyncExternalStore(b.useCallback(c=>{const p=i?()=>{}:s.subscribe(ut.batchCalls(c));return s.updateResult(),p},[s,i]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),b.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),D8(a,l))throw P8(a,s,o);if(T8({result:l,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:s.trackResult(l)}function O8(e,t){return $8(e,y8,t)}function rs(e,t){const n=Jb(t),[r]=b.useState(()=>new b8(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(a=>r.subscribe(ut.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=b.useCallback((a,s)=>{r.mutate(a,s).catch(N8)},[r]);if(i.error&&eS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function N8(){}var tS={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const nS=Symbol((tS?"production":void 0)!=="production"?"RESET":"");function zo(e){const t=Pe(e,(n,r,i)=>{const o=typeof i=="function"?i(n(t)):i;r(t,o===nS?e:o)});return t}const I8=e=>typeof(e==null?void 0:e.then)=="function";function j8(e){let t,n;const r={getItem:(i,o)=>{var a,s;const l=p=>{if(p=p||"",t!==p){try{n=JSON.parse(p)}catch{return o}t=p}return n},c=(s=(a=e())==null?void 0:a.getItem(i))!=null?s:null;return I8(c)?c.then(l):l(c)},setItem:(i,o)=>{var a;return(a=e())==null?void 0:a.setItem(i,JSON.stringify(o))},removeItem:i=>{var o;return(o=e())==null?void 0:o.removeItem(i)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(r.subscribe=(i,o,a)=>{if(!(e()instanceof window.Storage))return()=>{};const s=l=>{if(l.storageArea===e()&&l.key===i){let c;try{c=JSON.parse(l.newValue||"")}catch{c=a}o(c)}};return window.addEventListener("storage",s),()=>{window.removeEventListener("storage",s)}}),r}const B8=j8(()=>typeof window<"u"?window.localStorage:void 0);function rS(e,t,n=B8,r){const i=r==null?void 0:r.getOnInit,o=Pe(i?n.getItem(e,t):t);return(tS?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=s=>{i||s(n.getItem(e,t));let l;return n.subscribe&&(l=n.subscribe(e,s,t)),l},Pe(s=>s(o),(s,l,c)=>{const p=typeof c=="function"?c(s(o)):c;return p===nS?(l(o,t),n.removeItem(e)):p instanceof Promise?p.then(u=>(l(o,u),n.setItem(e,u))):(l(o,p),n.setItem(e,p))})}const $d=Pe(!1),iS=Pe(void 0),kg=()=>{const[e,t]=Ut($d),[n,r]=Ut(iS);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},F8=()=>{const e=Ne($d),t=Ne(iS);return n=>{e(!0),n&&t(n)}},sS=()=>{const e=Ne($d);return()=>{e(!1)}},Od=Pe(!1),oS=zo({title:"",onConfirm:()=>{}}),z8=()=>{const e=Ne(Od),t=Ne(oS);return n=>{t(n),e(!0)}},H8=()=>{const e=Ne(Od);return()=>{e(!1)}},U8=()=>{const e=qe(Od),t=qe(oS);return{isOpen:e,...t}},Nd=Pe(!1),aS=zo({title:"",onSubmit:()=>{}}),Id=()=>{const e=Ne(Nd),t=Ne(aS);return n=>{t(n),e(!0)}},W8=()=>{const e=Ne(Nd);return()=>{e(!1)}},V8=()=>{const e=qe(Nd),t=qe(aS);return{isOpen:e,...t}},Eg=Pe(!1),Rg=Pe(!1),Lg=Pe(!1),lS=()=>{const[e,t]=Ut(Eg);return{isSheetOpen:e,setIsSheetOpen:t}},cS=()=>{const[e,t]=Ut(Rg);return{isSheetOpen:e,setIsSheetOpen:t}},uS=()=>{const[e,t]=Ut(Lg);return{isSheetOpen:e,setIsSheetOpen:t}},jd=()=>{const e=Ne(Eg),t=Ne(Rg),n=Ne(Lg);return()=>{e(!1),t(!1),n(!1)}},Bd=zo(!1),dS=zo(void 0),Fd=()=>{const e=Ne(dS),t=Ne(Bd);return n=>{e(n),t(!0)}},hS=()=>{const e=Ne(Bd);return()=>{e(!1)}},K8=()=>{const e=qe(dS),[t,n]=Ut(Bd);return{isModalOpen:t,playerRef:e,closeModal:()=>n(!1)}};function q8(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const G8=/[ \t\n\f\r]/g;function Y8(e){return typeof e=="object"?e.type==="text"?M_(e.value):!1:M_(e)}function M_(e){return e.replace(G8,"")===""}class Tl{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Tl.prototype.property={};Tl.prototype.normal={};Tl.prototype.space=null;function fS(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new Tl(n,r,t)}function Mp(e){return e.toLowerCase()}class Cn{constructor(t,n){this.property=t,this.attribute=n}}Cn.prototype.space=null;Cn.prototype.boolean=!1;Cn.prototype.booleanish=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.number=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.spaceSeparated=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.defined=!1;let X8=0;const be=ls(),et=ls(),pS=ls(),te=ls(),Fe=ls(),qs=ls(),Kt=ls();function ls(){return 2**++X8}const Tp=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:et,commaOrSpaceSeparated:Kt,commaSeparated:qs,number:te,overloadedBoolean:pS,spaceSeparated:Fe},Symbol.toStringTag,{value:"Module"})),Hh=Object.keys(Tp);class Mg extends Cn{constructor(t,n,r,i){let o=-1;if(super(t,n),T_(this,"space",i),typeof r=="number")for(;++o<Hh.length;){const a=Hh[o];T_(this,Hh[o],(r&Tp[a])===Tp[a])}}}Mg.prototype.defined=!0;function T_(e,t,n){n&&(e[t]=n)}const Q8={}.hasOwnProperty;function Ho(e){const t={},n={};let r;for(r in e.properties)if(Q8.call(e.properties,r)){const i=e.properties[r],o=new Mg(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Mp(r)]=r,n[Mp(o.attribute)]=r}return new Tl(t,n,e.space)}const mS=Ho({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),gS=Ho({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function vS(e,t){return t in e?e[t]:t}function _S(e,t){return vS(e,t.toLowerCase())}const yS=Ho({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:_S,properties:{xmlns:null,xmlnsXLink:null}}),xS=Ho({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:et,ariaAutoComplete:null,ariaBusy:et,ariaChecked:et,ariaColCount:te,ariaColIndex:te,ariaColSpan:te,ariaControls:Fe,ariaCurrent:null,ariaDescribedBy:Fe,ariaDetails:null,ariaDisabled:et,ariaDropEffect:Fe,ariaErrorMessage:null,ariaExpanded:et,ariaFlowTo:Fe,ariaGrabbed:et,ariaHasPopup:null,ariaHidden:et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Fe,ariaLevel:te,ariaLive:null,ariaModal:et,ariaMultiLine:et,ariaMultiSelectable:et,ariaOrientation:null,ariaOwns:Fe,ariaPlaceholder:null,ariaPosInSet:te,ariaPressed:et,ariaReadOnly:et,ariaRelevant:null,ariaRequired:et,ariaRoleDescription:Fe,ariaRowCount:te,ariaRowIndex:te,ariaRowSpan:te,ariaSelected:et,ariaSetSize:te,ariaSort:null,ariaValueMax:te,ariaValueMin:te,ariaValueNow:te,ariaValueText:null,role:null}}),J8=Ho({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:_S,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qs,acceptCharset:Fe,accessKey:Fe,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Fe,autoFocus:be,autoPlay:be,blocking:Fe,capture:be,charSet:null,checked:be,cite:null,className:Fe,cols:te,colSpan:null,content:null,contentEditable:et,controls:be,controlsList:Fe,coords:te|qs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:pS,draggable:et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Fe,height:te,hidden:be,high:te,href:null,hrefLang:null,htmlFor:Fe,httpEquiv:Fe,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Fe,itemRef:Fe,itemScope:be,itemType:Fe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:te,manifest:null,max:null,maxLength:te,media:null,method:null,min:null,minLength:te,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:te,pattern:null,ping:Fe,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Fe,required:be,reversed:be,rows:te,rowSpan:te,sandbox:Fe,scope:null,scoped:be,seamless:be,selected:be,shape:null,size:te,sizes:null,slot:null,span:te,spellCheck:et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:te,step:null,style:null,tabIndex:te,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:et,width:te,wrap:null,align:null,aLink:null,archive:Fe,axis:null,background:null,bgColor:null,border:te,borderColor:null,bottomMargin:te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:te,leftMargin:te,link:null,longDesc:null,lowSrc:null,marginHeight:te,marginWidth:te,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:te,rules:null,scheme:null,scrolling:et,standby:null,summary:null,text:null,topMargin:te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:te,security:null,unselectable:null}}),Z8=Ho({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:vS,properties:{about:Kt,accentHeight:te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:te,amplitude:te,arabicForm:null,ascent:te,attributeName:null,attributeType:null,azimuth:te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:te,by:null,calcMode:null,capHeight:te,className:Fe,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:te,diffuseConstant:te,direction:null,display:null,dur:null,divisor:te,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:te,enableBackground:null,end:null,event:null,exponent:te,externalResourcesRequired:null,fill:null,fillOpacity:te,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qs,g2:qs,glyphName:qs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:te,horizOriginX:te,horizOriginY:te,id:null,ideographic:te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:te,k:te,k1:te,k2:te,k3:te,k4:te,kernelMatrix:Kt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:te,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:te,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:te,overlineThickness:te,paintOrder:null,panose1:null,path:null,pathLength:te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Fe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:te,pointsAtY:te,pointsAtZ:te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kt,rev:Kt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kt,requiredFeatures:Kt,requiredFonts:Kt,requiredFormats:Kt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:te,specularExponent:te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:te,strikethroughThickness:te,string:null,stroke:null,strokeDashArray:Kt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:te,strokeOpacity:te,strokeWidth:null,style:null,surfaceScale:te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kt,tabIndex:te,tableValues:null,target:null,targetX:te,targetY:te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:te,underlineThickness:te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:te,values:null,vAlphabetic:te,vMathematical:te,vectorEffect:null,vHanging:te,vIdeographic:te,version:null,vertAdvY:te,vertOriginX:te,vertOriginY:te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),eM=/^data[-\w.:]+$/i,A_=/-[a-z]/g,tM=/[A-Z]/g;function nM(e,t){const n=Mp(t);let r=t,i=Cn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&eM.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(A_,iM);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!A_.test(o)){let a=o.replace(tM,rM);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Mg}return new i(r,t)}function rM(e){return"-"+e.toLowerCase()}function iM(e){return e.charAt(1).toUpperCase()}const sM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},oM=fS([gS,mS,yS,xS,J8],"html"),wS=fS([gS,mS,yS,xS,Z8],"svg");function aM(e){return e.join(" ").trim()}var Tg={exports:{}},D_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,lM=/\n/g,cM=/^\s*/,uM=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,dM=/^:\s*/,hM=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,fM=/^[;\s]*/,pM=/^\s+|\s+$/g,mM=`
`,P_="/",$_="*",Ai="",gM="comment",vM="declaration",_M=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(x){var y=x.match(lM);y&&(n+=y.length);var h=x.lastIndexOf(mM);r=~h?x.length-h:r+x.length}function o(){var x={line:n,column:r};return function(y){return y.position=new a(x),c(),y}}function a(x){this.start=x,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function s(x){var y=new Error(t.source+":"+n+":"+r+": "+x);if(y.reason=x,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(x){var y=x.exec(e);if(y){var h=y[0];return i(h),e=e.slice(h.length),y}}function c(){l(cM)}function p(x){var y;for(x=x||[];y=u();)y!==!1&&x.push(y);return x}function u(){var x=o();if(!(P_!=e.charAt(0)||$_!=e.charAt(1))){for(var y=2;Ai!=e.charAt(y)&&($_!=e.charAt(y)||P_!=e.charAt(y+1));)++y;if(y+=2,Ai===e.charAt(y-1))return s("End of comment missing");var h=e.slice(2,y-2);return r+=2,i(h),e=e.slice(y),r+=2,x({type:gM,comment:h})}}function m(){var x=o(),y=l(uM);if(y){if(u(),!l(dM))return s("property missing ':'");var h=l(hM),f=x({type:vM,property:O_(y[0].replace(D_,Ai)),value:h?O_(h[0].replace(D_,Ai)):Ai});return l(fM),f}}function g(){var x=[];p(x);for(var y;y=m();)y!==!1&&(x.push(y),p(x));return x}return c(),g()};function O_(e){return e?e.replace(pM,Ai):Ai}var yM=_M;function bS(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=yM(e),o=typeof t=="function",a,s,l=0,c=i.length;l<c;l++)r=i[l],a=r.property,s=r.value,o?t(a,s,r):s&&(n||(n={}),n[a]=s);return n}Tg.exports=bS;Tg.exports.default=bS;var xM=Tg.exports;const wM=ld(xM),SS=CS("end"),Ag=CS("start");function CS(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function bM(e){const t=Ag(e),n=SS(e);if(t&&n)return{start:t,end:n}}function Ta(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?N_(e.position):"start"in e||"end"in e?N_(e):"line"in e||"column"in e?Ap(e):""}function Ap(e){return I_(e&&e.line)+":"+I_(e&&e.column)}function N_(e){return Ap(e&&e.start)+"-"+Ap(e&&e.end)}function I_(e){return e&&typeof e=="number"?e:1}class Pt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=Ta(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;const Dg={}.hasOwnProperty,SM=new Map,CM=/[A-Z]/g,kM=/-([a-z])/g,EM=new Set(["table","tbody","thead","tfoot","tr"]),RM=new Set(["td","th"]);function LM(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=TM(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=MM(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?wS:oM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=kS(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function kS(e,t,n){if(t.type==="element"||t.type==="root"){const r=e.schema;let i=r;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wS,e.schema=i),e.ancestors.push(t);let o=AM(e,t);const a=DM(e,e.ancestors);let s=e.Fragment;if(e.ancestors.pop(),t.type==="element")if(o&&EM.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!Y8(l):!0})),Dg.call(e.components,t.tagName)){const l=t.tagName;s=e.components[l],typeof s!="string"&&s!==e.Fragment&&e.passNode&&(a.node=t)}else s=t.tagName;if(o.length>0){const l=o.length>1?o:o[0];l&&(a.children=l)}return e.schema=r,e.create(t,s,a,n)}if(t.type==="text")return t.value}function MM(e,t,n){return r;function r(i,o,a,s){const c=Array.isArray(a.children)?n:t;return s?c(o,a,s):c(o,a)}}function TM(e,t){return n;function n(r,i,o,a){const s=Array.isArray(o.children),l=Ag(r);return t(i,o,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function AM(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:SM;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys&&o.type==="element"){const l=i.get(o.tagName)||0;a=o.tagName+"-"+l,i.set(o.tagName,l+1)}const s=kS(e,o,a);s!==void 0&&n.push(s)}return n}function DM(e,t){const n=t[t.length-1],r={};let i;if("properties"in n&&n.properties){let o;for(i in n.properties)if(i!=="children"&&Dg.call(n.properties,i)){const a=PM(e,t,i,n.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&RM.has(n.tagName)?o=l:r[s]=l}}if(o){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}}return r}function PM(e,t,n,r){const i=nM(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=i.commaSeparated?q8(r):aM(r)),i.property==="style"){let o=typeof r=="object"?r:$M(e,t,String(r));return e.stylePropertyNameCase==="css"&&(o=OM(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&i.space?sM[i.property]||i.property:i.attribute,r]}}function $M(e,t,n){const r={};try{wM(n,i)}catch(o){if(!e.ignoreInvalidStyle){const a=o,s=new Pt("Cannot parse `style` attribute",{ancestors:t,cause:a,source:"hast-util-to-jsx-runtime",ruleId:"style"});throw s.file=e.filePath||void 0,s.url="https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute",s}}return r;function i(o,a){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(kM,IM)),r[s]=a}}function OM(e){const t={};let n;for(n in e)Dg.call(e,n)&&(t[NM(n)]=e[n]);return t}function NM(e){let t=e.replace(CM,jM);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function IM(e,t){return t.toUpperCase()}function jM(e){return"-"+e.toLowerCase()}const Uh={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},BM={};function FM(e,t){const n=t||BM,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ES(e,r,i)}function ES(e,t,n){if(zM(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return j_(e.children,t,n)}return Array.isArray(e)?j_(e,t,n):""}function j_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ES(e[i],t,n);return r.join("")}function zM(e){return!!(e&&typeof e=="object")}const B_=document.createElement("i");function Pg(e){const t="&"+e+";";B_.innerHTML=t;const n=B_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function sr(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function pn(e,t){return e.length>0?(sr(e,e.length,0,t),e):t}const F_={}.hasOwnProperty;function HM(e){const t={};let n=-1;for(;++n<e.length;)UM(t,e[n]);return t}function UM(e,t){let n;for(n in t){const i=(F_.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){F_.call(i,a)||(i[a]=[]);const s=o[a];WM(i[a],Array.isArray(s)?s:s?[s]:[])}}}function WM(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);sr(e,0,0,r)}function RS(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Gs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const VM=Ci(new RegExp("\\p{P}","u")),Qn=Ci(/[A-Za-z]/),Jt=Ci(/[\dA-Za-z]/),KM=Ci(/[#-'*+\--9=?A-Z^-~]/);function Dp(e){return e!==null&&(e<32||e===127)}const Pp=Ci(/\d/),qM=Ci(/[\dA-Fa-f]/),LS=Ci(/[!-/:-@[-`{-~]/);function ve(e){return e!==null&&e<-2}function Wt(e){return e!==null&&(e<0||e===32)}function Oe(e){return e===-2||e===-1||e===32}function GM(e){return LS(e)||VM(e)}const YM=Ci(/\s/);function Ci(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Uo(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Jt(e.charCodeAt(n+1))&&Jt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function He(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Oe(l)?(e.enter(n),s(l)):t(l)}function s(l){return Oe(l)&&o++<i?(e.consume(l),s):(e.exit(n),t(l))}}const XM={tokenize:QM};function QM(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),He(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ve(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),a)}}const JM={tokenize:ZM},z_={tokenize:e7};function ZM(e){const t=this,n=[];let r=0,i,o,a;return s;function s(v){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(v)}return c(v)}function l(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&d();const S=t.events.length;let k=S,C;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){C=t.events[k][1].end;break}f(r);let R=S;for(;R<t.events.length;)t.events[R][1].end=Object.assign({},C),R++;return sr(t.events,k+1,0,t.events.slice(S)),t.events.length=R,c(v)}return s(v)}function c(v){if(r===n.length){if(!i)return m(v);if(i.currentConstruct&&i.currentConstruct.concrete)return x(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(z_,p,u)(v)}function p(v){return i&&d(),f(r),m(v)}function u(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,x(v)}function m(v){return t.containerState={},e.attempt(z_,g,x)(v)}function g(v){return r++,n.push([t.currentConstruct,t.containerState]),m(v)}function x(v){if(v===null){i&&d(),f(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:o,_tokenizer:i}),y(v)}function y(v){if(v===null){h(e.exit("chunkFlow"),!0),f(0),e.consume(v);return}return ve(v)?(e.consume(v),h(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(v),y)}function h(v,S){const k=t.sliceStream(v);if(S&&k.push(null),v.previous=o,o&&(o.next=v),o=v,i.defineSkip(v.start),i.write(k),t.parser.lazy[v.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<a&&(!i.events[C][1].end||i.events[C][1].end.offset>a))return;const R=t.events.length;let w=R,E,L;for(;w--;)if(t.events[w][0]==="exit"&&t.events[w][1].type==="chunkFlow"){if(E){L=t.events[w][1].end;break}E=!0}for(f(r),C=R;C<t.events.length;)t.events[C][1].end=Object.assign({},L),C++;sr(t.events,w+1,0,t.events.slice(R)),t.events.length=C}}function f(v){let S=n.length;for(;S-- >v;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=v}function d(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function e7(e,t,n){return He(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function H_(e){if(e===null||Wt(e)||YM(e))return 1;if(GM(e))return 2}function $g(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const $p={name:"attention",tokenize:n7,resolveAll:t7};function t7(e,t){let n=-1,r,i,o,a,s,l,c,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u=Object.assign({},e[r][1].end),m=Object.assign({},e[n][1].start);U_(u,-l),U_(m,l),a={type:l>1?"strongSequence":"emphasisSequence",start:u,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:m},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=pn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=pn(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),c=pn(c,$g(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=pn(c,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,c=pn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,sr(e,r-1,n-r+3,c),n=r+c.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function n7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=H_(r);let o;return a;function a(l){return o=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===o)return e.consume(l),s;const c=e.exit("attentionSequence"),p=H_(l),u=!p||p===2&&i||n.includes(l),m=!i||i===2&&p||n.includes(r);return c._open=!!(o===42?u:u&&(i||!m)),c._close=!!(o===42?m:m&&(p||!u)),t(l)}}function U_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const r7={name:"autolink",tokenize:i7};function i7(e,t,n){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return Qn(g)?(e.consume(g),a):c(g)}function a(g){return g===43||g===45||g===46||Jt(g)?(r=1,s(g)):c(g)}function s(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||Jt(g))&&r++<32?(e.consume(g),s):(r=0,c(g))}function l(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||Dp(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),p):KM(g)?(e.consume(g),c):n(g)}function p(g){return Jt(g)?u(g):n(g)}function u(g){return g===46?(e.consume(g),r=0,p):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):m(g)}function m(g){if((g===45||Jt(g))&&r++<63){const x=g===45?m:u;return e.consume(g),x}return n(g)}}const zd={tokenize:s7,partial:!0};function s7(e,t,n){return r;function r(o){return Oe(o)?He(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ve(o)?t(o):n(o)}}const MS={name:"blockQuote",tokenize:o7,continuation:{tokenize:a7},exit:l7};function o7(e,t,n){const r=this;return i;function i(a){if(a===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Oe(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function a7(e,t,n){const r=this;return i;function i(a){return Oe(a)?He(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(MS,t,n)(a)}}function l7(e){e.exit("blockQuote")}const TS={name:"characterEscape",tokenize:c7};function c7(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return LS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const AS={name:"characterReference",tokenize:u7};function u7(e,t,n){const r=this;let i=0,o,a;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),o=31,a=Jt,p(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=qM,p):(e.enter("characterReferenceValue"),o=7,a=Pp,p(u))}function p(u){if(u===59&&i){const m=e.exit("characterReferenceValue");return a===Jt&&!Pg(r.sliceSerialize(m))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(u)&&i++<o?(e.consume(u),p):n(u)}}const W_={tokenize:h7,partial:!0},V_={name:"codeFenced",tokenize:d7,concrete:!0};function d7(e,t,n){const r=this,i={tokenize:k,partial:!0};let o=0,a=0,s;return l;function l(C){return c(C)}function c(C){const R=r.events[r.events.length-1];return o=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,s=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(C)}function p(C){return C===s?(a++,e.consume(C),p):a<3?n(C):(e.exit("codeFencedFenceSequence"),Oe(C)?He(e,u,"whitespace")(C):u(C))}function u(C){return C===null||ve(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(W_,y,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(C)):Oe(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),He(e,g,"whitespace")(C)):C===96&&C===s?n(C):(e.consume(C),m)}function g(C){return C===null||ve(C)?u(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||ve(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(C)):C===96&&C===s?n(C):(e.consume(C),x)}function y(C){return e.attempt(i,S,h)(C)}function h(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),f}function f(C){return o>0&&Oe(C)?He(e,d,"linePrefix",o+1)(C):d(C)}function d(C){return C===null||ve(C)?e.check(W_,y,S)(C):(e.enter("codeFlowValue"),v(C))}function v(C){return C===null||ve(C)?(e.exit("codeFlowValue"),d(C)):(e.consume(C),v)}function S(C){return e.exit("codeFenced"),t(C)}function k(C,R,w){let E=0;return L;function L(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),M}function M(O){return C.enter("codeFencedFence"),Oe(O)?He(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):D(O)}function D(O){return O===s?(C.enter("codeFencedFenceSequence"),P(O)):w(O)}function P(O){return O===s?(E++,C.consume(O),P):E>=a?(C.exit("codeFencedFenceSequence"),Oe(O)?He(C,$,"whitespace")(O):$(O)):w(O)}function $(O){return O===null||ve(O)?(C.exit("codeFencedFence"),R(O)):w(O)}}}function h7(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Wh={name:"codeIndented",tokenize:p7},f7={tokenize:m7,partial:!0};function p7(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),He(e,o,"linePrefix",5)(c)}function o(c){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ve(c)?e.attempt(f7,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||ve(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function m7(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):He(e,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):ve(a)?i(a):n(a)}}const g7={name:"codeText",tokenize:y7,resolve:v7,previous:_7};function v7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function _7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function y7(e,t,n){let r=0,i,o;return a;function a(u){return e.enter("codeText"),e.enter("codeTextSequence"),s(u)}function s(u){return u===96?(e.consume(u),r++,s):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(o=e.enter("codeTextSequence"),i=0,p(u)):ve(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||ve(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function p(u){return u===96?(e.consume(u),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(o.type="codeTextData",c(u))}}function DS(e){const t={};let n=-1,r,i,o,a,s,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,x7(e,n)),n=t[n],c=!0);else if(r[1]._container){for(o=n,i=void 0;o--&&(a=e[o],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);i&&(r[1].end=Object.assign({},e[i][1].start),s=e.slice(i,n),s.unshift(r),sr(e,i,n-i+1,s))}}return!c}function x7(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const o=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let p,u,m=-1,g=n,x=0,y=0;const h=[y];for(;g;){for(;e[++i][1]!==g;);o.push(i),g._tokenizer||(p=r.sliceStream(g),g.next||p.push(null),u&&a.defineSkip(g.start),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),u=g,g=g.next}for(g=n;++m<s.length;)s[m][0]==="exit"&&s[m-1][0]==="enter"&&s[m][1].type===s[m-1][1].type&&s[m][1].start.line!==s[m][1].end.line&&(y=m+1,h.push(y),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(a.events=[],g?(g._tokenizer=void 0,g.previous=void 0):h.pop(),m=h.length;m--;){const f=s.slice(h[m],h[m+1]),d=o.pop();l.unshift([d,d+f.length-1]),sr(e,d,2,f)}for(m=-1;++m<l.length;)c[x+l[m][0]]=x+l[m][1],x+=l[m][1]-l[m][0]-1;return c}const w7={tokenize:C7,resolve:S7},b7={tokenize:k7,partial:!0};function S7(e){return DS(e),e}function C7(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ve(s)?e.check(b7,a,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function k7(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),He(e,o,"linePrefix")}function o(a){if(a===null||ve(a))return n(a);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function PS(e,t,n,r,i,o,a,s,l){const c=l||Number.POSITIVE_INFINITY;let p=0;return u;function u(f){return f===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(f),e.exit(o),m):f===null||f===32||f===41||Dp(f)?n(f):(e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(f))}function m(f){return f===62?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(f))}function g(f){return f===62?(e.exit("chunkString"),e.exit(s),m(f)):f===null||f===60||ve(f)?n(f):(e.consume(f),f===92?x:g)}function x(f){return f===60||f===62||f===92?(e.consume(f),g):g(f)}function y(f){return!p&&(f===null||f===41||Wt(f))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(f)):p<c&&f===40?(e.consume(f),p++,y):f===41?(e.consume(f),p--,y):f===null||f===32||f===40||Dp(f)?n(f):(e.consume(f),f===92?h:y)}function h(f){return f===40||f===41||f===92?(e.consume(f),y):y(f)}}function $S(e,t,n,r,i,o){const a=this;let s=0,l;return c;function c(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(o),p}function p(g){return s>999||g===null||g===91||g===93&&!l||g===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):ve(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===null||g===91||g===93||ve(g)||s++>999?(e.exit("chunkString"),p(g)):(e.consume(g),l||(l=!Oe(g)),g===92?m:u)}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,u):u(g)}}function OS(e,t,n,r,i,o){let a;return s;function s(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),a=m===40?41:m,l):n(m)}function l(m){return m===a?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),c(m))}function c(m){return m===a?(e.exit(o),l(a)):m===null?n(m):ve(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),He(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===a||m===null||ve(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?u:p)}function u(m){return m===a||m===92?(e.consume(m),p):p(m)}}function Aa(e,t){let n;return r;function r(i){return ve(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Oe(i)?He(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const E7={name:"definition",tokenize:L7},R7={tokenize:M7,partial:!0};function L7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),a(g)}function a(g){return $S.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=Gs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),l):n(g)}function l(g){return Wt(g)?Aa(e,c)(g):c(g)}function c(g){return PS(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(R7,u,u)(g)}function u(g){return Oe(g)?He(e,m,"whitespace")(g):m(g)}function m(g){return g===null||ve(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function M7(e,t,n){return r;function r(s){return Wt(s)?Aa(e,i)(s):n(s)}function i(s){return OS(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Oe(s)?He(e,a,"whitespace")(s):a(s)}function a(s){return s===null||ve(s)?t(s):n(s)}}const T7={name:"hardBreakEscape",tokenize:A7};function A7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ve(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const D7={name:"headingAtx",tokenize:$7,resolve:P7};function P7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},sr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function $7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||Wt(p)?(e.exit("atxHeadingSequence"),s(p)):n(p)}function s(p){return p===35?(e.enter("atxHeadingSequence"),l(p)):p===null||ve(p)?(e.exit("atxHeading"),t(p)):Oe(p)?He(e,s,"whitespace")(p):(e.enter("atxHeadingText"),c(p))}function l(p){return p===35?(e.consume(p),l):(e.exit("atxHeadingSequence"),s(p))}function c(p){return p===null||p===35||Wt(p)?(e.exit("atxHeadingText"),s(p)):(e.consume(p),c)}}const O7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],K_=["pre","script","style","textarea"],N7={name:"htmlFlow",tokenize:F7,resolveTo:B7,concrete:!0},I7={tokenize:H7,partial:!0},j7={tokenize:z7,partial:!0};function B7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function F7(e,t,n){const r=this;let i,o,a,s,l;return c;function c(N){return p(N)}function p(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),u}function u(N){return N===33?(e.consume(N),m):N===47?(e.consume(N),o=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:T):Qn(N)?(e.consume(N),a=String.fromCharCode(N),h):n(N)}function m(N){return N===45?(e.consume(N),i=2,g):N===91?(e.consume(N),i=5,s=0,x):Qn(N)?(e.consume(N),i=4,r.interrupt?t:T):n(N)}function g(N){return N===45?(e.consume(N),r.interrupt?t:T):n(N)}function x(N){const X="CDATA[";return N===X.charCodeAt(s++)?(e.consume(N),s===X.length?r.interrupt?t:D:x):n(N)}function y(N){return Qn(N)?(e.consume(N),a=String.fromCharCode(N),h):n(N)}function h(N){if(N===null||N===47||N===62||Wt(N)){const X=N===47,re=a.toLowerCase();return!X&&!o&&K_.includes(re)?(i=1,r.interrupt?t(N):D(N)):O7.includes(a.toLowerCase())?(i=6,X?(e.consume(N),f):r.interrupt?t(N):D(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):o?d(N):v(N))}return N===45||Jt(N)?(e.consume(N),a+=String.fromCharCode(N),h):n(N)}function f(N){return N===62?(e.consume(N),r.interrupt?t:D):n(N)}function d(N){return Oe(N)?(e.consume(N),d):L(N)}function v(N){return N===47?(e.consume(N),L):N===58||N===95||Qn(N)?(e.consume(N),S):Oe(N)?(e.consume(N),v):L(N)}function S(N){return N===45||N===46||N===58||N===95||Jt(N)?(e.consume(N),S):k(N)}function k(N){return N===61?(e.consume(N),C):Oe(N)?(e.consume(N),k):v(N)}function C(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,R):Oe(N)?(e.consume(N),C):w(N)}function R(N){return N===l?(e.consume(N),l=null,E):N===null||ve(N)?n(N):(e.consume(N),R)}function w(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Wt(N)?k(N):(e.consume(N),w)}function E(N){return N===47||N===62||Oe(N)?v(N):n(N)}function L(N){return N===62?(e.consume(N),M):n(N)}function M(N){return N===null||ve(N)?D(N):Oe(N)?(e.consume(N),M):n(N)}function D(N){return N===45&&i===2?(e.consume(N),F):N===60&&i===1?(e.consume(N),U):N===62&&i===4?(e.consume(N),j):N===63&&i===3?(e.consume(N),T):N===93&&i===5?(e.consume(N),A):ve(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(I7,z,P)(N)):N===null||ve(N)?(e.exit("htmlFlowData"),P(N)):(e.consume(N),D)}function P(N){return e.check(j7,$,z)(N)}function $(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),O}function O(N){return N===null||ve(N)?P(N):(e.enter("htmlFlowData"),D(N))}function F(N){return N===45?(e.consume(N),T):D(N)}function U(N){return N===47?(e.consume(N),a="",B):D(N)}function B(N){if(N===62){const X=a.toLowerCase();return K_.includes(X)?(e.consume(N),j):D(N)}return Qn(N)&&a.length<8?(e.consume(N),a+=String.fromCharCode(N),B):D(N)}function A(N){return N===93?(e.consume(N),T):D(N)}function T(N){return N===62?(e.consume(N),j):N===45&&i===2?(e.consume(N),T):D(N)}function j(N){return N===null||ve(N)?(e.exit("htmlFlowData"),z(N)):(e.consume(N),j)}function z(N){return e.exit("htmlFlow"),t(N)}}function z7(e,t,n){const r=this;return i;function i(a){return ve(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function H7(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(zd,t,n)}}const U7={name:"htmlText",tokenize:W7};function W7(e,t,n){const r=this;let i,o,a;return s;function s(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),c):T===47?(e.consume(T),k):T===63?(e.consume(T),v):Qn(T)?(e.consume(T),w):n(T)}function c(T){return T===45?(e.consume(T),p):T===91?(e.consume(T),o=0,x):Qn(T)?(e.consume(T),d):n(T)}function p(T){return T===45?(e.consume(T),g):n(T)}function u(T){return T===null?n(T):T===45?(e.consume(T),m):ve(T)?(a=u,U(T)):(e.consume(T),u)}function m(T){return T===45?(e.consume(T),g):u(T)}function g(T){return T===62?F(T):T===45?m(T):u(T)}function x(T){const j="CDATA[";return T===j.charCodeAt(o++)?(e.consume(T),o===j.length?y:x):n(T)}function y(T){return T===null?n(T):T===93?(e.consume(T),h):ve(T)?(a=y,U(T)):(e.consume(T),y)}function h(T){return T===93?(e.consume(T),f):y(T)}function f(T){return T===62?F(T):T===93?(e.consume(T),f):y(T)}function d(T){return T===null||T===62?F(T):ve(T)?(a=d,U(T)):(e.consume(T),d)}function v(T){return T===null?n(T):T===63?(e.consume(T),S):ve(T)?(a=v,U(T)):(e.consume(T),v)}function S(T){return T===62?F(T):v(T)}function k(T){return Qn(T)?(e.consume(T),C):n(T)}function C(T){return T===45||Jt(T)?(e.consume(T),C):R(T)}function R(T){return ve(T)?(a=R,U(T)):Oe(T)?(e.consume(T),R):F(T)}function w(T){return T===45||Jt(T)?(e.consume(T),w):T===47||T===62||Wt(T)?E(T):n(T)}function E(T){return T===47?(e.consume(T),F):T===58||T===95||Qn(T)?(e.consume(T),L):ve(T)?(a=E,U(T)):Oe(T)?(e.consume(T),E):F(T)}function L(T){return T===45||T===46||T===58||T===95||Jt(T)?(e.consume(T),L):M(T)}function M(T){return T===61?(e.consume(T),D):ve(T)?(a=M,U(T)):Oe(T)?(e.consume(T),M):E(T)}function D(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),i=T,P):ve(T)?(a=D,U(T)):Oe(T)?(e.consume(T),D):(e.consume(T),$)}function P(T){return T===i?(e.consume(T),i=void 0,O):T===null?n(T):ve(T)?(a=P,U(T)):(e.consume(T),P)}function $(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Wt(T)?E(T):(e.consume(T),$)}function O(T){return T===47||T===62||Wt(T)?E(T):n(T)}function F(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function U(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),B}function B(T){return Oe(T)?He(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):A(T)}function A(T){return e.enter("htmlTextData"),a(T)}}const Og={name:"labelEnd",tokenize:X7,resolveTo:Y7,resolveAll:G7},V7={tokenize:Q7},K7={tokenize:J7},q7={tokenize:Z7};function G7(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Y7(e,t){let n=e.length,r=0,i,o,a,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[o][1].start),end:Object.assign({},e[a][1].end)},p={type:"labelText",start:Object.assign({},e[o+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return s=[["enter",l,t],["enter",c,t]],s=pn(s,e.slice(o+1,o+r+3)),s=pn(s,[["enter",p,t]]),s=pn(s,$g(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),s=pn(s,[["exit",p,t],e[a-2],e[a-1],["exit",c,t]]),s=pn(s,e.slice(a+1)),s=pn(s,[["exit",l,t]]),sr(e,o,e.length,s),e}function X7(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(m){return o?o._inactive?u(m):(a=r.parser.defined.includes(Gs(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),l):n(m)}function l(m){return m===40?e.attempt(V7,p,a?p:u)(m):m===91?e.attempt(K7,p,a?c:u)(m):a?p(m):u(m)}function c(m){return e.attempt(q7,p,u)(m)}function p(m){return t(m)}function u(m){return o._balanced=!0,n(m)}}function Q7(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return Wt(u)?Aa(e,o)(u):o(u)}function o(u){return u===41?p(u):PS(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function a(u){return Wt(u)?Aa(e,l)(u):p(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?OS(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function c(u){return Wt(u)?Aa(e,p)(u):p(u)}function p(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function J7(e,t,n){const r=this;return i;function i(s){return $S.call(r,e,o,a,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Gs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function a(s){return n(s)}}function Z7(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const eT={name:"labelStartImage",tokenize:tT,resolveAll:Og.resolveAll};function tT(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):n(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const nT={name:"labelStartLink",tokenize:rT,resolveAll:Og.resolveAll};function rT(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Vh={name:"lineEnding",tokenize:iT};function iT(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),He(e,t,"linePrefix")}}const Jc={name:"thematicBreak",tokenize:sT};function sT(e,t,n){let r=0,i;return o;function o(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ve(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Oe(c)?He(e,s,"whitespace")(c):s(c))}}const Ot={name:"list",tokenize:lT,continuation:{tokenize:cT},exit:dT},oT={tokenize:hT,partial:!0},aT={tokenize:uT,partial:!0};function lT(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(g){const x=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:Pp(g)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(Jc,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(g)}return n(g)}function l(g){return Pp(g)&&++a<10?(e.consume(g),l):(!r.interrupt||a<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(zd,r.interrupt?n:p,e.attempt(oT,m,u))}function p(g){return r.containerState.initialBlankLine=!0,o++,m(g)}function u(g){return Oe(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function cT(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(zd,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,He(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Oe(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(aT,t,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,He(e,e.attempt(Ot,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function uT(e,t,n){const r=this;return He(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function dT(e){e.exit(this.containerState.type)}function hT(e,t,n){const r=this;return He(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Oe(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const q_={name:"setextUnderline",tokenize:pT,resolveTo:fT};function fT(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function pT(e,t,n){const r=this;let i;return o;function o(c){let p=r.events.length,u;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){u=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Oe(c)?He(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ve(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const mT={tokenize:gT};function gT(e){const t=this,n=e.attempt(zd,r,e.attempt(this.parser.constructs.flowInitial,i,He(e,e.attempt(this.parser.constructs.flow,i,e.attempt(w7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vT={resolveAll:IS()},_T=NS("string"),yT=NS("text");function NS(e){return{tokenize:t,resolveAll:IS(e==="text"?xT:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,s);return a;function a(p){return c(p)?o(p):s(p)}function s(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),l}function l(p){return c(p)?(n.exit("data"),o(p)):(n.consume(p),l)}function c(p){if(p===null)return!0;const u=i[p];let m=-1;if(u)for(;++m<u.length;){const g=u[m];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function IS(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function xT(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,s=0,l;for(;o--;){const c=i[o];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){o++;break}}if(s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+o,_bufferIndex:o?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function wT(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},o=[];let a=[],s=[];const l={consume:d,enter:v,exit:S,attempt:R(k),check:R(C),interrupt:R(C,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:g,sliceSerialize:m,now:x,defineSkip:y,write:u};let p=t.tokenize.call(c,l);return t.resolveAll&&o.push(t),c;function u(M){return a=pn(a,M),h(),a[a.length-1]!==null?[]:(w(t,0),c.events=$g(o,c.events,c),c.events)}function m(M,D){return ST(g(M),D)}function g(M){return bT(a,M)}function x(){const{line:M,column:D,offset:P,_index:$,_bufferIndex:O}=r;return{line:M,column:D,offset:P,_index:$,_bufferIndex:O}}function y(M){i[M.line]=M.column,L()}function h(){let M;for(;r._index<a.length;){const D=a[r._index];if(typeof D=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<D.length;)f(D.charCodeAt(r._bufferIndex));else f(D)}}function f(M){p=p(M)}function d(M){ve(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,L()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function v(M,D){const P=D||{};return P.type=M,P.start=x(),c.events.push(["enter",P,c]),s.push(P),P}function S(M){const D=s.pop();return D.end=x(),c.events.push(["exit",D,c]),D}function k(M,D){w(M,D.from)}function C(M,D){D.restore()}function R(M,D){return P;function P($,O,F){let U,B,A,T;return Array.isArray($)?z($):"tokenize"in $?z([$]):j($);function j(H){return W;function W(I){const K=I!==null&&H[I],J=I!==null&&H.null,q=[...Array.isArray(K)?K:K?[K]:[],...Array.isArray(J)?J:J?[J]:[]];return z(q)(I)}}function z(H){return U=H,B=0,H.length===0?F:N(H[B])}function N(H){return W;function W(I){return T=E(),A=H,H.partial||(c.currentConstruct=H),H.name&&c.parser.constructs.disable.null.includes(H.name)?re():H.tokenize.call(D?Object.assign(Object.create(c),D):c,l,X,re)(I)}}function X(H){return M(A,T),O}function re(H){return T.restore(),++B<U.length?N(U[B]):F}}}function w(M,D){M.resolveAll&&!o.includes(M)&&o.push(M),M.resolve&&sr(c.events,D,c.events.length-D,M.resolve(c.events.slice(D),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function E(){const M=x(),D=c.previous,P=c.currentConstruct,$=c.events.length,O=Array.from(s);return{restore:F,from:$};function F(){r=M,c.previous=D,c.currentConstruct=P,c.events.length=$,s=O,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function bT(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function ST(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}const CT={42:Ot,43:Ot,45:Ot,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,62:MS},kT={91:E7},ET={[-2]:Wh,[-1]:Wh,32:Wh},RT={35:D7,42:Jc,45:[q_,Jc],60:N7,61:q_,95:Jc,96:V_,126:V_},LT={38:AS,92:TS},MT={[-5]:Vh,[-4]:Vh,[-3]:Vh,33:eT,38:AS,42:$p,60:[r7,U7],91:nT,92:[T7,TS],93:Og,95:$p,96:g7},TT={null:[$p,vT]},AT={null:[42,95]},DT={null:[]},PT=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:AT,contentInitial:kT,disable:DT,document:CT,flow:RT,flowInitial:ET,insideSpan:TT,string:LT,text:MT},Symbol.toStringTag,{value:"Module"}));function $T(e){const n=HM([PT,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(XM),document:i(JM),flow:i(mT),string:i(_T),text:i(yT)};return r;function i(o){return a;function a(s){return wT(r,o,s)}}}function OT(e){for(;!DS(e););return e}const G_=/[\0\t\n\r]/g;function NT(){let e=1,t="",n=!0,r;return i;function i(o,a,s){const l=[];let c,p,u,m,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,t="",n&&(o.charCodeAt(0)===65279&&u++,n=void 0);u<o.length;){if(G_.lastIndex=u,c=G_.exec(o),m=c&&c.index!==void 0?c.index:o.length,g=o.charCodeAt(m),!c){t=o.slice(u);break}if(g===10&&u===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<m&&(l.push(o.slice(u,m)),e+=m-u),g){case 0:{l.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,l.push(-2);e++<p;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=m+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const IT=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jT(e){return e.replace(IT,BT)}function BT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return RS(n.slice(o?2:1),o?16:10)}return Pg(n)||e}const jS={}.hasOwnProperty;function FT(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zT(n)(OT($T(n).document().write(NT()(e,t,!0))))}function zT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Rt),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(ce),blockQuote:o(K),characterEscape:E,characterReference:E,codeFenced:o(J),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(J,a),codeText:o(q,a),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(de),hardBreakEscape:o(Ae),hardBreakTrailing:o(Ae),htmlFlow:o(je,a),htmlFlowData:E,htmlText:o(je,a),htmlTextData:E,image:o(ue),label:a,link:o(Rt),listItem:o(ke),listItemValue:m,listOrdered:o(kn,u),listUnordered:o(kn),paragraph:o(_e),reference:N,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(ce),strong:o(Ce),thematicBreak:o(Le)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:I,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:H,codeFenced:l(h),codeFencedFence:y,codeFencedFenceInfo:g,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:l(f),codeText:l(O),codeTextData:L,data:L,definition:l(),definitionDestinationString:S,definitionLabelString:d,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(P),htmlFlowData:L,htmlText:l($),htmlTextData:L,image:l(U),label:A,labelText:B,lineEnding:M,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:X,resourceDestinationString:T,resourceTitleString:j,resource:z,setextHeading:l(w),setextHeadingLineSequence:R,setextHeadingText:C,strong:l(),thematicBreak:l()}};BS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let Z={type:"root",children:[]};const pe={stack:[Z],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:p,data:n},me=[];let xe=-1;for(;++xe<G.length;)if(G[xe][1].type==="listOrdered"||G[xe][1].type==="listUnordered")if(G[xe][0]==="enter")me.push(xe);else{const $e=me.pop();xe=i(G,$e,xe)}for(xe=-1;++xe<G.length;){const $e=t[G[xe][0]];jS.call($e,G[xe][1].type)&&$e[G[xe][1].type].call(Object.assign({sliceSerialize:G[xe][2].sliceSerialize},pe),G[xe][1])}if(pe.tokenStack.length>0){const $e=pe.tokenStack[pe.tokenStack.length-1];($e[1]||Y_).call(pe,void 0,$e[0])}for(Z.position={start:Br(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Br(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)Z=t.transforms[xe](Z)||Z;return Z}function i(G,Z,pe){let me=Z-1,xe=-1,$e=!1,Te,ge,En,Hn;for(;++me<=pe;){const ft=G[me];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?xe++:xe--,Hn=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(Te&&!Hn&&!xe&&!En&&(En=me),Hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Hn=void 0}if(!xe&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||xe===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(Te){let cr=me;for(ge=void 0;cr--;){const $t=G[cr];if($t[1].type==="lineEnding"||$t[1].type==="lineEndingBlank"){if($t[0]==="exit")continue;ge&&(G[ge][1].type="lineEndingBlank",$e=!0),$t[1].type="lineEnding",ge=cr}else if(!($t[1].type==="linePrefix"||$t[1].type==="blockQuotePrefix"||$t[1].type==="blockQuotePrefixWhitespace"||$t[1].type==="blockQuoteMarker"||$t[1].type==="listItemIndent"))break}En&&(!ge||En<ge)&&(Te._spread=!0),Te.end=Object.assign({},ge?G[ge][1].start:ft[1].end),G.splice(ge||me,0,["exit",Te,ft[2]]),me++,pe++}if(ft[1].type==="listItemPrefix"){const cr={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};Te=cr,G.splice(me,0,["enter",cr,ft[2]]),me++,pe++,En=void 0,Hn=!0}}}return G[Z][1]._spread=$e,pe}function o(G,Z){return pe;function pe(me){s.call(this,G(me),me),Z&&Z.call(this,me)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(G,Z,pe){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([Z,pe]),G.position={start:Br(Z.start),end:void 0}}function l(G){return Z;function Z(pe){G&&G.call(this,pe),c.call(this,pe)}}function c(G,Z){const pe=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==G.type&&(Z?Z.call(this,G,me[0]):(me[1]||Y_).call(this,G,me[0]));else throw new Error("Cannot close `"+G.type+"` ("+Ta({start:G.start,end:G.end})+"): it’s not open");pe.position.end=Br(G.end)}function p(){return FM(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function m(G){if(this.data.expectingFirstListItemValue){const Z=this.stack[this.stack.length-2];Z.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function g(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.lang=G}function x(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.meta=G}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function h(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function f(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.value=G.replace(/(\r?\n|\r)$/g,"")}function d(G){const Z=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Z,pe.identifier=Gs(this.sliceSerialize(G)).toLowerCase()}function v(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.title=G}function S(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.url=G}function k(G){const Z=this.stack[this.stack.length-1];if(!Z.depth){const pe=this.sliceSerialize(G).length;Z.depth=pe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function R(G){const Z=this.stack[this.stack.length-1];Z.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function E(G){const pe=this.stack[this.stack.length-1].children;let me=pe[pe.length-1];(!me||me.type!=="text")&&(me=oe(),me.position={start:Br(G.start),end:void 0},pe.push(me)),this.stack.push(me)}function L(G){const Z=this.stack.pop();Z.value+=this.sliceSerialize(G),Z.position.end=Br(G.end)}function M(G){const Z=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=Z.children[Z.children.length-1];pe.position.end=Br(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Z.type)&&(E.call(this,G),L.call(this,G))}function D(){this.data.atHardBreak=!0}function P(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.value=G}function $(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.value=G}function O(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.value=G}function F(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=Z,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function U(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const Z=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=Z,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function B(G){const Z=this.sliceSerialize(G),pe=this.stack[this.stack.length-2];pe.label=jT(Z),pe.identifier=Gs(Z).toLowerCase()}function A(){const G=this.stack[this.stack.length-1],Z=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const me=G.children;pe.children=me}else pe.alt=Z}function T(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.url=G}function j(){const G=this.resume(),Z=this.stack[this.stack.length-1];Z.title=G}function z(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function X(G){const Z=this.resume(),pe=this.stack[this.stack.length-1];pe.label=Z,pe.identifier=Gs(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function re(G){this.data.characterReferenceType=G.type}function H(G){const Z=this.sliceSerialize(G),pe=this.data.characterReferenceType;let me;pe?(me=RS(Z,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=Pg(Z);const xe=this.stack.pop();xe.value+=me,xe.position.end=Br(G.end)}function W(G){L.call(this,G);const Z=this.stack[this.stack.length-1];Z.url=this.sliceSerialize(G)}function I(G){L.call(this,G);const Z=this.stack[this.stack.length-1];Z.url="mailto:"+this.sliceSerialize(G)}function K(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function ce(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function je(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function kn(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function ke(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function _e(){return{type:"paragraph",children:[]}}function Ce(){return{type:"strong",children:[]}}function oe(){return{type:"text",value:""}}function Le(){return{type:"thematicBreak"}}}function Br(e){return{line:e.line,column:e.column,offset:e.offset}}function BS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?BS(e,r):HT(e,r)}}function HT(e,t){let n;for(n in t)if(jS.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Y_(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ta({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ta({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ta({start:t.start,end:t.end})+") is still open")}function UT(e){const t=this;t.parser=n;function n(r){return FT(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function VT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function KT(e,t){const n=t.value?t.value+`
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function qT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YT(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Uo(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function XT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function FS(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function JT(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return FS(e,t);const i={src:Uo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function ZT(e,t){const n={src:Uo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function eA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function tA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return FS(e,t);const i={href:Uo(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function nA(e,t){const n={href:Uo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rA(e,t,n){const r=e.all(t),i=n?iA(n):zS(t),o={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let u;p&&p.type==="element"&&p.tagName==="p"?u=p:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const p=r[s];(i||s!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
`}),p.type==="element"&&p.tagName==="p"&&!i?a.push(...p.children):a.push(p)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
`});const c={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,c),e.applyData(t,c)}function iA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=zS(n[r])}return t}function zS(e){const t=e.spread;return t??e.children.length>1}function sA(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function oA(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aA(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function lA(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cA(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=Ag(t.children[1]),l=SS(t.children[t.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function uA(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const u=t.children[l],m={},g=a?a[l]:void 0;g&&(m.align=g);let x={type:"element",tagName:o,properties:m,children:[]};u&&(x.children=e.all(u),e.patch(u,x),x=e.applyData(u,x)),c.push(x)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,p),e.applyData(t,p)}function dA(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const X_=9,Q_=32;function hA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(J_(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(J_(t.slice(i),i>0,!1)),o.join("")}function J_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===X_||o===Q_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===X_||o===Q_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function fA(e,t){const n={type:"text",value:hA(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function pA(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const mA={blockquote:WT,break:VT,code:KT,delete:qT,emphasis:GT,footnoteReference:YT,heading:XT,html:QT,imageReference:JT,image:ZT,inlineCode:eA,linkReference:tA,link:nA,listItem:rA,list:sA,paragraph:oA,root:aA,strong:lA,table:cA,tableCell:dA,tableRow:uA,text:fA,thematicBreak:pA,toml:vc,yaml:vc,definition:vc,footnoteDefinition:vc};function vc(){}const HS=-1,Hd=0,Vu=1,Ku=2,Ng=3,Ig=4,jg=5,Bg=6,US=7,WS=8,Z_=typeof self=="object"?self:globalThis,gA=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case Hd:case HS:return n(a,i);case Vu:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Ku:{const s=n({},i);for(const[l,c]of a)s[r(l)]=r(c);return s}case Ng:return n(new Date(a),i);case Ig:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case jg:{const s=n(new Map,i);for(const[l,c]of a)s.set(r(l),r(c));return s}case Bg:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case US:{const{name:s,message:l}=a;return n(new Z_[s](l),i)}case WS:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Z_[o](a),i)};return r},e1=e=>gA(new Map,e)(0),_s="",{toString:vA}={},{keys:_A}=Object,aa=e=>{const t=typeof e;if(t!=="object"||!e)return[Hd,t];const n=vA.call(e).slice(8,-1);switch(n){case"Array":return[Vu,_s];case"Object":return[Ku,_s];case"Date":return[Ng,_s];case"RegExp":return[Ig,_s];case"Map":return[jg,_s];case"Set":return[Bg,_s]}return n.includes("Array")?[Vu,n]:n.includes("Error")?[US,n]:[Ku,n]},_c=([e,t])=>e===Hd&&(t==="function"||t==="symbol"),yA=(e,t,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=aa(a);switch(s){case Hd:{let p=a;switch(l){case"bigint":s=WS,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);p=null;break;case"undefined":return i([HS],a)}return i([s,p],a)}case Vu:{if(l)return i([l,[...a]],a);const p=[],u=i([s,p],a);for(const m of a)p.push(o(m));return u}case Ku:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const p=[],u=i([s,p],a);for(const m of _A(a))(e||!_c(aa(a[m])))&&p.push([o(m),o(a[m])]);return u}case Ng:return i([s,a.toISOString()],a);case Ig:{const{source:p,flags:u}=a;return i([s,{source:p,flags:u}],a)}case jg:{const p=[],u=i([s,p],a);for(const[m,g]of a)(e||!(_c(aa(m))||_c(aa(g))))&&p.push([o(m),o(g)]);return u}case Bg:{const p=[],u=i([s,p],a);for(const m of a)(e||!_c(aa(m)))&&p.push(o(m));return u}}const{message:c}=a;return i([s,{name:l,message:c}],a)};return o},t1=(e,{json:t,lossy:n}={})=>{const r=[];return yA(!(t||n),!!t,new Map,r)(e),r},qu=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?e1(t1(e,t)):structuredClone(e):(e,t)=>e1(t1(e,t));function xA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function wA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function bA(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||xA,r=e.options.footnoteBackLabel||wA,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const p=e.all(c),u=String(c.identifier).toUpperCase(),m=Uo(u.toLowerCase());let g=0;const x=[],y=e.footnoteCounts.get(u);for(;y!==void 0&&++g<=y;){x.length>0&&x.push({type:"text",value:" "});let d=typeof n=="string"?n:n(l,g);typeof d=="string"&&(d={type:"text",value:d}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),className:["data-footnote-backref"]},children:Array.isArray(d)?d:[d]})}const h=p[p.length-1];if(h&&h.type==="element"&&h.tagName==="p"){const d=h.children[h.children.length-1];d&&d.type==="text"?d.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...x)}else p.push(...x);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(p,!0)};e.patch(c,f),s.push(f)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...qu(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
`}]}}const VS=function(e){if(e==null)return EA;if(typeof e=="function")return Ud(e);if(typeof e=="object")return Array.isArray(e)?SA(e):CA(e);if(typeof e=="string")return kA(e);throw new Error("Expected function, string, or object as test")};function SA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=VS(e[n]);return Ud(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function CA(e){const t=e;return Ud(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function kA(e){return Ud(t);function t(n){return n&&n.type===e}}function Ud(e){return t;function t(n,r,i){return!!(RA(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function EA(){return!0}function RA(e){return e!==null&&typeof e=="object"&&"type"in e}const KS=[],LA=!0,n1=!1,MA="skip";function TA(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=VS(i),a=r?-1:1;s(e,void 0,[])();function s(l,c,p){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const g=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return m;function m(){let g=KS,x,y,h;if((!t||o(l,c,p[p.length-1]||void 0))&&(g=AA(n(l,p)),g[0]===n1))return g;if("children"in l&&l.children){const f=l;if(f.children&&g[0]!==MA)for(y=(r?f.children.length:-1)+a,h=p.concat(f);y>-1&&y<f.children.length;){const d=f.children[y];if(x=s(d,y,h)(),x[0]===n1)return x;y=typeof x[1]=="number"?x[1]:y+a}}return g}}}function AA(e){return Array.isArray(e)?e:typeof e=="number"?[LA,e]:e==null?KS:[e]}function qS(e,t,n,r){let i,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,i=n):(o=t,a=n,i=r),TA(e,o,s,i);function s(l,c){const p=c[c.length-1],u=p?p.children.indexOf(l):void 0;return a(l,u,p)}}const Op={}.hasOwnProperty,DA={};function PA(e,t){const n=t||DA,r=new Map,i=new Map,o=new Map,a={...mA,...n.handlers},s={all:c,applyData:OA,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:a,one:l,options:n,patch:$A,wrap:IA};return qS(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const u=p.type==="definition"?r:i,m=String(p.identifier).toUpperCase();u.has(m)||u.set(m,p)}}),s;function l(p,u){const m=p.type,g=s.handlers[m];if(Op.call(s.handlers,m)&&g)return g(s,p,u);if(s.options.passThrough&&s.options.passThrough.includes(m)){if("children"in p){const{children:y,...h}=p,f=qu(h);return f.children=s.all(p),f}return qu(p)}return(s.options.unknownHandler||NA)(s,p,u)}function c(p){const u=[];if("children"in p){const m=p.children;let g=-1;for(;++g<m.length;){const x=s.one(m[g],p);if(x){if(g&&m[g-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=r1(x.value)),!Array.isArray(x)&&x.type==="element")){const y=x.children[0];y&&y.type==="text"&&(y.value=r1(y.value))}Array.isArray(x)?u.push(...x):u.push(x)}}}return u}}function $A(e,t){e.position&&(t.position=bM(e))}function OA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,qu(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function NA(e,t){const n=t.data||{},r="value"in t&&!(Op.call(n,"hProperties")||Op.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function r1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function i1(e,t){const n=PA(e,t),r=n.one(e,void 0),i=bA(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
`},i),o}function jA(e,t){return e&&"run"in e?async function(n,r){const i=i1(n,t);await e.run(i,r)}:function(n){return i1(n,t||e)}}function s1(e){if(e)throw e}var Zc=Object.prototype.hasOwnProperty,GS=Object.prototype.toString,o1=Object.defineProperty,a1=Object.getOwnPropertyDescriptor,l1=function(t){return typeof Array.isArray=="function"?Array.isArray(t):GS.call(t)==="[object Array]"},c1=function(t){if(!t||GS.call(t)!=="[object Object]")return!1;var n=Zc.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Zc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Zc.call(t,i)},u1=function(t,n){o1&&n.name==="__proto__"?o1(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},d1=function(t,n){if(n==="__proto__")if(Zc.call(t,n)){if(a1)return a1(t,n).value}else return;return t[n]},BA=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,p=!1;for(typeof s=="boolean"&&(p=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=d1(s,n),i=d1(t,n),s!==i&&(p&&i&&(c1(i)||(o=l1(i)))?(o?(o=!1,a=r&&l1(r)?r:[]):a=r&&c1(r)?r:{},u1(s,{name:n,newValue:e(p,a,i)})):typeof i<"u"&&u1(s,{name:n,newValue:i}));return s};const Kh=ld(BA);function Np(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function FA(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...i);function s(l,...c){const p=e[++o];let u=-1;if(l){a(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,p?zA(p,s)(...c):a(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function zA(e,t){let n;return r;function r(...a){const s=e.length>a.length;let l;s&&a.push(i);try{l=e.apply(this,a)}catch(c){const p=c;if(s&&n)throw p;return i(p)}s||(l instanceof Promise?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,t(a,...s))}function o(a){i(null,a)}}const Vn={basename:HA,dirname:UA,extname:WA,join:VA,sep:"/"};function HA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Al(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function UA(e){if(Al(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function WA(e){Al(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const s=e.codePointAt(t);if(s===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function VA(...e){let t=-1,n;for(;++t<e.length;)Al(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":KA(n)}function KA(e){Al(e);const t=e.codePointAt(0)===47;let n=qA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function qA(e,t){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(i===a-1||o===1))if(i!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function Al(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GA={cwd:YA};function YA(){return"/"}function Ip(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function XA(e){if(typeof e=="string")e=new URL(e);else if(!Ip(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return QA(e)}function QA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const qh=["history","path","basename","stem","extname","dirname"];class YS{constructor(t){let n;t?Ip(t)?n={path:t}:typeof t=="string"||JA(t)?n={value:t}:n=t:n={},this.cwd=GA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qh.length;){const o=qh[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)qh.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Vn.basename(this.path):void 0}set basename(t){Yh(t,"basename"),Gh(t,"basename"),this.path=Vn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Vn.dirname(this.path):void 0}set dirname(t){h1(this.basename,"dirname"),this.path=Vn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Vn.extname(this.path):void 0}set extname(t){if(Gh(t,"extname"),h1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Vn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ip(t)&&(t=XA(t)),Yh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Vn.basename(this.path,this.extname):void 0}set stem(t){Yh(t,"stem"),Gh(t,"stem"),this.path=Vn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Pt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Gh(e,t){if(e&&e.includes(Vn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Vn.sep+"`")}function Yh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function h1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function JA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZA=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};Object.setPrototypeOf(o,r);const a=Object.getOwnPropertyNames(i);for(const s of a){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(o,s,l)}return o},eD={}.hasOwnProperty;class Fg extends ZA{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=FA()}copy(){const t=new Fg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Kh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Jh("data",this.frozen),this.namespace[t]=n,this):eD.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Jh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=yc(t),r=this.parser||this.Parser;return Xh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Xh("process",this.parser||this.Parser),Qh("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,a){const s=yc(t),l=r.parse(s);r.run(l,s,function(p,u,m){if(p||!u||!m)return c(p);const g=u,x=r.stringify(g,m);rD(x)?m.value=x:m.result=x,c(p,m)});function c(p,u){p||!u?a(p):o?o(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),Xh("processSync",this.parser||this.Parser),Qh("processSync",this.compiler||this.Compiler),this.process(t,i),p1("processSync","process",n),r;function i(o,a){n=!0,s1(o),r=a}}run(t,n,r){f1(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,s){const l=yc(n);i.run(t,l,c);function c(p,u,m){const g=u||t;p?s(p):a?a(g):r(void 0,g,m)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),p1("runSync","run",r),i;function o(a,s){s1(a),i=s,r=!0}}stringify(t,n){this.freeze();const r=yc(n),i=this.compiler||this.Compiler;return Qh("stringify",i),f1(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Jh("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[p,...u]=c;l(p,u)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=Kh(!0,i.settings,c.settings))}function s(c){let p=-1;if(c!=null)if(Array.isArray(c))for(;++p<c.length;){const u=c[p];o(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,p){let u=-1,m=-1;for(;++u<r.length;)if(r[u][0]===c){m=u;break}if(m===-1)r.push([c,...p]);else if(p.length>0){let[g,...x]=p;const y=r[m][1];Np(y)&&Np(g)&&(g=Kh(!0,y,g)),r[m]=[c,g,...x]}}}}const tD=new Fg().freeze();function Xh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function f1(e){if(!Np(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function p1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yc(e){return nD(e)?e:new YS(e)}function nD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rD(e){return typeof e=="string"||iD(e)}function iD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",m1=[],g1={allowDangerousHtml:!0},oD=/^(https?|ircs?|mailto|xmpp)$/i,aD=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function lD(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,s=e.rehypePlugins||m1,l=e.remarkPlugins||m1,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...g1}:g1,p=e.skipHtml,u=e.unwrapDisallowed,m=e.urlTransform||cD,g=tD().use(UT).use(l).use(jA,c).use(s),x=new YS;typeof r=="string"&&(x.value=r);for(const d of aD)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+sD+d.id,void 0);const y=g.parse(x);let h=g.runSync(y,x);return i&&(h={type:"element",tagName:"div",properties:{className:i},children:h.type==="root"?h.children:[h]}),qS(h,f),LM(h,{Fragment:_.Fragment,components:o,ignoreInvalidStyle:!0,jsx:_.jsx,jsxs:_.jsxs,passKeys:!0,passNode:!0});function f(d,v,S){if(d.type==="raw"&&S&&typeof v=="number")return p?S.children.splice(v,1):S.children[v]={type:"text",value:d.value},v;if(d.type==="element"){let k;for(k in Uh)if(Object.hasOwn(Uh,k)&&Object.hasOwn(d.properties,k)){const C=d.properties[k],R=Uh[k];(R===null||R.includes(d.tagName))&&(d.properties[k]=m(String(C||""),k,d))}}if(d.type==="element"){let k=t?!t.includes(d.tagName):a?a.includes(d.tagName):!1;if(!k&&n&&typeof v=="number"&&(k=!n(d,v,S)),k&&S&&typeof v=="number")return u&&d.children?S.children.splice(v,1,...d.children):S.children.splice(v,1),v}}}function cD(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||oD.test(e.slice(0,t))?e:""}function uD({href:e,children:t}){const n=Cl()[1],r=e==null?void 0:e.startsWith("http"),i=()=>{e&&(r?Io(e):n(e??"/"))};return _.jsxs("button",{onClick:i,className:"text-accent no-underline hover:underline m-0",children:[t,r&&_.jsx(Eo,{className:"inline ml-1 mb-1 h-5 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0"})]})}const dD={code:({children:e})=>_.jsx($n,{className:"not-prose",children:e}),pre:({children:e})=>_.jsx("pre",{className:"not-prose bg-muted p-2 rounded",children:e}),a:({children:e,href:t})=>_.jsx(uD,{href:t,children:e})};function v1({md:e,isSmall:t,isTitle:n}){return _.jsx(lD,{components:dD,className:Q("prose prose-zinc dark:prose-invert",t&&"prose-sm",n&&"tracking-wide"),children:B6(e.replace(/\n/g,`  
`))})}let hD={data:""},fD=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||hD,pD=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,mD=/\/\*[^]*?\*\/|  +/g,_1=/\n+/g,qr=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+a+";":r+=o[1]=="f"?qr(a,o):o+"{"+qr(a,o[1]=="k"?"":t)+"}":typeof a=="object"?r+=qr(a,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=qr.p?qr.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},dr={},XS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+XS(e[n]);return t}return e},gD=(e,t,n,r,i)=>{let o=XS(e),a=dr[o]||(dr[o]=(l=>{let c=0,p=11;for(;c<l.length;)p=101*p+l.charCodeAt(c++)>>>0;return"go"+p})(o));if(!dr[a]){let l=o!==e?e:(c=>{let p,u,m=[{}];for(;p=pD.exec(c.replace(mD,""));)p[4]?m.shift():p[3]?(u=p[3].replace(_1," ").trim(),m.unshift(m[0][u]=m[0][u]||{})):m[0][p[1]]=p[2].replace(_1," ").trim();return m[0]})(e);dr[a]=qr(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let s=n&&dr.g?dr.g:null;return n&&(dr.g=dr[a]),((l,c,p,u)=>{u?c.data=c.data.replace(u,l):c.data.indexOf(l)===-1&&(c.data=p?l+c.data:c.data+l)})(dr[a],t,r,s),a},vD=(e,t,n)=>e.reduce((r,i,o)=>{let a=t[o];if(a&&a.call){let s=a(n),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=l?"."+l:s&&typeof s=="object"?s.props?"":qr(s,""):s===!1?"":s}return r+i+(a??"")},"");function Wd(e){let t=this||{},n=e.call?e(t.p):e;return gD(n.unshift?n.raw?vD(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,fD(t.target),t.g,t.o,t.k)}let QS,jp,Bp;Wd.bind({g:1});let Rr=Wd.bind({k:1});function _D(e,t,n,r){qr.p=t,QS=e,jp=n,Bp=r}function ki(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),l=s.className||i.className;n.p=Object.assign({theme:jp&&jp()},s),n.o=/ *go\d+/.test(l),s.className=Wd.apply(n,r)+(l?" "+l:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),Bp&&c[0]&&Bp(s),QS(c,s)}return t?t(i):i}}var yD=e=>typeof e=="function",Gu=(e,t)=>yD(e)?e(t):e,xD=(()=>{let e=0;return()=>(++e).toString()})(),JS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),wD=20,eu=new Map,bD=1e3,y1=e=>{if(eu.has(e))return;let t=setTimeout(()=>{eu.delete(e),cs({type:4,toastId:e})},bD);eu.set(e,t)},SD=e=>{let t=eu.get(e);t&&clearTimeout(t)},Fp=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,wD)};case 1:return t.toast.id&&SD(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?Fp(e,{type:1,toast:n}):Fp(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?y1(r):e.toasts.forEach(o=>{y1(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},tu=[],nu={toasts:[],pausedAt:void 0},cs=e=>{nu=Fp(nu,e),tu.forEach(t=>{t(nu)})},CD={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},kD=(e={})=>{let[t,n]=b.useState(nu);b.useEffect(()=>(tu.push(n),()=>{let i=tu.indexOf(n);i>-1&&tu.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,a;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||CD[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},ED=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||xD()}),Dl=e=>(t,n)=>{let r=ED(t,e,n);return cs({type:2,toast:r}),r.id},Zt=(e,t)=>Dl("blank")(e,t);Zt.error=Dl("error");Zt.success=Dl("success");Zt.loading=Dl("loading");Zt.custom=Dl("custom");Zt.dismiss=e=>{cs({type:3,toastId:e})};Zt.remove=e=>cs({type:4,toastId:e});Zt.promise=(e,t,n)=>{let r=Zt.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Zt.success(Gu(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Zt.error(Gu(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var RD=(e,t)=>{cs({type:1,toast:{id:e,height:t}})},LD=()=>{cs({type:5,time:Date.now()})},MD=e=>{let{toasts:t,pausedAt:n}=kD(e);b.useEffect(()=>{if(n)return;let o=Date.now(),a=t.map(s=>{if(s.duration===1/0)return;let l=(s.duration||0)+s.pauseDuration-(o-s.createdAt);if(l<0){s.visible&&Zt.dismiss(s.id);return}return setTimeout(()=>Zt.dismiss(s.id),l)});return()=>{a.forEach(s=>s&&clearTimeout(s))}},[t,n]);let r=b.useCallback(()=>{n&&cs({type:6,time:Date.now()})},[n]),i=b.useCallback((o,a)=>{let{reverseOrder:s=!1,gutter:l=8,defaultPosition:c}=a||{},p=t.filter(g=>(g.position||c)===(o.position||c)&&g.height),u=p.findIndex(g=>g.id===o.id),m=p.filter((g,x)=>x<u&&g.visible).length;return p.filter(g=>g.visible).slice(...s?[m+1]:[0,m]).reduce((g,x)=>g+(x.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:RD,startPause:LD,endPause:r,calculateOffset:i}}},TD=Rr`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,AD=Rr`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,DD=Rr`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,PD=ki("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

  animation: ${TD} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;

  &:after,
  &:before {
    content: '';
    animation: ${AD} 0.15s ease-out forwards;
    animation-delay: 150ms;
    position: absolute;
    border-radius: 3px;
    opacity: 0;
    background: ${e=>e.secondary||"#fff"};
    bottom: 9px;
    left: 4px;
    height: 2px;
    width: 12px;
  }

  &:before {
    animation: ${DD} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,$D=Rr`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,OD=ki("div")`
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid;
  border-radius: 100%;
  border-color: ${e=>e.secondary||"#e0e0e0"};
  border-right-color: ${e=>e.primary||"#616161"};
  animation: ${$D} 1s linear infinite;
`,ND=Rr`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,ID=Rr`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,jD=ki("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${ND} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${ID} 0.2s ease-out forwards;
    opacity: 0;
    animation-delay: 200ms;
    position: absolute;
    border-right: 2px solid;
    border-bottom: 2px solid;
    border-color: ${e=>e.secondary||"#fff"};
    bottom: 6px;
    left: 6px;
    height: 10px;
    width: 6px;
  }
`,BD=ki("div")`
  position: absolute;
`,FD=ki("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,zD=Rr`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,HD=ki("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${zD} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,UD=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?b.createElement(HD,null,t):t:n==="blank"?null:b.createElement(FD,null,b.createElement(OD,{...r}),n!=="loading"&&b.createElement(BD,null,n==="error"?b.createElement(PD,{...r}):b.createElement(jD,{...r})))},WD=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,VD=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,KD="0%{opacity:0;} 100%{opacity:1;}",qD="0%{opacity:1;} 100%{opacity:0;}",GD=ki("div")`
  display: flex;
  align-items: center;
  background: #fff;
  color: #363636;
  line-height: 1.3;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
  max-width: 350px;
  pointer-events: auto;
  padding: 8px 10px;
  border-radius: 8px;
`,YD=ki("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,XD=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=JS()?[KD,qD]:[WD(n),VD(n)];return{animation:t?`${Rr(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Rr(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},QD=b.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?XD(e.position||t||"top-center",e.visible):{opacity:0},o=b.createElement(UD,{toast:e}),a=b.createElement(YD,{...e.ariaProps},Gu(e.message,e));return b.createElement(GD,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:o,message:a}):b.createElement(b.Fragment,null,o,a))});_D(b.createElement);var JD=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let o=b.useCallback(a=>{if(a){let s=()=>{let l=a.getBoundingClientRect().height;r(e,l)};s(),new MutationObserver(s).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return b.createElement("div",{ref:o,className:t,style:n},i)},ZD=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:JS()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},eP=Wd`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,xc=16,tP=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:l}=MD(n);return b.createElement("div",{style:{position:"fixed",zIndex:9999,top:xc,left:xc,right:xc,bottom:xc,pointerEvents:"none",...o},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},s.map(c=>{let p=c.position||t,u=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),m=ZD(p,u);return b.createElement(JD,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?eP:"",style:m},c.type==="custom"?Gu(c.message,c):i?i(c):b.createElement(QD,{toast:c,position:p}))}))},Yu=Zt;const nP=["default","loading","info","success","warning","error"],rP=Si(`max-w-xl w-full sm:w-auto sm:min-w-[28rem] relative overflow-hidden z-40
    p-3 pr-10 flex items-center justify-between space-x-4
    rounded-xl border shadow-lg transition-all pointer-events-none
    text-black/75 dark:text-white/90`,{variants:{type:{default:"dark:border-primary/25 bg-white dark:bg-secondary dark:text-secondary-foreground",loading:"dark:border-primary/25 bg-white dark:bg-secondary dark:text-secondary-foreground",info:"border-info/70 bg-info-hint",success:"border-success/70 bg-success-hint",warning:"border-warning/70 bg-warning-hint",error:"border-destructive/70 bg-destructive-hint"}},defaultVariants:{type:"default"}}),iP={default:_.jsx(sL,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:_.jsx(Fn,{className:"animate-spin"}),info:_.jsx(xg,{className:"stroke-info animate-toastbar-icon"}),success:_.jsx(iL,{className:"stroke-success animate-toastbar-icon"}),warning:_.jsx(YR,{className:"stroke-warning animate-toastbar-icon"}),error:_.jsx(XR,{className:"stroke-destructive animate-toastbar-icon"})},sP=({t:e,type:t,data:n})=>{const[r,i]=b.useState(0);return b.useEffect(()=>{let o=null;const a=()=>{o&&clearInterval(o)};return t==="loading"&&e.visible?o=setInterval(()=>{i(s=>s+1)},1e3):o&&a(),a},[t,e.visible]),_.jsxs("div",{className:Q(rP({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[_.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?_.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:_.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):iP[t]}),_.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?_.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?_.jsxs(_.Fragment,{children:[n.title?_.jsx(v1,{md:`**${n.title}**`,isSmall:!0,isTitle:!0}):null,_.jsx(v1,{md:n.msg,isSmall:!0})]}):_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"font-semibold mb-1",children:n.title}),_.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&_.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",_.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",onClick:Xa,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),_.jsxs("button",{onClick:()=>Yu.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[_.jsx($r,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})};function oP(){return _.jsx(tP,{reverseOrder:!0,containerStyle:{top:"calc(4.5rem + 1px)",zIndex:60}})}const Mi=(e,t,n={})=>(n.duration??(n.duration=e==="loading"?1/0:5e3),Yu.custom(r=>_.jsx(sP,{t:r,type:e,data:t}),n)),aP=(e,t)=>Mi(e.type,e,t),Ct=Object.assign(aP,{default:(e,t)=>Mi("default",e,t),loading:(e,t)=>Mi("loading",e,t),info:(e,t)=>Mi("info",e,t),success:(e,t)=>Mi("success",e,t),warning:(e,t)=>Mi("warning",e,t),error:(e,t)=>Mi("error",e,t),dismiss:Yu.dismiss,remove:Yu.remove}),zg=zo(!1),ZS=zo(void 0),eC=()=>{const e=Ne(ZS),t=Ne(zg);return n=>{e(n),t(!0)}},lP=()=>{const e=qe(ZS),[t,n]=Ut(zg);return{isModalOpen:t,actionRef:e,closeModal:()=>n(!1)}},Wo=Pe(window.txConsts.preAuth),tC=Pe(e=>!!e(Wo)),cP=Pe(e=>{const t=e(Wo);return t?t.csrfToken:void 0}),uP=Pe(e=>{const t=e(Wo);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),dP=()=>qe(tC),hP=()=>qe(cP),fP=()=>Ne(Wo),ar=()=>{const e=qe(uP);return{hasPerm:n=>{if(!e)return!1;try{return n==="master"?e.isMaster:e.isMaster||e.permissions.includes("all_permissions")||e.permissions.includes(n)}catch{return console.error(`Error validating permission '${n}' denied.`),!1}},isMaster:e?e.isMaster:!1}},Hg=()=>{const e=Ne(Wo);return(t="unknown",n="unknown")=>{console.log(`Logout notice received from '${t}' for reason '${n}'. Wiping auth data.`),e(!1),window.history.replaceState(null,"","/login#expired")}},us=()=>{const[e,t]=Ut(Wo),n=rs({mutationKey:["auth"],mutationFn:()=>fetch("/auth/logout",{method:"POST"}).then(r=>r.json()),onSuccess:r=>{r.logout&&(t(!1),window.history.replaceState(null,"","/login#logout"))}});return{authData:e,setAuthData:t,logout:{mutate:n.mutate,isLoading:n.isPending}}},pP=Cb((e,t)=>{e(tC)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t($d,!1),t(Od,!1),t(Nd,!1),t(Eg,!1),t(Rg,!1),t(Lg,!1),t(Bd,!1),t(zg,!1),t(as,null),Ct.dismiss())}),mP=rS("liveConsoleCommandHistory",[]),gP=rS("liveConsoleCommandBookmarks",[]),vP=50,nC=()=>{const[e,t]=Ut(mP);return{history:e,setHistory:t,appendHistory:n=>{const r=e.filter(i=>i!==n);r.unshift(n)>vP&&r.pop(),t(r)},wipeHistory:()=>{t([])}}},_P=()=>{const[e,t]=Ut(gP);return{bookmarks:e,addBookmark:n=>{e.includes(n)||t([n,...e])},removeBookmark:n=>{t(e.filter(r=>r!==n))}}};function yP({featName:e,durationDays:t}){const n=`dynamicNewBadgeTs-${e}`,r=parseInt(localStorage.getItem(n)??"");if(isNaN(r)||window.txConsts.showAdvanced)localStorage.setItem(n,Date.now().toString());else{const i=(t??3)*24*60*60*1e3;if(r+i<Date.now())return null}return _.jsx("span",{className:"rounded bg-accent text-accent-foreground text-2xs tracking-wider font-semibold px-1 ml-1.5",children:"NEW"})}const zp=tt.memo(yP);function wc({icon:e,title:t,disabled:n,onClick:r}){return _.jsxs("div",{tabIndex:0,className:Q(`group bg-secondary xs:bg-transparent 2xl:hover:bg-secondary w-full rounded-lg px-1.5 py-2 cursor-pointer flex items-center justify-center
                transition-all ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,n&&"opacity-50 pointer-events-none"),onClick:()=>!n&&r(),onKeyDown:i=>(i.code==="Enter"||i.code==="Space")&&!n&&r(),children:[_.jsx(e,{className:"w-6 h-6 2xl:w-5 2xl:h-5 text-muted-foreground group-hover:scale-110 group-hover:text-secondary-foreground inline"}),_.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t}),t==="Saved"&&_.jsx(zp,{featName:"liveConsoleBookmarks"})]})}function xP(e){const{history:t,appendHistory:n}=nC(),[r,i]=b.useState(-1),o=b.useRef(""),a=e.termInputRef,{hasPerm:s}=ar(),l=s("console.write");b.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected,a]);const c=()=>{if(!a.current)return;r===-1&&(o.current=a.current.value??"");const g=r+1;t[g]&&(a.current.value=t[g],i(g))},p=()=>{if(!a.current)return;const g=r-1;g===-1?(a.current.value=o.current,i(g)):t[g]&&(a.current.value=t[g],i(g))},u=()=>{if(!a.current)return;const g=a.current.value.trim();i(-1),a.current.value="",o.current="",g&&(n(g),e.consoleWrite(g))},m=g=>{e.isConnected&&(g.key==="ArrowUp"?(c(),g.preventDefault()):g.key==="ArrowDown"?(p(),g.preventDefault()):g.key==="Enter"&&(u(),g.preventDefault()))};return _.jsxs("div",{className:"flex flex-col xs:flex-row xs:items-center gap-2 px-1 sm:px-4 py-2 border-t justify-center",children:[_.jsxs("div",{className:"flex items-center grow",children:[_.jsx("svg",{className:"hidden sm:block w-4 h-4 mr-2 text-warning-inline shrink-0",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{d:"m9 18 6-6-6-6"})}),_.jsx(it,{ref:a,className:"w-full",placeholder:"Type a command...",type:"text",disabled:!e.isConnected||!l,onKeyDown:m,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),_.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[_.jsx(wc,{icon:eL,title:"Saved",onClick:e.toggleSaveSheet}),_.jsx(wc,{icon:FL,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),_.jsx(wc,{icon:GL,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),_.jsx(wc,{icon:mL,title:"Download",disabled:!e.isConnected,onClick:()=>{Io("/fxserver/downloadLog")}})]})]})}function wP(){return _.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",height:"24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[_.jsx("polyline",{points:"4 17 10 11 4 5"}),_.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),_.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]})})}function ys({title:e,onClick:t,isActive:n,children:r}){return _.jsx("button",{title:e,className:Q("rounded p-0.5","hover:bg-secondary-foreground hover:text-secondary","focus:outline-none focus:ring-1 focus:ring-secondary-foreground focus:ring-offset-1x focus:ring-offset-secondary-foreground",n&&"bg-muted-foreground text-secondary"),onClick:t,children:r})}const Zh="No results",bP={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function SP({show:e,setShow:t,searchAddon:n}){const[r,i]=b.useState(!1),[o,a]=b.useState(!1),[s,l]=b.useState(!1),c=b.useRef(null),[p,u]=b.useState(Zh),m=k=>{n.clearDecorations(),k&&u(k)},g=k=>({decorations:bP,caseSensitive:r,wholeWord:o,regex:s,...k});b.useEffect(()=>{var k;e?(k=c.current)==null||k.focus():m(Zh)},[e]),b.useEffect(()=>{if(!n)return;const k=n.onDidChangeResults(({resultIndex:C,resultCount:R})=>{u(C===-1?Zh:`${C+1}/${R}`)});return()=>{k.dispose()}},[]);const x=()=>{!c.current||!c.current.value||(console.log("backward search for",c.current.value),n.findPrevious(c.current.value,g()))},y=()=>{!c.current||!c.current.value||(console.log("forward search for",c.current.value),n.findNext(c.current.value,g()))},h=k=>{c.current&&(console.log("search input keydown",k.code),k.code==="Enter"&&(k.shiftKey?x():y(),k.preventDefault()))},f=k=>{c.current&&y()},d=()=>{c.current&&(i(!r),m(),n.findNext(c.current.value,g({caseSensitive:!r})))},v=()=>{c.current&&(a(!o),m(),n.findNext(c.current.value,g({wholeWord:!o})))},S=()=>{c.current&&(l(!s),m(),n.findNext(c.current.value,g({regex:!s})))};return Er("message",k=>{var C;k.data.type==="liveConsoleSearchHotkey"&&(k.data.action==="previous"?x():k.data.action==="next"?y():k.data.action==="focus"&&((C=c.current)==null||C.focus()))}),e?_.jsxs("div",{className:"absolute top-0 xs:right-4 bg-secondary border z-10 flex items-center justify-center gap-1 xs:gap-4 shadow-xl p-1 rounded-b-lg border-t-0 w-full xs:w-auto flex-wrap",children:[_.jsxs("div",{className:"relative",children:[_.jsx(it,{ref:c,className:"h-8",placeholder:"Search string",onKeyDown:h,onChange:f,onBlur:()=>{n.clearActiveDecoration()}}),_.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[_.jsx(ys,{title:"Case Sensitive",isActive:r,onClick:d,children:_.jsx(rL,{className:"h-5 w-5"})}),_.jsx(ys,{title:"Whole Word",isActive:o,onClick:v,children:_.jsx(YL,{className:"h-5 w-5"})}),_.jsx(ys,{title:"Regex",isActive:s,onClick:S,children:_.jsx(IL,{className:"h-4 w-5"})})]})]}),_.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:p}),_.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[_.jsx(ys,{title:"Previous",onClick:x,children:_.jsx(JR,{className:"h-5 w-5"})}),_.jsx(ys,{title:"Next",onClick:y,children:_.jsx(QR,{className:"h-5 w-5"})}),_.jsx(ys,{title:"Close",onClick:()=>{t(!1)},children:_.jsx($r,{className:"h-5 w-5"})})]})]}):null}function CP({isOpen:e,closeSheet:t}){return _.jsx("div",{className:Q("absolute inset-0 z-20","bg-black/40 duration-300","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","data-[state=open]:opacity-100 data-[state=open]:backdrop-blur-sm","data-[state=closed]:opacity-0 data-[state=closed]:backdrop-blur-none"),"data-state":e?"open":"closed",onClick:t})}function kP({closeSheet:e}){return _.jsx("button",{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-0 transition-opacity hover:opacity-100 focus:outline-none cursor-pointer",onClick:e,title:"Close",children:_.jsx($r,{className:"h-8 w-8"})})}function x1({cmd:e,type:t,onClick:n,onFavAction:r}){const i=o=>{o.stopPropagation(),r()};return _.jsxs("div",{onClick:n,className:"px-2 py-1 flex justify-between items-center rounded-lg bg-card hover:bg-muted cursor-pointer group",children:[_.jsx("span",{className:"py-1 line-clamp-4 font-mono group-hover:text-primary",children:e}),_.jsx("div",{className:"min-w-max",children:_.jsx("button",{className:"size-7 rounded-lg flex items-center justify-center hover:bg-primary hover:text-primary-foreground invisible group-hover:visible",onClick:i,children:t==="history"?_.jsxs(_.Fragment,{children:[_.jsx(WL,{className:"size-5"}),_.jsx("span",{className:"sr-only",children:"Save"})]}):_.jsxs(_.Fragment,{children:[_.jsx(UL,{className:"size-5"}),_.jsx("span",{className:"sr-only",children:"Remove"})]})})})]})}function EP({toTermInput:e}){const{history:t,wipeHistory:n}=nC(),{bookmarks:r,addBookmark:i,removeBookmark:o}=_P(),a=Id(),s=()=>{Ct.success("History cleared"),n()},l=()=>{a({title:"Save Command",message:"Enter the command to save:",submitLabel:"Save",onSubmit:c=>{c&&i(c)}})};return _.jsxs("div",{className:"flex flex-row gap-4 max-h-full",children:[_.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[_.jsx("h2",{className:"text-xl font-bold",children:"History"}),_.jsxs(Bn,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[_.jsx("button",{onClick:s,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:_.jsxs("div",{className:"flex items-center justify-center gap-2",children:[_.jsx($r,{className:"w-4 h-4 inline"}),"Clear History"]})}),_.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:t.map((c,p)=>_.jsx(x1,{cmd:c,type:"history",onClick:()=>e(c),onFavAction:()=>i(c)},p))}),t.length===0&&_.jsx("div",{className:"w-full h-auto text-center italic tracking-wider",children:"The command history is empty."})]})]}),_.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[_.jsx("h2",{className:"text-xl font-bold",children:"Saved"}),_.jsxs(Bn,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[_.jsx("button",{onClick:l,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:_.jsxs("div",{className:"flex items-center justify-center gap-2",children:[_.jsx($L,{className:"w-4 h-4 inline"}),"Add New"]})}),_.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:r.map((c,p)=>_.jsx(x1,{cmd:c,type:"saved",onClick:()=>e(c),onFavAction:()=>o(c)},p))}),r.length===0&&_.jsxs("div",{className:"w-full h-auto text-center italic tracking-wider",children:["There are no saved commands. ",_.jsx("br",{}),"To save a command, click the star icon next to it."]})]})]})]})}function RP({isOpen:e,closeSheet:t,toTermInput:n}){return _.jsxs(_.Fragment,{children:[_.jsx(CP,{isOpen:e,closeSheet:t}),_.jsxs("div",{"data-state":e?"open":"closed",className:Q("absolute z-20 inset-y-0 w-full md:max-w-2xl","bg-background px-4 pt-6 shadow-lg border-l","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","transition-all duration-300 ease-in-out",e?"right-0 opacity-100":"-right-full opacity-0"),children:[_.jsx(kP,{closeSheet:t}),_.jsx(EP,{toTermInput:n})]})]})}class LP{constructor(t,n){ms(this,"btnRef");ms(this,"containerElement");ms(this,"_disposables",[]);this.btnRef=t,this.containerElement=n}activate(t){if(!this.containerElement)throw new Error("containerElement is null");this.containerElement.addEventListener("wheel",i=>{this.checkViewportY(t)});const n=t.onScroll(()=>{this.checkViewportY(t)});this._disposables.push(n);const r=t.onLineFeed(()=>{this.checkViewportY(t)});this._disposables.push(r)}checkViewportY(t){t.buffer.active.viewportY===t.buffer.active.baseY?this.btnRef.classList.add("hidden"):this.btnRef.classList.remove("hidden")}dispose(){this._disposables.forEach(t=>t.dispose()),this._disposables.length=0}}const MP={background:"#222326",foreground:"#F8F8F8",black:"#000000",brightBlack:"#555555",red:"#D62341",brightRed:"#FF5370",green:"#9ECE58",brightGreen:"#C3E88D",yellow:"#FAED70",brightYellow:"#FFCB6B",blue:"#396FE2",brightBlue:"#82AAFF",magenta:"#BB80B3",brightMagenta:"#C792EA",cyan:"#2DDAFD",brightCyan:"#89DDFF",white:"#D0D0D0",brightWhite:"#FFFFFF"},TP={theme:MP,convertEol:!0,cursorBlink:!0,cursorStyle:"bar",disableStdin:!0,drawBoldTextInBrightColors:!1,fontFamily:"JetBrains Mono Variable, monospace",fontSize:14,lineHeight:1.1,fontWeight:"300",fontWeightBold:"600",letterSpacing:.8,scrollback:5e3,allowProposedApi:!0,allowTransparency:!0,overviewRulerWidth:15},la=150,AP=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]{3,}/,DP=/[\x00-\x08\x0B-\x1A\x1C-\x1F\x7F\x80-\x9F]/g,PP=/(\u001b\[|\u009B)[\d;]+[@-K]/g,$P=/\u001b[^m]*?m/g,OP=e=>e.replace(DP,"").replace(PP,"").replace($P,"");function NP(){const[e,t]=b.useState(!1),[n,r]=b.useState(!1),[i,o]=b.useState(!1),a=b.useRef(null),s=_g(),l=vg();s("Live Console");const c=b.useRef(null),p=b.useRef(null),u=b.useMemo(()=>new JL.Terminal(TP),[]),m=b.useMemo(()=>new e8.FitAddon,[]),g=b.useMemo(()=>new t8.SearchAddon,[]),x=(M,D)=>{Io(D)},y=b.useMemo(()=>new n8.WebLinksAddon(x),[]),h=_r(la,M=>{window.postMessage({type:"liveConsoleSearchHotkey",action:M})},{noTrailing:!0}),f=()=>{if(!p.current||!u.element||!m){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const M=m.proposeDimensions();M?u.resize(M.cols,M.rows):console.log("refitTerminal: no proposed dimensions")};Er("resize",UR(100,f)),b.useEffect(()=>{if(p.current&&c.current&&!u.element){console.log("live console xterm init"),p.current.innerHTML="",u.loadAddon(m),u.loadAddon(g),u.loadAddon(y),u.loadAddon(new ZL.CanvasAddon),u.loadAddon(new LP(c.current,p.current)),u.open(p.current),u.write("\x1B[?25l"),f();const M=_r(la,()=>{u.scrollLines(Math.min(1,2-u.rows))},{noTrailing:!0}),D=_r(la,()=>{u.scrollLines(Math.max(1,u.rows-2))},{noTrailing:!0}),P=_r(la,()=>{u.scrollToTop()},{noTrailing:!0}),$=_r(la,()=>{u.scrollToBottom()},{noTrailing:!0});u.attachCustomKeyEventHandler(O=>O.code==="F5"||O.code==="Escape"||O.code==="KeyF"&&(O.ctrlKey||O.metaKey)||O.code==="F3"?!1:O.code==="KeyC"&&(O.ctrlKey||O.metaKey)?(document.execCommand("copy"),u.clearSelection(),!1):O.code==="PageUp"?(M(),!1):O.code==="PageDown"?(D(),!1):O.code==="Home"?(P(),!1):O.code==="End"?($(),!1):!Pb(O))}},[u]),Er("keydown",M=>{M.code==="F5"?n&&(l(),M.preventDefault()):M.code==="Escape"?(g.clearDecorations(),o(!1)):M.code==="KeyF"&&(M.ctrlKey||M.metaKey)?(i?h("focus"):o(!0),M.preventDefault()):M.code==="F3"&&(h(M.shiftKey?"previous":"next"),M.preventDefault())});const d=M=>{const D=u.registerMarker(0),P=u.registerDecoration({marker:D});P&&P.onRender($=>{$.classList.add("cursor-pointer"),$.innerText="🔠",$.onclick=()=>{Ct.info({title:"Bidirectional Text Detected:",msg:M})}})},v=M=>{const D=M.split(/\r?\n/);D.length&&!D[D.length-1]&&D.pop();for(const P of D)AP.test(P)&&d(OP(P)),u.writeln(P)},S=b.useRef(0),k=b.useRef(null);b.useEffect(()=>(console.log("live console socket init"),k.current=ib(["liveconsole"]),k.current.on("connect",()=>{console.log("Live Console Socket.IO Connected."),r(!0)}),k.current.on("disconnect",M=>{console.log("Live Console Socket.IO Disonnected:",M);const D=S.current+1;S.current=D,setTimeout(()=>{S.current===D&&r(!1)},500)}),k.current.on("error",M=>{console.log("Live Console Socket.IO",M)}),k.current.on("consoleData",function(M){v(M)}),()=>{var M,D;(M=k.current)==null||M.removeAllListeners(),(D=k.current)==null||D.disconnect()}),[]);const C=M=>{!n||!k.current||k.current.emit("consoleCommand",M)},R=()=>{u.clear()},w=()=>{o(!i)},E=()=>{t(!e)},L=M=>{a.current&&(a.current.value=M,a.current.focus()),t(!1)};return _.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[_.jsx(wP,{}),_.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[n?null:_.jsx("div",{className:"absolute inset-0 z-20 bg-black/40 backdrop-blur-sm flex items-center justify-center",children:_.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[_.jsx(Fn,{className:"w-16 h-16 animate-spin"}),_.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),_.jsx(RP,{isOpen:e,closeSheet:()=>t(!1),toTermInput:M=>L(M)}),_.jsx("div",{ref:p,className:"absolute top-1 left-2 right-0 bottom-0"}),_.jsx(SP,{show:i,setShow:o,searchAddon:g}),_.jsx("button",{ref:c,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{u.scrollToBottom()},children:_.jsx(cL,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),_.jsx(xP,{termInputRef:a,isConnected:n,consoleWrite:C,consoleClear:R,toggleSaveSheet:E,toggleSearchBar:w})]})}const IP=e=>1- --e*e*e*e,w1=1e3/60,bc=({countTo:e,duration:t=1250})=>{const[n,r]=b.useState(0);return b.useEffect(()=>{let i=0;const o=Math.round(t/w1),a=setInterval(()=>{i++;const s=IP(i/o);r(e*s),i===o&&clearInterval(a)},w1)},[]),Math.floor(n).toLocaleString("en-US")};function Sc(){return _.jsx("div",{className:"h-7 w-28 animate-pulse rounded-md bg-muted"})}function rC({callouts:e}){return e.length!==4?null:_.jsxs("div",{className:"grid px-2 md:px-0 gap-2 xs:gap-4 grid-cols-2 lg:grid-cols-4 mb-4 md:mb-6",children:[_.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[_.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[_.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[0].label}),_.jsx("div",{className:"hidden xs:block",children:e[0].icon})]}),e[0].value===!1?_.jsx(Sc,{}):_.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[0].prefix,_.jsx(bc,{countTo:e[0].value})]})]}),_.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[_.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[_.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[1].label}),_.jsx("div",{className:"hidden xs:block",children:e[1].icon})]}),e[1].value===!1?_.jsx(Sc,{}):_.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[1].prefix,_.jsx(bc,{countTo:e[1].value})]})]}),_.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[_.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[_.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[2].label}),_.jsx("div",{className:"hidden xs:block",children:e[2].icon})]}),e[2].value===!1?_.jsx(Sc,{}):_.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[2].prefix,_.jsx(bc,{countTo:e[2].value})]})]}),_.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[_.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[_.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[3].label}),_.jsx("div",{className:"hidden xs:block",children:e[3].icon})]}),e[3].value===!1?_.jsx(Sc,{}):_.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[3].prefix,_.jsx(bc,{countTo:e[3].value})]})]})]})}function Lr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=jP({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=Be(n),l=b.useCallback(c=>{if(o){const u=typeof c=="function"?c(e):c;u!==e&&s(u)}else i(c)},[o,e,i,s]);return[a,l]}function jP({defaultProp:e,onChange:t}){const n=b.useState(e),[r]=n,i=b.useRef(r),o=Be(t);return b.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function Pl(e){const t=e+"CollectionProvider",[n,r]=Vt(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:x,children:y}=g,h=tt.useRef(null),f=tt.useRef(new Map).current;return tt.createElement(i,{scope:x,itemMap:f,collectionRef:h},y)},s=e+"CollectionSlot",l=tt.forwardRef((g,x)=>{const{scope:y,children:h}=g,f=o(s,y),d=Se(x,f.collectionRef);return tt.createElement(mi,{ref:d},h)}),c=e+"CollectionItemSlot",p="data-radix-collection-item",u=tt.forwardRef((g,x)=>{const{scope:y,children:h,...f}=g,d=tt.useRef(null),v=Se(x,d),S=o(c,y);return tt.useEffect(()=>(S.itemMap.set(d,{ref:d,...f}),()=>void S.itemMap.delete(d))),tt.createElement(mi,{[p]:"",ref:v},h)});function m(g){const x=o(e+"CollectionConsumer",g);return tt.useCallback(()=>{const h=x.collectionRef.current;if(!h)return[];const f=Array.from(h.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((S,k)=>f.indexOf(S.ref.current)-f.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:a,Slot:l,ItemSlot:u},m,r]}function BP(e,t=globalThis==null?void 0:globalThis.document){const n=Be(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Hp="dismissableLayer.update",FP="dismissableLayer.pointerDownOutside",zP="dismissableLayer.focusOutside";let b1;const HP=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$l=b.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,p=b.useContext(HP),[u,m]=b.useState(null),g=(n=u==null?void 0:u.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,x]=b.useState({}),y=Se(t,w=>m(w)),h=Array.from(p.layers),[f]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),d=h.indexOf(f),v=u?h.indexOf(u):-1,S=p.layersWithOutsidePointerEventsDisabled.size>0,k=v>=d,C=UP(w=>{const E=w.target,L=[...p.branches].some(M=>M.contains(E));!k||L||(o==null||o(w),s==null||s(w),w.defaultPrevented||l==null||l())},g),R=WP(w=>{const E=w.target;[...p.branches].some(M=>M.contains(E))||(a==null||a(w),s==null||s(w),w.defaultPrevented||l==null||l())},g);return BP(w=>{v===p.layers.size-1&&(i==null||i(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()))},g),b.useEffect(()=>{if(u)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(b1=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(u)),p.layers.add(u),S1(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=b1)}},[u,g,r,p]),b.useEffect(()=>()=>{u&&(p.layers.delete(u),p.layersWithOutsidePointerEventsDisabled.delete(u),S1())},[u,p]),b.useEffect(()=>{const w=()=>x({});return document.addEventListener(Hp,w),()=>document.removeEventListener(Hp,w)},[]),b.createElement(fe.div,Y({},c,{ref:y,style:{pointerEvents:S?k?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,R.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,C.onPointerDownCapture)}))});function UP(e,t=globalThis==null?void 0:globalThis.document){const n=Be(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let c=function(){iC(FP,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function WP(e,t=globalThis==null?void 0:globalThis.document){const n=Be(e),r=b.useRef(!1);return b.useEffect(()=>{const i=o=>{o.target&&!r.current&&iC(zP,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function S1(){const e=new CustomEvent(Hp);document.dispatchEvent(e)}function iC(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Nu(i,o):i.dispatchEvent(o)}let ef=0;function Ug(){b.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:C1()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:C1()),ef++,()=>{ef===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ef--}},[])}function C1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const tf="focusScope.autoFocusOnMount",nf="focusScope.autoFocusOnUnmount",k1={bubbles:!1,cancelable:!0},Wg=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=b.useState(null),c=Be(i),p=Be(o),u=b.useRef(null),m=Se(t,y=>l(y)),g=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let y=function(v){if(g.paused||!s)return;const S=v.target;s.contains(S)?u.current=S:Hr(u.current,{select:!0})},h=function(v){if(g.paused||!s)return;const S=v.relatedTarget;S!==null&&(s.contains(S)||Hr(u.current,{select:!0}))},f=function(v){if(document.activeElement===document.body)for(const k of v)k.removedNodes.length>0&&Hr(s)};document.addEventListener("focusin",y),document.addEventListener("focusout",h);const d=new MutationObserver(f);return s&&d.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",h),d.disconnect()}}},[r,s,g.paused]),b.useEffect(()=>{if(s){R1.add(g);const y=document.activeElement;if(!s.contains(y)){const f=new CustomEvent(tf,k1);s.addEventListener(tf,c),s.dispatchEvent(f),f.defaultPrevented||(VP(XP(sC(s)),{select:!0}),document.activeElement===y&&Hr(s))}return()=>{s.removeEventListener(tf,c),setTimeout(()=>{const f=new CustomEvent(nf,k1);s.addEventListener(nf,p),s.dispatchEvent(f),f.defaultPrevented||Hr(y??document.body,{select:!0}),s.removeEventListener(nf,p),R1.remove(g)},0)}}},[s,c,p,g]);const x=b.useCallback(y=>{if(!n&&!r||g.paused)return;const h=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,f=document.activeElement;if(h&&f){const d=y.currentTarget,[v,S]=KP(d);v&&S?!y.shiftKey&&f===S?(y.preventDefault(),n&&Hr(v,{select:!0})):y.shiftKey&&f===v&&(y.preventDefault(),n&&Hr(S,{select:!0})):f===d&&y.preventDefault()}},[n,r,g.paused]);return b.createElement(fe.div,Y({tabIndex:-1},a,{ref:m,onKeyDown:x}))});function VP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Hr(r,{select:t}),document.activeElement!==n)return}function KP(e){const t=sC(e),n=E1(t,e),r=E1(t.reverse(),e);return[n,r]}function sC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function E1(e,t){for(const n of e)if(!qP(n,{upTo:t}))return n}function qP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function GP(e){return e instanceof HTMLInputElement&&"select"in e}function Hr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&GP(e)&&t&&e.select()}}const R1=YP();function YP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=L1(e,t),e.unshift(t)},remove(t){var n;e=L1(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function L1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function XP(e){return e.filter(t=>t.tagName!=="A")}const QP=Ey.useId||(()=>{});let JP=0;function _n(e){const[t,n]=b.useState(QP());return st(()=>{e||n(r=>r??String(JP++))},[e]),e||(t?`radix-${t}`:"")}const ZP=["top","right","bottom","left"],gi=Math.min,Xt=Math.max,Xu=Math.round,Cc=Math.floor,vi=e=>({x:e,y:e}),e$={left:"right",right:"left",bottom:"top",top:"bottom"},t$={start:"end",end:"start"};function Up(e,t,n){return Xt(e,gi(t,n))}function Mr(e,t){return typeof e=="function"?e(t):e}function Tr(e){return e.split("-")[0]}function Vo(e){return e.split("-")[1]}function Vg(e){return e==="x"?"y":"x"}function Kg(e){return e==="y"?"height":"width"}function Ko(e){return["top","bottom"].includes(Tr(e))?"y":"x"}function qg(e){return Vg(Ko(e))}function n$(e,t,n){n===void 0&&(n=!1);const r=Vo(e),i=qg(e),o=Kg(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Qu(a)),[a,Qu(a)]}function r$(e){const t=Qu(e);return[Wp(e),t,Wp(t)]}function Wp(e){return e.replace(/start|end/g,t=>t$[t])}function i$(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function s$(e,t,n,r){const i=Vo(e);let o=i$(Tr(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Wp)))),o}function Qu(e){return e.replace(/left|right|bottom|top/g,t=>e$[t])}function o$(e){return{top:0,right:0,bottom:0,left:0,...e}}function oC(e){return typeof e!="number"?o$(e):{top:e,right:e,bottom:e,left:e}}function Ju(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function M1(e,t,n){let{reference:r,floating:i}=e;const o=Ko(t),a=qg(t),s=Kg(a),l=Tr(t),c=o==="y",p=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let g;switch(l){case"top":g={x:p,y:r.y-i.height};break;case"bottom":g={x:p,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:u};break;case"left":g={x:r.x-i.width,y:u};break;default:g={x:r.x,y:r.y}}switch(Vo(t)){case"start":g[a]-=m*(n&&c?-1:1);break;case"end":g[a]+=m*(n&&c?-1:1);break}return g}const a$=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:u}=M1(c,r,l),m=r,g={},x=0;for(let y=0;y<s.length;y++){const{name:h,fn:f}=s[y],{x:d,y:v,data:S,reset:k}=await f({x:p,y:u,initialPlacement:r,placement:m,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});if(p=d??p,u=v??u,g={...g,[h]:{...g[h],...S}},k&&x<=50){x++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(c=k.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:p,y:u}=M1(c,m,l)),y=-1;continue}}return{x:p,y:u,placement:m,strategy:i,middlewareData:g}};async function Ja(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:u="floating",altBoundary:m=!1,padding:g=0}=Mr(t,e),x=oC(g),h=s[m?u==="floating"?"reference":"floating":u],f=Ju(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(h)))==null||n?h:h.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:p,strategy:l})),d=u==="floating"?{...a.floating,x:r,y:i}:a.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},k=Ju(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:d,offsetParent:v,strategy:l}):d);return{top:(f.top-k.top+x.top)/S.y,bottom:(k.bottom-f.bottom+x.bottom)/S.y,left:(f.left-k.left+x.left)/S.x,right:(k.right-f.right+x.right)/S.x}}const l$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:p=0}=Mr(e,t)||{};if(c==null)return{};const u=oC(p),m={x:n,y:r},g=qg(i),x=Kg(g),y=await a.getDimensions(c),h=g==="y",f=h?"top":"left",d=h?"bottom":"right",v=h?"clientHeight":"clientWidth",S=o.reference[x]+o.reference[g]-m[g]-o.floating[x],k=m[g]-o.reference[g],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let R=C?C[v]:0;(!R||!await(a.isElement==null?void 0:a.isElement(C)))&&(R=s.floating[v]||o.floating[x]);const w=S/2-k/2,E=R/2-y[x]/2-1,L=gi(u[f],E),M=gi(u[d],E),D=L,P=R-y[x]-M,$=R/2-y[x]/2+w,O=Up(D,$,P),F=!l.arrow&&Vo(i)!=null&&$!=O&&o.reference[x]/2-($<D?L:M)-y[x]/2<0,U=F?$<D?$-D:$-P:0;return{[g]:m[g]+U,data:{[g]:O,centerOffset:$-O-U,...F&&{alignmentOffset:U}},reset:F}}}),c$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:p=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...h}=Mr(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const f=Tr(i),d=Tr(s)===s,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=m||(d||!y?[Qu(s)]:r$(s));!m&&x!=="none"&&S.push(...s$(s,y,x,v));const k=[s,...S],C=await Ja(t,h),R=[];let w=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&R.push(C[f]),u){const D=n$(i,a,v);R.push(C[D[0]],C[D[1]])}if(w=[...w,{placement:i,overflows:R}],!R.every(D=>D<=0)){var E,L;const D=(((E=o.flip)==null?void 0:E.index)||0)+1,P=k[D];if(P)return{data:{index:D,overflows:w},reset:{placement:P}};let $=(L=w.filter(O=>O.overflows[0]<=0).sort((O,F)=>O.overflows[1]-F.overflows[1])[0])==null?void 0:L.placement;if(!$)switch(g){case"bestFit":{var M;const O=(M=w.map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,B)=>U+B,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:M[0];O&&($=O);break}case"initialPlacement":$=s;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function T1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function A1(e){return ZP.some(t=>e[t]>=0)}const u$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Mr(e,t);switch(r){case"referenceHidden":{const o=await Ja(t,{...i,elementContext:"reference"}),a=T1(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:A1(a)}}}case"escaped":{const o=await Ja(t,{...i,altBoundary:!0}),a=T1(o,n.floating);return{data:{escapedOffsets:a,escaped:A1(a)}}}default:return{}}}}};async function d$(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Tr(n),s=Vo(n),l=Ko(n)==="y",c=["left","top"].includes(a)?-1:1,p=o&&l?-1:1,u=Mr(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:x}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return s&&typeof x=="number"&&(g=s==="end"?x*-1:x),l?{x:g*p,y:m*c}:{x:m*c,y:g*p}}const h$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await d$(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},f$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:h=>{let{x:f,y:d}=h;return{x:f,y:d}}},...l}=Mr(e,t),c={x:n,y:r},p=await Ja(t,l),u=Ko(Tr(i)),m=Vg(u);let g=c[m],x=c[u];if(o){const h=m==="y"?"top":"left",f=m==="y"?"bottom":"right",d=g+p[h],v=g-p[f];g=Up(d,g,v)}if(a){const h=u==="y"?"top":"left",f=u==="y"?"bottom":"right",d=x+p[h],v=x-p[f];x=Up(d,x,v)}const y=s.fn({...t,[m]:g,[u]:x});return{...y,data:{x:y.x-n,y:y.y-r}}}}},p$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Mr(e,t),p={x:n,y:r},u=Ko(i),m=Vg(u);let g=p[m],x=p[u];const y=Mr(s,t),h=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const v=m==="y"?"height":"width",S=o.reference[m]-o.floating[v]+h.mainAxis,k=o.reference[m]+o.reference[v]-h.mainAxis;g<S?g=S:g>k&&(g=k)}if(c){var f,d;const v=m==="y"?"width":"height",S=["top","left"].includes(Tr(i)),k=o.reference[u]-o.floating[v]+(S&&((f=a.offset)==null?void 0:f[u])||0)+(S?0:h.crossAxis),C=o.reference[u]+o.reference[v]+(S?0:((d=a.offset)==null?void 0:d[u])||0)-(S?h.crossAxis:0);x<k?x=k:x>C&&(x=C)}return{[m]:g,[u]:x}}}},m$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=Mr(e,t),l=await Ja(t,s),c=Tr(n),p=Vo(n),u=Ko(n)==="y",{width:m,height:g}=r.floating;let x,y;c==="top"||c==="bottom"?(x=c,y=p===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(y=c,x=p==="end"?"top":"bottom");const h=g-l[x],f=m-l[y],d=!t.middlewareData.shift;let v=h,S=f;if(u){const C=m-l.left-l.right;S=p||d?gi(f,C):C}else{const C=g-l.top-l.bottom;v=p||d?gi(h,C):C}if(d&&!p){const C=Xt(l.left,0),R=Xt(l.right,0),w=Xt(l.top,0),E=Xt(l.bottom,0);u?S=m-2*(C!==0||R!==0?C+R:Xt(l.left,l.right)):v=g-2*(w!==0||E!==0?w+E:Xt(l.top,l.bottom))}await a({...t,availableWidth:S,availableHeight:v});const k=await i.getDimensions(o.floating);return m!==k.width||g!==k.height?{reset:{rects:!0}}:{}}}};function _i(e){return aC(e)?(e.nodeName||"").toLowerCase():"#document"}function tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Or(e){var t;return(t=(aC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aC(e){return e instanceof Node||e instanceof tn(e).Node}function Ar(e){return e instanceof Element||e instanceof tn(e).Element}function or(e){return e instanceof HTMLElement||e instanceof tn(e).HTMLElement}function D1(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tn(e).ShadowRoot}function Ol(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function g$(e){return["table","td","th"].includes(_i(e))}function Gg(e){const t=Yg(),n=bn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function v$(e){let t=Lo(e);for(;or(t)&&!Vd(t);){if(Gg(t))return t;t=Lo(t)}return null}function Yg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vd(e){return["html","body","#document"].includes(_i(e))}function bn(e){return tn(e).getComputedStyle(e)}function Kd(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Lo(e){if(_i(e)==="html")return e;const t=e.assignedSlot||e.parentNode||D1(e)&&e.host||Or(e);return D1(t)?t.host:t}function lC(e){const t=Lo(e);return Vd(t)?e.ownerDocument?e.ownerDocument.body:e.body:or(t)&&Ol(t)?t:lC(t)}function Za(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=lC(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=tn(i);return o?t.concat(a,a.visualViewport||[],Ol(i)?i:[],a.frameElement&&n?Za(a.frameElement):[]):t.concat(i,Za(i,[],n))}function cC(e){const t=bn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=or(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Xu(n)!==o||Xu(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function Xg(e){return Ar(e)?e:e.contextElement}function Ys(e){const t=Xg(e);if(!or(t))return vi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=cC(t);let a=(o?Xu(n.width):n.width)/r,s=(o?Xu(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const _$=vi(0);function uC(e){const t=tn(e);return!Yg()||!t.visualViewport?_$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function y$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tn(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Xg(e);let a=vi(1);t&&(r?Ar(r)&&(a=Ys(r)):a=Ys(e));const s=y$(o,n,r)?uC(o):vi(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,p=i.width/a.x,u=i.height/a.y;if(o){const m=tn(o),g=r&&Ar(r)?tn(r):r;let x=m.frameElement;for(;x&&r&&g!==m;){const y=Ys(x),h=x.getBoundingClientRect(),f=bn(x),d=h.left+(x.clientLeft+parseFloat(f.paddingLeft))*y.x,v=h.top+(x.clientTop+parseFloat(f.paddingTop))*y.y;l*=y.x,c*=y.y,p*=y.x,u*=y.y,l+=d,c+=v,x=tn(x).frameElement}}return Ju({width:p,height:u,x:l,y:c})}function x$(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=or(n),o=Or(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s=vi(1);const l=vi(0);if((i||!i&&r!=="fixed")&&((_i(n)!=="body"||Ol(o))&&(a=Kd(n)),or(n))){const c=is(n);s=Ys(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function w$(e){return Array.from(e.getClientRects())}function dC(e){return is(Or(e)).left+Kd(e).scrollLeft}function b$(e){const t=Or(e),n=Kd(e),r=e.ownerDocument.body,i=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+dC(e);const s=-n.scrollTop;return bn(r).direction==="rtl"&&(a+=Xt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function S$(e,t){const n=tn(e),r=Or(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const c=Yg();(!c||c&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function C$(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=or(e)?Ys(e):vi(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:a,height:s,x:l,y:c}}function P1(e,t,n){let r;if(t==="viewport")r=S$(e,n);else if(t==="document")r=b$(Or(e));else if(Ar(t))r=C$(t,n);else{const i=uC(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Ju(r)}function hC(e,t){const n=Lo(e);return n===t||!Ar(n)||Vd(n)?!1:bn(n).position==="fixed"||hC(n,t)}function k$(e,t){const n=t.get(e);if(n)return n;let r=Za(e,[],!1).filter(s=>Ar(s)&&_i(s)!=="body"),i=null;const o=bn(e).position==="fixed";let a=o?Lo(e):e;for(;Ar(a)&&!Vd(a);){const s=bn(a),l=Gg(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ol(a)&&!l&&hC(e,a))?r=r.filter(p=>p!==a):i=s,a=Lo(a)}return t.set(e,r),r}function E$(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?k$(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,p)=>{const u=P1(t,p,i);return c.top=Xt(u.top,c.top),c.right=gi(u.right,c.right),c.bottom=gi(u.bottom,c.bottom),c.left=Xt(u.left,c.left),c},P1(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function R$(e){const{width:t,height:n}=cC(e);return{width:t,height:n}}function L$(e,t,n){const r=or(t),i=Or(t),o=n==="fixed",a=is(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=vi(0);if(r||!r&&!o)if((_i(t)!=="body"||Ol(i))&&(s=Kd(t)),r){const c=is(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=dC(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function $1(e,t){return!or(e)||bn(e).position==="fixed"?null:t?t(e):e.offsetParent}function fC(e,t){const n=tn(e);if(!or(e))return n;let r=$1(e,t);for(;r&&g$(r)&&bn(r).position==="static";)r=$1(r,t);return r&&(_i(r)==="html"||_i(r)==="body"&&bn(r).position==="static"&&!Gg(r))?n:r||v$(e)||n}const M$=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||fC,o=this.getDimensions;return{reference:L$(t,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function T$(e){return bn(e).direction==="rtl"}const A$={convertOffsetParentRelativeRectToViewportRelativeRect:x$,getDocumentElement:Or,getClippingRect:E$,getOffsetParent:fC,getElementRects:M$,getClientRects:w$,getDimensions:R$,getScale:Ys,isElement:Ar,isRTL:T$};function D$(e,t){let n=null,r;const i=Or(e);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:c,top:p,width:u,height:m}=e.getBoundingClientRect();if(s||t(),!u||!m)return;const g=Cc(p),x=Cc(i.clientWidth-(c+u)),y=Cc(i.clientHeight-(p+m)),h=Cc(c),d={rootMargin:-g+"px "+-x+"px "+-y+"px "+-h+"px",threshold:Xt(0,gi(1,l))||1};let v=!0;function S(k){const C=k[0].intersectionRatio;if(C!==l){if(!v)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},100)}v=!1}try{n=new IntersectionObserver(S,{...d,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,d)}n.observe(e)}return a(!0),o}function P$(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Xg(e),p=i||o?[...c?Za(c):[],...Za(t)]:[];p.forEach(f=>{i&&f.addEventListener("scroll",n,{passive:!0}),o&&f.addEventListener("resize",n)});const u=c&&s?D$(c,n):null;let m=-1,g=null;a&&(g=new ResizeObserver(f=>{let[d]=f;d&&d.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let x,y=l?is(e):null;l&&h();function h(){const f=is(e);y&&(f.x!==y.x||f.y!==y.y||f.width!==y.width||f.height!==y.height)&&n(),y=f,x=requestAnimationFrame(h)}return n(),()=>{p.forEach(f=>{i&&f.removeEventListener("scroll",n),o&&f.removeEventListener("resize",n)}),u&&u(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(x)}}const $$=f$,O$=c$,N$=m$,I$=u$,O1=l$,j$=p$,B$=(e,t,n)=>{const r=new Map,i={platform:A$,...n},o={...i.platform,_c:r};return a$(e,t,{...i,platform:o})},F$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?O1({element:r.current,padding:i}).fn(n):{}:r?O1({element:r,padding:i}).fn(n):{}}}};var ru=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Zu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Zu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Zu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function pC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function N1(e,t){const n=pC(e);return Math.round(t*n)/n}function I1(e){const t=b.useRef(e);return ru(()=>{t.current=e}),t}function z$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[p,u]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=b.useState(r);Zu(m,r)||g(r);const[x,y]=b.useState(null),[h,f]=b.useState(null),d=b.useCallback(F=>{F!=C.current&&(C.current=F,y(F))},[y]),v=b.useCallback(F=>{F!==R.current&&(R.current=F,f(F))},[f]),S=o||x,k=a||h,C=b.useRef(null),R=b.useRef(null),w=b.useRef(p),E=I1(l),L=I1(i),M=b.useCallback(()=>{if(!C.current||!R.current)return;const F={placement:t,strategy:n,middleware:m};L.current&&(F.platform=L.current),B$(C.current,R.current,F).then(U=>{const B={...U,isPositioned:!0};D.current&&!Zu(w.current,B)&&(w.current=B,bi.flushSync(()=>{u(B)}))})},[m,t,n,L]);ru(()=>{c===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(F=>({...F,isPositioned:!1})))},[c]);const D=b.useRef(!1);ru(()=>(D.current=!0,()=>{D.current=!1}),[]),ru(()=>{if(S&&(C.current=S),k&&(R.current=k),S&&k){if(E.current)return E.current(S,k,M);M()}},[S,k,M,E]);const P=b.useMemo(()=>({reference:C,floating:R,setReference:d,setFloating:v}),[d,v]),$=b.useMemo(()=>({reference:S,floating:k}),[S,k]),O=b.useMemo(()=>{const F={position:n,left:0,top:0};if(!$.floating)return F;const U=N1($.floating,p.x),B=N1($.floating,p.y);return s?{...F,transform:"translate("+U+"px, "+B+"px)",...pC($.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:B}},[n,s,$.floating,p.x,p.y]);return b.useMemo(()=>({...p,update:M,refs:P,elements:$,floatingStyles:O}),[p,M,P,$,O])}function mC(e){const[t,n]=b.useState(void 0);return st(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const gC="Popper",[vC,qo]=Vt(gC),[H$,_C]=vC(gC),U$=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return b.createElement(H$,{scope:t,anchor:r,onAnchorChange:i},n)},W$="PopperAnchor",V$=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=_C(W$,n),a=b.useRef(null),s=Se(t,a);return b.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:b.createElement(fe.div,Y({},i,{ref:s}))}),yC="PopperContent",[K$,vz]=vC(yC),q$=b.forwardRef((e,t)=>{var n,r,i,o,a,s,l,c;const{__scopePopper:p,side:u="bottom",sideOffset:m=0,align:g="center",alignOffset:x=0,arrowPadding:y=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:v="partial",hideWhenDetached:S=!1,updatePositionStrategy:k="optimized",onPlaced:C,...R}=e,w=_C(yC,p),[E,L]=b.useState(null),M=Se(t,Ae=>L(Ae)),[D,P]=b.useState(null),$=mC(D),O=(n=$==null?void 0:$.width)!==null&&n!==void 0?n:0,F=(r=$==null?void 0:$.height)!==null&&r!==void 0?r:0,U=u+(g!=="center"?"-"+g:""),B=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(f)?f:[f],T=A.length>0,j={padding:B,boundary:A.filter(G$),altBoundary:T},{refs:z,floatingStyles:N,placement:X,isPositioned:re,middlewareData:H}=z$({strategy:"fixed",placement:U,whileElementsMounted:(...Ae)=>P$(...Ae,{animationFrame:k==="always"}),elements:{reference:w.anchor},middleware:[h$({mainAxis:m+F,alignmentAxis:x}),h&&$$({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?j$():void 0,...j}),h&&O$({...j}),N$({...j,apply:({elements:Ae,rects:je,availableWidth:ue,availableHeight:Rt})=>{const{width:kn,height:ke}=je.reference,_e=Ae.floating.style;_e.setProperty("--radix-popper-available-width",`${ue}px`),_e.setProperty("--radix-popper-available-height",`${Rt}px`),_e.setProperty("--radix-popper-anchor-width",`${kn}px`),_e.setProperty("--radix-popper-anchor-height",`${ke}px`)}}),D&&F$({element:D,padding:y}),Y$({arrowWidth:O,arrowHeight:F}),S&&I$({strategy:"referenceHidden",...j})]}),[W,I]=xC(X),K=Be(C);st(()=>{re&&(K==null||K())},[re,K]);const J=(i=H.arrow)===null||i===void 0?void 0:i.x,q=(o=H.arrow)===null||o===void 0?void 0:o.y,he=((a=H.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[de,ce]=b.useState();return st(()=>{E&&ce(window.getComputedStyle(E).zIndex)},[E]),b.createElement("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...N,transform:re?N.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(s=H.transformOrigin)===null||s===void 0?void 0:s.x,(l=H.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},b.createElement(K$,{scope:p,placedSide:W,onArrowChange:P,arrowX:J,arrowY:q,shouldHideArrow:he},b.createElement(fe.div,Y({"data-side":W,"data-align":I},R,{ref:M,style:{...R.style,animation:re?void 0:"none",opacity:(c=H.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function G$(e){return e!==null}const Y$=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:c}=t,u=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=u?0:e.arrowWidth,g=u?0:e.arrowHeight,[x,y]=xC(s),h={start:"0%",center:"50%",end:"100%"}[y],f=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,d=((o=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+g/2;let v="",S="";return x==="bottom"?(v=u?h:`${f}px`,S=`${-g}px`):x==="top"?(v=u?h:`${f}px`,S=`${l.floating.height+g}px`):x==="right"?(v=`${-g}px`,S=u?h:`${d}px`):x==="left"&&(v=`${l.floating.width+g}px`,S=u?h:`${d}px`),{data:{x:v,y:S}}}});function xC(e){const[t,n="center"]=e.split("-");return[t,n]}const Qg=U$,Jg=V$,Zg=q$,ev=b.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?Dw.createPortal(b.createElement(fe.div,Y({},i,{ref:t})),r):null}),rf="rovingFocusGroup.onEntryFocus",X$={bubbles:!1,cancelable:!0},tv="RovingFocusGroup",[Vp,wC,Q$]=Pl(tv),[J$,qd]=Vt(tv,[Q$]),[Z$,eO]=J$(tv),tO=b.forwardRef((e,t)=>b.createElement(Vp.Provider,{scope:e.__scopeRovingFocusGroup},b.createElement(Vp.Slot,{scope:e.__scopeRovingFocusGroup},b.createElement(nO,Y({},e,{ref:t}))))),nO=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...p}=e,u=b.useRef(null),m=Se(t,u),g=Bo(o),[x=null,y]=Lr({prop:a,defaultProp:s,onChange:l}),[h,f]=b.useState(!1),d=Be(c),v=wC(n),S=b.useRef(!1),[k,C]=b.useState(0);return b.useEffect(()=>{const R=u.current;if(R)return R.addEventListener(rf,d),()=>R.removeEventListener(rf,d)},[d]),b.createElement(Z$,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:x,onItemFocus:b.useCallback(R=>y(R),[y]),onItemShiftTab:b.useCallback(()=>f(!0),[]),onFocusableItemAdd:b.useCallback(()=>C(R=>R+1),[]),onFocusableItemRemove:b.useCallback(()=>C(R=>R-1),[])},b.createElement(fe.div,Y({tabIndex:h||k===0?-1:0,"data-orientation":r},p,{ref:m,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{S.current=!0}),onFocus:ne(e.onFocus,R=>{const w=!S.current;if(R.target===R.currentTarget&&w&&!h){const E=new CustomEvent(rf,X$);if(R.currentTarget.dispatchEvent(E),!E.defaultPrevented){const L=v().filter(O=>O.focusable),M=L.find(O=>O.active),D=L.find(O=>O.id===x),$=[M,D,...L].filter(Boolean).map(O=>O.ref.current);bC($)}}S.current=!1}),onBlur:ne(e.onBlur,()=>f(!1))})))}),rO="RovingFocusGroupItem",iO=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...a}=e,s=_n(),l=o||s,c=eO(rO,n),p=c.currentTabStopId===l,u=wC(n),{onFocusableItemAdd:m,onFocusableItemRemove:g}=c;return b.useEffect(()=>{if(r)return m(),()=>g()},[r,m,g]),b.createElement(Vp.ItemSlot,{scope:n,id:l,focusable:r,active:i},b.createElement(fe.span,Y({tabIndex:p?0:-1,"data-orientation":c.orientation},a,{ref:t,onMouseDown:ne(e.onMouseDown,x=>{r?c.onItemFocus(l):x.preventDefault()}),onFocus:ne(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ne(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){c.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=aO(x,c.orientation,c.dir);if(y!==void 0){x.preventDefault();let f=u().filter(d=>d.focusable).map(d=>d.ref.current);if(y==="last")f.reverse();else if(y==="prev"||y==="next"){y==="prev"&&f.reverse();const d=f.indexOf(x.currentTarget);f=c.loop?lO(f,d+1):f.slice(d+1)}setTimeout(()=>bC(f))}})})))}),sO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aO(e,t,n){const r=oO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sO[r]}function bC(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const SC=tO,CC=iO;var cO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xs=new WeakMap,kc=new WeakMap,Ec={},sf=0,kC=function(e){return e&&(e.host||kC(e.parentNode))},uO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dO=function(e,t,n,r){var i=uO(t,Array.isArray(e)?e:[e]);Ec[n]||(Ec[n]=new WeakMap);var o=Ec[n],a=[],s=new Set,l=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var p=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(m){if(s.has(m))p(m);else{var g=m.getAttribute(r),x=g!==null&&g!=="false",y=(xs.get(m)||0)+1,h=(o.get(m)||0)+1;xs.set(m,y),o.set(m,h),a.push(m),y===1&&x&&kc.set(m,!0),h===1&&m.setAttribute(n,"true"),x||m.setAttribute(r,"true")}})};return p(t),s.clear(),sf++,function(){a.forEach(function(u){var m=xs.get(u)-1,g=o.get(u)-1;xs.set(u,m),o.set(u,g),m||(kc.has(u)||u.removeAttribute(r),kc.delete(u)),g||u.removeAttribute(n)}),sf--,sf||(xs=new WeakMap,xs=new WeakMap,kc=new WeakMap,Ec={})}},nv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||cO(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),dO(r,i,n,"aria-hidden")):function(){return null}},Jn=function(){return Jn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Jn.apply(this,arguments)};function EC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function hO(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var iu="right-scroll-bar-position",su="width-before-scroll-bar",fO="with-scroll-bars-hidden",pO="--removed-body-scroll-bar-size";function mO(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gO(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function vO(e,t){return gO(t||null,function(n){return e.forEach(function(r){return mO(r,n)})})}function _O(e){return e}function yO(e,t){t===void 0&&(t=_O);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var p=a;a=[],p.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(p){a.push(p),c()},filter:function(p){return a=a.filter(p),n}}}};return i}function xO(e){e===void 0&&(e={});var t=yO(null);return t.options=Jn({async:!0,ssr:!1},e),t}var RC=function(e){var t=e.sideCar,n=EC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,Jn({},n))};RC.isSideCarExport=!0;function wO(e,t){return e.useMedium(t),RC}var LC=xO(),of=function(){},Gd=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:of,onWheelCapture:of,onTouchMoveCapture:of}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,p=e.enabled,u=e.shards,m=e.sideCar,g=e.noIsolation,x=e.inert,y=e.allowPinchZoom,h=e.as,f=h===void 0?"div":h,d=EC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),v=m,S=vO([n,t]),k=Jn(Jn({},d),i);return b.createElement(b.Fragment,null,p&&b.createElement(v,{sideCar:LC,removeScrollBar:c,shards:u,noIsolation:g,inert:x,setCallbacks:o,allowPinchZoom:!!y,lockRef:n}),a?b.cloneElement(b.Children.only(s),Jn(Jn({},k),{ref:S})):b.createElement(f,Jn({},k,{className:l,ref:S}),s))});Gd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gd.classNames={fullWidth:su,zeroRight:iu};var bO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function SO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=bO();return t&&e.setAttribute("nonce",t),e}function CO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var EO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=SO())&&(CO(t,n),kO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},RO=function(){var e=EO();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},MC=function(){var e=RO(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},LO={left:0,top:0,right:0,gap:0},af=function(e){return parseInt(e||"",10)||0},MO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[af(n),af(r),af(i)]},TO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LO;var t=MO(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},AO=MC(),DO=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(fO,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(s,"px ").concat(r,`;
  }
  body {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(s,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(iu,` {
    right: `).concat(s,"px ").concat(r,`;
  }
  
  .`).concat(su,` {
    margin-right: `).concat(s,"px ").concat(r,`;
  }
  
  .`).concat(iu," .").concat(iu,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(su," .").concat(su,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body {
    `).concat(pO,": ").concat(s,`px;
  }
`)},PO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=b.useMemo(function(){return TO(i)},[i]);return b.createElement(AO,{styles:DO(o,!t,i,n?"":"!important")})},Kp=!1;if(typeof window<"u")try{var Rc=Object.defineProperty({},"passive",{get:function(){return Kp=!0,!0}});window.addEventListener("test",Rc,Rc),window.removeEventListener("test",Rc,Rc)}catch{Kp=!1}var ws=Kp?{passive:!1}:!1,$O=function(e){return e.tagName==="TEXTAREA"},TC=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$O(e)&&n[t]==="visible")},OO=function(e){return TC(e,"overflowY")},NO=function(e){return TC(e,"overflowX")},j1=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=AC(e,n);if(r){var i=DC(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},IO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},jO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},AC=function(e,t){return e==="v"?OO(t):NO(t)},DC=function(e,t){return e==="v"?IO(t):jO(t)},BO=function(e,t){return e==="h"&&t==="rtl"?-1:1},FO=function(e,t,n,r,i){var o=BO(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),c=!1,p=a>0,u=0,m=0;do{var g=DC(e,s),x=g[0],y=g[1],h=g[2],f=y-h-o*x;(x||f)&&AC(e,s)&&(u+=f,m+=x),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(p&&(i&&u===0||!i&&a>u)||!p&&(i&&m===0||!i&&-a>m))&&(c=!0),c},Lc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},B1=function(e){return[e.deltaX,e.deltaY]},F1=function(e){return e&&"current"in e?e.current:e},zO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HO=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},UO=0,bs=[];function WO(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(UO++)[0],o=b.useState(function(){return MC()})[0],a=b.useRef(e);b.useEffect(function(){a.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=hO([e.lockRef.current],(e.shards||[]).map(F1),!0).filter(Boolean);return y.forEach(function(h){return h.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=b.useCallback(function(y,h){if("touches"in y&&y.touches.length===2)return!a.current.allowPinchZoom;var f=Lc(y),d=n.current,v="deltaX"in y?y.deltaX:d[0]-f[0],S="deltaY"in y?y.deltaY:d[1]-f[1],k,C=y.target,R=Math.abs(v)>Math.abs(S)?"h":"v";if("touches"in y&&R==="h"&&C.type==="range")return!1;var w=j1(R,C);if(!w)return!0;if(w?k=R:(k=R==="v"?"h":"v",w=j1(R,C)),!w)return!1;if(!r.current&&"changedTouches"in y&&(v||S)&&(r.current=k),!k)return!0;var E=r.current||k;return FO(E,h,y,E==="h"?v:S,!0)},[]),l=b.useCallback(function(y){var h=y;if(!(!bs.length||bs[bs.length-1]!==o)){var f="deltaY"in h?B1(h):Lc(h),d=t.current.filter(function(k){return k.name===h.type&&k.target===h.target&&zO(k.delta,f)})[0];if(d&&d.should){h.cancelable&&h.preventDefault();return}if(!d){var v=(a.current.shards||[]).map(F1).filter(Boolean).filter(function(k){return k.contains(h.target)}),S=v.length>0?s(h,v[0]):!a.current.noIsolation;S&&h.cancelable&&h.preventDefault()}}},[]),c=b.useCallback(function(y,h,f,d){var v={name:y,delta:h,target:f,should:d};t.current.push(v),setTimeout(function(){t.current=t.current.filter(function(S){return S!==v})},1)},[]),p=b.useCallback(function(y){n.current=Lc(y),r.current=void 0},[]),u=b.useCallback(function(y){c(y.type,B1(y),y.target,s(y,e.lockRef.current))},[]),m=b.useCallback(function(y){c(y.type,Lc(y),y.target,s(y,e.lockRef.current))},[]);b.useEffect(function(){return bs.push(o),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,ws),document.addEventListener("touchmove",l,ws),document.addEventListener("touchstart",p,ws),function(){bs=bs.filter(function(y){return y!==o}),document.removeEventListener("wheel",l,ws),document.removeEventListener("touchmove",l,ws),document.removeEventListener("touchstart",p,ws)}},[]);var g=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(o,{styles:HO(i)}):null,g?b.createElement(PO,{gapMode:"margin"}):null)}const VO=wO(LC,WO);var PC=b.forwardRef(function(e,t){return b.createElement(Gd,Jn({},e,{ref:t,sideCar:VO}))});PC.classNames=Gd.classNames;const rv=PC,qp=["Enter"," "],KO=["ArrowDown","PageUp","Home"],$C=["ArrowUp","PageDown","End"],qO=[...KO,...$C],GO={ltr:[...qp,"ArrowRight"],rtl:[...qp,"ArrowLeft"]},YO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Yd="Menu",[el,XO,QO]=Pl(Yd),[ds,OC]=Vt(Yd,[QO,qo,qd]),iv=qo(),NC=qd(),[JO,hs]=ds(Yd),[ZO,Nl]=ds(Yd),eN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=iv(t),[l,c]=b.useState(null),p=b.useRef(!1),u=Be(o),m=Bo(i);return b.useEffect(()=>{const g=()=>{p.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>p.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),b.createElement(Qg,s,b.createElement(JO,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c},b.createElement(ZO,{scope:t,onClose:b.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:p,dir:m,modal:a},r)))},IC=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=iv(n);return b.createElement(Jg,Y({},i,r,{ref:t}))}),jC="MenuPortal",[tN,BC]=ds(jC,{forceMount:void 0}),nN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=hs(jC,t);return b.createElement(tN,{scope:t,forceMount:n},b.createElement(ht,{present:n||o.open},b.createElement(ev,{asChild:!0,container:i},r)))},In="MenuContent",[rN,sv]=ds(In),iN=b.forwardRef((e,t)=>{const n=BC(In,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=hs(In,e.__scopeMenu),a=Nl(In,e.__scopeMenu);return b.createElement(el.Provider,{scope:e.__scopeMenu},b.createElement(ht,{present:r||o.open},b.createElement(el.Slot,{scope:e.__scopeMenu},a.modal?b.createElement(sN,Y({},i,{ref:t})):b.createElement(oN,Y({},i,{ref:t})))))}),sN=b.forwardRef((e,t)=>{const n=hs(In,e.__scopeMenu),r=b.useRef(null),i=Se(t,r);return b.useEffect(()=>{const o=r.current;if(o)return nv(o)},[]),b.createElement(ov,Y({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ne(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),oN=b.forwardRef((e,t)=>{const n=hs(In,e.__scopeMenu);return b.createElement(ov,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),ov=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:m,onDismiss:g,disableOutsideScroll:x,...y}=e,h=hs(In,n),f=Nl(In,n),d=iv(n),v=NC(n),S=XO(n),[k,C]=b.useState(null),R=b.useRef(null),w=Se(t,R,h.onContentChange),E=b.useRef(0),L=b.useRef(""),M=b.useRef(0),D=b.useRef(null),P=b.useRef("right"),$=b.useRef(0),O=x?rv:b.Fragment,F=x?{as:mi,allowPinchZoom:!0}:void 0,U=A=>{var T,j;const z=L.current+A,N=S().filter(K=>!K.disabled),X=document.activeElement,re=(T=N.find(K=>K.ref.current===X))===null||T===void 0?void 0:T.textValue,H=N.map(K=>K.textValue),W=kN(H,z,re),I=(j=N.find(K=>K.textValue===W))===null||j===void 0?void 0:j.ref.current;(function K(J){L.current=J,window.clearTimeout(E.current),J!==""&&(E.current=window.setTimeout(()=>K(""),1e3))})(z),I&&setTimeout(()=>I.focus())};b.useEffect(()=>()=>window.clearTimeout(E.current),[]),Ug();const B=b.useCallback(A=>{var T,j;return P.current===((T=D.current)===null||T===void 0?void 0:T.side)&&RN(A,(j=D.current)===null||j===void 0?void 0:j.area)},[]);return b.createElement(rN,{scope:n,searchRef:L,onItemEnter:b.useCallback(A=>{B(A)&&A.preventDefault()},[B]),onItemLeave:b.useCallback(A=>{var T;B(A)||((T=R.current)===null||T===void 0||T.focus(),C(null))},[B]),onTriggerLeave:b.useCallback(A=>{B(A)&&A.preventDefault()},[B]),pointerGraceTimerRef:M,onPointerGraceIntentChange:b.useCallback(A=>{D.current=A},[])},b.createElement(O,F,b.createElement(Wg,{asChild:!0,trapped:i,onMountAutoFocus:ne(o,A=>{var T;A.preventDefault(),(T=R.current)===null||T===void 0||T.focus()}),onUnmountAutoFocus:a},b.createElement($l,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:m,onDismiss:g},b.createElement(SC,Y({asChild:!0},v,{dir:f.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:ne(l,A=>{f.isUsingKeyboardRef.current||A.preventDefault()})}),b.createElement(Zg,Y({role:"menu","aria-orientation":"vertical","data-state":WC(h.open),"data-radix-menu-content":"",dir:f.dir},d,y,{ref:w,style:{outline:"none",...y.style},onKeyDown:ne(y.onKeyDown,A=>{const j=A.target.closest("[data-radix-menu-content]")===A.currentTarget,z=A.ctrlKey||A.altKey||A.metaKey,N=A.key.length===1;j&&(A.key==="Tab"&&A.preventDefault(),!z&&N&&U(A.key));const X=R.current;if(A.target!==X||!qO.includes(A.key))return;A.preventDefault();const H=S().filter(W=>!W.disabled).map(W=>W.ref.current);$C.includes(A.key)&&H.reverse(),SN(H)}),onBlur:ne(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(E.current),L.current="")}),onPointerMove:ne(e.onPointerMove,tl(A=>{const T=A.target,j=$.current!==A.clientX;if(A.currentTarget.contains(T)&&j){const z=A.clientX>$.current?"right":"left";P.current=z,$.current=A.clientX}}))})))))))}),aN=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return b.createElement(fe.div,Y({role:"group"},r,{ref:t}))}),lN=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return b.createElement(fe.div,Y({},r,{ref:t}))}),Gp="MenuItem",z1="menu.itemSelect",av=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=b.useRef(null),a=Nl(Gp,e.__scopeMenu),s=sv(Gp,e.__scopeMenu),l=Se(t,o),c=b.useRef(!1),p=()=>{const u=o.current;if(!n&&u){const m=new CustomEvent(z1,{bubbles:!0,cancelable:!0});u.addEventListener(z1,g=>r==null?void 0:r(g),{once:!0}),Nu(u,m),m.defaultPrevented?c.current=!1:a.onClose()}};return b.createElement(FC,Y({},i,{ref:l,disabled:n,onClick:ne(e.onClick,p),onPointerDown:u=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,u),c.current=!0},onPointerUp:ne(e.onPointerUp,u=>{var m;c.current||(m=u.currentTarget)===null||m===void 0||m.click()}),onKeyDown:ne(e.onKeyDown,u=>{const m=s.searchRef.current!=="";n||m&&u.key===" "||qp.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})}))}),FC=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=sv(Gp,n),s=NC(n),l=b.useRef(null),c=Se(t,l),[p,u]=b.useState(!1),[m,g]=b.useState("");return b.useEffect(()=>{const x=l.current;if(x){var y;g(((y=x.textContent)!==null&&y!==void 0?y:"").trim())}},[o.children]),b.createElement(el.ItemSlot,{scope:n,disabled:r,textValue:i??m},b.createElement(CC,Y({asChild:!0},s,{focusable:!r}),b.createElement(fe.div,Y({role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:ne(e.onPointerMove,tl(x=>{r?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus())})),onPointerLeave:ne(e.onPointerLeave,tl(x=>a.onItemLeave(x))),onFocus:ne(e.onFocus,()=>u(!0)),onBlur:ne(e.onBlur,()=>u(!1))}))))}),cN=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return b.createElement(HC,{scope:e.__scopeMenu,checked:n},b.createElement(av,Y({role:"menuitemcheckbox","aria-checked":ed(n)?"mixed":n},i,{ref:t,"data-state":lv(n),onSelect:ne(i.onSelect,()=>r==null?void 0:r(ed(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),uN="MenuRadioGroup",[dN,hN]=ds(uN,{value:void 0,onValueChange:()=>{}}),fN=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Be(r);return b.createElement(dN,{scope:e.__scopeMenu,value:n,onValueChange:o},b.createElement(aN,Y({},i,{ref:t})))}),pN="MenuRadioItem",mN=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=hN(pN,e.__scopeMenu),o=n===i.value;return b.createElement(HC,{scope:e.__scopeMenu,checked:o},b.createElement(av,Y({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":lv(o),onSelect:ne(r.onSelect,()=>{var a;return(a=i.onValueChange)===null||a===void 0?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})))}),zC="MenuItemIndicator",[HC,gN]=ds(zC,{checked:!1}),vN=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=gN(zC,n);return b.createElement(ht,{present:r||ed(o.checked)||o.checked===!0},b.createElement(fe.span,Y({},i,{ref:t,"data-state":lv(o.checked)})))}),_N=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return b.createElement(fe.div,Y({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),yN="MenuSub",[_z,UC]=ds(yN),Mc="MenuSubTrigger",xN=b.forwardRef((e,t)=>{const n=hs(Mc,e.__scopeMenu),r=Nl(Mc,e.__scopeMenu),i=UC(Mc,e.__scopeMenu),o=sv(Mc,e.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},p=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>p,[p]),b.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),b.createElement(IC,Y({asChild:!0},c),b.createElement(FC,Y({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":WC(n.open)},e,{ref:Rl(t,i.onTriggerChange),onClick:u=>{var m;(m=e.onClick)===null||m===void 0||m.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ne(e.onPointerMove,tl(u=>{o.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:ne(e.onPointerLeave,tl(u=>{var m;p();const g=(m=n.content)===null||m===void 0?void 0:m.getBoundingClientRect();if(g){var x;const y=(x=n.content)===null||x===void 0?void 0:x.dataset.side,h=y==="right",f=h?-5:5,d=g[h?"left":"right"],v=g[h?"right":"left"];o.onPointerGraceIntentChange({area:[{x:u.clientX+f,y:u.clientY},{x:d,y:g.top},{x:v,y:g.top},{x:v,y:g.bottom},{x:d,y:g.bottom}],side:y}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(u),u.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ne(e.onKeyDown,u=>{const m=o.searchRef.current!=="";if(!(e.disabled||m&&u.key===" ")&&GO[r.dir].includes(u.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),u.preventDefault()}})})))}),wN="MenuSubContent",bN=b.forwardRef((e,t)=>{const n=BC(In,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=hs(In,e.__scopeMenu),a=Nl(In,e.__scopeMenu),s=UC(wN,e.__scopeMenu),l=b.useRef(null),c=Se(t,l);return b.createElement(el.Provider,{scope:e.__scopeMenu},b.createElement(ht,{present:r||o.open},b.createElement(el.Slot,{scope:e.__scopeMenu},b.createElement(ov,Y({id:s.contentId,"aria-labelledby":s.triggerId},i,{ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var u;a.isUsingKeyboardRef.current&&((u=l.current)===null||u===void 0||u.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:ne(e.onFocusOutside,p=>{p.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ne(e.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:ne(e.onKeyDown,p=>{const u=p.currentTarget.contains(p.target),m=YO[a.dir].includes(p.key);if(u&&m){var g;o.onOpenChange(!1),(g=s.trigger)===null||g===void 0||g.focus(),p.preventDefault()}})})))))});function WC(e){return e?"open":"closed"}function ed(e){return e==="indeterminate"}function lv(e){return ed(e)?"indeterminate":e?"checked":"unchecked"}function SN(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function CN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function kN(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=CN(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function EN(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o].x,l=t[o].y,c=t[a].x,p=t[a].y;l>r!=p>r&&n<(c-s)*(r-l)/(p-l)+s&&(i=!i)}return i}function RN(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return EN(n,t)}function tl(e){return t=>t.pointerType==="mouse"?e(t):void 0}const LN=eN,MN=IC,TN=nN,AN=iN,DN=lN,PN=av,$N=cN,ON=fN,NN=mN,IN=vN,jN=_N,BN=xN,FN=bN,VC="DropdownMenu",[zN,yz]=Vt(VC,[OC]),on=OC(),[HN,KC]=zN(VC),UN=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=on(t),c=b.useRef(null),[p=!1,u]=Lr({prop:i,defaultProp:o,onChange:a});return b.createElement(HN,{scope:t,triggerId:_n(),triggerRef:c,contentId:_n(),open:p,onOpenChange:u,onOpenToggle:b.useCallback(()=>u(m=>!m),[u]),modal:s},b.createElement(LN,Y({},l,{open:p,onOpenChange:u,dir:r,modal:s}),n))},WN="DropdownMenuTrigger",VN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=KC(WN,n),a=on(n);return b.createElement(MN,Y({asChild:!0},a),b.createElement(fe.button,Y({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:Rl(t,o.triggerRef),onPointerDown:ne(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:ne(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),KN=e=>{const{__scopeDropdownMenu:t,...n}=e,r=on(t);return b.createElement(TN,Y({},r,n))},qN="DropdownMenuContent",GN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=KC(qN,n),o=on(n),a=b.useRef(!1);return b.createElement(AN,Y({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:ne(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:ne(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,p=l.button===2||c;(!i.modal||p)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),YN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(DN,Y({},i,r,{ref:t}))}),XN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(PN,Y({},i,r,{ref:t}))}),QN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement($N,Y({},i,r,{ref:t}))}),JN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(ON,Y({},i,r,{ref:t}))}),ZN=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(NN,Y({},i,r,{ref:t}))}),eI=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(IN,Y({},i,r,{ref:t}))}),tI=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(jN,Y({},i,r,{ref:t}))}),nI=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(BN,Y({},i,r,{ref:t}))}),rI=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=on(n);return b.createElement(FN,Y({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),iI=UN,sI=VN,oI=KN,qC=GN,GC=YN,YC=XN,XC=QN,aI=JN,QC=ZN,JC=eI,ZC=tI,e2=nI,t2=rI,Xs=iI,Qs=sI,n2=aI,lI=b.forwardRef(({className:e,inset:t,children:n,...r},i)=>_.jsxs(e2,{ref:i,className:Q("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,_.jsx(aL,{className:"ml-auto h-4 w-4"})]}));lI.displayName=e2.displayName;const cI=b.forwardRef(({className:e,...t},n)=>_.jsx(t2,{ref:n,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));cI.displayName=t2.displayName;const Gi=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(oI,{children:_.jsx(qC,{ref:r,sideOffset:t,className:Q("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Gi.displayName=qC.displayName;const Zn=b.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(YC,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Zn.displayName=YC.displayName;const r2=b.forwardRef(({className:e,children:t,checked:n,...r},i)=>_.jsxs(XC,{ref:i,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(JC,{children:_.jsx(yg,{className:"h-4 w-4"})})}),t]}));r2.displayName=XC.displayName;const cv=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(QC,{ref:r,className:Q("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(JC,{children:_.jsx(uL,{className:"h-2 w-2 fill-current"})})}),t]}));cv.displayName=QC.displayName;const td=b.forwardRef(({className:e,inset:t,...n},r)=>_.jsx(GC,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));td.displayName=GC.displayName;const Js=b.forwardRef(({className:e,...t},n)=>_.jsx(ZC,{ref:n,className:Q("-mx-1 my-1 h-px bg-muted",e),...t}));Js.displayName=ZC.displayName;const H1=[{value:"playerName",label:"Name",placeholder:"Enter a player name",description:"Search players by their last display name."},{value:"playerNotes",label:"Notes",placeholder:"Enter part of the note to search for",description:"Search players by their profile notes contents."},{value:"playerIds",label:"Player IDs",placeholder:"License, Discord, Steam, etc.",description:"Search players by their IDs separated by a comma."}],uI=[{label:"Is Admin",value:"isAdmin"},{label:"Is Online",value:"isOnline"},{label:"Has Whitelisted ID",value:"isWhitelisted"},{label:"Has Profile Notes",value:"hasNote"}],Tc=_r(1250,e=>{e()},{noLeading:!0});function dI({doSearch:e,initialState:t}){var v,S;const n=b.useRef(null),[r,i]=b.useState(!1),[o,a]=b.useState(!1),[s,l]=b.useState(((v=t.search)==null?void 0:v.type)||"playerName"),[c,p]=b.useState(t.filters),[u,m]=b.useState(!!((S=t.search)!=null&&S.value)),g=()=>{if(!n.current)return;const k=n.current.value.trim();k.length?e({value:k,type:s},c):e(null,c)};b.useEffect(()=>{g()},[s,c]);const x=k=>{k.key==="Enter"?(Tc.cancel({upcomingOnly:!0}),g()):k.key==="Escape"?(n.current.value="",Tc(g),m(!1)):(Tc(g),m(!0))},y=()=>{n.current.value="",Tc.cancel({upcomingOnly:!0}),g(),m(!1)},h=(k,C)=>{p(C?R=>[...R,k]:R=>R.filter(w=>w!==k))};Er("keydown",k=>{var C;k.code==="KeyF"&&(k.ctrlKey||k.metaKey)&&((C=n.current)==null||C.focus(),k.preventDefault())});const f=H1.find(k=>k.value===s);if(!f)throw new Error(`Invalid search type: ${s}`);const d=c.length?`${c.length} Filter${c.length>1?"s":""}`:"No filters";return _.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[_.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[_.jsxs("div",{className:"relative min-w-44 grow",children:[_.jsx(it,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:n,placeholder:f.placeholder,onKeyDown:x}),u?_.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:y,children:_.jsx($r,{})}):_.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:_.jsx($n,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),_.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[_.jsxs(Xs,{children:[_.jsx(Qs,{asChild:!0,children:_.jsxs(Ee,{variant:"outline",role:"combobox","aria-expanded":r,onClick:()=>i(!r),className:"xs:w-40 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:["Search by ",f.label,_.jsx(gp,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_.jsxs(Gi,{className:"w-40",children:[_.jsx(td,{children:"Search Type"}),_.jsx(Js,{}),_.jsx(n2,{value:s,onValueChange:l,children:H1.map(k=>_.jsx(cv,{value:k.value,className:"cursor-pointer",children:k.label},k.value))})]})]}),_.jsxs(Xs,{children:[_.jsx(Qs,{asChild:!0,children:_.jsxs(Ee,{variant:"outline",role:"combobox","aria-expanded":o,onClick:()=>a(!o),className:"xs:w-44 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:[d,_.jsx(gp,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_.jsxs(Gi,{className:"w-44",children:[_.jsx(td,{children:"Search Filters"}),_.jsx(Js,{}),uI.map(k=>_.jsx(r2,{checked:c.includes(k.value),className:"cursor-pointer",onCheckedChange:C=>{h(k.value,C)},children:k.label},k.value)),_.jsx(Js,{}),_.jsxs(Zn,{className:"cursor-pointer",onClick:()=>p([]),children:[_.jsx(_L,{className:"mr-2 h-4 w-4"}),"Clear Filters"]})]})]}),_.jsx("div",{className:"flex justify-end flex-grow",children:_.jsxs(Xs,{children:[_.jsx(Qs,{className:"",children:_.jsxs(Ee,{variant:"outline",className:"grow md:grow-0",children:["More",_.jsx(Ml,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_.jsxs(Gi,{children:[_.jsx(Zn,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:_.jsxs(ts,{href:"/players/old",className:"cursor-pointer",children:[_.jsx(Eo,{className:"inline mr-1 h-4"}),"Old Page"]})}),_.jsx(Zn,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:_.jsxs(ts,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[_.jsx(Eo,{className:"inline mr-1 h-4"}),"Prune Players/HWIDs"]})})]})]})})]})]}),_.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:f.description})]})}/**
 * react-virtual
 *
 * Copyright (c) TanStack
 *
 * 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 nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nd.apply(this,arguments)}/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * 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 rd(){return rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rd.apply(this,arguments)}/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * 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 Ss(e,t,n){var r,i=(r=n.initialDeps)!=null?r:[],o;return function(){var a;n.key&&n.debug!=null&&n.debug()&&(a=Date.now());var s=e(),l=s.length!==i.length||s.some(function(x,y){return i[y]!==x});if(!l)return o;i=s;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),o=t.apply(void 0,s),n.key&&n.debug!=null&&n.debug()){var p=Math.round((Date.now()-a)*100)/100,u=Math.round((Date.now()-c)*100)/100,m=u/16,g=function(y,h){for(y=String(y);y.length<h;)y=" "+y;return y};console.info("%c⏱ "+g(u,5)+" /"+g(p,5)+" ms",`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(`+Math.max(0,Math.min(120-120*m,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(o),o}}function lf(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var hI=function(t,n){return Math.abs(t-n)<1};/**
 * virtual-core
 *
 * Copyright (c) TanStack
 *
 * 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
 */var fI=function(t){return t},pI=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),i=[],o=n;o<=r;o++)i.push(o);return i},mI=function(t,n){var r=t.scrollElement;if(r){var i=function(s){var l=s.width,c=s.height;n({width:Math.round(l),height:Math.round(c)})};i(r.getBoundingClientRect());var o=new ResizeObserver(function(a){var s=a[0];if(s!=null&&s.borderBoxSize){var l=s.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(r.getBoundingClientRect())});return o.observe(r,{box:"border-box"}),function(){o.unobserve(r)}}},gI=function(t,n){var r=t.scrollElement;if(r){var i=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return i(),r.addEventListener("scroll",i,{passive:!0}),function(){r.removeEventListener("scroll",i)}}},vI=function(t,n,r){if(n!=null&&n.borderBoxSize){var i=n.borderBoxSize[0];if(i){var o=Math.round(i[r.options.horizontal?"inlineSize":"blockSize"]);return o}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},_I=function(t,n,r){var i,o,a=n.adjustments,s=a===void 0?0:a,l=n.behavior,c=t+s;(i=r.scrollElement)==null||i.scrollTo==null||i.scrollTo((o={},o[r.options.horizontal?"left":"top"]=c,o.behavior=l,o))},yI=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,i=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(a){a.forEach(function(s){n._measureElement(s.target,s)})}):null)};return{disconnect:function(){var a;return(a=i())==null?void 0:a.disconnect()},observe:function(a){var s;return(s=i())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:function(a){var s;return(s=i())==null?void 0:s.unobserve(a)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(i){var o=i[0],a=i[1];typeof a>"u"&&delete r[o]}),n.options=rd({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fI,rangeExtractor:pI,onChange:function(){},measureElement:vI,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=Ss(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:!1,debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(i){n.scrollRect=i,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(i){n.scrollAdjustments=0,n.scrollOffset!==i&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<i?"forward":"backward",n.scrollOffset=i,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=Ss(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,i,o,a){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:i,scrollMargin:o,getItemKey:a}},{key:!1}),this.getFurthestMeasurement=function(r,i){for(var o=new Map,a=new Map,s=i-1;s>=0;s--){var l=r[s];if(!o.has(l.lane)){var c=a.get(l.lane);if(c==null||l.end>c.end?a.set(l.lane,l):l.end<c.end&&o.set(l.lane,!0),o.size===n.options.lanes)break}}return a.size===n.options.lanes?Array.from(a.values()).sort(function(p,u){return p.end-u.end})[0]:void 0},this.getMeasurements=Ss(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,i){var o=r.count,a=r.paddingStart,s=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var p=n.measurementsCache.slice(0,c),u=c;u<o;u++){var m=l(u),g=n.options.lanes===1?p[u-1]:n.getFurthestMeasurement(p,u),x=g?g.end:a+s,y=i.get(m),h=typeof y=="number"?y:n.options.estimateSize(u),f=x+h,d=g?g.lane:u%n.options.lanes;p[u]={index:u,start:x,size:h,end:f,key:m,lane:d}}return n.measurementsCache=p,p},{key:!1,debug:function(){return n.options.debug}}),this.calculateRange=Ss(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,i,o){return n.range=r.length>0&&i>0?xI({measurements:r,outerSize:i,scrollOffset:o}):null},{key:!1,debug:function(){return n.options.debug}}),this.getIndexes=Ss(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,i,o,a){return i===null?[]:r(rd({},i,{overscan:o,count:a}))},{key:!1,debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var i=n.options.indexAttribute,o=r.getAttribute(i);return o?parseInt(o,10):(console.warn("Missing attribute name '"+i+"={index}' on measured element."),-1)},this._measureElement=function(r,i){var o=n.measurementsCache[n.indexFromElement(r)];if(!o||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var a=n.measureElementCache.get(o.key);a!==r&&(a&&n.observer.unobserve(a),n.observer.observe(r),n.measureElementCache.set(o.key,r));var s=n.options.measureElement(r,i,n);n.resizeItem(o,s)},this.resizeItem=function(r,i){var o,a=(o=n.itemSizeCache.get(r.key))!=null?o:r.size,s=i-a;s!==0&&(r.start<n.scrollOffset&&n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=s,behavior:void 0}),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,i)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=Ss(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,i){for(var o=[],a=0,s=r.length;a<s;a++){var l=r[a],c=i[l];o.push(c)}return o},{key:!1,debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var i=n.getMeasurements();return lf(i[i2(0,i.length-1,function(o){return lf(i[o]).start},r)])},this.getOffsetForAlignment=function(r,i){var o=n.getSize();i==="auto"&&(r<=n.scrollOffset?i="start":r>=n.scrollOffset+o?i="end":i="start"),i==="start"?r=r:i==="end"?r=r-o:i==="center"&&(r=r-o/2);var a=n.options.horizontal?"scrollWidth":"scrollHeight",s=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[a]:n.scrollElement[a]:0,l=s-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,i){i===void 0&&(i="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var o=lf(n.getMeasurements()[r]);if(i==="auto")if(o.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)i="end";else if(o.start<=n.scrollOffset+n.options.scrollPaddingStart)i="start";else return[n.scrollOffset,i];var a=i==="end"?o.end+n.options.scrollPaddingEnd:o.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(a,i),i]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,i){var o=i===void 0?{}:i,a=o.align,s=a===void 0?"start":a,l=o.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,s),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,i){var o=i===void 0?{}:i,a=o.align,s=a===void 0?"auto":a,l=o.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,s),p=c[0],u=c[1];n._scrollToOffset(p,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var m=n.measureElementCache.has(n.options.getItemKey(r));if(m){var g=n.getOffsetForIndex(r,u),x=g[0];hI(x,n.scrollOffset)||n.scrollToIndex(r,{align:u,behavior:l})}else n.scrollToIndex(r,{align:u,behavior:l})}))},this.scrollBy=function(r,i){var o=i===void 0?{}:i,a=o.behavior;n.cancelScrollToIndex(),a==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:a})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,i){var o=i.adjustments,a=i.behavior;n.options.scrollToFn(r,{behavior:a,adjustments:o},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},i2=function(t,n,r,i){for(;t<=n;){var o=(t+n)/2|0,a=r(o);if(a<i)t=o+1;else if(a>i)n=o-1;else return o}return t>0?t-1:0};function xI(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,i=t.length-1,o=function(c){return t[c].start},a=i2(0,i,o,r),s=a;s<i&&t[s].end<r+n;)s++;return{startIndex:a,endIndex:s}}/**
 * react-virtual
 *
 * Copyright (c) TanStack
 *
 * 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
 */var wI=typeof document<"u"?b.useLayoutEffect:b.useEffect;function bI(e){var t=b.useReducer(function(){return{}},{})[1],n=nd({},e,{onChange:function(a,s){s?bi.flushSync(t):t(),e.onChange==null||e.onChange(a,s)}}),r=b.useState(function(){return new yI(n)}),i=r[0];return i.setOptions(n),b.useEffect(function(){return i._didMount()},[]),wI(function(){return i._willUpdate()}),i}function uv(e){return bI(nd({observeElementRect:mI,observeElementOffset:gI,scrollToFn:_I},e))}function Mo({children:e,href:t,className:n,rel:r,...i}){const o=Cl()[1],a=t==null?void 0:t.startsWith("http"),s=l=>{t&&(l.preventDefault(),a?Io(t):o(t??"/"))};return _.jsxs("a",{...i,rel:r??"noopener noreferrer",href:t,className:Q("text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer",n),onClick:s,children:[e,a&&_.jsx(Eo,{className:"inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0"})]})}const SI=b.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:"relative w-full overflow-auto",children:_.jsx("table",{ref:n,className:Q("w-full caption-bottom text-sm",e),...t})}));SI.displayName="Table";const dv=b.forwardRef(({className:e,...t},n)=>_.jsx("thead",{ref:n,className:Q("[&_tr]:border-b",e),...t}));dv.displayName="TableHeader";const hv=b.forwardRef(({className:e,...t},n)=>_.jsx("tbody",{ref:n,className:Q("[&_tr:last-child]:border-0",e),...t}));hv.displayName="TableBody";const CI=b.forwardRef(({className:e,...t},n)=>_.jsx("tfoot",{ref:n,className:Q("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));CI.displayName="TableFooter";const Il=b.forwardRef(({className:e,...t},n)=>_.jsx("tr",{ref:n,className:Q("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Il.displayName="TableRow";const kI=b.forwardRef(({className:e,...t},n)=>_.jsx("th",{ref:n,className:Q("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));kI.displayName="TableHead";const mn=b.forwardRef(({className:e,...t},n)=>_.jsx("td",{ref:n,className:Q("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));mn.displayName="TableCell";const EI=b.forwardRef(({className:e,...t},n)=>_.jsx("caption",{ref:n,className:Q("mt-4 text-sm text-muted-foreground",e),...t}));EI.displayName="TableCaption";const RI="https://monitor/WebPipe",LI=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,s2={"User-Agent":LI,"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};class MI extends Error{constructor(n,r){super();ms(this,"title");ms(this,"message");this.title=n,this.message=r}}const o2=()=>{const e=hP(),t=Hg();return async(n,r={},i)=>{if(!e)throw new Error("CSRF token not set");if(n[0]!=="/"||n[1]==="/")throw new Error(`[useAuthedFetcher] fetchUrl MUST start with a single '/', got '${n}'.`);window.txConsts.isWebInterface||(n=RI+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...s2,"X-TxAdmin-CsrfToken":e},body:r.body?JSON.stringify(r.body):void 0,signal:i==null?void 0:i.signal})).json();if(a!=null&&a.logout)throw t("api"),new Error("Session expired");return a}},TI=async(e,t={})=>{const n=new AbortController,r=setTimeout(()=>{n.abort("timeout")},t.timeout??7500);t.method??(t.method="GET");try{const i=await fetch(e,{...s2,signal:n.signal});return clearTimeout(r),await i.json()}catch(i){throw clearTimeout(r),i}},vt=e=>{const t=b.useRef(void 0),n=b.useRef(void 0),r=o2();return e.abortOnUnmount??(e.abortOnUnmount=!1),b.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&Ct.dismiss(n.current))},[]),async i=>{var c,p;n.current&&(Ct.dismiss(n.current),n.current=void 0),t.current=new AbortController;let o=e.path;if(i.pathParams)for(const[u,m]of Object.entries(i.pathParams))o=o.replace(`/:${u}/`,`/${m.toString()}/`);if(i.queryParams){const u=new URLSearchParams;for(const[m,g]of Object.entries(i.queryParams))u.append(m,g.toString());o+=`?${u.toString()}`}const a=`${e.method} ${e.path}`,s=(u,m)=>{if(n.current&&Ct.error({title:u,msg:m},{id:n.current}),i.error)try{i.error(m,n.current)}catch(g){console.log("[ERROR CB ERROR]",a,g)}else throw new MI(u,m)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=Ct.loading(i.toastLoadingMessage):i.toastId&&(n.current=i.toastId);const l=setTimeout(()=>{var u,m;(u=t.current)!=null&&u.signal.aborted||(console.log("[TIMEOUT]",a),(m=t.current)==null||m.abort("timeout"),s("Request Timeout","If you closed txAdmin, please restart it and try again."))},i.timeout??7500);try{console.log("[>>]",a);const u=await r(o,{method:e.method,body:i.data},t.current);if(clearTimeout(l),(c=t.current)!=null&&c.signal.aborted)return;if(i.genericHandler&&n.current&&("error"in u?Ct.error({title:i.genericHandler.errorTitle,msg:u.error},{id:n.current}):Ct.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(u==null?void 0:u.type)=="string"&&typeof(u==null?void 0:u.msg)=="string"&&nP.includes(u==null?void 0:u.type)&&typeof Ct[u.type]=="function"&&Ct[u.type](u,{id:n.current}),i.success)try{i.success(u,n.current)}catch(m){console.log("[SUCCESS CB ERROR]",a,m)}return u}catch(u){if((p=t.current)!=null&&p.signal.aborted)return;clearTimeout(l);let m="unknown error";const g=u;typeof g.message!="string"?m=JSON.stringify(g):g.message.startsWith("NetworkError")?m=`Network error.
If you closed txAdmin, please restart it and try again.`:g.message.startsWith("JSON.parse:")?m="Invalid JSON response from server.":m=g.message,m.includes("unmount")?console.warn("[UNMOUNTED]",a):(console.error("[ERROR]",a,m),s("Request Error",m))}}};function AI({rowData:e,modalOpener:t}){const n=()=>{t({license:e.license})};return _.jsxs(Il,{onClick:n,className:"cursor-pointer",children:[_.jsxs(mn,{className:"px-4 py-2 flex justify-between border-r",children:[_.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.displayName}),_.jsxs("div",{className:"hidden md:inline-flex items-center gap-1",children:[_.jsx(GR,{className:Q("h-5",e.isOnline?"text-success-inline animate-pulse":"text-muted")}),_.jsx(Ob,{className:Q("h-5",e.isAdmin?"text-warning-inline":"text-muted")}),_.jsx(vL,{className:Q("h-5",e.notes?"text-secondary-foreground":"text-muted")})]})]}),_.jsx(mn,{className:"min-w-[8rem] px-4 py-2 border-r",children:F6(e.playTime*6e4)}),_.jsx(mn,{className:"min-w-[10rem] px-4 py-2 border-r",children:hp(e.tsJoined)}),_.jsx(mn,{className:"min-w-[10rem] px-4 py-2",children:hp(e.tsLastConnection)})]})}function DI({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let o;return n?o=_.jsx(Fn,{className:"mx-auto animate-spin"}):r?o=_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),_.jsx("br",{}),_.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?o=_.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No players found."}):o=_.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",_.jsx("br",{}),_.jsxs("i",{children:["(this is a bug, please report it in ",_.jsx(Mo,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),_.jsx(Il,{children:_.jsx(mn,{colSpan:4,className:"px-4 py-2 text-center",children:o})})}function cf({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const o=n.key===t,a=n.desc,s=o?a?"▼":"▲":_.jsx(_.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:o?!a:!0})};return _.jsxs("th",{onClick:l,className:Q("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",o&&"font-medium dark:bg-zinc-700",i),children:[e,_.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:s})]})}function PI({search:e,filters:t}){const n=b.useRef(null),[r,i]=b.useState([]),[o,a]=b.useState(!1),[s,l]=b.useState(!0),[c,p]=b.useState(null),[u,m]=b.useState({key:"tsJoined",desc:!0}),[g,x]=b.useState(!1),y=Fd(),h=vt({method:"GET",path:"/player/search",abortOnUnmount:!0}),f=async R=>{l(!0),p(null),R&&x(!0);const w=E=>{p(E),R&&i([])};try{const E={sortingKey:u.key,sortingDesc:u.desc};e&&(E.searchValue=e.value,E.searchType=e.type),t.length&&(E.filters=t.join(",")),!R&&r.length&&(E.offsetParam=r[r.length-1][u.key],E.offsetLicense=r[r.length-1].license);const L=await h({queryParams:E});if(L===void 0)return w("Request failed.");if("error"in L)return w(`Request failed: ${L.error}`);p(null),a(L.hasReachedEnd),x(!1),L.players.length?i(M=>R?L.players:[...M,...L.players]):i([])}catch(E){w(`Failed to fetch more data: ${E.message}`)}finally{l(!1),x(!1)}},d=uv({scrollingDelay:0,count:r.length+1,getScrollElement:()=>{var R;return(R=n.current)==null?void 0:R.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),v=d.getVirtualItems(),S=d.getTotalSize();let k=null,C=null;if(v.length>0){const R=v[0].start-d.options.scrollMargin;R>0&&(k=_.jsx("tr",{children:_.jsx("td",{colSpan:3,style:{height:R}})}));const w=S-v[v.length-1].end;w>0&&(C=_.jsx("tr",{children:_.jsx("td",{colSpan:3,style:{height:w}})}))}return b.useEffect(()=>{if(!r.length||!v.length)return;const R=v[v.length-1].index;r.length<=R&&!o&&!s&&f()},[r,v,o,s]),b.useEffect(()=>{d.scrollToIndex(0),f(!0)},[e,t,u]),_.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:_.jsx(Bn,{className:"h-full",ref:n,children:_.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[_.jsx(dv,{children:_.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[_.jsx("th",{className:"py-2 px-4 font-light tracking-wider text-left text-muted-foreground",children:"Display Name"}),_.jsx(cf,{label:"Play Time",sortKey:"playTime",sortingState:u,setSorting:m}),_.jsx(cf,{label:"First Joined",sortKey:"tsJoined",sortingState:u,setSorting:m}),_.jsx(cf,{label:"Last Connection",sortKey:"tsLastConnection",sortingState:u,setSorting:m})]})}),_.jsxs(hv,{className:Q(g&&"opacity-25"),children:[k,v.map(R=>R.index>r.length-1?_.jsx(DI,{playersCount:r.length,hasReachedEnd:o,loadError:c,isFetching:s,retryFetch:f},R.key):_.jsx(AI,{rowData:r[R.index],modalOpener:y},R.key)),C]})]})})})}const $I=b.memo(dI),OI=b.memo(PI),NI=b.memo(rC);function II(){const[e,t]=b.useState(void 0),[n,r]=b.useState(void 0),i=vt({method:"GET",path:"/player/stats",abortOnUnmount:!0});b.useEffect(()=>{i({success(l,c){t(l)}})},[]);const o=b.useCallback((l,c)=>{r({search:l,filters:c})},[]),a=b.useMemo(()=>({search:null,filters:[]}),[]),s=b.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Players",value:l?e.total:!1,icon:_.jsx(bg,{})},{label:"Players Last 24h",value:l?e.playedLast24h:!1,icon:_.jsx(nL,{})},{label:"New Players Last 24h",value:l?e.joinedLast24h:!1,icon:_.jsx(w_,{}),prefix:"+"},{label:"New Players Last 7d",value:l?e.joinedLast7d:!1,icon:_.jsx(w_,{}),prefix:"+"}]},[e]);return _.jsxs("div",{className:"flex flex-col min-w-96 w-full",style:{height:"calc(100vh - 3.5rem - 1px - 2rem)"},children:[_.jsx(NI,{callouts:s}),_.jsx($I,{doSearch:o,initialState:a}),n?_.jsx(OI,{search:n.search,filters:n.filters}):null]})}function fv(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const a2=b.forwardRef((e,t)=>b.createElement(fe.span,Y({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),l2=a2,jI=[" ","Enter","ArrowUp","ArrowDown"],BI=[" ","Enter"],Xd="Select",[Qd,Jd,FI]=Pl(Xd),[Go,xz]=Vt(Xd,[FI,qo]),pv=qo(),[zI,fs]=Go(Xd),[HI,UI]=Go(Xd),WI=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:c,name:p,autoComplete:u,disabled:m,required:g}=e,x=pv(t),[y,h]=b.useState(null),[f,d]=b.useState(null),[v,S]=b.useState(!1),k=Bo(c),[C=!1,R]=Lr({prop:r,defaultProp:i,onChange:o}),[w,E]=Lr({prop:a,defaultProp:s,onChange:l}),L=b.useRef(null),M=y?!!y.closest("form"):!0,[D,P]=b.useState(new Set),$=Array.from(D).map(O=>O.props.value).join(";");return b.createElement(Qg,x,b.createElement(zI,{required:g,scope:t,trigger:y,onTriggerChange:h,valueNode:f,onValueNodeChange:d,valueNodeHasChildren:v,onValueNodeHasChildrenChange:S,contentId:_n(),value:w,onValueChange:E,open:C,onOpenChange:R,dir:k,triggerPointerDownPosRef:L,disabled:m},b.createElement(Qd.Provider,{scope:t},b.createElement(HI,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(O=>{P(F=>new Set(F).add(O))},[]),onNativeOptionRemove:b.useCallback(O=>{P(F=>{const U=new Set(F);return U.delete(O),U})},[])},n)),M?b.createElement(f2,{key:$,"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:u,value:w,onChange:O=>E(O.target.value),disabled:m},w===void 0?b.createElement("option",{value:""}):null,Array.from(D)):null))},VI="SelectTrigger",KI=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=pv(n),a=fs(VI,n),s=a.disabled||r,l=Se(t,a.onTriggerChange),c=Jd(n),[p,u,m]=p2(x=>{const y=c().filter(d=>!d.disabled),h=y.find(d=>d.value===a.value),f=m2(y,x,h);f!==void 0&&a.onValueChange(f.value)}),g=()=>{s||(a.onOpenChange(!0),m())};return b.createElement(Jg,Y({asChild:!0},o),b.createElement(fe.button,Y({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":h2(a.value)?"":void 0},i,{ref:l,onClick:ne(i.onClick,x=>{x.currentTarget.focus()}),onPointerDown:ne(i.onPointerDown,x=>{const y=x.target;y.hasPointerCapture(x.pointerId)&&y.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(g(),a.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:ne(i.onKeyDown,x=>{const y=p.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&u(x.key),!(y&&x.key===" ")&&jI.includes(x.key)&&(g(),x.preventDefault())})})))}),qI="SelectValue",GI=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...s}=e,l=fs(qI,n),{onValueNodeHasChildrenChange:c}=l,p=o!==void 0,u=Se(t,l.onValueNodeChange);return st(()=>{c(p)},[c,p]),b.createElement(fe.span,Y({},s,{ref:u,style:{pointerEvents:"none"}}),h2(l.value)?b.createElement(b.Fragment,null,a):o)}),YI=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return b.createElement(fe.span,Y({"aria-hidden":!0},i,{ref:t}),r||"▼")}),XI=e=>b.createElement(ev,Y({asChild:!0},e)),To="SelectContent",QI=b.forwardRef((e,t)=>{const n=fs(To,e.__scopeSelect),[r,i]=b.useState();if(st(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?bi.createPortal(b.createElement(c2,{scope:e.__scopeSelect},b.createElement(Qd.Slot,{scope:e.__scopeSelect},b.createElement("div",null,e.children))),o):null}return b.createElement(JI,Y({},e,{ref:t}))}),pr=10,[c2,ps]=Go(To),JI=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:y,avoidCollisions:h,...f}=e,d=fs(To,n),[v,S]=b.useState(null),[k,C]=b.useState(null),R=Se(t,W=>S(W)),[w,E]=b.useState(null),[L,M]=b.useState(null),D=Jd(n),[P,$]=b.useState(!1),O=b.useRef(!1);b.useEffect(()=>{if(v)return nv(v)},[v]),Ug();const F=b.useCallback(W=>{const[I,...K]=D().map(he=>he.ref.current),[J]=K.slice(-1),q=document.activeElement;for(const he of W)if(he===q||(he==null||he.scrollIntoView({block:"nearest"}),he===I&&k&&(k.scrollTop=0),he===J&&k&&(k.scrollTop=k.scrollHeight),he==null||he.focus(),document.activeElement!==q))return},[D,k]),U=b.useCallback(()=>F([w,v]),[F,w,v]);b.useEffect(()=>{P&&U()},[P,U]);const{onOpenChange:B,triggerPointerDownPosRef:A}=d;b.useEffect(()=>{if(v){let W={x:0,y:0};const I=J=>{var q,he,de,ce;W={x:Math.abs(Math.round(J.pageX)-((q=(he=A.current)===null||he===void 0?void 0:he.x)!==null&&q!==void 0?q:0)),y:Math.abs(Math.round(J.pageY)-((de=(ce=A.current)===null||ce===void 0?void 0:ce.y)!==null&&de!==void 0?de:0))}},K=J=>{W.x<=10&&W.y<=10?J.preventDefault():v.contains(J.target)||B(!1),document.removeEventListener("pointermove",I),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",K,{capture:!0})}}},[v,B,A]),b.useEffect(()=>{const W=()=>B(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[B]);const[T,j]=p2(W=>{const I=D().filter(q=>!q.disabled),K=I.find(q=>q.ref.current===document.activeElement),J=m2(I,W,K);J&&setTimeout(()=>J.ref.current.focus())}),z=b.useCallback((W,I,K)=>{const J=!O.current&&!K;(d.value!==void 0&&d.value===I||J)&&(E(W),J&&(O.current=!0))},[d.value]),N=b.useCallback(()=>v==null?void 0:v.focus(),[v]),X=b.useCallback((W,I,K)=>{const J=!O.current&&!K;(d.value!==void 0&&d.value===I||J)&&M(W)},[d.value]),re=r==="popper"?U1:ZI,H=re===U1?{side:s,sideOffset:l,align:c,alignOffset:p,arrowPadding:u,collisionBoundary:m,collisionPadding:g,sticky:x,hideWhenDetached:y,avoidCollisions:h}:{};return b.createElement(c2,{scope:n,content:v,viewport:k,onViewportChange:C,itemRefCallback:z,selectedItem:w,onItemLeave:N,itemTextRefCallback:X,focusSelectedItem:U,selectedItemText:L,position:r,isPositioned:P,searchRef:T},b.createElement(rv,{as:mi,allowPinchZoom:!0},b.createElement(Wg,{asChild:!0,trapped:d.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:ne(i,W=>{var I;(I=d.trigger)===null||I===void 0||I.focus({preventScroll:!0}),W.preventDefault()})},b.createElement($l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>d.onOpenChange(!1)},b.createElement(re,Y({role:"listbox",id:d.contentId,"data-state":d.open?"open":"closed",dir:d.dir,onContextMenu:W=>W.preventDefault()},f,H,{onPlaced:()=>$(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...f.style},onKeyDown:ne(f.onKeyDown,W=>{const I=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!I&&W.key.length===1&&j(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let J=D().filter(q=>!q.disabled).map(q=>q.ref.current);if(["ArrowUp","End"].includes(W.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const q=W.target,he=J.indexOf(q);J=J.slice(he+1)}setTimeout(()=>F(J)),W.preventDefault()}})}))))))}),ZI=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=fs(To,n),a=ps(To,n),[s,l]=b.useState(null),[c,p]=b.useState(null),u=Se(t,R=>p(R)),m=Jd(n),g=b.useRef(!1),x=b.useRef(!0),{viewport:y,selectedItem:h,selectedItemText:f,focusSelectedItem:d}=a,v=b.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&c&&y&&h&&f){const R=o.trigger.getBoundingClientRect(),w=c.getBoundingClientRect(),E=o.valueNode.getBoundingClientRect(),L=f.getBoundingClientRect();if(o.dir!=="rtl"){const q=L.left-w.left,he=E.left-q,de=R.left-he,ce=R.width+de,Ae=Math.max(ce,w.width),je=window.innerWidth-pr,ue=pp(he,[pr,je-Ae]);s.style.minWidth=ce+"px",s.style.left=ue+"px"}else{const q=w.right-L.right,he=window.innerWidth-E.right-q,de=window.innerWidth-R.right-he,ce=R.width+de,Ae=Math.max(ce,w.width),je=window.innerWidth-pr,ue=pp(he,[pr,je-Ae]);s.style.minWidth=ce+"px",s.style.right=ue+"px"}const M=m(),D=window.innerHeight-pr*2,P=y.scrollHeight,$=window.getComputedStyle(c),O=parseInt($.borderTopWidth,10),F=parseInt($.paddingTop,10),U=parseInt($.borderBottomWidth,10),B=parseInt($.paddingBottom,10),A=O+F+P+B+U,T=Math.min(h.offsetHeight*5,A),j=window.getComputedStyle(y),z=parseInt(j.paddingTop,10),N=parseInt(j.paddingBottom,10),X=R.top+R.height/2-pr,re=D-X,H=h.offsetHeight/2,W=h.offsetTop+H,I=O+F+W,K=A-I;if(I<=X){const q=h===M[M.length-1].ref.current;s.style.bottom="0px";const he=c.clientHeight-y.offsetTop-y.offsetHeight,de=Math.max(re,H+(q?N:0)+he+U),ce=I+de;s.style.height=ce+"px"}else{const q=h===M[0].ref.current;s.style.top="0px";const de=Math.max(X,O+y.offsetTop+(q?z:0)+H)+K;s.style.height=de+"px",y.scrollTop=I-X+y.offsetTop}s.style.margin=`${pr}px 0`,s.style.minHeight=T+"px",s.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,s,c,y,h,f,o.dir,r]);st(()=>v(),[v]);const[S,k]=b.useState();st(()=>{c&&k(window.getComputedStyle(c).zIndex)},[c]);const C=b.useCallback(R=>{R&&x.current===!0&&(v(),d==null||d(),x.current=!1)},[v,d]);return b.createElement(ej,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:C},b.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},b.createElement(fe.div,Y({},i,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),U1=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=pr,...o}=e,a=pv(n);return b.createElement(Zg,Y({},a,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[ej,mv]=Go(To,{}),W1="SelectViewport",tj=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ps(W1,n),o=mv(W1,n),a=Se(t,i.onViewportChange),s=b.useRef(0);return b.createElement(b.Fragment,null,b.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),b.createElement(Qd.Slot,{scope:n},b.createElement(fe.div,Y({"data-radix-select-viewport":"",role:"presentation"},r,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:ne(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:u}=o;if(u!=null&&u.current&&p){const m=Math.abs(s.current-c.scrollTop);if(m>0){const g=window.innerHeight-pr*2,x=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),h=Math.max(x,y);if(h<g){const f=h+m,d=Math.min(g,f),v=f-d;p.style.height=d+"px",p.style.bottom==="0px"&&(c.scrollTop=v>0?v:0,p.style.justifyContent="flex-end")}}}s.current=c.scrollTop})}))))}),nj="SelectGroup",[wz,rj]=Go(nj),ij="SelectLabel",sj=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=rj(ij,n);return b.createElement(fe.div,Y({id:i.id},r,{ref:t}))}),Yp="SelectItem",[oj,u2]=Go(Yp),aj=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,s=fs(Yp,n),l=ps(Yp,n),c=s.value===r,[p,u]=b.useState(o??""),[m,g]=b.useState(!1),x=Se(t,f=>{var d;return(d=l.itemRefCallback)===null||d===void 0?void 0:d.call(l,f,r,i)}),y=_n(),h=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.createElement(oj,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:b.useCallback(f=>{u(d=>{var v;return d||((v=f==null?void 0:f.textContent)!==null&&v!==void 0?v:"").trim()})},[])},b.createElement(Qd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p},b.createElement(fe.div,Y({role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:x,onFocus:ne(a.onFocus,()=>g(!0)),onBlur:ne(a.onBlur,()=>g(!1)),onPointerUp:ne(a.onPointerUp,h),onPointerMove:ne(a.onPointerMove,f=>{if(i){var d;(d=l.onItemLeave)===null||d===void 0||d.call(l)}else f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ne(a.onPointerLeave,f=>{if(f.currentTarget===document.activeElement){var d;(d=l.onItemLeave)===null||d===void 0||d.call(l)}}),onKeyDown:ne(a.onKeyDown,f=>{var d;((d=l.searchRef)===null||d===void 0?void 0:d.current)!==""&&f.key===" "||(BI.includes(f.key)&&h(),f.key===" "&&f.preventDefault())})}))))}),Ac="SelectItemText",lj=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=fs(Ac,n),s=ps(Ac,n),l=u2(Ac,n),c=UI(Ac,n),[p,u]=b.useState(null),m=Se(t,f=>u(f),l.onItemTextChange,f=>{var d;return(d=s.itemTextRefCallback)===null||d===void 0?void 0:d.call(s,f,l.value,l.disabled)}),g=p==null?void 0:p.textContent,x=b.useMemo(()=>b.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:h}=c;return st(()=>(y(x),()=>h(x)),[y,h,x]),b.createElement(b.Fragment,null,b.createElement(fe.span,Y({id:l.textId},o,{ref:m})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?bi.createPortal(o.children,a.valueNode):null)}),cj="SelectItemIndicator",uj=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u2(cj,n).isSelected?b.createElement(fe.span,Y({"aria-hidden":!0},r,{ref:t})):null}),V1="SelectScrollUpButton",dj=b.forwardRef((e,t)=>{const n=ps(V1,e.__scopeSelect),r=mv(V1,e.__scopeSelect),[i,o]=b.useState(!1),a=Se(t,r.onScrollButtonChange);return st(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollTop>0;o(c)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?b.createElement(d2,Y({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),K1="SelectScrollDownButton",hj=b.forwardRef((e,t)=>{const n=ps(K1,e.__scopeSelect),r=mv(K1,e.__scopeSelect),[i,o]=b.useState(!1),a=Se(t,r.onScrollButtonChange);return st(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=s.scrollHeight-s.clientHeight,p=Math.ceil(s.scrollTop)<c;o(p)};const s=n.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?b.createElement(d2,Y({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),d2=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ps("SelectScrollButton",n),a=b.useRef(null),s=Jd(n),l=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>l(),[l]),st(()=>{var c;const p=s().find(u=>u.ref.current===document.activeElement);p==null||(c=p.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[s]),b.createElement(fe.div,Y({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:ne(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:ne(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:ne(i.onPointerLeave,()=>{l()})}))}),fj=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return b.createElement(fe.div,Y({"aria-hidden":!0},r,{ref:t}))});function h2(e){return e===""||e===void 0}const f2=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=b.useRef(null),o=Se(t,i),a=fv(n);return b.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&p){const u=new Event("change",{bubbles:!0});p.call(s,n),s.dispatchEvent(u)}},[a,n]),b.createElement(a2,{asChild:!0},b.createElement("select",Y({},r,{ref:o,defaultValue:n})))});f2.displayName="BubbleSelect";function p2(e){const t=Be(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(a=>{const s=n.current+a;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function m2(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=pj(e,Math.max(o,0));i.length===1&&(a=a.filter(c=>c!==n));const l=a.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function pj(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const mj=WI,g2=KI,gj=GI,vj=YI,_j=XI,v2=QI,yj=tj,_2=sj,y2=aj,xj=lj,wj=uj,x2=dj,w2=hj,b2=fj,id=mj,sd=gj,nl=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(g2,{ref:r,className:Q("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","bg-black/5 dark:bg-black/30",e),...n,children:[t,_.jsx(vj,{asChild:!0,children:_.jsx(Ml,{className:"h-4 w-4 opacity-50"})})]}));nl.displayName=g2.displayName;const S2=b.forwardRef(({className:e,...t},n)=>_.jsx(x2,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(lL,{className:"h-4 w-4"})}));S2.displayName=x2.displayName;const C2=b.forwardRef(({className:e,...t},n)=>_.jsx(w2,{ref:n,className:Q("flex cursor-default items-center justify-center py-1",e),...t,children:_.jsx(Ml,{className:"h-4 w-4"})}));C2.displayName=w2.displayName;const rl=b.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>_.jsx(_j,{children:_.jsxs(v2,{ref:i,className:Q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[_.jsx(S2,{}),_.jsx(yj,{className:Q("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),_.jsx(C2,{})]})}));rl.displayName=v2.displayName;const bj=b.forwardRef(({className:e,...t},n)=>_.jsx(_2,{ref:n,className:Q("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));bj.displayName=_2.displayName;const lt=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(y2,{ref:r,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[_.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_.jsx(wj,{children:_.jsx(yg,{className:"h-4 w-4"})})}),_.jsx(xj,{children:t})]}));lt.displayName=y2.displayName;const Xp=b.forwardRef(({className:e,...t},n)=>_.jsx(b2,{ref:n,className:Q("-mx-1 my-1 h-px bg-muted",e),...t}));Xp.displayName=b2.displayName;const q1=[{value:"actionId",label:"Action ID",placeholder:"XXXX-XXXX",description:"Search actions by their ID."},{value:"reason",label:"Reason",placeholder:"Enter part of the reason to search for",description:"Search actions by their reason contents."},{value:"identifiers",label:"Player IDs",placeholder:"License, Discord, Steam, etc.",description:"Search actions by their player IDs separated by a comma."}],Cs="!any",Dc=_r(1250,e=>{e()},{noLeading:!0});function Sj({doSearch:e,initialState:t,adminStats:n}){var k,C;const{authData:r}=us(),i=b.useRef(null),[o,a]=b.useState(!1),[s,l]=b.useState(((k=t.search)==null?void 0:k.type)||"actionId"),[c,p]=b.useState(!!((C=t.search)!=null&&C.value)),[u,m]=b.useState(t.filterbyType??Cs),[g,x]=b.useState(t.filterbyAdmin??Cs),y=()=>{if(!i.current)return;const R=i.current.value.trim(),w=u!==Cs?u:void 0,E=g!==Cs?g:void 0;R.length?e({value:R,type:s},w,E):e(null,w,E)};b.useEffect(()=>{y()},[s,u,g]);const h=R=>{R.key==="Enter"?(Dc.cancel({upcomingOnly:!0}),y()):R.key==="Escape"?(i.current.value="",Dc(y),p(!1)):(Dc(y),p(!0))},f=()=>{i.current.value="",Dc.cancel({upcomingOnly:!0}),y(),p(!1)};Er("keydown",R=>{var w;R.code==="KeyF"&&(R.ctrlKey||R.metaKey)&&((w=i.current)==null||w.focus(),R.preventDefault())});const d=q1.find(R=>R.value===s);if(!d)throw new Error(`Invalid search type: ${s}`);if(!r)throw new Error("authData is not available");const v=b.useMemo(()=>n.filter(R=>R.name!==r.name),[n,r.name]),S=b.useMemo(()=>{var R;return((R=n.find(w=>w.name===r.name))==null?void 0:R.actions)||0},[n,r.name]);return _.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[_.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[_.jsxs("div",{className:"relative min-w-44 grow",children:[_.jsx(it,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:i,placeholder:d.placeholder,onKeyDown:h}),c?_.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:f,children:_.jsx($r,{})}):_.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:_.jsx($n,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),_.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[_.jsxs(Xs,{children:[_.jsx(Qs,{asChild:!0,children:_.jsxs(Ee,{variant:"outline",role:"combobox","aria-expanded":o,onClick:()=>a(!o),className:"xs:w-48 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:["Search by ",d.label,_.jsx(gp,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_.jsxs(Gi,{className:"w-48",children:[_.jsx(td,{children:"Search Type"}),_.jsx(Js,{}),_.jsx(n2,{value:s,onValueChange:l,children:q1.map(R=>_.jsx(cv,{value:R.value,className:"cursor-pointer",children:R.label},R.value))})]})]}),_.jsxs(id,{defaultValue:u,onValueChange:m,children:[_.jsx(nl,{className:"w-36 grow md:grow-0",children:_.jsx(sd,{placeholder:"Filter by admin"})}),_.jsxs(rl,{className:"px-0",children:[_.jsx(lt,{value:Cs,className:"cursor-pointer",children:"Any type"}),_.jsx(Xp,{}),_.jsx(lt,{value:"ban",className:"cursor-pointer",children:"Bans"}),_.jsx(lt,{value:"warn",className:"cursor-pointer",children:"Warns"})]})]}),_.jsxs(id,{defaultValue:g,onValueChange:x,children:[_.jsx(nl,{className:"w-36 grow md:grow-0",children:_.jsx(sd,{placeholder:"Filter by admin"})}),_.jsxs(rl,{className:"px-0",children:[_.jsx(lt,{value:Cs,className:"cursor-pointer",children:"By any admin"}),_.jsxs(lt,{value:r.name,className:"cursor-pointer",children:[r.name," ",_.jsxs("span",{className:"opacity-50",children:["(",S,")"]})]}),_.jsx(Xp,{}),v.map(R=>_.jsxs(lt,{className:"cursor-pointer",value:R.name,children:[R.name," ",_.jsxs("span",{className:"opacity-50",children:["(",R.actions,")"]})]},R.name))]})]}),_.jsx("div",{className:"flex justify-end flex-grow",children:_.jsxs(Xs,{children:[_.jsx(Qs,{asChild:!0,children:_.jsxs(Ee,{variant:"outline",className:"grow md:grow-0",children:["More",_.jsx(Ml,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_.jsxs(Gi,{children:[_.jsx(Zn,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:_.jsxs(ts,{href:"/players/old",className:"cursor-pointer",children:[_.jsx(Eo,{className:"inline mr-1 h-4"}),"Old Page"]})}),_.jsx(Zn,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:_.jsxs(ts,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[_.jsx(Eo,{className:"inline mr-1 h-4"}),"Bulk Remove"]})})]})]})})]})]}),_.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:d.description})]})}function Cj({action:e,modalOpener:t}){const n=()=>{t(e.id)};let r,i;if(e.type==="warn")r=_.jsx("div",{className:"flex items-center px-1 bg-warning-hint text-warning",children:_.jsx(Fu,{className:"size-5"})}),i=_.jsx("span",{className:"tracking-wider text-warning",children:e.id});else if(e.type==="ban")r=_.jsx("div",{className:"flex items-center px-1 bg-destructive-hint text-destructive",children:_.jsx(zu,{className:"size-5"})}),i=_.jsx("span",{className:"tracking-wider text-destructive",children:e.id});else throw new Error(`Invalid action type: ${e.type}`);let o;return e.isRevoked?o=_.jsx(Nb,{className:"size-4"}):e.banExpiration&&(e.banExpiration==="permanent"?o=_.jsx(KL,{className:"size-4"}):e.banExpiration==="active"&&(o=_.jsx(qL,{className:"size-4"}))),_.jsxs(Il,{onClick:n,className:"cursor-pointer",children:[_.jsx(mn,{className:Q("w-[10.4rem] border-r p-0",e.isRevoked&&"opacity-40"),children:_.jsxs("div",{className:"flex justify-start gap-2",children:[r,_.jsx("div",{className:"p-2 font-mono",children:i}),_.jsx("div",{className:"flex-grow flex justify-end items-center my-auto pr-2 text-muted-foreground",children:o})]})}),_.jsx(mn,{className:"px-4 py-2 border-r",children:_.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.playerName?e.playerName:_.jsx("span",{className:"text-muted-foreground italic",children:"unknown"})})}),_.jsx(mn,{className:"px-4 py-2 border-r",children:_.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.reason})}),_.jsx(mn,{className:"px-4 py-2 border-r",children:_.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.author})}),_.jsx(mn,{className:"min-w-[10rem] px-4 py-2",children:_.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:hp(e.timestamp)})})]})}function kj({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let o;return n?o=_.jsx(Fn,{className:"mx-auto animate-spin"}):r?o=_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),_.jsx("br",{}),_.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?o=_.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No actions found."}):o=_.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",_.jsx("br",{}),_.jsxs("i",{children:["(this is a bug, please report it in ",_.jsx(Mo,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),_.jsx(Il,{children:_.jsx(mn,{colSpan:5,className:"px-4 py-2 text-center",children:o})})}function Ej({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const o=n.key===t,a=n.desc,s=o?a?"▼":"▲":_.jsx(_.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:o?!a:!0})};return _.jsxs("th",{onClick:l,className:Q("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",o&&"font-medium dark:bg-zinc-700",i),children:[e,_.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:s})]})}function Pc({label:e,className:t}){return _.jsx("th",{className:Q("py-2 px-4 font-light tracking-wider text-left text-muted-foreground",t),children:e})}function Rj({search:e,filterbyType:t,filterbyAdmin:n}){const r=b.useRef(null),[i,o]=b.useState([]),[a,s]=b.useState(!1),[l,c]=b.useState(!1),[p,u]=b.useState(null),[m,g]=b.useState({key:"timestamp",desc:!0}),[x,y]=b.useState(!1),h=eC(),f=vt({method:"GET",path:"/history/search",abortOnUnmount:!0}),d=async w=>{c(!0),u(null),w&&y(!0);const E=L=>{u(L),w&&o([])};try{const L={sortingKey:m.key,sortingDesc:m.desc};e&&(L.searchValue=e.value,L.searchType=e.type),t&&t!=="!any"&&(L.filterbyType=t),n&&n!=="!any"&&(L.filterbyAdmin=n),!w&&i.length&&(L.offsetParam=i[i.length-1][m.key],L.offsetActionId=i[i.length-1].id);const M=await f({queryParams:L});if(M===void 0)return E("Request failed.");if("error"in M)return E(`Request failed: ${M.error}`);u(null),s(M.hasReachedEnd),y(!1),M.history.length?o(D=>w?M.history:[...D,...M.history]):o([])}catch(L){E(`Failed to fetch more data: ${L.message}`)}finally{c(!1),y(!1)}},v=uv({scrollingDelay:0,count:i.length+1,getScrollElement:()=>{var w;return(w=r.current)==null?void 0:w.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),S=v.getVirtualItems(),k=v.getTotalSize();let C=null,R=null;if(S.length>0){const w=S[0].start-v.options.scrollMargin;w>0&&(C=_.jsx("tr",{children:_.jsx("td",{colSpan:3,style:{height:w}})}));const E=k-S[S.length-1].end;E>0&&(R=_.jsx("tr",{children:_.jsx("td",{colSpan:3,style:{height:E}})}))}return b.useEffect(()=>{if(!i.length||!S.length)return;const w=S[S.length-1].index;i.length<=w&&!a&&!l&&d()},[i,S,a,l]),b.useEffect(()=>{v.scrollToIndex(0),d(!0)},[e,t,n,m]),_.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:_.jsx(Bn,{className:"h-full",ref:r,children:_.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[_.jsx(dv,{children:_.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[_.jsx(Pc,{label:"Action"}),_.jsx(Pc,{label:"Player"}),_.jsx(Pc,{label:"Reason"}),_.jsx(Pc,{label:"Author"}),_.jsx(Ej,{label:"Date Time",sortKey:"timestamp",sortingState:m,setSorting:g})]})}),_.jsxs(hv,{className:Q(x&&"opacity-25"),children:[C,S.map(w=>w.index>i.length-1?_.jsx(kj,{playersCount:i.length,hasReachedEnd:a,loadError:p,isFetching:l,retryFetch:d},w.key):_.jsx(Cj,{action:i[w.index],modalOpener:h},w.key)),R]})]})})})}const Lj=b.memo(Sj),Mj=b.memo(Rj),Tj=b.memo(rC);function Aj(){const[e,t]=b.useState(void 0),[n,r]=b.useState(void 0),i=vt({method:"GET",path:"/history/stats",abortOnUnmount:!0});b.useEffect(()=>{i({success(l,c){t(l)}})},[]);const o=b.useCallback((l,c,p)=>{r({search:l,filterbyType:c,filterbyAdmin:p})},[]),a=b.useMemo(()=>({search:null,filterbyType:void 0,filterbyAdmin:void 0}),[]),s=b.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Warns",value:l?e.totalWarns:!1,icon:_.jsx(Fu,{})},{label:"New Warns Last 7d",value:l?e.warnsLast7d:!1,icon:_.jsx(Fu,{}),prefix:"+"},{label:"Total Bans",value:l?e.totalBans:!1,icon:_.jsx(zu,{})},{label:"New Bans Last 7d",value:l?e.bansLast7d:!1,icon:_.jsx(zu,{}),prefix:"+"}]},[e]);return _.jsxs("div",{className:"flex flex-col min-w-96 w-full",style:{height:"calc(100vh - 3.5rem - 1px - 2rem)"},children:[_.jsx(Tj,{callouts:s}),e&&!("error"in e)?_.jsx(Lj,{doSearch:o,initialState:a,adminStats:e.groupedByAdmins}):null,n?_.jsx(Mj,{search:n.search,filterbyType:n.filterbyType,filterbyAdmin:n.filterbyAdmin}):null]})}const Dj=[{path:"/players/old",title:"Players",children:_.jsx(St,{legacyUrl:"players"})},{path:"/players",title:"Players",children:_.jsx(II,{})},{path:"/history",title:"History",children:_.jsx(Aj,{})},{path:"/whitelist",title:"Whitelist",children:_.jsx(St,{legacyUrl:"whitelist"})},{path:"/admins",title:"Admins",children:_.jsx(St,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",children:_.jsx(St,{legacyUrl:"settings"})},{path:"/system/master-actions",title:"Master Actions",children:_.jsx(St,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",children:_.jsx(St,{legacyUrl:"diagnostics"})},{path:"/system/console-log",title:"Console Log",children:_.jsx(St,{legacyUrl:"systemLog#nav-console"})},{path:"/system/system-logs",title:"System Logs",children:_.jsx(St,{legacyUrl:"systemLog"})},{path:"/",title:"Dashboard",children:_.jsx(St,{legacyUrl:"dashboard"})},{path:"/server/console",title:"Live Console",children:_.jsx(NP,{})},{path:"/server/console/old",title:"Old Live Console",children:_.jsx(St,{legacyUrl:"console"})},{path:"/server/resources",title:"Resources",children:_.jsx(St,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",children:_.jsx(St,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",children:_.jsx(St,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",children:_.jsx(St,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",children:_.jsx(St,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",children:_.jsx(St,{legacyUrl:"advanced"})}];function Pj(e){return _g()(e.title),_.jsx(Ti,{path:e.path,children:e.children})}function $j(){const e=Ne(Ab),t=qe(Tb);return _.jsx(Ly,{FallbackComponent:kR,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),ig("/"),e(!1)},children:_.jsxs(Nw,{children:[Dj.map(n=>_.jsx(Pj,{path:n.path,title:n.title,children:n.children},n.path)),!1,_.jsx(Ti,{path:"/:fullPath*",component:VR})]})},t)}const jl="NavigationMenu",[gv,k2,Oj]=Pl(jl),[Qp,Nj,Ij]=Pl(jl),[vv,bz]=Vt(jl,[Oj,Ij]),[jj,zn]=vv(jl),[Bj,Fj]=vv(jl),zj=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:s=300,orientation:l="horizontal",dir:c,...p}=e,[u,m]=b.useState(null),g=Se(t,E=>m(E)),x=Bo(c),y=b.useRef(0),h=b.useRef(0),f=b.useRef(0),[d,v]=b.useState(!0),[S="",k]=Lr({prop:r,onChange:E=>{const L=E!=="",M=s>0;L?(window.clearTimeout(f.current),M&&v(!1)):(window.clearTimeout(f.current),f.current=window.setTimeout(()=>v(!0),s)),i==null||i(E)},defaultProp:o}),C=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>k(""),150)},[k]),R=b.useCallback(E=>{window.clearTimeout(h.current),k(E)},[k]),w=b.useCallback(E=>{S===E?window.clearTimeout(h.current):y.current=window.setTimeout(()=>{window.clearTimeout(h.current),k(E)},a)},[S,k,a]);return b.useEffect(()=>()=>{window.clearTimeout(y.current),window.clearTimeout(h.current),window.clearTimeout(f.current)},[]),b.createElement(Hj,{scope:n,isRootMenu:!0,value:S,dir:x,orientation:l,rootNavigationMenu:u,onTriggerEnter:E=>{window.clearTimeout(y.current),d?w(E):R(E)},onTriggerLeave:()=>{window.clearTimeout(y.current),C()},onContentEnter:()=>window.clearTimeout(h.current),onContentLeave:C,onItemSelect:E=>{k(L=>L===E?"":E)},onItemDismiss:()=>k("")},b.createElement(fe.nav,Y({"aria-label":"Main","data-orientation":l,dir:x},p,{ref:g})))}),Hj=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:s,onItemSelect:l,onItemDismiss:c,onTriggerEnter:p,onTriggerLeave:u,onContentEnter:m,onContentLeave:g}=e,[x,y]=b.useState(null),[h,f]=b.useState(new Map),[d,v]=b.useState(null);return b.createElement(jj,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:fv(s),baseId:_n(),dir:i,orientation:o,viewport:x,onViewportChange:y,indicatorTrack:d,onIndicatorTrackChange:v,onTriggerEnter:Be(p),onTriggerLeave:Be(u),onContentEnter:Be(m),onContentLeave:Be(g),onItemSelect:Be(l),onItemDismiss:Be(c),onViewportContentChange:b.useCallback((S,k)=>{f(C=>(C.set(S,k),new Map(C)))},[]),onViewportContentRemove:b.useCallback(S=>{f(k=>k.has(S)?(k.delete(S),new Map(k)):k)},[])},b.createElement(gv.Provider,{scope:t},b.createElement(Bj,{scope:t,items:h},a)))},Uj="NavigationMenuList",Wj=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=zn(Uj,n),o=b.createElement(fe.ul,Y({"data-orientation":i.orientation},r,{ref:t}));return b.createElement(fe.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange},b.createElement(gv.Slot,{scope:n},i.isRootMenu?b.createElement(T2,{asChild:!0},o):o))}),Vj="NavigationMenuItem",[Kj,E2]=vv(Vj),qj=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=_n(),a=r||o||"LEGACY_REACT_AUTO_VALUE",s=b.useRef(null),l=b.useRef(null),c=b.useRef(null),p=b.useRef(()=>{}),u=b.useRef(!1),m=b.useCallback((x="start")=>{if(s.current){p.current();const y=Jp(s.current);y.length&&_v(x==="start"?y:y.reverse())}},[]),g=b.useCallback(()=>{if(s.current){const x=Jp(s.current);x.length&&(p.current=i9(x))}},[]);return b.createElement(Kj,{scope:n,value:a,triggerRef:l,contentRef:s,focusProxyRef:c,wasEscapeCloseRef:u,onEntryKeyDown:m,onFocusProxyEnter:m,onRootContentClose:g,onContentFocusOutside:g},b.createElement(fe.li,Y({},i,{ref:t})))}),G1="NavigationMenuTrigger",Gj=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=zn(G1,e.__scopeNavigationMenu),a=E2(G1,e.__scopeNavigationMenu),s=b.useRef(null),l=Se(s,a.triggerRef,t),c=D2(o.baseId,a.value),p=P2(o.baseId,a.value),u=b.useRef(!1),m=b.useRef(!1),g=a.value===o.value;return b.createElement(b.Fragment,null,b.createElement(gv.ItemSlot,{scope:n,value:a.value},b.createElement(A2,{asChild:!0},b.createElement(fe.button,Y({id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":yv(g),"aria-expanded":g,"aria-controls":p},i,{ref:l,onPointerEnter:ne(e.onPointerEnter,()=>{m.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:ne(e.onPointerMove,od(()=>{r||m.current||a.wasEscapeCloseRef.current||u.current||(o.onTriggerEnter(a.value),u.current=!0)})),onPointerLeave:ne(e.onPointerLeave,od(()=>{r||(o.onTriggerLeave(),u.current=!1)})),onClick:ne(e.onClick,()=>{o.onItemSelect(a.value),m.current=g}),onKeyDown:ne(e.onKeyDown,x=>{const h={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];g&&x.key===h&&(a.onEntryKeyDown(),x.preventDefault())})})))),g&&b.createElement(b.Fragment,null,b.createElement(l2,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:x=>{const y=a.contentRef.current,h=x.relatedTarget,f=h===s.current,d=y==null?void 0:y.contains(h);(f||!d)&&a.onFocusProxyEnter(f?"start":"end")}}),o.viewport&&b.createElement("span",{"aria-owns":p})))}),Y1="navigationMenu.linkSelect",Yj=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return b.createElement(A2,{asChild:!0},b.createElement(fe.a,Y({"data-active":r?"":void 0,"aria-current":r?"page":void 0},o,{ref:t,onClick:ne(e.onClick,a=>{const s=a.target,l=new CustomEvent(Y1,{bubbles:!0,cancelable:!0});if(s.addEventListener(Y1,c=>i==null?void 0:i(c),{once:!0}),Nu(s,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(ou,{bubbles:!0,cancelable:!0});Nu(s,c)}},{checkForDefaultPrevented:!1})})))}),R2="NavigationMenuIndicator",Xj=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=zn(R2,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?Dw.createPortal(b.createElement(ht,{present:n||o},b.createElement(Qj,Y({},r,{ref:t}))),i.indicatorTrack):null}),Qj=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=zn(R2,n),o=k2(n),[a,s]=b.useState(null),[l,c]=b.useState(null),p=i.orientation==="horizontal",u=!!i.value;b.useEffect(()=>{var g;const y=(g=o().find(h=>h.value===i.value))===null||g===void 0?void 0:g.ref.current;y&&s(y)},[o,i.value]);const m=()=>{a&&c({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return Zp(a,m),Zp(i.indicatorTrack,m),l?b.createElement(fe.div,Y({"aria-hidden":!0,"data-state":u?"visible":"hidden","data-orientation":i.orientation},r,{ref:t,style:{position:"absolute",...p?{left:0,width:l.size+"px",transform:`translateX(${l.offset}px)`}:{top:0,height:l.size+"px",transform:`translateY(${l.offset}px)`},...r.style}})):null}),il="NavigationMenuContent",Jj=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=zn(il,e.__scopeNavigationMenu),o=E2(il,e.__scopeNavigationMenu),a=Se(o.contentRef,t),s=o.value===i.value,l={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?b.createElement(Zj,Y({forceMount:n},l,{ref:a})):b.createElement(ht,{present:n||s},b.createElement(L2,Y({"data-state":yv(s)},l,{ref:a,onPointerEnter:ne(e.onPointerEnter,i.onContentEnter),onPointerLeave:ne(e.onPointerLeave,od(i.onContentLeave)),style:{pointerEvents:!s&&i.isRootMenu?"none":void 0,...l.style}})))}),Zj=b.forwardRef((e,t)=>{const n=zn(il,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return st(()=>{r(e.value,{ref:t,...e})},[e,t,r]),st(()=>()=>i(e.value),[e.value,i]),null}),ou="navigationMenu.rootContentDismiss",L2=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:s,onContentFocusOutside:l,...c}=e,p=zn(il,n),u=b.useRef(null),m=Se(u,t),g=D2(p.baseId,r),x=P2(p.baseId,r),y=k2(n),h=b.useRef(null),{onItemDismiss:f}=p;b.useEffect(()=>{const v=u.current;if(p.isRootMenu&&v){const S=()=>{var k;f(),s(),v.contains(document.activeElement)&&((k=i.current)===null||k===void 0||k.focus())};return v.addEventListener(ou,S),()=>v.removeEventListener(ou,S)}},[p.isRootMenu,e.value,i,f,s]);const d=b.useMemo(()=>{const S=y().map(L=>L.value);p.dir==="rtl"&&S.reverse();const k=S.indexOf(p.value),C=S.indexOf(p.previousValue),R=r===p.value,w=C===S.indexOf(r);if(!R&&!w)return h.current;const E=(()=>{if(k!==C){if(R&&C!==-1)return k>C?"from-end":"from-start";if(w&&k!==-1)return k>C?"to-start":"to-end"}return null})();return h.current=E,E},[p.previousValue,p.value,p.dir,y,r]);return b.createElement(T2,{asChild:!0},b.createElement($l,Y({id:x,"aria-labelledby":g,"data-motion":d,"data-orientation":p.orientation},c,{ref:m,onDismiss:()=>{var v;const S=new Event(ou,{bubbles:!0,cancelable:!0});(v=u.current)===null||v===void 0||v.dispatchEvent(S)},onFocusOutside:ne(e.onFocusOutside,v=>{var S;l();const k=v.target;(S=p.rootNavigationMenu)!==null&&S!==void 0&&S.contains(k)&&v.preventDefault()}),onPointerDownOutside:ne(e.onPointerDownOutside,v=>{var S;const k=v.target,C=y().some(w=>{var E;return(E=w.ref.current)===null||E===void 0?void 0:E.contains(k)}),R=p.isRootMenu&&((S=p.viewport)===null||S===void 0?void 0:S.contains(k));(C||R||!p.isRootMenu)&&v.preventDefault()}),onKeyDown:ne(e.onKeyDown,v=>{const S=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!S){const R=Jp(v.currentTarget),w=document.activeElement,E=R.findIndex(D=>D===w),M=v.shiftKey?R.slice(0,E).reverse():R.slice(E+1,R.length);if(_v(M))v.preventDefault();else{var C;(C=o.current)===null||C===void 0||C.focus()}}}),onEscapeKeyDown:ne(e.onEscapeKeyDown,v=>{a.current=!0})})))}),M2="NavigationMenuViewport",e9=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!zn(M2,e.__scopeNavigationMenu).value;return b.createElement(ht,{present:n||o},b.createElement(t9,Y({},r,{ref:t})))}),t9=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=zn(M2,n),a=Se(t,o.onViewportChange),s=Fj(il,e.__scopeNavigationMenu),[l,c]=b.useState(null),[p,u]=b.useState(null),m=l?(l==null?void 0:l.width)+"px":void 0,g=l?(l==null?void 0:l.height)+"px":void 0,x=!!o.value,y=x?o.value:o.previousValue;return Zp(p,()=>{p&&c({width:p.offsetWidth,height:p.offsetHeight})}),b.createElement(fe.div,Y({"data-state":yv(x),"data-orientation":o.orientation},i,{ref:a,style:{pointerEvents:!x&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":m,"--radix-navigation-menu-viewport-height":g,...i.style},onPointerEnter:ne(e.onPointerEnter,o.onContentEnter),onPointerLeave:ne(e.onPointerLeave,od(o.onContentLeave))}),Array.from(s.items).map(([f,{ref:d,forceMount:v,...S}])=>{const k=y===f;return b.createElement(ht,{key:f,present:v||k},b.createElement(L2,Y({},S,{ref:Rl(d,C=>{k&&C&&u(C)})})))}))}),n9="FocusGroup",T2=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=zn(n9,n);return b.createElement(Qp.Provider,{scope:n},b.createElement(Qp.Slot,{scope:n},b.createElement(fe.div,Y({dir:i.dir},r,{ref:t}))))}),X1=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],r9="FocusGroupItem",A2=b.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=Nj(n),o=zn(r9,n);return b.createElement(Qp.ItemSlot,{scope:n},b.createElement(fe.button,Y({},r,{ref:t,onKeyDown:ne(e.onKeyDown,a=>{if(["Home","End",...X1].includes(a.key)){let l=i().map(u=>u.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),X1.includes(a.key)){const u=l.indexOf(a.currentTarget);l=l.slice(u+1)}setTimeout(()=>_v(l)),a.preventDefault()}})})))});function Jp(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _v(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function i9(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function Zp(e,t){const n=Be(t);st(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function yv(e){return e?"open":"closed"}function D2(e,t){return`${e}-trigger-${t}`}function P2(e,t){return`${e}-content-${t}`}function od(e){return t=>t.pointerType==="mouse"?e(t):void 0}const $2=zj,O2=Wj,s9=qj,N2=Gj,o9=Yj,I2=Xj,j2=Jj,B2=e9,em=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs($2,{ref:r,className:Q("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,_.jsx(U2,{})]}));em.displayName=$2.displayName;const tm=b.forwardRef(({className:e,...t},n)=>_.jsx(O2,{ref:n,className:Q("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));tm.displayName=O2.displayName;const F2=s9,a9=Si("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:bg-secondary focus:text-secondary-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-secondary/50 data-[state=open]:bg-secondary/50"),z2=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(N2,{ref:r,className:Q(a9(),"group",e),...n,children:[t," ",_.jsx(Ml,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));z2.displayName=N2.displayName;const H2=b.forwardRef(({className:e,...t},n)=>_.jsx(j2,{ref:n,className:Q("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",e),...t}));H2.displayName=j2.displayName;const l9=o9,U2=b.forwardRef(({className:e,...t},n)=>_.jsx("div",{className:Q("absolute left-0 top-full flex justify-center"),children:_.jsx(B2,{className:Q("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",e),ref:n,...t})}));U2.displayName=B2.displayName;const c9=b.forwardRef(({className:e,...t},n)=>_.jsx(I2,{ref:n,className:Q("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",e),...t,children:_.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));c9.displayName=I2.displayName;const[Zd,Sz]=Vt("Tooltip",[qo]),xv=qo(),u9="TooltipProvider",d9=700,nm="tooltip.open",[h9,wv]=Zd(u9),f9=e=>{const{__scopeTooltip:t,delayDuration:n=d9,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[a,s]=b.useState(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const p=c.current;return()=>window.clearTimeout(p)},[]),b.createElement(h9,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),s(!1)},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(p=>{l.current=p},[]),disableHoverableContent:i},o)},bv="Tooltip",[p9,eh]=Zd(bv),m9=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=wv(bv,e.__scopeTooltip),c=xv(t),[p,u]=b.useState(null),m=_n(),g=b.useRef(0),x=a??l.disableHoverableContent,y=s??l.delayDuration,h=b.useRef(!1),[f=!1,d]=Lr({prop:r,defaultProp:i,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(nm))):l.onClose(),o==null||o(R)}}),v=b.useMemo(()=>f?h.current?"delayed-open":"instant-open":"closed",[f]),S=b.useCallback(()=>{window.clearTimeout(g.current),h.current=!1,d(!0)},[d]),k=b.useCallback(()=>{window.clearTimeout(g.current),d(!1)},[d]),C=b.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h.current=!0,d(!0)},y)},[y,d]);return b.useEffect(()=>()=>window.clearTimeout(g.current),[]),b.createElement(Qg,c,b.createElement(p9,{scope:t,contentId:m,open:f,stateAttribute:v,trigger:p,onTriggerChange:u,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayed?C():S()},[l.isOpenDelayed,C,S]),onTriggerLeave:b.useCallback(()=>{x?k():window.clearTimeout(g.current)},[k,x]),onOpen:S,onClose:k,disableHoverableContent:x},n))},Q1="TooltipTrigger",g9=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=eh(Q1,n),o=wv(Q1,n),a=xv(n),s=b.useRef(null),l=Se(t,s,i.onTriggerChange),c=b.useRef(!1),p=b.useRef(!1),u=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),b.createElement(Jg,Y({asChild:!0},a),b.createElement(fe.button,Y({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:ne(e.onPointerMove,m=>{m.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:ne(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:ne(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:ne(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:ne(e.onBlur,i.onClose),onClick:ne(e.onClick,i.onClose)})))}),v9="TooltipPortal",[Cz,_9]=Zd(v9,{forceMount:void 0}),sl="TooltipContent",y9=b.forwardRef((e,t)=>{const n=_9(sl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=eh(sl,e.__scopeTooltip);return b.createElement(ht,{present:r||a.open},a.disableHoverableContent?b.createElement(W2,Y({side:i},o,{ref:t})):b.createElement(x9,Y({side:i},o,{ref:t})))}),x9=b.forwardRef((e,t)=>{const n=eh(sl,e.__scopeTooltip),r=wv(sl,e.__scopeTooltip),i=b.useRef(null),o=Se(t,i),[a,s]=b.useState(null),{trigger:l,onClose:c}=n,p=i.current,{onPointerInTransitChange:u}=r,m=b.useCallback(()=>{s(null),u(!1)},[u]),g=b.useCallback((x,y)=>{const h=x.currentTarget,f={x:x.clientX,y:x.clientY},d=b9(f,h.getBoundingClientRect()),v=S9(f,d),S=C9(y.getBoundingClientRect()),k=E9([...v,...S]);s(k),u(!0)},[u]);return b.useEffect(()=>()=>m(),[m]),b.useEffect(()=>{if(l&&p){const x=h=>g(h,p),y=h=>g(h,l);return l.addEventListener("pointerleave",x),p.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",x),p.removeEventListener("pointerleave",y)}}},[l,p,g,m]),b.useEffect(()=>{if(a){const x=y=>{const h=y.target,f={x:y.clientX,y:y.clientY},d=(l==null?void 0:l.contains(h))||(p==null?void 0:p.contains(h)),v=!k9(f,a);d?m():v&&(m(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,p,a,c,m]),b.createElement(W2,Y({},e,{ref:o}))}),[w9,kz]=Zd(bv,{isInside:!1}),W2=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=eh(sl,n),c=xv(n),{onClose:p}=l;return b.useEffect(()=>(document.addEventListener(nm,p),()=>document.removeEventListener(nm,p)),[p]),b.useEffect(()=>{if(l.trigger){const u=m=>{const g=m.target;g!=null&&g.contains(l.trigger)&&p()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,p]),b.createElement($l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:p},b.createElement(Zg,Y({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),b.createElement(pg,null,r),b.createElement(w9,{scope:n,isInside:!0},b.createElement(l2,{id:l.contentId,role:"tooltip"},i||r))))});function b9(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function S9(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function C9(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function k9(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o].x,l=t[o].y,c=t[a].x,p=t[a].y;l>r!=p>r&&n<(c-s)*(r-l)/(p-l)+s&&(i=!i)}return i}function E9(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),R9(t)}function R9(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const L9=f9,M9=m9,T9=g9,V2=y9,A9=L9,Ni=M9,Ii=T9,ii=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>_.jsx(V2,{ref:r,sideOffset:t,className:Q("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));ii.displayName=V2.displayName;function D9(e,t){const n=qe(Ab),r=vg(),i=jd(),o=a=>{if(e.disabled){a.preventDefault();return}i(),(e.isActive||n)&&(console.log("Page is already active or in error state. Forcing error boundry + router re-render."),r(),a.preventDefault())};return _.jsx(ts,{ref:t,href:e.href,onClick:o,className:e.className,children:e.children})}const Sv=b.forwardRef(D9);function It({href:e,children:t,className:n,disabled:r}){const[i]=kl(e);return r?_.jsxs(Ni,{children:[_.jsx(Ii,{className:"cursor-help",children:_.jsx(Ee,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),_.jsxs(ii,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",_.jsx("br",{}),"to access this page."]})]}):_.jsx(Sv,{href:e,isActive:i,className:Q(Ll({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function rm({href:e,children:t}){const[n]=kl(e);return _.jsx(Sv,{href:e,isActive:n,children:_.jsx("a",{children:t})})}const J1=Si("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:outline-none disabled:pointer-events-none disabled:opacity-50 ring-offset-background  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",{variants:{variant:{default:"hover:bg-primary hover:text-primary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80"}}});function Fr(e){const[t]=kl(e.href);return _.jsx(F2,{children:_.jsx(l9,{asChild:!0,active:t,children:e.disabled?_.jsxs(Ni,{children:[_.jsx(Ii,{className:"cursor-help",children:_.jsx("a",{className:Q(J1({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),_.jsxs(ii,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",_.jsx("br",{}),"to access this page."]})]}):_.jsx(Sv,{href:e.href,isActive:t,className:Q(J1({variant:t?"secondary":"default"}),e.className),children:e.children})})})}function P9(){const{hasPerm:e}=ar();return _.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[_.jsx(em,{children:_.jsxs(tm,{children:[_.jsxs(Fr,{href:"/players",children:["Players",_.jsx(zp,{featName:"newPlayersPage"})]}),_.jsxs(Fr,{href:"/history",children:["History",_.jsx(zp,{featName:"newHistoryPage"})]}),_.jsx(Fr,{href:"/whitelist",children:"Whitelist"}),_.jsx(Fr,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),_.jsx(Fr,{href:"/settings",disabled:!e("settings.view"),children:"Settings"})]})}),_.jsx(em,{children:_.jsx(tm,{children:_.jsxs(F2,{children:[_.jsx(z2,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),_.jsxs(H2,{className:"flex flex-col gap-2 p-4 list-none",children:[_.jsx(Fr,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),_.jsx(Fr,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),_.jsx(Fr,{className:"w-36 justify-start",href:"/system/system-logs",disabled:!e("txadmin.log.view"),children:"System Logs"})]})]})})})]})}const K2="Avatar",[$9,Ez]=Vt(K2),[O9,q2]=$9(K2),N9=b.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=b.useState("idle");return b.createElement(O9,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o},b.createElement(fe.span,Y({},r,{ref:t})))}),I9="AvatarImage",j9=b.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,a=q2(I9,n),s=z9(r),l=Be(c=>{i(c),a.onImageLoadingStatusChange(c)});return st(()=>{s!=="idle"&&l(s)},[s,l]),s==="loaded"?b.createElement(fe.img,Y({},o,{ref:t,src:r})):null}),B9="AvatarFallback",F9=b.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=q2(B9,n),[a,s]=b.useState(r===void 0);return b.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&o.imageLoadingStatus!=="loaded"?b.createElement(fe.span,Y({},i,{ref:t})):null});function z9(e){const[t,n]=b.useState("idle");return st(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,()=>{r=!1}},[e]),t}const G2=N9,Y2=j9,X2=F9,Q2=b.forwardRef(({className:e,...t},n)=>_.jsx(G2,{ref:n,className:Q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Q2.displayName=G2.displayName;const J2=b.forwardRef(({className:e,...t},n)=>_.jsx(Y2,{ref:n,className:Q("aspect-square h-full w-full",e),...t}));J2.displayName=Y2.displayName;const Z2=b.forwardRef(({className:e,...t},n)=>_.jsx(X2,{ref:n,className:Q("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Z2.displayName=X2.displayName;const Z1=["#c67d28","#3d9bf3","#4af34b","#ee59a6","#34f0e0","#b19c9b","#f07891","#6f9a4e","#edb3f5","#ed655f","#59ef9b","#2bfe46","#a3d4f5","#41988e","#a587f6","#b5a626","#bbe5ce","#4da419","#b3f665","#ea5d25","#e19b73","#8e8cbc","#df788c","#f9ae1b","#f475e1","#898d66","#4bbf92","#bcef8e","#a4c791","#ad7895","#3bc359","#dec6dc","#4491bb","#ecccb3","#9fc348","#bc79bd","#a6a055","#b5e925","#ecb155","#7993a0","#eada6e","#f19dbf","#3ec8ea","#85f322","#58956e","#3be4f8","#b77776","#fbc32d","#71c47a","#c57346","#50afbb","#67e7ee","#f04885","#e495f1","#b4bc9f","#ac8455","#b487fb","#ecc23a","#d9b06d","#58f4c7","#ba9def","#71e660","#ce73a5","#f4b2a3","#e68b1a","#f17d59","#53a042","#6bbea6","#c5a1d2","#c6cbf5","#ee7513","#e47774","#839c29","#91b2a8","#8baadc","#e95f7d","#57b2e6","#9dc877","#ed8c4c","#e5b9ba","#90ced4","#ecd19e","#b9bd4f","#22d042","#54ee81","#858c86","#439d5e","#a8b319","#8c91f0","#97f17d","#43a26b","#c89c15","#a9adbd","#e274bd","#85e7bf","#c2a13f","#f14d63","#f1d935","#7bcc69","#d2c977","#e56c9b","#f05b48","#bb73d2","#f0a364","#b2d939","#b38774","#ccd318","#ba8739","#dfb087","#cc9497","#74df32","#5fc32e","#7ba0ec","#b5ac83","#8edcca","#f08c70","#ac91a4","#e47c2d","#8797f3","#2acd7d","#c0e974","#77aa72","#9e8a1a","#49beb7","#b9e5f3","#e36b37","#c4cdca","#848f3c","#e9c0ed","#3e96dc","#cdc98d","#6a8cbe","#a183cd","#87869e","#c68b51","#73ab20","#65b543","#958977","#258eb7","#b782af","#a87d85","#7c8e57","#ec9cab","#e8c25b","#dbc845","#90db22","#db5fbb","#919ad9","#a5b964","#7feea3","#e0b2c6","#779978","#7cd45c","#aca169","#e79b87","#9d8465","#7ab992","#35a633","#46a35a","#96bed5","#d26b3c","#a698b9","#9fc29f","#278dde","#cab0a1","#5f8ce5","#a88e57","#5daacb","#9f8e36","#0ea827","#5e9695","#bbce88","#9de0a6","#eb9ed0","#6de8d8","#8dc957","#d07c76","#8e7dd6","#13edae","#48db29","#ea666f","#a88e4f","#bc8723","#5f9b8f","#94ad74","#df705f","#e480ec","#ce7236","#c37758","#eb8c5e","#ebca7d","#e99b99","#d6d6ee","#f6c823","#977dab","#8491ac","#838e76","#c77e96","#3da27b","#3ab097","#d78d45","#e19adc","#dc4da7","#e9a140","#82dd89","#51bf81","#a9a28c","#aeb1de","#ecae2f","#e9bcb4","#45deac","#47e85d","#76d3ee","#9de053","#da6949","#7ea924"],H9=e=>{e=e.normalize("NFKD").replace(/[\u0300-\u036F]/g,"");let t="";if(/^[A-Z][a-z]*((?:[A-Z][a-z]*)+)$/.test(e)){const n=e.match(/[A-Z]/g);t=n?n.slice(0,2).join(""):"??"}else if(/^[a-z]+([_\-.][a-z]+)+$/.test(e)){const n=e.split(/[_\-.]/);t=n[0][0]+n[1][0]}else{const n=e.replace(/[^a-zA-Z0-9]/g,"");n.length===0?t=e.length?e[0]:"??":n.length<=2?t=n:t=n[0]+n[n.length-1]}return t.toLocaleUpperCase()},U9=e=>{let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Z1[Math.abs(t)%Z1.length]};function e5({username:e,profilePicture:t,className:n}){return _.jsxs(Q2,{className:Q("bg-zinc-200 dark:bg-zinc-800 transition-colors text-zinc-200",n),children:[t&&_.jsx(J2,{src:t,alt:e}),_.jsx(Z2,{className:n,style:{backgroundColor:U9(e)},delayMs:t?1e3:void 0,children:H9(e)})]})}const t5=e=>{document.cookie=`txAdmin-theme=${e};path=/;SameSite=Lax;max-age=31536000;`},Da=window.document.documentElement,n5=window.txConsts.customThemes.map(e=>e.name),W9=window.txConsts.customThemes.map(e=>`theme-${e.name}`),im=["dark","light"],r5=n5.find(e=>Da.classList.contains(`theme-${e}`))??im.find(e=>Da.classList.contains(e))??window.txConsts.defaultTheme,i5=Pe(r5);t5(r5);const sm=(e,t)=>{var i,o;let n;if(Da.classList.remove(...im,...W9),im.includes(t))Da.classList.add(t),n=t;else if(n5.includes(t)){const a=window.txConsts.customThemes.find(l=>l.name===t),s=a!=null&&a.isDark?"dark":"light";Da.classList.add(s,`theme-${t}`),n=s}else throw new Error(`invalid theme ${t}`);const r=(o=(i=document.getElementById("legacyPageIframe"))==null?void 0:i.contentDocument)==null?void 0:o.body;r&&(n==="dark"?r.classList.add("theme--dark"):r.classList.remove("theme--dark")),t5(t),console.log(`Changed theme from '${e}' to '${t}'.`)},s5=()=>{const[e,t]=Ut(i5);return{theme:e,setTheme:r=>{r!==e&&(sm(e,r),t(r))}}},V9=()=>{const e=Ne(i5);return()=>e(t=>t==="dark"?(sm(t,"light"),"light"):t==="light"?(sm(t,"dark"),"dark"):(console.log("invalid theme",t),t))};function o5(e){return lb({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"},child:[]}]})(e)}function Cv({style:e,className:t}){const n=b.useId(),r=b.useId();return _.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1115 288",children:[_.jsxs("mask",{id:n,fill:"#fff",children:[_.jsx("path",{d:"M.42 48.27v191.46C.42 266.39 22.03 288 48.69 288h191.46c26.66 0 48.27-21.61 48.27-48.27V48.27C288.42 21.61 266.81 0 240.15 0H48.69C22.03 0 .42 21.61.42 48.27Zm36.19 106.19.07-106.24c7.96 0 15.15 3.23 20.38 8.44a28.733 28.733 0 0 1 8.43 20.38v38.82h50.46c0 15.42-12.5 27.91-27.91 27.91H65.49v1.7c0 54.78 50.08 53.84 50.08 53.84h22.11l-24.38 28.45c-77.82-1.38-76.69-73.3-76.69-73.3Zm194.47 73.32c-7.44 0-14.5-3.26-19.32-8.92l-6.64-7.81-15.17-17.82-21.81 25.63a25.37 25.37 0 0 1-19.32 8.92h-25.47l24.39-28.47h.16l23.61-27.73-5.01-5.88-42.43-49.84h25.14c7.43 0 14.49 3.26 19.31 8.92l16.46 19.33 4.96 5.83 7.68-9.02 13.75-16.14a25.366 25.366 0 0 1 19.31-8.92h25.14l-29.54 34.7-17.9 21.02 15.17 17.82 32.67 38.38h-25.14Z"}),_.jsx("path",{d:"m310.85 240.677 75.49-180.805a22.205 22.205 0 0 1 20.487-13.65 22.203 22.203 0 0 1 20.486 13.65l75.49 180.805h-36.828l-15.9-38.781h-86.484l-15.901 38.781h-36.84Zm63.603-67.51h64.723l-32.361-79.23-32.362 79.23Z"}),_.jsx("path",{d:"M616.61 120.438V68.424c0-12.256 9.934-22.202 22.202-22.202h11.279v152.041c0 11.994 2.787 16.46 10.327 16.46 1.953 0 4.466-.274 6.98-.559v27.061c-3.621 1.393-9.207 2.227-16.461 2.227-8.087 0-14.507-1.393-19.534-4.466-6.134-4.181-10.04-9.767-11.434-17.021C610.202 236.746 594.027 244 571.707 244c-19.808 0-36.542-6.98-50.216-21.201-13.387-14.233-20.081-31.528-20.081-52.443 0-20.927 6.694-38.222 20.081-52.169 13.674-14.233 30.408-21.201 50.216-21.201 22.583.024 39.603 10.064 44.903 23.452Zm-10.04 80.624c8.373-8.088 12.553-18.414 12.553-30.682 0-12.28-4.18-22.595-12.553-30.682-8.088-8.088-18.415-12.28-30.409-12.28s-21.76 4.18-29.848 12.28c-7.813 8.087-11.72 18.414-11.72 30.682 0 12.28 3.907 22.594 11.72 30.682 8.088 8.087 17.854 12.28 29.848 12.28s22.321-4.193 30.409-12.28Z"}),_.jsx("path",{d:"M680.5 240.677V122.272c0-12.256 9.933-22.201 22.201-22.201h11.006v20.081c5.86-13.673 19.807-22.88 37.661-22.88 19.248 0 32.636 8.087 39.615 24.548 8.088-16.461 23.155-24.548 45.19-24.548 30.408 0 47.988 21.487 47.988 56.349v44.356c0 10.874 1.953 14.781 9.481 14.781l4.609-.012c.072 0 .131.06.131.131v27.49c-3.346 1.12-8.087 1.68-14.507 1.68-22.035 0-32.921-12.28-32.921-36.828V158.35c0-19.248-8.933-31.242-24.548-31.242-15.615 0-27.061 13.674-27.061 32.635v80.898h-33.207v-82.303c0-19.248-9.207-31.242-25.108-31.242-15.627 0-27.335 13.674-27.335 32.636v80.897H680.5v.048Z"}),_.jsx("path",{d:"M907.304 63.898c-.048-10.077 7.789-18.664 17.806-19.772 11.887-1.31 22.095 7.754 22.095 19.677 0 11.16-8.933 19.807-19.808 19.807-11.136 0-20.046-8.6-20.093-19.712Zm25.548 36.173h11.28v98.752c0 10.874 2.227 14.781 9.766 14.781 2.514 0 4.467-.274 5.861-.56v28.181c-3.347 1.393-8.934 2.227-16.735 2.227-21.487 0-32.361-11.994-32.361-35.708V122.26c-.012-12.244 9.933-22.189 22.189-22.189Z"}),_.jsx("path",{d:"M972.3 240.677V122.272c0-12.256 9.934-22.201 22.202-22.201h11.008v20.081c6.69-13.673 22.32-22.88 42.13-22.88 33.19 0 52.44 21.487 52.44 56.349v44.356c0 10.874 1.95 14.781 9.48 14.781l4.61-.012c.07 0 .13.06.13.131v27.49c-3.91 1.12-8.65 1.68-14.51 1.68-22.03 0-32.92-12.28-32.92-36.828V158.35c0-19.248-10.87-31.242-29.57-31.242-18.69 0-31.8 13.388-31.8 32.635v80.898h-33.2v.036Z"})]}),_.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),_.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[_.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),_.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function K9({style:e,className:t}){const n=b.useId(),r=b.useId();return _.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 288 288",children:[_.jsx("mask",{id:n,fill:"#fff",children:_.jsx("path",{d:"M-.46 48.21v191.46c0 26.66 21.61 48.27 48.27 48.27h191.46c26.66 0 48.27-21.61 48.27-48.27V48.21c0-26.66-21.61-48.27-48.27-48.27H47.81C21.15-.06-.46 21.55-.46 48.21ZM35.73 154.4l.07-106.24c7.96 0 15.15 3.23 20.38 8.44a28.735 28.735 0 0 1 8.43 20.38v38.82h50.46c0 15.42-12.5 27.91-27.91 27.91H64.61v1.7c0 54.78 50.08 53.84 50.08 53.84h22.11l-24.38 28.45c-77.82-1.38-76.69-73.3-76.69-73.3Zm194.47 73.32c-7.44 0-14.5-3.26-19.32-8.92l-6.64-7.81-15.17-17.82-21.81 25.63a25.365 25.365 0 0 1-19.32 8.92h-25.47l24.39-28.47h.16l23.61-27.73-5.01-5.88-42.43-49.84h25.14c7.43 0 14.49 3.26 19.31 8.92l16.46 19.33 4.96 5.83 7.68-9.02 13.75-16.14a25.366 25.366 0 0 1 19.31-8.92h25.14l-29.54 34.7-17.9 21.02 15.17 17.82 32.67 38.38H230.2Z"})}),_.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),_.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[_.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),_.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function q9(){const e=qe(Dd),t=qe(Eb);return _.jsxs("div",{className:"flex justify-start",children:[_.jsx("h1",{className:"line-clamp-1 text-base break-all",children:t}),_.jsxs("span",{children:[": ",_.jsx("span",{className:"font-mono",title:"players connected",children:e})]})]})}const kv=`h-11 w-11 sm:h-10 sm:min-w-max sm:px-2 lg:px-3
    flex justify-center items-center gap-2
    transition-all ring-offset-background 
    focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
    rounded-md text-sm border
   
    bg-zinc-100 hover:bg-zinc-200 border-zinc-200
    dark:bg-zinc-900 dark:hover:bg-zinc-800 dark:border-zinc-800
`;function G9({className:e}){const{setIsSheetOpen:t}=cS();return _.jsxs("button",{className:Q(kv,e),title:"Server Menu",onClick:()=>t(!0),children:[_.jsx(RL,{className:"h-6 w-6 sm:h-5 sm:w-5"}),_.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function Y9({className:e}){const{setIsSheetOpen:t}=lS();return _.jsxs("button",{className:Q(kv,e),title:"Global Menu",onClick:()=>t(!0),children:[_.jsx(EL,{className:"h-6 w-6 sm:h-5 sm:w-5"}),_.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function X9({className:e}){const{setIsSheetOpen:t}=uS(),n=qe(Dd);return _.jsxs("button",{className:Q(kv,e),title:"Global Menu",onClick:()=>t(!0),children:[_.jsx(TL,{className:"h-6 w-6 sm:h-5 sm:w-5"}),_.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",_.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function Q9(){const{authData:e,logout:t}=us(),{theme:n,setTheme:r}=s5(),{setAccountModalOpen:i}=kg();if(!e)return null;const o=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},s=()=>{Io("https://discord.gg/uAmsGa2")},l=()=>{t.mutate()};return _.jsxs(Xs,{children:[_.jsxs(Qs,{className:"flex flex-row items-center gap-2 sm:gap-3 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",children:[_.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),_.jsx(e5,{className:`w-11 h-11 sm:w-10 sm:h-10 rounded-md text-2xl 
                        transition-all focus-visible:outline-none
                        hover:border-zinc-500 hover:border`,username:e.name,profilePicture:e.profilePicture})]}),_.jsxs(Gi,{children:[_.jsxs(Zn,{className:"cursor-pointer",onClick:o,children:[_.jsxs("span",{className:"hidden dark:flex items-center",children:[_.jsx(VL,{className:"mr-2 h-4 w-4"}),"Light Mode"]}),_.jsxs("span",{className:"flex dark:hidden items-center",children:[_.jsx(LL,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})]}),_.jsxs(Zn,{className:"cursor-pointer",onClick:a,children:[_.jsx(wL,{className:"mr-2 h-4 w-4"}),"Your Account"]}),_.jsxs(Zn,{className:"cursor-pointer",onClick:s,children:[_.jsx(o5,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&_.jsxs(_.Fragment,{children:[_.jsx(Js,{}),_.jsxs(Zn,{className:"cursor-pointer",onClick:l,children:[_.jsx(SL,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function J9(){return _.jsx("header",{className:`sticky top-0 z-20 flex flex-col items-center justify-center
            border-b bg-card text-card-foreground border-card-background`,children:_.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[_.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[_.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:_.jsx(rm,{href:"/",children:_.jsx(Cv,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),_.jsx(rm,{href:"/",children:_.jsx(K9,{className:"h-8 w-8 lg:h-10 lg:w-10 hidden sm:max-xl:block hover:scale-105 hover:brightness-110"})}),_.jsx("div",{className:"lg:hidden",children:_.jsx(q9,{})}),_.jsx("nav",{className:"hidden lg:block flex-grow",children:_.jsx(P9,{})})]}),_.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[_.jsx(G9,{className:"lg:hidden"}),_.jsx(Y9,{className:"lg:hidden"}),_.jsx(X9,{className:"xl:hidden"}),_.jsx(Q9,{})]})]})})}function Z9(){return qe(Eb)}function eB({pendingStep:e}){const[t]=Cl(),[n,r]=b.useState(""),i=b.useRef("");return b.useEffect(()=>{let o="";if(e==="setup"&&!t.startsWith("/server/setup")?(o="/server/setup",i.current="Go to the setup page!"):e==="deployer"&&!t.startsWith("/server/deployer")?(o="/server/deployer",i.current="Go to the deployer page!"):o="",o){const a=setTimeout(()=>{r(o)},500);return()=>clearTimeout(a)}else{r("");return}},[t,e]),_.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[_.jsx(xL,{className:"h-12 w-12 opacity-75 animate-pulse"}),_.jsx("p",{className:"text-center text-lg tracking-wider font-light opacity-75",children:"You need to configure your server to be able to start it."}),n?_.jsx(Mo,{href:n,className:"animate-toastbar-enter",children:i.current}):_.jsx(Mo,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||_.jsx(_.Fragment,{children:" "})})]})}function tB(){const e=qe(Rb),{hasPerm:t}=ar();return _.jsxs("div",{className:"relative",children:[e&&_.jsx(eB,{pendingStep:e}),_.jsxs("div",{className:Q(e&&"opacity-0 pointer-events-none"),children:[_.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight overflow-hidden text-ellipsis",children:_.jsx(Z9,{})}),_.jsxs("div",{className:"space-y-1 select-none",children:[_.jsxs(It,{href:"/",children:[_.jsx(bL,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),_.jsxs(It,{href:"/server/console",disabled:!t("console.view"),children:[_.jsx(oL,{className:"mr-2 h-4 w-4"}),"Live Console"]}),_.jsxs(It,{href:"/server/resources",children:[_.jsx(tL,{className:"mr-2 h-4 w-4"}),"Resources"]}),_.jsxs(It,{href:"/server/server-log",children:[_.jsx(pL,{className:"mr-2 h-4 w-4"}),"Server Log"]}),_.jsxs(It,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[_.jsx(gL,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&_.jsxs(It,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[_.jsx(fL,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function nB({style:e}){return _.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:_.jsx("path",{d:"M18.97 18.35a3.076 3.076 0 0 1-3.42 3.4h-7.1a4.075 4.075 0 0 1-1.529-.25.75.75 0 1 1 .558-1.4 2.679 2.679 0 0 0 .971.146h7.1c1.363 0 1.92-.55 1.92-1.9a3.42 3.42 0 0 0-3.4-3.7.748.748 0 0 1-.714-.783.768.768 0 0 1 .783-.715 4.872 4.872 0 0 1 4.831 5.202zm-12.67.407L2.53 22.53a.75.75 0 0 1-1.06-1.06l3.579-3.579a4.81 4.81 0 0 1 4.721-4.722l1.486-1.485a3.755 3.755 0 1 1 4.428-4.428l2.95-2.95a1.407 1.407 0 0 0-1.124-.556 1.345 1.345 0 0 0-.947.367.75.75 0 1 1-1.046-1.074 2.832 2.832 0 0 1 1.993-.793 2.9 2.9 0 0 1 2.184 1l1.776-1.78a.75.75 0 0 1 1.06 1.06L6.3 18.756zm6.55-8.667 1.24-1.24a2.29 2.29 0 0 0 .17-.84 2.255 2.255 0 1 0-2.25 2.25 2.29 2.29 0 0 0 .84-.17zm5.94-1.41h-.22a.75.75 0 0 0 0 1.5h.22a2.261 2.261 0 0 1 2.46 2.47c0 .864-.309 1.17-1.18 1.17h-.36a.75.75 0 0 0 0 1.5h.36a2.435 2.435 0 0 0 2.68-2.67 3.76 3.76 0 0 0-3.96-3.97zM5.922 8.035a.75.75 0 1 0 .3-1.471A1.421 1.421 0 0 1 6.51 3.75a1.386 1.386 0 0 1 .956.375.749.749 0 0 0 1.029-1.09A2.875 2.875 0 0 0 6.51 2.25a2.922 2.922 0 0 0-.588 5.785zM3.93 15.32h.35a.75.75 0 1 0 0-1.5h-.35c-.871 0-1.18-.306-1.18-1.17a2.261 2.261 0 0 1 2.46-2.47h.99a.75.75 0 0 0 0-1.5h-.99a3.726 3.726 0 0 0-3.96 3.97 2.435 2.435 0 0 0 2.68 2.67z"})})}function rB({style:e}){return _.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:_.jsx("path",{d:"M19.75 18.02c0 2.405-1.332 3.73-3.75 3.73H8a4.932 4.932 0 0 1-1.072-.108.75.75 0 1 1 .324-1.464A3.555 3.555 0 0 0 8 20.25h8c1.577 0 2.25-.667 2.25-2.23a3.954 3.954 0 0 0-3.411-4.22.75.75 0 1 1 .2-1.486 5.422 5.422 0 0 1 4.711 5.706zm1.78-14.49-19 19a.75.75 0 0 1-1.06-1.06l2.842-2.843a4.87 4.87 0 0 1-.062-.607c0-2.662 1.506-5.77 5.75-5.77h.689l1.521-1.52c-.068 0-.132.02-.2.02a4.25 4.25 0 1 1 4.25-4.25c0 .069-.017.133-.02.2l4.23-4.23a.75.75 0 0 1 1.06 1.06zm-9.521 5.72a2.75 2.75 0 1 0-2.75-2.75 2.753 2.753 0 0 0 2.75 2.75zm-6.18 7.861 3.293-3.293a3.7 3.7 0 0 0-3.293 3.293z"})})}const ca=Si(`h-10 sm:h-8 rounded-md transition-colors
    flex flex-grow items-center justify-center flex-shrink-0
    border bg-muted shadow-sm

    focus:outline-none disabled:opacity-50 ring-offset-background  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,{variants:{type:{default:"hover:bg-primary hover:text-primary-foreground hover:border-primary",destructive:"hover:bg-destructive hover:text-destructive-foreground hover:border-destructive",warning:"hover:bg-warning hover:text-warning-foreground hover:border-warning",success:"hover:bg-success hover:text-success-foreground hover:border-success",info:"hover:bg-info hover:text-info-foreground hover:border-info"}},defaultVariants:{type:"default"}});function iB(){const e=qe(Rb),t=qe(BR),n=z8(),r=Id(),i=jd(),{hasPerm:o}=ar(),a=vt({method:"POST",path:"/fxserver/controls"}),s=vt({method:"POST",path:"/fxserver/commands"}),l=y=>{const h={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},f=`${h[y]}...`,d=()=>{i(),a({data:{action:y},toastLoadingMessage:f})};y==="start"?d():n({title:h[y],message:`Are you sure you want to ${y} the server?`,onConfirm:d})},c=()=>{l(t?"stop":"start")},p=()=>{t&&l("restart")},u=()=>{t&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:y=>{i(),s({data:{action:"admin_broadcast",parameter:y},toastLoadingMessage:"Sending announcement..."})}})},m=()=>{t&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:y=>{i(),s({data:{action:"kick_all",parameter:y},toastLoadingMessage:"Kicking players..."})}})},g=o("control.server"),x=o("players.message");return e?_.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):_.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[_.jsxs(Ni,{children:[_.jsx(Ii,{asChild:!0,children:t?_.jsx("button",{onClick:c,className:ca({type:"destructive"}),disabled:!g,children:_.jsx(OL,{className:"h-5"})}):_.jsxs("div",{className:"relative flex flex-grow inset-0",children:[_.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),_.jsx("button",{onClick:c,className:Q(ca({type:"success"}),"relative"),disabled:!g,children:_.jsx(NL,{className:"h-5"})})]})}),_.jsx(ii,{className:Q(!g&&"text-destructive-inline text-center"),children:g?_.jsx("p",{children:t?"Stop the server":"Start the server! 🚀"}):_.jsxs("p",{children:["You do not have permission ",_.jsx("br",{}),"to control the server."]})})]}),_.jsxs(Ni,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx("button",{onClick:p,className:Q(ca({type:"warning"})),disabled:!g||!t,children:_.jsx(jL,{className:"h-5"})})}),_.jsx(ii,{className:Q(!g&&"text-destructive-inline text-center"),children:g?_.jsx("p",{children:"Restart Server"}):_.jsxs("p",{children:["You do not have permission ",_.jsx("br",{}),"to control the server."]})})]}),_.jsxs(Ni,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx("button",{onClick:m,className:ca(),disabled:!g||!t,children:_.jsx(nB,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),_.jsx(ii,{className:Q(!g&&"text-destructive-inline text-center"),children:g?_.jsx("p",{children:"Kick All Players"}):_.jsxs("p",{children:["You do not have permission ",_.jsx("br",{}),"to control the server."]})})]}),_.jsxs(Ni,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx("button",{onClick:u,className:ca(),disabled:!x||!t,children:_.jsx(kL,{className:"h-5"})})}),_.jsx(ii,{className:Q(!x&&"text-destructive-inline text-center"),children:x?_.jsx("p",{children:"Send Announcement"}):_.jsxs("p",{children:["You do not have permission ",_.jsx("br",{}),"to send an Announcement."]})})]})]})}const sB=Si("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center cursor-help",{variants:{type:{default:"bg-secondary text-secondary-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning text-warning-foreground",success:"bg-success text-success-foreground",info:"bg-info text-info-foreground",muted:"bg-muted text-muted-foreground"}},defaultVariants:{type:"default"}});function $c({children:e,tooltip:t,type:n}){return _.jsxs(Ni,{children:[_.jsx(Ii,{asChild:!0,children:_.jsx("span",{className:sB({type:n}),children:e})}),_.jsx(ii,{side:"right",children:_.jsx("p",{children:t})})]})}const ey=["READY","CONNECTING","RECONNECTING","IDLE","NEARLY","DISCONNECTED","WAITING_FOR_GUILDS","IDENTIFYING","RESUMING"];function oB(){const e=Lb();let t="--",n="--",r="default",i="--",o="--",a="default",s="--",l="--",c="default";return e&&(t=e.server.status,e.server.status==="ONLINE"?(r="success",n="Resources running, accepting connections."):e.server.status==="PARTIAL"?(r="warning",n="Resources not running or not accepting connections."):e.server.status==="OFFLINE"?(r="destructive",n="Server is offline."):(r="destructive",n="Unknown server status."),e.server.whitelist==="disabled"?(i="DISABLED",o="Anyone can join."):e.server.whitelist==="adminOnly"?(i="ADMIN",a="warning",o="Only admins can join."):e.server.whitelist==="guildMember"?(i="MEMBER",o="Only guild members can join."):e.server.whitelist==="guildRoles"?(i="ROLE",o="Only guild members with the specified roles can join."):e.server.whitelist==="approvedLicense"&&(i="LICENSE",o="Only players with an approved license can join."),e.discord===!1?(s="DISABLED",c="default",l="Discord bot is disabled."):e.discord===0?(s="READY",c="default",l="Discord bot is ready."):(s=`CODE-${e.discord}`,c="destructive",l=ey[e.discord]?`Bot ws status: ${ey[e.discord]}`:"Unknown status code")),_.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[_.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",_.jsx($c,{tooltip:n,type:r,children:t})]}),_.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Process:",_.jsx($c,{tooltip:"Status of the FXServer process.",children:(e==null?void 0:e.server.process.toUpperCase())??"--"})]}),_.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Whitelist:",_.jsx($c,{tooltip:o,type:a,children:i})]}),_.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",_.jsx($c,{tooltip:l,type:c,children:s})]})]})}const a5=Intl.DateTimeFormat().resolvedOptions().timeZone,aB=_.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",_.jsx("b",{children:window.txConsts.serverTimezone})," ",_.jsx("br",{}),"Your timezone: ",_.jsx("b",{children:a5})," ",_.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),ty={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:_.jsxs(_.Fragment,{children:[_.jsxs("p",{children:["Possible formats: ",_.jsx("br",{}),_.jsxs("ul",{className:"list-disc ml-4",children:[_.jsxs("li",{children:[_.jsx($n,{children:"+MM"})," relative time in minutes (example: ",_.jsx($n,{children:"+15"})," for 15 minutes from now.)"]}),_.jsxs("li",{children:[_.jsx($n,{children:"HH:MM"})," absolute 24-hour time (example: ",_.jsx($n,{children:"23:30"})," for 11:30 PM.)"]})]})]}),a5!==window.txConsts.serverTimezone&&aB]}),placeholder:"+15",required:!0,isWide:!0},lB=e=>{if(e.startsWith("+")){const t=parseInt(e.substring(1));if(isNaN(t)||t<1||t>=1440)return!1}else{const[t,n]=e.split(":",2).map(r=>parseInt(r));if(typeof t>"u"||isNaN(t)||t<0||t>23||typeof n>"u"||isNaN(n)||n<0||n>59)return!1}return!0};function cB(){const e=jd(),t=Id(),{hasPerm:n}=ar(),r=vt({method:"POST",path:"/fxserver/schedule"}),i=Lb();if(!i)return _.jsxs("div",{children:[_.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),_.jsx("span",{className:"font-light text-muted-foreground italic",children:"loading..."})]});const{scheduler:o}=i;let a="nothing scheduled",s="text-muted-foreground italic",l=!1,c=!1,p=!1;const u=typeof o.nextRelativeMs=="number";if(u){const d=o.nextIsTemp?"(temp)":"",v=Pu(o.nextRelativeMs,{units:["h","m"]}),S=o.nextRelativeMs<6e4;S?(l=!0,a=`right now ${d}`):a=`in ${v} ${d}`,o.nextSkip?(s="text-muted-foreground line-through",S||(p=!0)):(s="text-warning-inline",S||(c=!0))}const m=d=>{if(e(),d.includes(",")){Ct.error({title:"Invalid scheduled restart time.",msg:`It looks like you are trying to schedule multiple restart times, which can only be done the Settings page.
This input is for just the next (not persistent) restart.`},{duration:1e4});return}if(!lB(d)){Ct.error(`Invalid schedule time: ${d}`);return}r({data:{action:"setNextTempSchedule",parameter:d},toastLoadingMessage:"Scheduling server restart..."})},g=()=>{t({...ty,onSubmit:m,submitLabel:"Edit"})},x=()=>{t({...ty,onSubmit:m,submitLabel:"Schedule"})},y=()=>{e(),r({data:{action:"setNextSkip",parameter:!0},toastLoadingMessage:"Cancelling next server restart..."})},h=()=>{e(),r({data:{action:"setNextSkip",parameter:!1},toastLoadingMessage:"Enabling next server restart..."})},f=n("control.server");return _.jsxs("div",{children:[_.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),_.jsx("span",{className:Q("font-light",s),children:a}),_.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[u?_.jsxs(Ee,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!f||l,onClick:g,children:[_.jsx(ML,{className:"h-4 w-4 mr-1"})," Edit"]}):_.jsxs(Ee,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!f||l,onClick:x,children:[_.jsx(PL,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),c&&_.jsxs(Ee,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:y,disabled:!f,children:[_.jsx(XL,{className:"h-4 w-4 mr-1"})," Cancel"]}),p&&_.jsxs(Ee,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:h,disabled:!f,children:[_.jsx(DL,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}function l5({isSheet:e}){return _.jsxs("aside",{className:Q("flex flex-col gap-4 z-10",e?"mr-4 pl-2":"tx-sidebar hidden lg:flex"),children:[_.jsx("div",{className:Q(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4"),children:_.jsx(tB,{})}),_.jsx("hr",{className:e?"block":"hidden"}),_.jsxs("div",{className:Q(!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[_.jsx(iB,{}),_.jsx(oB,{}),_.jsx(cB,{})]}),_.jsx("hr",{className:e?"block":"hidden"}),window.txConsts.adsData.main?_.jsxs("a",{href:window.txConsts.adsData.main.url,onClick:Xa,target:"_blank",className:`w-sidebar h-[80px] relative self-center group shadow-sm opacity-80 hover:opacity-100
                    dark:brightness-90 dark:hover:brightness-100`,children:[_.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                    scale-0 group-hover:scale-100 transition-transform bg-black
                    dark:bg-gradient-to-r dark:from-[#18E889] dark:to-[#01FFFF]`}),_.jsx("img",{className:"rounded-xl max-w-sidebar max-h-[80px] m-auto",src:window.txConsts.adsData.main.img})]}):null,window.txConsts.isWebInterface?_.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:[_.jsxs("span",{className:"text-muted-foreground text-smx",children:["tx: ",_.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",_.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]}),_.jsxs("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",onClick:Xa,target:"_blank",className:"text-muted-foreground hover:text-accent",children:["© 2019-",new Date().getUTCFullYear()," Tabarra"]})]}):null]})}function uB(){const t=qe(Dd).toLocaleString("en-US");return _.jsxs("div",{className:"w-full flex justify-between items-center",children:[_.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:_.jsx(bg,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),_.jsxs("div",{className:"flex flex-col items-end",children:[_.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),_.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const dB=e=>{let t=e.substring(0,75).replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF\u200E\uA9C1-\uA9C5\u239B-\u23AD]/g,"").replace(/~(HUD_\S+|HC_\S+|[a-z]|[a1]_\d+|bold|italic|ws|wanted_star|nrt|EX_R\*|BLIP_\S+|ACCEPT|CANCEL|PAD_\S+|INPUT_\S+|INPUTGROUP_\S+)~/ig,"").replace(/\^\d/ig,"").replace(new RegExp("\\p{Mark}{2,}","ug"),"").replace(/\s+/g," ").trim();t.length||(t="empty name");let n=t.normalize("NFKC").replace(/[^\p{Letter}\p{Number} ]/gu,"").replace(/\s+/g,"").toLocaleLowerCase().trim();return n.length||(n="emptyname"),{displayName:t,pureName:n}};function hB({filterString:e,setFilterString:t}){const n=b.useRef(null);return Er("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),_.jsx("div",{className:"pt-2 px-2 flex gap-2",children:_.jsxs("div",{className:"relative w-full",children:[_.jsx(it,{ref:n,className:"h-8",placeholder:"Filter by Name or ID",value:e,onChange:r=>t(r.target.value),onKeyDown:r=>{r.key==="Escape"&&t("")}}),e?_.jsx("button",{className:"absolute right-2 inset-y-0 text-zinc-500 dark:text-zinc-400 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-lg",onClick:()=>t(""),children:_.jsx($r,{})}):_.jsx("div",{className:"absolute right-2 inset-y-0 flex items-center text-zinc-500 dark:text-zinc-400 select-none pointer-events-none",children:_.jsx($n,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const fB=b.memo(hB);function pB({virtualItem:e,player:t,modalOpener:n}){return _.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[_.jsx("div",{className:"pid-block leading-[1.7]",children:_.jsx("span",{className:"pid-badge",children:t.netid})}),_.jsx("span",{className:"pname",children:t.displayName})]})}function mB(){const e=qe(gg),t=qe(Mb),n=Fd(),r=b.useRef(null),[i,o]=b.useState(""),a=b.useMemo(()=>{const u=dB(i).pureName;return u!=="emptyname"?e.filter(m=>m.pureName.includes(u)||m.netid.toString().includes(u)):e},[e,i]),s=b.useMemo(()=>{var g;const u=((g=e.at(-1))==null?void 0:g.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(u))+1+1}ch; }`},[e]),l=uv({scrollingDelay:0,count:a.length,getScrollElement:()=>{var u;return(u=r.current)==null?void 0:u.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),c=l.getVirtualItems(),p=u=>{t&&n({mutex:t,netid:u})};return _.jsxs(_.Fragment,{children:[_.jsx(fB,{filterString:i,setFilterString:o}),_.jsxs("div",{className:Q("text-center m-1 text-warning-inline tracking-wider italic text-xs",a.length!==e.length&&c.length?"block":"hidden"),children:["Showing ",a.length," of ",e.length," players."]}),_.jsx("div",{className:Q("text-center m-6 text-muted-foreground tracking-wider italic",c.length?"hidden":"block"),children:e.length&&i?_.jsxs("p",{children:["No players to show.",_.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):_.jsxs("p",{children:["No players online.",_.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),_.jsx("style",{children:s}),_.jsx(Bn,{className:"h-full select-none",ref:r,children:_.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:c.map(u=>_.jsx(pB,{virtualItem:u,player:a[u.index],modalOpener:p},u.key))})})]})}function c5({isSheet:e}){return _.jsxs("aside",{className:Q("flex flex-col gap-4 z-10",e?"w-full pr-2":"tx-sidebar hidden xl:flex"),style:{height:e?"calc(100vh - 3rem)":"calc(100vh - 3.5rem - 1px - 2rem)"},children:[_.jsx("div",{className:"rounded-xl border border-border bg-card text-card-foreground shadow-sm shrink-0 p-4",children:_.jsx(uB,{})}),_.jsx("div",{className:Q("min-h-[480px]",!e&&"rounded-xl border border-border bg-card text-card-foreground shadow-sm","flex flex-col gap-2 flex-grow overflow-hidden"),children:_.jsx(mB,{})})]})}const u5="Dialog",[d5,h5]=Vt(u5),[gB,lr]=d5(u5),vB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=b.useRef(null),l=b.useRef(null),[c=!1,p]=Lr({prop:r,defaultProp:i,onChange:o});return b.createElement(gB,{scope:t,triggerRef:s,contentRef:l,contentId:_n(),titleId:_n(),descriptionId:_n(),open:c,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(u=>!u),[p]),modal:a},n)},f5="DialogPortal",[_B,p5]=d5(f5,{forceMount:void 0}),yB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=lr(f5,t);return b.createElement(_B,{scope:t,forceMount:n},b.Children.map(r,a=>b.createElement(ht,{present:n||o.open},b.createElement(ev,{asChild:!0,container:i},a))))},om="DialogOverlay",xB=b.forwardRef((e,t)=>{const n=p5(om,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=lr(om,e.__scopeDialog);return o.modal?b.createElement(ht,{present:r||o.open},b.createElement(wB,Y({},i,{ref:t}))):null}),wB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=lr(om,n);return b.createElement(rv,{as:mi,allowPinchZoom:!0,shards:[i.contentRef]},b.createElement(fe.div,Y({"data-state":v5(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Ao="DialogContent",bB=b.forwardRef((e,t)=>{const n=p5(Ao,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=lr(Ao,e.__scopeDialog);return b.createElement(ht,{present:r||o.open},o.modal?b.createElement(SB,Y({},i,{ref:t})):b.createElement(CB,Y({},i,{ref:t})))}),SB=b.forwardRef((e,t)=>{const n=lr(Ao,e.__scopeDialog),r=b.useRef(null),i=Se(t,n.contentRef,r);return b.useEffect(()=>{const o=r.current;if(o)return nv(o)},[]),b.createElement(m5,Y({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,o=>o.preventDefault())}))}),CB=b.forwardRef((e,t)=>{const n=lr(Ao,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return b.createElement(m5,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a;if((a=e.onCloseAutoFocus)===null||a===void 0||a.call(e,o),!o.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var a,s;(a=e.onInteractOutside)===null||a===void 0||a.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),m5=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=lr(Ao,n),l=b.useRef(null),c=Se(t,l);return Ug(),b.createElement(b.Fragment,null,b.createElement(Wg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},b.createElement($l,Y({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":v5(s.open)},a,{ref:c,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),g5="DialogTitle",kB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=lr(g5,n);return b.createElement(fe.h2,Y({id:i.titleId},r,{ref:t}))}),EB="DialogDescription",RB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=lr(EB,n);return b.createElement(fe.p,Y({id:i.descriptionId},r,{ref:t}))}),LB="DialogClose",MB=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=lr(LB,n);return b.createElement(fe.button,Y({type:"button"},r,{ref:t,onClick:ne(e.onClick,()=>i.onOpenChange(!1))}))});function v5(e){return e?"open":"closed"}const TB="DialogTitleWarning",[AB,Rz]=rR(TB,{contentName:Ao,titleName:g5,docsSlug:"dialog"}),Ev=vB,Rv=yB,Bl=xB,Fl=bB,zl=kB,Hl=RB,th=MB,Lv=Ev,DB=Rv,_5=b.forwardRef(({className:e,...t},n)=>_.jsx(Bl,{className:Q("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));_5.displayName=Bl.displayName;const PB=Si("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),nh=b.forwardRef(({side:e="right",className:t,children:n,...r},i)=>_.jsxs(DB,{children:[_.jsx(_5,{}),_.jsxs(Fl,{ref:i,className:Q(PB({side:e}),t),...r,children:[n,_.jsxs(th,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[_.jsx($r,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));nh.displayName=Fl.displayName;const y5=({className:e,...t})=>_.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});y5.displayName="SheetHeader";const x5=b.forwardRef(({className:e,...t},n)=>_.jsx(zl,{ref:n,className:Q("text-lg font-semibold text-foreground",e),...t}));x5.displayName=zl.displayName;const $B=b.forwardRef(({className:e,...t},n)=>_.jsx(Hl,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));$B.displayName=Hl.displayName;function OB(){const{isSheetOpen:e,setIsSheetOpen:t}=lS(),{hasPerm:n}=ar();return _.jsx(Lv,{open:e,onOpenChange:t,children:_.jsxs(nh,{side:"left",className:"flex flex-col gap-6 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:[_.jsx(y5,{children:_.jsx(x5,{children:_.jsx(rm,{href:"/",children:_.jsx(Cv,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),_.jsxs("div",{children:[_.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsxs(It,{href:"/players",children:[_.jsx(bg,{className:"mr-2 h-4 w-4"}),"Players"]}),_.jsxs(It,{href:"/history",children:[_.jsx(BL,{className:"mr-2 h-4 w-4"}),"History"]}),_.jsxs(It,{href:"/whitelist",children:[_.jsx(dL,{className:"mr-2 h-4 w-4"}),"Whitelist"]}),_.jsxs(It,{href:"/admins",disabled:!n("manage.admins"),children:[_.jsx(HL,{className:"mr-2 h-4 w-4"}),"Admins"]}),_.jsxs(It,{href:"/settings",disabled:!n("settings.view"),children:[_.jsx(zL,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),_.jsxs("div",{children:[_.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsxs(It,{href:"/system/master-actions",children:[_.jsx(QL,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),_.jsxs(It,{href:"/system/diagnostics",children:[_.jsx(AL,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),_.jsxs(It,{href:"/system/system-logs",disabled:!n("txadmin.log.view"),children:[_.jsx(wg,{className:"mr-2 h-4 w-4"}),"System Logs"]})]})]})]})})}function NB(){const{isSheetOpen:e,setIsSheetOpen:t}=cS();return _.jsx(Lv,{open:e,onOpenChange:t,children:_.jsx(nh,{side:"left",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:_.jsx(Bn,{className:"h-full",children:_.jsx(l5,{isSheet:!0})})})})}function IB(){const{isSheetOpen:e,setIsSheetOpen:t}=uS();return _.jsx(Lv,{open:e,onOpenChange:t,children:_.jsx(nh,{side:"right",className:"w-full xs:w-3/4",onOpenAutoFocus:n=>n.preventDefault(),children:_.jsx(Bn,{className:"h-full",children:_.jsx(c5,{isSheet:!0})})})})}function jB(){return _.jsxs(_.Fragment,{children:[_.jsx(OB,{}),_.jsx(NB,{}),_.jsx(IB,{})]})}const w5=Pe(!1),b5=Pe(window.txConsts.fxsOutdated),S5=Pe(window.txConsts.txaOutdated);function BB(){const[e,t]=Ut(w5),[n,r]=Ut(b5),[i,o]=Ut(S5);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:o}}const FB=()=>Ne(w5),zB=()=>{const e=Ne(b5),t=Ne(S5);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},C5="tsUpdateDismissed",HB=12*60*60*1e3,UB=48*60*60*1e3,WB=()=>{const e=localStorage.getItem(C5);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},VB=e=>{const t=WB(),n=Date.now();return!t||t+(e?HB:UB)<n};function uf({titleIcon:e,title:t,description:n,isImportant:r,canPostpone:i}){const[o,a]=b.useState(0),s=()=>{a(Math.random())},l=()=>{localStorage.setItem(C5,Date.now().toString()),s()};return b.useEffect(()=>{const c=setInterval(()=>{s()},6e4);return()=>clearInterval(c)},[]),i&&!VB(r)?null:_.jsx("div",{className:"absolute top-[calc(3.5rem+1px)] w-full flex justify-center z-40",children:_.jsxs("div",{className:Q("w-full sm:w-[28rem] h-9 hover:h-32 overflow-hidden sm:rounded-b-md","flex flex-col justify-center items-center p-2","group cursor-default transition-[height] shadow-xl",r?"bg-destructive text-destructive-foreground":"bg-info text-info-foreground"),children:[_.jsxs("h2",{className:"text-md group-hover:font-medium",children:[e,t]}),_.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,_.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&_.jsxs(Ee,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[_.jsx(ZR,{className:"h-[0.9rem] mr-1"})," Postpone"]}),_.jsx(Ee,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:_.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[_.jsx(o5,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function KB(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=BB();return e?_.jsx(uf,{titleIcon:_.jsx(hL,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:_.jsxs(_.Fragment,{children:["The connection to the txAdmin server has been lost. ",_.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?_.jsx(uf,{titleIcon:_.jsx(x_,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:t.isImportant?"This version of txAdmin is outdated.":"A patch (bug fix) update is available for txAdmin.",description:t.isImportant?`Version v${t.version} has been released bringing new features, bug fixes and improvements.`:`If you are experiencing any kind of issue, please update to v${t.version}.`,isImportant:t.isImportant,canPostpone:!0}):n?_.jsx(uf,{titleIcon:_.jsx(x_,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:n.isImportant?"This version of FXServer is outdated.":"An update is available for FXServer.",description:`Please update FXServer to artifact ${n.version}.`,isImportant:n.isImportant,canPostpone:!0}):null}const qB="AlertDialog",[GB,Lz]=Vt(qB,[h5]),Ei=h5(),YB=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ei(t);return b.createElement(Ev,Y({},r,n,{modal:!0}))},XB=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ei(t);return b.createElement(Rv,Y({},r,n))},QB=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ei(n);return b.createElement(Bl,Y({},i,r,{ref:t}))}),k5="AlertDialogContent",[JB,ZB]=GB(k5),eF=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Ei(n),a=b.useRef(null),s=Se(t,a),l=b.useRef(null);return b.createElement(AB,{contentName:k5,titleName:tF,docsSlug:"alert-dialog"},b.createElement(JB,{scope:n,cancelRef:l},b.createElement(Fl,Y({role:"alertdialog"},o,i,{ref:s,onOpenAutoFocus:ne(i.onOpenAutoFocus,c=>{var p;c.preventDefault(),(p=l.current)===null||p===void 0||p.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),b.createElement(pg,null,r),!1)))}),tF="AlertDialogTitle",nF=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ei(n);return b.createElement(zl,Y({},i,r,{ref:t}))}),rF=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ei(n);return b.createElement(Hl,Y({},i,r,{ref:t}))}),iF=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ei(n);return b.createElement(th,Y({},i,r,{ref:t}))}),sF="AlertDialogCancel",oF=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=ZB(sF,n),o=Ei(n),a=Se(t,i);return b.createElement(th,Y({},o,r,{ref:a}))}),aF=YB,lF=XB,E5=QB,R5=eF,L5=iF,M5=oF,T5=nF,A5=rF,cF=aF,uF=lF,D5=b.forwardRef(({className:e,...t},n)=>_.jsx(E5,{className:Q("fixed inset-0 z-50 bg-black/40 dark:bg-black/75 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));D5.displayName=E5.displayName;const P5=b.forwardRef(({className:e,...t},n)=>_.jsxs(uF,{children:[_.jsx(D5,{}),_.jsx(R5,{ref:n,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));P5.displayName=R5.displayName;const $5=({className:e,...t})=>_.jsx("div",{className:Q("flex flex-col space-y-2 text-center sm:text-left",e),...t});$5.displayName="AlertDialogHeader";const O5=({className:e,...t})=>_.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O5.displayName="AlertDialogFooter";const N5=b.forwardRef(({className:e,...t},n)=>_.jsx(T5,{ref:n,className:Q("text-lg font-semibold",e),...t}));N5.displayName=T5.displayName;const I5=b.forwardRef(({className:e,...t},n)=>_.jsx(A5,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));I5.displayName=A5.displayName;const j5=b.forwardRef(({className:e,...t},n)=>_.jsx(L5,{ref:n,className:Q(Ll(),e),...t}));j5.displayName=L5.displayName;const B5=b.forwardRef(({className:e,...t},n)=>_.jsx(M5,{ref:n,className:Q(Ll({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));B5.displayName=M5.displayName;function dF(){const e=b.useRef(null),t=U8(),n=H8(),r=()=>{t.isOpen&&(n(),t.onCancel&&t.onCancel())},i=()=>{t.isOpen&&(n(),t.onConfirm())},o=s=>{s.preventDefault(),s.key==="Enter"||s.key==="NumpadEnter"?i():(s.key==="Backspace"||s.key==="Escape")&&r()},a=s=>{s||r()};return O3(e,r),_.jsx(cF,{open:t.isOpen,onOpenChange:a,children:_.jsxs(P5,{ref:e,children:[_.jsxs($5,{children:[_.jsx(N5,{children:t.title}),_.jsx(I5,{children:t.message})]}),_.jsxs(O5,{children:[_.jsx(B5,{children:t.cancelLabel??"Cancel"}),_.jsx(j5,{autoFocus:!0,onKeyDown:o,onClick:i,className:Q(Ll({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}const rh=Ev,hF=Rv,F5=b.forwardRef(({className:e,...t},n)=>_.jsx(Bl,{ref:n,className:Q("fixed inset-0 z-50 bg-black/40 dark:bg-black/75 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));F5.displayName=Bl.displayName;const Ul=b.forwardRef(({className:e,children:t,...n},r)=>_.jsxs(hF,{children:[_.jsx(F5,{}),_.jsxs(Fl,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,_.jsxs(th,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[_.jsx($r,{className:"h-6 w-6"}),_.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ul.displayName=Fl.displayName;const Wl=({className:e,...t})=>_.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wl.displayName="DialogHeader";const Mv=({className:e,...t})=>_.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Mv.displayName="DialogFooter";const Vl=b.forwardRef(({className:e,...t},n)=>_.jsx(zl,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));Vl.displayName=zl.displayName;const z5=b.forwardRef(({className:e,...t},n)=>_.jsx(Hl,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));z5.displayName=Hl.displayName;function fF(){const e=b.useRef(null),t=V8(),n=W8(),r=()=>{var s;if(!t.isOpen)return;n();const a=((s=e.current)==null?void 0:s.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},o=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return _.jsx(rh,{open:t.isOpen,onOpenChange:o,children:_.jsx(Ul,{className:Q(t.isWide&&"md:max-w-2xl"),children:_.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[_.jsxs(Wl,{children:[_.jsx(Vl,{children:t.title}),_.jsx(z5,{children:t.message})]}),_.jsx(it,{autoFocus:!0,id:"userInput",ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),_.jsxs(Mv,{className:"gap-2 flex-col",children:[_.jsx("div",{className:"flex flex-col sm:flex-row sm:justify-start gap-2 w-full flex-wrap",children:t.suggestions&&t.suggestions.map((a,s)=>_.jsxs(Ee,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[_.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},s))}),_.jsx(Ee,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}const au=b.forwardRef((e,t)=>b.createElement(fe.label,Y({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),H5=au,pF=Si("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yn=b.forwardRef(({className:e,...t},n)=>_.jsx(H5,{ref:n,className:Q(pF(),e),...t}));yn.displayName=H5.displayName;const U5="Tabs",[mF,Mz]=Vt(U5,[qd]),W5=qd(),[gF,Tv]=mF(U5),vF=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,p=Bo(s),[u,m]=Lr({prop:r,onChange:i,defaultProp:o});return b.createElement(gF,{scope:n,baseId:_n(),value:u,onValueChange:m,orientation:a,dir:p,activationMode:l},b.createElement(fe.div,Y({dir:p,"data-orientation":a},c,{ref:t})))}),_F="TabsList",yF=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Tv(_F,n),a=W5(n);return b.createElement(SC,Y({asChild:!0},a,{orientation:o.orientation,dir:o.dir,loop:r}),b.createElement(fe.div,Y({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),xF="TabsTrigger",wF=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=Tv(xF,n),s=W5(n),l=V5(a.baseId,r),c=K5(a.baseId,r),p=r===a.value;return b.createElement(CC,Y({asChild:!0},s,{focusable:!i,active:p}),b.createElement(fe.button,Y({type:"button",role:"tab","aria-selected":p,"aria-controls":c,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:ne(e.onMouseDown,u=>{!i&&u.button===0&&u.ctrlKey===!1?a.onValueChange(r):u.preventDefault()}),onKeyDown:ne(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(r)}),onFocus:ne(e.onFocus,()=>{const u=a.activationMode!=="manual";!p&&!i&&u&&a.onValueChange(r)})})))}),bF="TabsContent",SF=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,s=Tv(bF,n),l=V5(s.baseId,r),c=K5(s.baseId,r),p=r===s.value,u=b.useRef(p);return b.useEffect(()=>{const m=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(m)},[]),b.createElement(ht,{present:i||p},({present:m})=>b.createElement(fe.div,Y({"data-state":p?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:c,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0}}),m&&o))});function V5(e,t){return`${e}-trigger-${t}`}function K5(e,t){return`${e}-content-${t}`}const CF=vF,q5=yF,G5=wF,Y5=SF,kF=CF,X5=b.forwardRef(({className:e,...t},n)=>_.jsx(q5,{ref:n,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));X5.displayName=q5.displayName;const am=b.forwardRef(({className:e,...t},n)=>_.jsx(G5,{ref:n,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));am.displayName=G5.displayName;const Av=b.forwardRef(({className:e,...t},n)=>_.jsx(Y5,{ref:n,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Av.displayName=Y5.displayName;const Oc="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",Dn={regexValidHwidToken:/^[0-9A-Fa-f]{1,2}:[0-9A-Fa-f]{64}$/,validIdentifiers:{discord:/^discord:\d{17,20}$/,fivem:/^fivem:\d{1,8}$/,license:/^license:[0-9A-Fa-f]{40}$/,license2:/^license2:[0-9A-Fa-f]{40}$/,live:/^live:\d{14,20}$/,steam:/^steam:1100001[0-9A-Fa-f]{8}$/,xbl:/^xbl:\d{14,20}$/},validIdentifierParts:{discord:/^\d{17,20}$/,fivem:/^\d{1,8}$/,license:/^[0-9A-Fa-f]{40}$/,license2:/^[0-9A-Fa-f]{40}$/,live:/^\d{14,20}$/,steam:/^1100001[0-9A-Fa-f]{8}$/,xbl:/^\d{14,20}$/},adminPasswordMinLength:6,adminPasswordMaxLength:128,regexActionID:new RegExp(`^[${Oc}]{4}-[${Oc}]{4}$`),regexWhitelistReqID:new RegExp(`R[${Oc}]{4}`),regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,noLookAlikesAlphabet:Oc,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/},EF=b.memo(function(){const{authData:e,setAuthData:t}=us(),{setAccountModalTab:n}=kg(),r=sS(),i=vt({method:"POST",path:"/auth/changePassword"}),[o,a]=b.useState(""),[s,l]=b.useState(""),[c,p]=b.useState(""),[u,m]=b.useState(""),[g,x]=b.useState(!1),y=h=>{if(h==null||h.preventDefault(),!!e){if(m(""),s.length<Dn.adminPasswordMinLength||s.length>Dn.adminPasswordMaxLength){m(`The password must be between ${Dn.adminPasswordMinLength} and ${Dn.adminPasswordMaxLength} digits long.`);return}else if(s!==c){m("The passwords do not match.");return}x(!0),i({data:{newPassword:s,oldPassword:e.isTempPassword?void 0:o},error:f=>{x(!1),m(f)},success:f=>{x(!1),"success"in f?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(Ct.success("Password changed successfully!"),r()):m(f.error)}})}};if(e)return _.jsx(Av,{value:"password",tabIndex:void 0,children:_.jsxs("form",{onSubmit:y,children:[e.isTempPassword?_.jsxs("p",{className:"text-sm text-warning-inline",children:["Your account has a temporary password that needs to be changed before you can use this web panel. ",_.jsx("br",{}),_.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):_.jsx("p",{className:"text-sm text-muted-foreground",children:"You can use your password to login to the txAdmin inferface even without using the Cfx.re login button."}),_.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&_.jsxs("div",{className:"space-y-1",children:[_.jsx(yn,{htmlFor:"current-password",children:"Current Password"}),_.jsx(it,{id:"current-password",placeholder:"Enter current password",type:"password",value:o,autoFocus:!0,required:!0,onChange:h=>{a(h.target.value),m("")}})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsx(yn,{htmlFor:"new-password",children:"New Password"}),_.jsx(it,{id:"new-password",autoComplete:"new-password",placeholder:"Enter new password",type:"password",value:s,autoFocus:e.isTempPassword,required:!0,onChange:h=>{l(h.target.value),m("")}})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsx(yn,{htmlFor:"confirm-password",children:"Confirm Password"}),_.jsx(it,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:h=>{p(h.target.value),m("")}})]})]}),u&&_.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:u}),_.jsx(Ee,{className:"w-full",type:"submit",disabled:g,children:g?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})});function RF(){const e=o2(),[t,n]=b.useState(""),[r,i]=b.useState(""),[o,a]=b.useState(""),[s,l]=b.useState(!1),c=sS(),[p,u]=b.useState(!1),{isPending:m,error:g,data:x}=O8({queryKey:["getIdentifiers"],gcTime:3e4,queryFn:()=>e("/auth/getIdentifiers")}),y=vt({method:"POST",path:"/auth/changeIdentifiers"});b.useEffect(()=>{x&&(n(x.cfxreId),i(x.discordId))},[x]),b.useEffect(()=>{a(g?g.message:"")},[g]);const h=v=>{v==null||v.preventDefault(),a(""),u(!0),y({data:{cfxreId:t,discordId:r},error:S=>{a(S)},success:S=>{u(!1),"success"in S?(Ct.success("Identifiers changed successfully!"),c()):a(S.error)}})},f=async()=>{if(!t)return;const v=t.trim();if(/^\d+$/.test(v))n(`fivem:${v}`);else if(v.startsWith("fivem:"))t!==v&&n(v);else{try{l(!0);const S=await TI(`https://forum.cfx.re/u/${v}.json`);S.user&&typeof S.user.id=="number"?n(`fivem:${S.user.id}`):a("Could not find the user in the forum. Make sure you typed the username correctly.")}catch{a("Failed to check the identifiers on the forum API.")}l(!1)}},d=()=>{if(!r)return;const v=r.trim();/^\d+$/.test(v)?i(`discord:${v}`):r!==v&&i(v)};return _.jsx(Av,{value:"identifiers",tabIndex:void 0,children:_.jsxs("form",{onSubmit:h,children:[_.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",_.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",_.jsx("strong",{children:"In Game Menu"})," and the ",_.jsx("strong",{children:"Discord Bot"}),". ",_.jsx("br",{}),_.jsx("strong",{children:"It is recommended that you configure at least one."})]}),_.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[_.jsxs("div",{className:"space-y-1",children:[_.jsxs(yn,{htmlFor:"cfxreId",children:["FiveM identifier ",_.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),_.jsx(it,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:m||s?"loading...":t,disabled:m||s,autoFocus:!0,onBlur:f,onChange:v=>{n(v.target.value),a("")}}),_.jsxs("p",{className:"text-sm text-muted-foreground",children:["Your identifier can be found by clicking in your name in the playerlist and going to the IDs page. ",_.jsx("br",{}),"You can also type in your ",_.jsx(Mo,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",_.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsxs(yn,{htmlFor:"discordId",children:["Discord identifier ",_.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),_.jsx(it,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:m?"loading...":r,disabled:m,onBlur:d,onChange:v=>{i(v.target.value),a("")}}),_.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",_.jsx(Mo,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",_.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),o&&_.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:o}),_.jsx(Ee,{className:"w-full",type:"submit",disabled:!x||p,children:p?"Saving...":"Save Changes"})]})})}function LF(){const{authData:e}=us(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=kg();b.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const o=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return _.jsx(rh,{open:t,onOpenChange:o,children:_.jsxs(Ul,{className:"sm:max-w-lg",tabIndex:void 0,children:[_.jsx(Wl,{children:_.jsx(Vl,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),_.jsxs(kF,{defaultValue:"password",value:r,onValueChange:i,children:[_.jsxs(X5,{className:"grid w-full grid-cols-2 mb-4",children:[_.jsx(am,{value:"password",children:"Password"}),_.jsx(am,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),_.jsx(EF,{}),_.jsx(RF,{})]})]})})}const MF=5*60;function Zs({tsFetch:e,tsObject:t,serverTime:n,className:r,isDateOnly:i,dateStyle:o,timeStyle:a}){const s=n-e,l=n-t,c=e-l,p=()=>{Ct.warning(`This means that the server clock is ${Math.abs(s)} seconds ${s>0?"ahead":"behind"} your computer time. Make sure both your computer and the server have their clocks synchronized.`)},u=i?z6(c,o??"medium"):Fs(c,o??"medium",a??"short");return _.jsxs("span",{className:r,title:Fs(c,"long","long"),children:[u,Math.abs(s)>MF&&_.jsx("button",{className:"ml-1 text-warning-inline",onClick:p,children:"(clock drift)"})]})}const Dv=b.forwardRef(({className:e,...t},n)=>_.jsx("textarea",{className:Q("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","bg-black/5 dark:bg-black/30",e),ref:n,...t}));Dv.displayName="Textarea";function ny({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?_.jsxs("span",{className:Q("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center inline-block","bg-secondary text-secondary-foreground"),children:["0 ",e,"s"]}):_.jsxs("span",{className:Q("rounded-sm text-xs font-semibold px-1 py-[0.125rem] tracking-widest text-center inline-block",e==="Ban"?"bg-destructive text-destructive-foreground":"bg-warning text-warning-foreground"),children:[t," ",n]})}const ry=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function TF({playerRef:e,player:t,refreshModalData:n}){const r=b.useRef(null),[i,o]=b.useState(t.notesLog??""),[a,s]=b.useState(ry(t.notes)),l=vt({method:"POST",path:"/player/save_note"}),c=()=>{var u;o("Saving..."),l({queryParams:e,data:{note:(u=r.current)==null?void 0:u.value.trim()},success:m=>{"error"in m?o(m.error):n()}})},p=u=>{u.key==="Enter"&&!u.shiftKey&&!window.txIsMobile?(u.preventDefault(),c()):s(ry(u.currentTarget.value))};return _.jsxs(_.Fragment,{children:[_.jsxs(yn,{htmlFor:"playerNotes",children:["Notes: ",_.jsx("span",{className:"text-muted-foreground",children:i})]}),_.jsx(Dv,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>o("Press enter to save."),onKeyDown:p,style:{height:`${1+1.25*a}rem`},placeholder:t.isRegistered?"Type your notes about the player.":"Cannot set notes for players that are not registered."}),window.txIsMobile&&_.jsx("div",{className:"mt-2 w-full",children:_.jsx(Ee,{variant:"outline",size:"xs",onClick:c,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function AF({playerRef:e,player:t,serverTime:n,tsFetch:r,setSelectedTab:i,refreshModalData:o}){const{hasPerm:a}=ar(),s=vt({method:"POST",path:"/player/whitelist"}),l=t.sessionTime?Pu(t.sessionTime*6e4,{units:["h","m"]}):"--",c=t.tsLastConnection?_.jsx(Zs,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsLastConnection,tsFetch:r,isDateOnly:!0}):"--",p=t.playTime?Pu(t.playTime*6e4,{units:["d","h","m"]}):"--",u=t.tsJoined?_.jsx(Zs,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsJoined,tsFetch:r,isDateOnly:!0}):"--",m=t.tsWhitelisted?_.jsx(Zs,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsWhitelisted,tsFetch:r,isDateOnly:!0}):"not yet",g=t.actionHistory.filter(h=>h.type==="ban"&&!h.revokedAt).length,x=t.actionHistory.filter(h=>h.type==="warn"&&!h.revokedAt).length,y=()=>{s({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(h,f)=>{"success"in h&&o()}})};return _.jsxs("div",{className:"p-1",children:[_.jsxs("dl",{className:"pb-2",children:[t.isConnected&&_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:p})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:u})]}),!t.isConnected&&_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),_.jsx("dd",{className:"text-sm leading-6 mt-0",children:m}),_.jsx("dd",{className:"text-right",children:_.jsx(Ee,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:y,disabled:!a("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Sanctions"}),_.jsxs("dd",{className:"text-sm leading-6 mt-0 space-x-2",children:[_.jsx(ny,{type:"Ban",count:g}),_.jsx(ny,{type:"Warn",count:x})]}),_.jsx("dd",{className:"text-right",children:_.jsx(Ee,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{i("History")},children:"View"})})]})]}),_.jsx(TF,{player:t,playerRef:e,refreshModalData:o})]})}function iy({title:e,emptyMessage:t,currIds:n,allIds:r,isSmaller:i}){b.useState(!1);const o=n.sort((s,l)=>s.localeCompare(l)),a=r.filter(s=>!n.includes(s)).sort((s,l)=>s.localeCompare(l));return _.jsxs("div",{children:[_.jsx("div",{className:"flex justify-between items-center pb-1",children:_.jsx("h3",{className:"text-xl",children:e})}),_.jsxs("p",{className:Q("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:[o.length===0&&_.jsx("span",{className:"block px-1 opacity-50 italic",children:t}),o.map(s=>_.jsx("span",{className:"block px-1 font-semibold",children:s},s)),a.map(s=>_.jsx("span",{className:"block px-1 opacity-50",children:s},s))]})]})}function DF({player:e}){return _.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[_.jsx(iy,{title:"Player Identifiers",emptyMessage:"This player has no identifiers.",currIds:e.ids,allIds:(e==null?void 0:e.oldIds)??[]}),_.jsx(iy,{title:"Player Hardware IDs",emptyMessage:"This player has no hardware IDs.",currIds:e.hwids,allIds:(e==null?void 0:e.oldHwids)??[],isSmaller:!0})]})}function ih({children:e}){return _.jsx("div",{className:"flex items-center justify-center min-h-[16.5rem] text-xl p1 text-muted-foreground",children:e})}function PF({action:e,serverTime:t,modalOpener:n}){let r,i,o;if(e.type==="ban"?(i="border-destructive",o=`BANNED by ${e.author}`):e.type==="warn"&&(i="border-warning",o=`WARNED by ${e.author}`),e.revokedBy){i="";const a=Fs(e.revokedAt??0,"medium","short");r=`Revoked by ${e.revokedBy} on ${a}.`}else if(typeof e.exp=="number"){const a=Fs(e.exp,"medium","short");r=e.exp<t?`Expired on ${a}.`:`Expires in ${a}.`}return _.jsxs("div",{onClick:()=>{n(e.id)},className:Q("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30 cursor-pointer",i),children:[_.jsxs("div",{className:"flex w-full justify-between",children:[_.jsx("strong",{className:"text-sm text-muted-foreground",children:o}),_.jsxs("small",{className:"text-right text-2xs space-x-1",children:[_.jsx($n,{className:"tracking-widest",children:e.id}),_.jsx("span",{className:"opacity-75 cursor-help",title:Fs(e.ts,"long","long"),children:Fs(e.ts,"medium","short")})]})]}),_.jsx("span",{className:"text-sm",children:e.reason}),r&&_.jsx("small",{className:"block text-xs opacity-75",children:r})]})}function $F({actionHistory:e,serverTime:t,refreshModalData:n}){const r=eC();if(!e.length)return _.jsx(ih,{children:"No bans/warns found."});const i=a=>{r(a)},o=[...e].reverse();return _.jsx("div",{className:"flex flex-col gap-1 p-1",children:o.map(a=>_.jsx(PF,{action:a,serverTime:t,modalOpener:i},a.id))})}function OF({playerRef:e}){const t=b.useRef(null),n=b.useRef(null),[r,i]=b.useState("2 days"),[o,a]=b.useState("days"),[s,l]=b.useState(!1),{hasPerm:c}=ar(),p=hS(),u=vt({method:"POST",path:"/player/ban"});if(!c("players.ban"))return _.jsx(ih,{children:"You don't have permission to ban players."});const m=g=>{var x,y;g==null||g.preventDefault(),l(!0),u({queryParams:e,data:{reason:(x=t.current)==null?void 0:x.value.trim(),duration:r==="custom"?`${(y=n.current)==null?void 0:y.value} ${o}`:r},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},success:h=>{l(!1),"success"in h&&p()}})};return _.jsxs("form",{onSubmit:m,className:"grid gap-4 p-1",children:[_.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[_.jsx(yn,{htmlFor:"banReason",className:"col-span-4 xs:col-auto",children:"Reason"}),_.jsx(it,{id:"banReason",placeholder:"The reason for the ban, rule violated, etc.",className:"col-span-full xs:col-span-3",ref:t,autoFocus:!0,required:!0})]}),_.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[_.jsx(yn,{htmlFor:"durationSelect",className:"col-span-4 xs:col-auto",children:"Duration"}),_.jsxs("div",{className:"col-span-full xs:col-span-3 space-y-1 ",children:[_.jsxs(id,{onValueChange:i,defaultValue:r,children:[_.jsx(nl,{id:"durationSelect",className:"tracking-wide",children:_.jsx(sd,{placeholder:"Select Duration"})}),_.jsxs(rl,{className:"tracking-wide",children:[_.jsx(lt,{value:"custom",className:"font-bold",children:"Custom (set below)"}),_.jsx(lt,{value:"2 hours",children:"2 HOURS"}),_.jsx(lt,{value:"8 hours",children:"8 HOURS"}),_.jsx(lt,{value:"1 day",children:"1 DAY"}),_.jsx(lt,{value:"2 days",children:"2 DAYS"}),_.jsx(lt,{value:"1 week",children:"1 WEEK"}),_.jsx(lt,{value:"2 weeks",children:"2 WEEKS"}),_.jsx(lt,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),_.jsxs("div",{className:"flex flex-row gap-2",children:[_.jsx(it,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:r!=="custom",ref:n}),_.jsxs(id,{onValueChange:a,defaultValue:o,children:[_.jsx(nl,{className:"tracking-wide",id:"durationUnits",disabled:r!=="custom",children:_.jsx(sd,{})}),_.jsxs(rl,{className:"tracking-wide",children:[_.jsx(lt,{value:"hours",children:"HOURS"}),_.jsx(lt,{value:"days",children:"DAYS"}),_.jsx(lt,{value:"weeks",children:"WEEKS"}),_.jsx(lt,{value:"months",children:"MONTHS"})]})]})]})]})]}),_.jsx("div",{className:"grid grid-cols-4 items-center gap-4",children:_.jsx(Ee,{variant:"destructive",size:"xs",className:"col-start-1 col-span-full xs:col-span-3 xs:col-start-2",type:"submit",disabled:s,children:s?_.jsxs("span",{className:"flex items-center leading-relaxed",children:[_.jsx(Fn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function sh({msg:e}){return _.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[_.jsx(Fn,{className:"inline animate-spin h-5"})," ",e]})}function NF({playerRef:e,player:t}){const{hasPerm:n}=ar(),r=Id(),i=hS(),o=Cl()[1],[a]=kl("/admins"),s=vg(),l=jd(),c=vt({method:"POST",path:"/player/message"}),p=vt({method:"POST",path:"/player/kick"}),u=vt({method:"POST",path:"/player/warn"}),m=f=>{"success"in f&&(i(),l())},g=()=>{if(!t)return;const f=new URLSearchParams;f.set("autofill","true"),f.set("name",t.pureName);for(const d of t.ids)d.startsWith("discord:")?f.set("discord",d):d.startsWith("fivem:")&&f.set("citizenfx",d);o(`/admins?${f.toString()}`),console.log("isAlreadyInAdminPage",a),a&&s(),i(),l()},x=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:f=>{c({queryParams:e,data:{message:f},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:m})}})},y=()=>{t&&r({title:`Kick ${t.displayName}`,message:"Type the kick reason or leave it blank (press enter)",placeholder:"any reason you want",submitLabel:"Send",onSubmit:f=>{p({queryParams:e,data:{reason:f},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:m})}})},h=()=>{t&&r({title:`Warn ${t.displayName}`,message:"Type the warn reason.",placeholder:"any reason you want",submitLabel:"Send",required:!0,onSubmit:f=>{u({queryParams:e,data:{reason:f},genericHandler:{successMsg:"Player warned."},toastLoadingMessage:"Warning player...",success:m})}})};return _.jsxs(Mv,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[_.jsxs(Ee,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.ids.length,onClick:g,className:"pl-2 sm:mr-auto",children:[_.jsx(Ob,{className:"h-5 mr-1"})," Give Admin"]}),_.jsxs(Ee,{variant:"outline",size:"sm",disabled:!n("players.message")||!t||!t.isConnected,onClick:x,className:"pl-2",children:[_.jsx(CL,{className:"h-5 mr-1"})," DM"]}),_.jsxs(Ee,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:y,className:"pl-2",children:[_.jsx(rB,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),_.jsxs(Ee,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t||!t.isConnected,onClick:h,className:"pl-2",children:[_.jsx(Fu,{className:"h-5 mr-1"})," Warn"]})]})}const ua=[{title:"Info",icon:_.jsx(xg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:_.jsx(yL,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:_.jsx(wg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:_.jsx(zu,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function IF(){const{isModalOpen:e,closeModal:t,playerRef:n}=K8(),[r,i]=b.useState(ua[0].title),[o,a]=b.useState(0),[s,l]=b.useState(void 0),[c,p]=b.useState(""),[u,m]=b.useState(0),g=vt({method:"GET",path:"/player",abortOnUnmount:!0}),x=()=>{a(o+1)};b.useEffect(()=>{n&&(l(void 0),p(""),g({queryParams:n,success:d=>{"error"in d?p(d.error):(l(d),m(Math.round(Date.now()/1e3)))},error:d=>{p(d)}}))},[n,o]),b.useEffect(()=>{e||setTimeout(()=>{i(ua[0].title)},200)},[e]);const y=d=>{e&&!d&&t()},h=d=>{if(d.key==="ArrowUp"||d.key==="ArrowDown"){d.preventDefault();const v=ua.findIndex(C=>C.title===r),S=d.key==="ArrowUp"?v-1:v+1,k=ua[S];if(k){i(k.title);const C=document.getElementById(`player-modal-tab-${k.title}`);C&&C.focus()}}};let f;return s?s.player.netid?f=_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-success-inline font-mono mr-2",children:["[",s.player.netid,"]"]}),s.player.displayName]}):f=_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-destructive-inline font-mono mr-2",children:"[OFF]"}),s.player.displayName]}):c?f=_.jsx("span",{className:"text-destructive-inline",children:"Error!"}):f=_.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),_.jsx(rh,{open:e,onOpenChange:y,children:_.jsxs(Ul,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[_.jsx(Wl,{className:"p-4 border-b",children:_.jsx(Vl,{className:"tracking-wide line-clamp-1 break-all mr-6",children:f})}),_.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[_.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:ua.map(d=>_.jsxs(Ee,{id:`player-modal-tab-${d.title}`,variant:r===d.title?"secondary":"ghost",className:Q("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",d.className),onClick:()=>i(d.title),onKeyDown:h,children:[d.icon," ",d.title]},d.title))}),_.jsx(Bn,{className:"w-full max-h-[calc(100vh-3.125rem-4rem-5rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:s?_.jsxs(_.Fragment,{children:[r==="Info"&&_.jsx(AF,{playerRef:n,player:s.player,serverTime:s.serverTime,tsFetch:u,setSelectedTab:i,refreshModalData:x}),r==="History"&&_.jsx($F,{actionHistory:s.player.actionHistory,serverTime:s.serverTime,refreshModalData:x}),r==="IDs"&&_.jsx(DF,{player:s.player}),r==="Ban"&&_.jsx(OF,{playerRef:n})]}):_.jsx(ih,{children:c?_.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):_.jsx(sh,{msg:"Loading..."})})})]}),_.jsx(NF,{playerRef:n,player:s==null?void 0:s.player})]})})}function jF(){const e=Hg(),t=fP(),n=b.useRef(0),r=FB(),i=FR(),o=zR(),a=zB();return b.useEffect(()=>{const s=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=ib(s);return l.on("connect",()=>{console.log("Main Socket.IO Connected."),r(!1)}),l.on("disconnect",c=>{console.log("Main Socket.IO Disonnected:",c);const p=n.current+1;n.current=p,setTimeout(()=>{n.current===p&&r(!0)},500)}),l.on("error",c=>{console.log("Main Socket.IO",c)}),l.on("logout",function(c){e("main socketio",c)}),l.on("refreshToUpdate",function(){window.location.href="/login#updated"}),l.on("status",function(c){i(c)}),l.on("playerlist",function(c){window.txConsts.isWebInterface&&o(c)}),l.on("updateAvailable",function(c){a(c)}),l.on("updateAuthData",function(c){console.warn("Got updateAuthData from websocket",c),t(c)}),()=>{l.removeAllListeners(),l.disconnect(),i(null)}},[]),null}function sy({title:e,emptyMessage:t,ids:n,isSmaller:r}){b.useState(!1);const i=Array.isArray(n)&&n.length;return _.jsxs("div",{className:"mb-1 md:mb-4",children:[_.jsx("div",{className:"flex justify-between items-center pb-1",children:_.jsx("h3",{className:"text-xl",children:e})}),_.jsx("p",{className:Q("font-mono break-all whitespace-pre-wrap border rounded divide-y divide-border/50 text-muted-foreground",i&&r?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:i?n.map(o=>_.jsx("span",{className:"block px-1 font-semibold",children:o},o)):_.jsx("span",{className:"block px-1 opacity-50 italic",children:t})})]})}function BF({action:e}){return _.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[_.jsx(sy,{title:"Target Identifiers",emptyMessage:"This action targets no identifiers.",ids:e.ids}),_.jsx(sy,{title:"Target Hardware IDs",emptyMessage:"This action targets no hardware IDs.",ids:e.hwids,isSmaller:!0})]})}const FF=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function zF({actionReason:e}){const t=b.useRef(null),[n,r]=b.useState(FF(e));return _.jsxs(_.Fragment,{children:[_.jsx(yn,{htmlFor:"actionReason",children:"Reason:"}),_.jsx(Dv,{ref:t,id:"actionReason",className:"w-full mt-1",readOnly:!0,value:e,style:{height:`${1+1.25*n}rem`}})]})}function HF({action:e,serverTime:t,tsFetch:n}){const r=Fd();let i;if(e.type==="ban")if(e.expiration===!1)i=_.jsx("span",{className:"text-destructive-inline",children:"Never"});else if(e.expiration>t){const p=Pu((t-e.expiration)*1e3,{units:["mo","w","d","h","m"]});i=_.jsxs("span",{className:"text-warning-inline",children:["In ",p]})}else i=_.jsx(Zs,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.expiration,tsFetch:n});let o;e.revocation.timestamp?o=_.jsxs("span",{className:"text-warning-inline",children:["By ",e.revocation.author," on ",_.jsx(Zs,{isDateOnly:!0,className:"cursor-help",serverTime:t,tsObject:e.revocation.timestamp,tsFetch:n})]}):o=_.jsx("span",{className:"opacity-75",children:"No"});const a=e.playerName!==!1?_.jsx("span",{children:e.playerName}):_.jsx("span",{className:"italic opacity-75",children:"unknown player"}),s=e.ids.filter(p=>p.startsWith("license:")),l=s.length===1?s[0].split(":")[1]:!1,c=()=>{l&&r({license:l})};return _.jsxs("div",{className:"mb-1 md:mb-4",children:[_.jsxs("dl",{className:"pb-2",children:[_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Date/Time"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:_.jsx(Zs,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.timestamp,tsFetch:n})})]}),e.type==="ban"&&_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Expiration"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:i})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Revoked"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:o})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Admin"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:e.author})]}),_.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[_.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player"}),_.jsx("dd",{className:"text-sm leading-6 col-span-2x mt-0",children:a}),_.jsx("dd",{className:"text-right",children:_.jsx(Ee,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:c,disabled:!l,children:"View"})})]})]}),_.jsx(zF,{actionReason:e.reason})]})}function UF({action:e,refreshModalData:t}){const[n,r]=b.useState(!1),{hasPerm:i}=ar(),o=vt({method:"POST",path:"/history/revoke_action"}),a=e.type.charAt(0).toUpperCase()+e.type.slice(1),s=()=>{r(!0),o({data:{actionId:e.id},toastLoadingMessage:`Revoking ${e.type}...`,genericHandler:{successMsg:`${a} revoked.`},success:u=>{r(!1),"success"in u&&t()}})},l=!!e.revocation.timestamp,c=i(e.type==="warn"?"players.warn":"players.ban"),p=l?`${e.type} revoked`:c?`Revoke ${a}`:"Revoke (no permission)";return _.jsx("div",{className:"flex flex-col gap-4 mb-1 md:mb-4",children:_.jsxs("div",{className:"space-y-2",children:[_.jsxs("h3",{className:"text-xl",children:["Revoke ",a]}),_.jsxs("p",{className:"text-muted-foreground text-sm",children:["This is generally done when the player successfully appeals the ",e.type," or the admin regrets issuing it.",_.jsxs("ul",{className:"list-disc list-inside pt-1",children:[e.type==="ban"&&_.jsx("li",{children:"The player will be able to rejoin the server."}),_.jsx("li",{children:"The player will not be notified of the revocation."}),_.jsxs("li",{children:["This ",e.type," will not be removed from the player history."]}),_.jsx("li",{children:"The revocation cannot be undone!"})]})]}),_.jsx(Ee,{variant:"destructive",size:"xs",className:"col-start-1 col-span-full xs:col-span-3 xs:col-start-2",type:"submit",disabled:l||!c||n,onClick:s,children:n?_.jsxs("span",{className:"flex items-center leading-relaxed",children:[_.jsx(Fn,{className:"inline animate-spin h-4"})," Revoking..."]}):p})]})})}const da=[{title:"Info",icon:_.jsx(xg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:_.jsx(wg,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Revoke",icon:_.jsx(Nb,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function WF(){const{isModalOpen:e,closeModal:t,actionRef:n}=lP(),[r,i]=b.useState(da[0].title),[o,a]=b.useState(0),[s,l]=b.useState(void 0),[c,p]=b.useState(""),[u,m]=b.useState(0),g=vt({method:"GET",path:"/history/action",abortOnUnmount:!0}),x=()=>{a(o+1)};b.useEffect(()=>{n&&(l(void 0),p(""),g({queryParams:{id:n},success:d=>{"error"in d?p(d.error):(l(d),m(Math.round(Date.now()/1e3)))},error:d=>{p(d)}}))},[n,o]),b.useEffect(()=>{e||setTimeout(()=>{i(da[0].title)},200)},[e]);const y=d=>{e&&!d&&t()},h=d=>{if(d.key==="ArrowUp"||d.key==="ArrowDown"){d.preventDefault();const v=da.findIndex(C=>C.title===r),S=d.key==="ArrowUp"?v-1:v+1,k=da[S];if(k){i(k.title);const C=document.getElementById(`action-modal-tab-${k.title}`);C&&C.focus()}}};let f;if(s){const d=s.action.playerName!==!1?_.jsx("span",{children:s.action.playerName}):_.jsx("span",{className:"italic opacity-75",children:"unknown player"});if(s.action.type==="ban")f=_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-destructive-inline font-mono mr-2",children:["[",s.action.id,"]"]}),"Banned ",d]});else if(s.action.type==="warn")f=_.jsxs(_.Fragment,{children:[_.jsxs("span",{className:"text-warning-inline font-mono mr-2",children:["[",s.action.id,"]"]}),"Warned ",d]});else throw new Error(`Unknown action type: ${s.action.type}`)}else c?f=_.jsx("span",{className:"text-destructive-inline",children:"Error!"}):f=_.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."});return _.jsx(rh,{open:e,onOpenChange:y,children:_.jsxs(Ul,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[_.jsx(Wl,{className:"p-4 border-b",children:_.jsx(Vl,{className:"tracking-wide line-clamp-1 break-all mr-6",children:f})}),_.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[_.jsx("div",{className:"flex flex-row md:flex-col gap-1 bg-muted md:bg-transparent p-1 md:p-0 mx-2 md:mx-0 rounded-md",children:da.map(d=>_.jsxs(Ee,{id:`action-modal-tab-${d.title}`,variant:r===d.title?"secondary":"ghost",className:Q("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",d.className),onClick:()=>i(d.title),onKeyDown:h,children:[d.icon," ",d.title]},d.title))}),_.jsx(Bn,{className:"w-full max-h-[calc(100vh-3.125rem-4rem)] min-h-[16.5rem] md:max-h-[50vh] px-4 py-2 md:py-0",children:s?_.jsxs(_.Fragment,{children:[r==="Info"&&_.jsx(HF,{action:s.action,serverTime:s.serverTime,tsFetch:u}),r==="IDs"&&_.jsx(BF,{action:s.action}),r==="Revoke"&&_.jsx(UF,{action:s.action,refreshModalData:x})]}):_.jsx(ih,{children:c?_.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):_.jsx(sh,{msg:"Loading..."})})})]})]})})}function VF(){const e=Hg(),t=F8(),n=Fd(),r=V9();return Er("message",i=>{i.data.type==="logoutNotice"?e("child iframe","got logoutNotice"):i.data.type==="openAccountModal"?t():i.data.type==="openPlayerModal"?n(i.data.ref):i.data.type==="navigateToPage"?ig(i.data.href):i.data.type==="globalHotkey"&&i.data.action==="toggleLightMode"&&r()}),Er("keydown",$b),_.jsx(_.Fragment,{children:_.jsxs(A9,{delayDuration:300,disableHoverableContent:!0,children:[_.jsx(J9,{}),_.jsxs("div",{className:"md:px-3 min-h-full pt-2 md:py-4 w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[_.jsx(l5,{}),_.jsx("main",{className:"flex flex-1 min-h-[calc(100vh-4rem-1px)] md:min-h-[calc(100vh-5.5rem-1px)]",children:_.jsx($j,{})}),window.txConsts.isWebInterface&&_.jsx(c5,{})]}),_.jsx(jB,{}),_.jsx(KB,{}),_.jsx(dF,{}),_.jsx(fF,{}),_.jsx(oP,{}),_.jsx(LF,{}),_.jsx(IF,{}),_.jsx(WF,{}),_.jsx(jF,{})]})})}function KF(){const{setAuthData:e}=us(),t=b.useRef(null),n=b.useRef(null),[r,i]=b.useState(),o=Cl()[1],a=g=>{g.message.startsWith("NetworkError")?i("Network error. If you closed txAdmin, please restart it and try again."):i(g.message)},s=g=>{g==="no_admins_setup"?(i("No admins set up. Redirecting..."),o("/addMaster/pin")):i(g)},l=rs({mutationKey:["oauthRedirect"],mutationFn:()=>{const g=`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`;return fetch(g).then(x=>x.json())},onError:a,onSuccess:g=>{"error"in g?s(g.error):(console.log("Redirecting to",g.authUrl),window.location.href=g.authUrl)}}),c=rs({mutationKey:["auth"],mutationFn:({username:g,password:x})=>fetch(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:g,password:x})}).then(y=>y.json()),onError:a,onSuccess:g=>{"error"in g?g.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):s(g.error):e(g)}}),p=g=>{var x,y;g==null||g.preventDefault(),c.mutate({username:((x=t.current)==null?void 0:x.value)||"",password:((y=n.current)==null?void 0:y.value)||""})};let u;window.location.hash==="#logout"?u="Logged Out.":window.location.hash==="#expired"?u="Session Expired.":window.location.hash==="#updated"&&(u="txAdmin updated, please login again.");const m=r??u;return b.useEffect(()=>{try{const g=localStorage.getItem("authCredsAutofill");if(g){const[x,y]=JSON.parse(g);t.current.value=x??"",n.current.value=y??""}}catch(g){console.error("Username/Pass autofill failed",g)}},[]),_.jsxs("form",{onSubmit:p,className:"w-full",children:[_.jsx(Md,{className:"space-y-1",children:_.jsx(fg,{className:"text-3xl",children:"Login"})}),_.jsxs(El,{className:"grid gap-4",children:[_.jsx("div",{children:_.jsx("button",{type:"button",className:"cfxrebtn",onClick:()=>{l.mutate()},disabled:l.isPending,children:l.isPending?_.jsx("div",{className:"w-[6rem]",children:_.jsx(Fn,{className:"mx-auto h-5 w-5 animate-spin"})}):_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"51.12 12.29 1070.38 231.43",className:"w-[6rem] h-5",children:_.jsx("path",{fill:"#fff",d:"M555.37 202.281c-12.725 2.072-36.4 4.44-51.493 4.44-39.952 0-47.35-19.533-47.35-75.17 0-57.412 9.174-75.464 46.462-75.464 14.501 0 39.064 2.367 52.382 4.735l1.183-26.635c-12.725-2.96-36.992-7.398-58.004-7.398-60.668 0-76.057 31.665-76.057 104.763 0 69.25 14.205 104.467 76.057 104.467 18.94 0 43.8-3.552 57.708-6.511l-.887-27.227zm69.547-89.966h39.064V84.793h-39.064v-9.174c0-20.42 4.143-26.93 17.756-26.93 9.174 0 23.675.591 23.675.591l.296-26.043c0-.296-21.9-3.255-31.961-3.255-30.778 0-41.728 12.725-41.728 55.34v9.471H575.79v27.522h17.165v120.448h31.962V112.315zm49.422-27.522 42.911 73.69-42.911 74.28h34.33l29.001-50.606 29.298 50.606h34.33l-44.096-75.169 44.096-72.801h-34.33l-29.298 51.198-29.002-51.198h-34.33zM824.38 190.148h34.625v42.615H824.38zm72.21 42.615h32.257V129.48s23.084-10.358 50.014-15.685V81.538c-25.155 4.735-50.31 21.011-50.31 21.011V84.793h-31.961v147.97zm164.839-24.859c-24.563 0-33.441-11.837-33.737-35.513h91.741l2.072-23.083c0-46.167-20.716-67.77-62.148-67.77-40.84 0-64.219 24.563-64.219 78.72 0 52.085 17.165 75.76 61.556 75.76 26.043 0 59.78-6.806 59.78-6.806l-.592-23.971s-31.074 2.663-54.453 2.663zm-34.033-60.372c.296-28.41 10.062-39.36 31.961-39.36 21.604 0 30.482 9.766 30.482 39.36h-62.443zM242.957 146.08v-.723l-4.34-57.857c-.12-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h-33.63c-1.567 0-2.953.573-4.158 1.718-1.206 1.145-1.868 2.5-1.989 4.068l-4.34 57.857v.723c-.12 1.447.362 2.653 1.447 3.616 1.085.964 2.35 1.447 3.797 1.447h44.116c1.447 0 2.712-.483 3.797-1.447 1.085-.963 1.568-2.17 1.447-3.616zm137.23 84.436c0 8.8-2.772 13.199-8.317 13.199H244.584c1.567 0 2.893-.574 3.977-1.718 1.085-1.145 1.568-2.5 1.447-4.068l-3.616-46.286c-.121-1.568-.783-2.924-1.99-4.068s-2.59-1.718-4.158-1.718h-49.178c-1.567 0-2.953.573-4.159 1.718-1.205 1.144-1.868 2.5-1.989 4.068l-3.616 46.286c-.12 1.567.362 2.923 1.447 4.068s2.41 1.718 3.977 1.718H59.44c-5.544 0-8.317-4.4-8.317-13.2 0-6.508 1.567-13.5 4.701-20.972l75.396-188.76c.964-2.29 2.53-4.279 4.7-5.966 2.17-1.688 4.46-2.532 6.871-2.532h61.293c-1.567 0-2.953.573-4.159 1.718-1.205 1.145-1.868 2.501-1.989 4.068l-2.712 34.715c-.12 1.687.362 3.073 1.447 4.158 1.085 1.085 2.41 1.627 3.977 1.627h30.014c1.567 0 2.893-.542 3.978-1.627 1.084-1.085 1.567-2.471 1.446-4.158l-2.712-34.715c-.121-1.567-.783-2.923-1.989-4.068s-2.59-1.718-4.158-1.718h61.292c2.41 0 4.701.844 6.87 2.532 2.17 1.687 3.738 3.676 4.702 5.966l75.395 188.76c3.133 7.472 4.7 14.464 4.7 20.973z"})})})}),_.jsxs("div",{className:"relative",children:[_.jsx("div",{className:"absolute inset-0 flex items-center",children:_.jsx("span",{className:"w-full border-t"})}),_.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:_.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"OR"})})]}),_.jsxs("div",{className:"flex flex-col gap-4",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(yn,{htmlFor:"frm-login",children:"Login"}),_.jsx(it,{id:"frm-login",type:"text",ref:t,placeholder:"username",autoCapitalize:"off",autoComplete:"off",required:!0})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx(yn,{htmlFor:"frm-password",children:"Password"}),_.jsx(it,{id:"frm-password",type:"password",ref:n,placeholder:"password",autoCapitalize:"off",autoComplete:"off",required:!0})]})]})]}),_.jsxs(jo,{className:"flex-col pb-0",children:[_.jsxs(Ee,{className:"w-full",disabled:c.isPending,children:[c.isPending&&_.jsx(Fn,{className:"mr-2 h-4 w-4 animate-spin"}),"Login"]}),_.jsx("div",{className:"text-destructive mt-2",children:m??_.jsx(_.Fragment,{children:" "})})]})]})}const ks=({children:e})=>_.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:e}),ha=({children:e})=>_.jsx("p",{className:"whitespace-pre-wrap pb-2",children:e}),Es=({returnTo:e})=>_.jsx(jo,{className:"w-full flex justify-center mt-4 pb-0",children:_.jsx(ts,{href:e,children:_.jsx(Ee,{className:"x",children:"Try Again"})})});function Q5({error:e,returnTo:t}){var n,r;if(t=t??"/login","errorTitle"in e)return _.jsxs("div",{children:[_.jsx(ks,{children:e.errorTitle}),_.jsx(ha,{children:e.errorMessage}),_.jsx(Es,{returnTo:t})]});if(e.errorCode==="invalid_session")return _.jsxs("div",{children:[_.jsx(ks,{children:"Invalid Browser Session."}),_.jsxs(ha,{children:["You may have restarted txAdmin right before entering this page. ",_.jsx("br",{}),"Please return and try again."]}),_.jsx(Es,{returnTo:t})]});if(e.errorCode==="clock_desync")return _.jsxs("div",{children:[_.jsx(ks,{children:"Please Update/Synchronize your VPS clock."}),_.jsx(ha,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."}),_.jsx(Es,{returnTo:t})]});if(e.errorCode==="timeout")return _.jsxs("div",{children:[_.jsx(ks,{children:"Connection to FiveM servers timed out."}),_.jsx(ha,{children:"Please try again or login using your existing username and backup password."}),_.jsx(Es,{returnTo:t})]});if(e.errorCode==="not_admin"){const i=((n=e.errorContext)==null?void 0:n.identifier)??"unknown",o=((r=e.errorContext)==null?void 0:r.name)??"unknown";return _.jsxs("div",{children:[_.jsx(ks,{children:`The Cfx.re account '${o}' is not an admin.`}),_.jsxs(ha,{children:["The account above with identifier ",_.jsx($n,{children:i})," is not assigned to any account registered on txAdmin. ",_.jsx("br",{}),"You can also try to login using your username and backup password."]}),_.jsx(Es,{returnTo:t})]})}else return _.jsxs(_.Fragment,{children:[_.jsx(ks,{children:"Unknown Error:"}),_.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:_.jsx("code",{className:"text-left whitespace-pre-wrap ",children:JSON.stringify(e,null,2)})}),_.jsx(Es,{returnTo:t})]})}function qF(){const{authData:e,setAuthData:t}=us(),[n,r]=b.useState(),i=b.useRef(!1),o=rs({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/cfxre/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(s=>s.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?r(a):t(a)},onError:a=>{a.message.startsWith("NetworkError")?r({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):r({errorTitle:"Unknown Error",errorMessage:a.message})}});return b.useEffect(()=>{if(!(e||i.current))return i.current=!0,o.mutate({redirectUri:window.location.href}),o.reset},[]),n?_.jsx(Q5,{error:n}):_.jsx(sh,{msg:"Logging in..."})}function GF(){const[e,t]=b.useState(!1),[n,r]=b.useState(),[i,o]=b.useState(!1),a=b.useRef(null),s=rs({mutationFn:({pin:p,origin:u})=>fetch("/auth/addMaster/pin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:p,origin:u})}).then(m=>m.json()),onSuccess:p=>{"error"in p?(o(!0),r(p.error)):(t(!0),console.log("Redirecting to",p.authUrl),window.location.href=p.authUrl)},onError:p=>{o(!0),p.message.startsWith("NetworkError")?r("Network error. If you closed txAdmin, please restart it and try again."):r(p.message)}}),l=p=>{var u;p==null||p.preventDefault(),o(!1),r(void 0),s.mutate({pin:((u=a.current)==null?void 0:u.value)||"0000",origin:window.location.origin})};b.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(r("Autofilled ✔"),a.current.value=window.location.hash.substring(1))},[]);const c=s.isPending||e;return _.jsxs("form",{onSubmit:l,className:"w-full",children:[_.jsxs(Md,{className:"space-y-1",children:[_.jsx(fg,{className:"text-3xl",children:"No Cfx.re account linked."}),_.jsx(sb,{className:"text-sm text-muted-foreground",children:'Type the PIN from your terminal and click "Link Account".'})]}),_.jsxs(El,{className:"grid gap-2",children:[_.jsx("span",{className:Q("text-center",i?"text-destructive":"text-success"),children:n??_.jsx(_.Fragment,{children:" "})}),_.jsx(it,{className:Q("text-2xl text-center font-mono tracking-[0.25em] p-2",n&&(i?"border-acctext-destructive text-destructive":"border-succtext-success text-success")),id:"frm-pin",type:"text",ref:a,minLength:4,maxLength:4,placeholder:"0000",autoComplete:"off",onFocus:()=>{o(!1),r(void 0)},disabled:c,required:!0})]}),_.jsx(jo,{children:_.jsxs(Ee,{className:"w-full",disabled:c,children:[c&&_.jsx(Fn,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}const J5="Checkbox",[YF,Tz]=Vt(J5),[XF,QF]=YF(J5),JF=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:a,disabled:s,value:l="on",onCheckedChange:c,...p}=e,[u,m]=b.useState(null),g=Se(t,v=>m(v)),x=b.useRef(!1),y=u?!!u.closest("form"):!0,[h=!1,f]=Lr({prop:i,defaultProp:o,onChange:c}),d=b.useRef(h);return b.useEffect(()=>{const v=u==null?void 0:u.form;if(v){const S=()=>f(d.current);return v.addEventListener("reset",S),()=>v.removeEventListener("reset",S)}},[u,f]),b.createElement(XF,{scope:n,state:h,disabled:s},b.createElement(fe.button,Y({type:"button",role:"checkbox","aria-checked":Yi(h)?"mixed":h,"aria-required":a,"data-state":Z5(h),"data-disabled":s?"":void 0,disabled:s,value:l},p,{ref:g,onKeyDown:ne(e.onKeyDown,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:ne(e.onClick,v=>{f(S=>Yi(S)?!0:!S),y&&(x.current=v.isPropagationStopped(),x.current||v.stopPropagation())})})),y&&b.createElement(tz,{control:u,bubbles:!x.current,name:r,value:l,checked:h,required:a,disabled:s,style:{transform:"translateX(-100%)"}}))}),ZF="CheckboxIndicator",ez=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=QF(ZF,n);return b.createElement(ht,{present:r||Yi(o.state)||o.state===!0},b.createElement(fe.span,Y({"data-state":Z5(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),tz=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=b.useRef(null),a=fv(n),s=mC(t);return b.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&u){const m=new Event("click",{bubbles:r});l.indeterminate=Yi(n),u.call(l,Yi(n)?!1:n),l.dispatchEvent(m)}},[a,n,r]),b.createElement("input",Y({type:"checkbox","aria-hidden":!0,defaultChecked:Yi(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Yi(e){return e==="indeterminate"}function Z5(e){return Yi(e)?"indeterminate":e?"checked":"unchecked"}const ek=JF,nz=ez,tk=b.forwardRef(({className:e,...t},n)=>_.jsx(ek,{ref:n,className:Q("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:_.jsx(nz,{className:Q("flex items-center justify-center text-current"),children:_.jsx(yg,{className:"h-4 w-4"})})}));tk.displayName=ek.displayName;function rz({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=us(),[i,o]=b.useState(),a=b.useRef(null),s=b.useRef(null),l=b.useRef(null),c=b.useRef(null),p=rs({mutationKey:["auth"],mutationFn:({discordId:m,password:g})=>fetch("/auth/addMaster/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({discordId:m,password:g})}).then(x=>x.json()),onSuccess:m=>{"error"in m?o(m.error):(window.txConsts.hasMasterAccount=!0,r(m))},onError:m=>{m.message.startsWith("NetworkError")?o("Network error. If you closed txAdmin, please restart it and try again."):o(m.message)}}),u=m=>{var f,d,v,S,k;m==null||m.preventDefault(),o(void 0);let g,x=(d=(f=a.current)==null?void 0:f.value)==null?void 0:d.trim();if(typeof x=="string"&&x.length>0){if(x.startsWith("discord:")&&(x=x.substring(8),a.current.value=x),!Dn.validIdentifierParts.discord.test(x)){o(`The Discord ID needs to be the numeric "User ID" instead of the username.
 You can also leave it blank.`);return}g=x}if(((v=c.current)==null?void 0:v.value)!=="on"){o("You MUST agree to the terms.");return}const y=((S=s.current)==null?void 0:S.value)||"",h=((k=l.current)==null?void 0:k.value)||"";if(y.length<Dn.adminPasswordMinLength||y.length>Dn.adminPasswordMaxLength){o(`The password must be between ${Dn.adminPasswordMinLength} and ${Dn.adminPasswordMaxLength} characters long.`);return}else if(y!==h){o("The passwords do not match.");return}p.mutate({discordId:g,password:y})};return b.useEffect(()=>{try{const m=localStorage.getItem("authCredsAutofill");if(m){const[g,x]=JSON.parse(m);s.current.value=x??"",l.current.value=x??""}}catch(m){console.error("Passwords autofill failed",m)}},[]),_.jsxs("form",{onSubmit:u,className:"w-full text-left",children:[_.jsxs(El,{className:"flex flex-col gap-4",children:[_.jsxs("div",{children:["Cfx.re account",_.jsxs("div",{className:"rounded-md border bg-zinc-100 dark:bg-zinc-900 p-2 mt-2 flex flex-row justify-start items-center",children:[_.jsx(e5,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),_.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[_.jsx("span",{className:"text-2xl",children:t})," ",_.jsx("br",{}),_.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),_.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),_.jsxs("div",{className:"grid gap-2",children:[_.jsxs("div",{className:"flex flex-row justify-between items-center",children:[_.jsx(au,{htmlFor:"frm-discord",children:"Discord ID"}),_.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),_.jsx(it,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:a,placeholder:"000000000000000000",disabled:p.isPending})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsxs("div",{className:"flex flex-row justify-between items-center",children:[_.jsx(au,{htmlFor:"frm-password",children:"Backup Password"}),_.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",Dn.adminPasswordMinLength,"~",Dn.adminPasswordMaxLength," digits)"]})]}),_.jsx(it,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:s,placeholder:"password",disabled:p.isPending,required:!0})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx(au,{htmlFor:"frm-password2",children:"Confirm Password"}),_.jsx(it,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:l,placeholder:"password",disabled:p.isPending,required:!0})]}),_.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[_.jsx(tk,{id:"terms",ref:c,required:!0}),_.jsxs("label",{htmlFor:"terms",className:"text-sm font-medium leading-4 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:["I have read and agree to the ",_.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"})," as well as the ",_.jsx("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"txAdmin License"}),"."]})]})]}),_.jsxs(jo,{className:"flex-col gap-2",children:[_.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:i}),_.jsxs(Ee,{className:"w-full",disabled:p.isPending,children:[p.isPending&&_.jsx(Fn,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function iz(){const e=b.useRef(!1),[t,n]=b.useState(),[r,i]=b.useState(),o=rs({mutationKey:["auth"],mutationFn:({redirectUri:a})=>fetch("/auth/addMaster/callback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({redirectUri:a})}).then(s=>s.json()),onSuccess:a=>{"errorCode"in a||"errorTitle"in a?i(a):n(a)},onError:a=>{a.message.startsWith("NetworkError")?i({errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}):i({errorTitle:"Unknown Error",errorMessage:a.message})}});return b.useEffect(()=>{if(!(t||e.current))return e.current=!0,o.mutate({redirectUri:window.location.href}),o.reset},[]),t?_.jsx(rz,{...t}):r?_.jsx(Q5,{error:r,returnTo:"/addMaster/pin"}):_.jsx(sh,{msg:"Authenticating..."})}function sz(){return _.jsx("div",{className:"min-h-screen flex items-center justify-center",children:_.jsxs("div",{className:"text-center m-4 w-full xs:w-[25rem] min-w-[20rem]",children:[_.jsx(Cv,{className:"h-12 mx-auto"}),_.jsx(hg,{className:"min-h-64 mt-8 mb-4 p-4 flex items-center justify-center",children:_.jsxs(Nw,{children:[_.jsx(Ti,{path:"/login",children:_.jsx(KF,{})}),_.jsx(Ti,{path:"/login/callback",children:_.jsx(qF,{})}),_.jsx(Ti,{path:"/addMaster/pin",children:_.jsx(GF,{})}),_.jsx(Ti,{path:"/addMaster/callback",children:_.jsx(iz,{})}),_.jsx(Ti,{path:"/:fullPath*",children:_.jsx("small",{children:"redirecting to the login page..."})})]})}),_.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[window.txConsts.adsData.login?_.jsxs("a",{href:window.txConsts.adsData.login.url,onClick:Xa,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100
                            dark:brightness-90 dark:hover:brightness-110`,children:[_.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                            scale-0 group-hover:scale-100 transition-transform bg-black
                            dark:bg-gradient-to-r dark:from-[#18E889] dark:to-[#01FFFF]`}),_.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:window.txConsts.adsData.login.img})]}):null,_.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:Xa,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100 brightness-110
                        dark:brightness-95 dark:hover:brightness-110`,children:[_.jsx("div",{className:`absolute inset-0 -z-10 animate-pulse blur 
                        scale-0 group-hover:scale-100 transition-transform bg-black
                        dark:bg-gradient-to-t dark:from-[#8567EC] dark:to-[#BD5CBF]`}),_.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),_.jsx("div",{children:_.jsxs("small",{className:"text-muted-foreground text-sm font-light",children:["tx: ",_.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",_.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})})]})})}function oz({children:e}){const{theme:t,setTheme:n}=s5();return b.useEffect(()=>{const r=o=>{const a=o.matches;t==="dark"&&!a?n("light"):t==="light"&&a&&n("dark")},i=window.matchMedia("(prefers-color-scheme: dark)");return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[t]),_.jsx(_.Fragment,{children:e})}var Pv={exports:{}};Pv.exports=$v;var az=Pv.exports.isMobile=$v;Pv.exports.default=$v;const lz=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,cz=/CrOS/,uz=/android|ipad|playbook|silk/i;function $v(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let n=lz.test(t)&&!cz.test(t)||!!e.tablet&&uz.test(t);return!n&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(n=!0),n}window.txConsts.isWebInterface||(console.log("Silencing txAdmin Web UI console.* calls inside NUI to prevent confusion."),console.log=()=>{},console.info=()=>{},console.warn=()=>{},console.error=()=>{},console.debug=()=>{},console.table=()=>{});try{window.txIsMobile=az({tablet:!0})}catch{window.txIsMobile=!1}if(window.location.pathname.substring(0,8)==="/WebPipe"){console.info("Removing WebPipe prefix from the pathname.");const e=window.location.pathname.substring(8)+window.location.search+window.location.hash;window.history.replaceState(null,"",e)}const dz=["/login","/addMaster"],oy=e=>dz.some(t=>e.startsWith(t));function hz(){if(qe(pP),qe(HR),dP()){const n=new URLSearchParams(window.location.search).get("r");return n?j6(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):oy(window.location.pathname)&&window.history.replaceState(null,"","/"),_.jsx(VF,{})}else{if(!window.txConsts.hasMasterAccount&&!window.location.pathname.startsWith("/addMaster"))console.log("No master account detected. Redirecting to addMaster page."),window.history.replaceState(null,"","/addMaster/pin");else if(!oy(window.location.pathname)){console.log("User is not authenticated. Redirecting to login page.");const t=window.location.pathname+window.location.search+window.location.hash,n=t==="/"?"/login":`/login?r=${encodeURIComponent(t)}`;window.history.replaceState(null,"",n)}return _.jsx(sz,{})}}const fz=new _8;df.createRoot(document.getElementById("root")).render(_.jsx(b.StrictMode,{children:_.jsx(Ly,{FallbackComponent:CR,children:_.jsx(S8,{client:fz,children:_.jsx(oz,{children:_.jsx(hz,{})})})})}));
//# sourceMappingURL=index-a5R1IgQa.js.map
