var $H=Object.defineProperty;var BH=(e,t,n)=>t in e?$H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var pl=(e,t,n)=>BH(e,typeof t!="symbol"?t+"":t,n);/*!
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 *                     _            _       _           _       
 *                    | |___  __   / \   __| |_ __ ___ (_)_ __  
 *                    | __\ \/ /  / _ \ / _` | '_ ` _ \| | '_ \ 
 *                    | |_ >  <  / ___ \ (_| | | | | | | | | | |
 *                     \__/_/\_\/_/   \_\__,_|_| |_| |_|_|_| |_|
 *                                                              
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * Author: André Tabarra (https://github.com/tabarra)
 * Repository: https://github.com/tabarra/txAdmin
 * txAdmin is a free open source software provided under the license below.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * MIT License
 * 
 * Copyright (c) 2019-2025 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.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 * This distribution also includes third party code under their own licenses, which
 * can be found in ../THIRD-PARTY-LICENSES.txt or their respective repositories.
 * Attribution for non-code assets can be found at the bottom of ../README.md or at
 * the top of the respective file.
 * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 */function FH(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 s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{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 s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var $i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var XA={exports:{}},dv={},JA={exports:{}},Ze={};/**
 * @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 qh=Symbol.for("react.element"),zH=Symbol.for("react.portal"),HH=Symbol.for("react.fragment"),WH=Symbol.for("react.strict_mode"),UH=Symbol.for("react.profiler"),VH=Symbol.for("react.provider"),qH=Symbol.for("react.context"),GH=Symbol.for("react.forward_ref"),KH=Symbol.for("react.suspense"),YH=Symbol.for("react.memo"),XH=Symbol.for("react.lazy"),K5=Symbol.iterator;function JH(e){return e===null||typeof e!="object"?null:(e=K5&&e[K5]||e["@@iterator"],typeof e=="function"?e:null)}var QA={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZA=Object.assign,ej={};function $c(e,t,n){this.props=e,this.context=t,this.refs=ej,this.updater=n||QA}$c.prototype.isReactComponent={};$c.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")};$c.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tj(){}tj.prototype=$c.prototype;function Uw(e,t,n){this.props=e,this.context=t,this.refs=ej,this.updater=n||QA}var Vw=Uw.prototype=new tj;Vw.constructor=Uw;ZA(Vw,$c.prototype);Vw.isPureReactComponent=!0;var Y5=Array.isArray,nj=Object.prototype.hasOwnProperty,qw={current:null},rj={key:!0,ref:!0,__self:!0,__source:!0};function ij(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)nj.call(t,r)&&!rj.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:qh,type:e,key:s,ref:a,props:i,_owner:qw.current}}function QH(e,t){return{$$typeof:qh,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gw(e){return typeof e=="object"&&e!==null&&e.$$typeof===qh}function ZH(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var X5=/\/+/g;function Q1(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ZH(""+e.key):t.toString(36)}function Vp(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case qh:case zH:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Q1(a,0):r,Y5(i)?(n="",e!=null&&(n=e.replace(X5,"$&/")+"/"),Vp(i,t,n,"",function(c){return c})):i!=null&&(Gw(i)&&(i=QH(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(X5,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",Y5(e))for(var o=0;o<e.length;o++){s=e[o];var l=r+Q1(s,o);a+=Vp(s,t,n,l,i)}else if(l=JH(e),typeof l=="function")for(e=l.call(e),o=0;!(s=e.next()).done;)s=s.value,l=r+Q1(s,o++),a+=Vp(s,t,n,l,i);else if(s==="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 Ff(e,t,n){if(e==null)return e;var r=[],i=0;return Vp(e,r,"","",function(s){return t.call(n,s,i++)}),r}function eW(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 tr={current:null},qp={transition:null},tW={ReactCurrentDispatcher:tr,ReactCurrentBatchConfig:qp,ReactCurrentOwner:qw};function sj(){throw Error("act(...) is not supported in production builds of React.")}Ze.Children={map:Ff,forEach:function(e,t,n){Ff(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ff(e,function(){t++}),t},toArray:function(e){return Ff(e,function(t){return t})||[]},only:function(e){if(!Gw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ze.Component=$c;Ze.Fragment=HH;Ze.Profiler=UH;Ze.PureComponent=Uw;Ze.StrictMode=WH;Ze.Suspense=KH;Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tW;Ze.act=sj;Ze.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=ZA({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=qw.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)nj.call(t,l)&&!rj.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&o!==void 0?o[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:qh,type:e.type,key:i,ref:s,props:r,_owner:a}};Ze.createContext=function(e){return e={$$typeof:qH,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:VH,_context:e},e.Consumer=e};Ze.createElement=ij;Ze.createFactory=function(e){var t=ij.bind(null,e);return t.type=e,t};Ze.createRef=function(){return{current:null}};Ze.forwardRef=function(e){return{$$typeof:GH,render:e}};Ze.isValidElement=Gw;Ze.lazy=function(e){return{$$typeof:XH,_payload:{_status:-1,_result:e},_init:eW}};Ze.memo=function(e,t){return{$$typeof:YH,type:e,compare:t===void 0?null:t}};Ze.startTransition=function(e){var t=qp.transition;qp.transition={};try{e()}finally{qp.transition=t}};Ze.unstable_act=sj;Ze.useCallback=function(e,t){return tr.current.useCallback(e,t)};Ze.useContext=function(e){return tr.current.useContext(e)};Ze.useDebugValue=function(){};Ze.useDeferredValue=function(e){return tr.current.useDeferredValue(e)};Ze.useEffect=function(e,t){return tr.current.useEffect(e,t)};Ze.useId=function(){return tr.current.useId()};Ze.useImperativeHandle=function(e,t,n){return tr.current.useImperativeHandle(e,t,n)};Ze.useInsertionEffect=function(e,t){return tr.current.useInsertionEffect(e,t)};Ze.useLayoutEffect=function(e,t){return tr.current.useLayoutEffect(e,t)};Ze.useMemo=function(e,t){return tr.current.useMemo(e,t)};Ze.useReducer=function(e,t,n){return tr.current.useReducer(e,t,n)};Ze.useRef=function(e){return tr.current.useRef(e)};Ze.useState=function(e){return tr.current.useState(e)};Ze.useSyncExternalStore=function(e,t,n){return tr.current.useSyncExternalStore(e,t,n)};Ze.useTransition=function(){return tr.current.useTransition()};Ze.version="18.3.1";JA.exports=Ze;var w=JA.exports;const lt=Tn(w),oj=FH({__proto__:null,default:lt},[w]);/**
 * @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 nW=w,rW=Symbol.for("react.element"),iW=Symbol.for("react.fragment"),sW=Object.prototype.hasOwnProperty,oW=nW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,aW={key:!0,ref:!0,__self:!0,__source:!0};function aj(e,t,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)sW.call(t,r)&&!aW.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:rW,type:e,key:s,ref:a,props:i,_owner:oW.current}}dv.Fragment=iW;dv.jsx=aj;dv.jsxs=aj;XA.exports=dv;var u=XA.exports;const lW=w.createContext(null),Z1={didCatch:!1,error:null};class lj extends w.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Z1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(Z1)}}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&&cW(t.resetKeys,i)){var s,a;(s=(a=this.props).onReset)===null||s===void 0||s.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Z1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:s,error:a}=this.state;let o=t;if(s){const l={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")o=n(l);else if(r)o=w.createElement(r,l);else if(i!==void 0)o=i;else throw a}return w.createElement(lW.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},o)}}function cW(){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 Ux={},cj={exports:{}},Dr={},uj={exports:{}},dj={};/**
 * @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(O,j){var A=O.length;O.push(j);e:for(;0<A;){var F=A-1>>>1,H=O[F];if(0<i(H,j))O[F]=j,O[A]=H,A=F;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var j=O[0],A=O.pop();if(A!==j){O[0]=A;e:for(var F=0,H=O.length,B=H>>>1;F<B;){var G=2*(F+1)-1,Q=O[G],Y=G+1,W=O[Y];if(0>i(Q,A))Y<H&&0>i(W,Q)?(O[F]=W,O[Y]=A,F=Y):(O[F]=Q,O[G]=A,F=G);else if(Y<H&&0>i(W,A))O[F]=W,O[Y]=A,F=Y;else break e}}return j}function i(O,j){var A=O.sortIndex-j.sortIndex;return A!==0?A:O.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],c=[],h=1,d=null,f=3,g=!1,_=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var j=n(c);j!==null;){if(j.callback===null)r(c);else if(j.startTime<=O)r(c),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(c)}}function b(O){if(y=!1,x(O),!_)if(n(l)!==null)_=!0,I(S);else{var j=n(c);j!==null&&z(b,j.startTime-O)}}function S(O,j){_=!1,y&&(y=!1,m(k),k=-1),g=!0;var A=f;try{for(x(j),d=n(l);d!==null&&(!(d.expirationTime>j)||O&&!M());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var H=F(d.expirationTime<=j);j=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),x(j)}else r(l);d=n(l)}if(d!==null)var B=!0;else{var G=n(c);G!==null&&z(b,G.startTime-j),B=!1}return B}finally{d=null,f=A,g=!1}}var C=!1,E=null,k=-1,T=5,R=-1;function M(){return!(e.unstable_now()-R<T)}function L(){if(E!==null){var O=e.unstable_now();R=O;var j=!0;try{j=E(!0,O)}finally{j?D():(C=!1,E=null)}}else C=!1}var D;if(typeof p=="function")D=function(){p(L)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,P=N.port2;N.port1.onmessage=L,D=function(){P.postMessage(null)}}else D=function(){v(L,0)};function I(O){E=O,C||(C=!0,D())}function z(O,j){k=v(function(){O(e.unstable_now())},j)}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(O){O.callback=null},e.unstable_continueExecution=function(){_||g||(_=!0,I(S))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(O){switch(f){case 1:case 2:case 3:var j=3;break;default:j=f}var A=f;f=j;try{return O()}finally{f=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,j){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var A=f;f=O;try{return j()}finally{f=A}},e.unstable_scheduleCallback=function(O,j,A){var F=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?F+A:F):A=F,O){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=A+H,O={id:h++,callback:j,priorityLevel:O,startTime:A,expirationTime:H,sortIndex:-1},A>F?(O.sortIndex=A,t(c,O),n(l)===null&&O===n(c)&&(y?(m(k),k=-1):y=!0,z(b,A-F))):(O.sortIndex=H,t(l,O),_||g||(_=!0,I(S))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var j=f;return function(){var A=f;f=j;try{return O.apply(this,arguments)}finally{f=A}}}})(dj);uj.exports=dj;var uW=uj.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 dW=w,jr=uW;function pe(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 hj=new Set,qd={};function Fa(e,t){uc(e,t),uc(e+"Capture",t)}function uc(e,t){for(qd[e]=t,e=0;e<t.length;e++)hj.add(t[e])}var Es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vx=Object.prototype.hasOwnProperty,hW=/^[: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]*$/,J5={},Q5={};function fW(e){return Vx.call(Q5,e)?!0:Vx.call(J5,e)?!1:hW.test(e)?Q5[e]=!0:(J5[e]=!0,!1)}function pW(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 mW(e,t,n,r){if(t===null||typeof t>"u"||pW(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 nr(e,t,n,r,i,s,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=s,this.removeEmptyString=a}var Nn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nn[e]=new nr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nn[t]=new nr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nn[e]=new nr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nn[e]=new nr(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){Nn[e]=new nr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nn[e]=new nr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nn[e]=new nr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nn[e]=new nr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nn[e]=new nr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kw=/[\-:]([a-z])/g;function Yw(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(Kw,Yw);Nn[t]=new nr(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(Kw,Yw);Nn[t]=new nr(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(Kw,Yw);Nn[t]=new nr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nn[e]=new nr(e,1,!1,e.toLowerCase(),null,!1,!1)});Nn.xlinkHref=new nr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nn[e]=new nr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xw(e,t,n,r){var i=Nn.hasOwnProperty(t)?Nn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mW(t,n,i,r)&&(n=null),r||i===null?fW(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 Is=dW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zf=Symbol.for("react.element"),Ml=Symbol.for("react.portal"),Rl=Symbol.for("react.fragment"),Jw=Symbol.for("react.strict_mode"),qx=Symbol.for("react.profiler"),fj=Symbol.for("react.provider"),pj=Symbol.for("react.context"),Qw=Symbol.for("react.forward_ref"),Gx=Symbol.for("react.suspense"),Kx=Symbol.for("react.suspense_list"),Zw=Symbol.for("react.memo"),Ys=Symbol.for("react.lazy"),mj=Symbol.for("react.offscreen"),Z5=Symbol.iterator;function Su(e){return e===null||typeof e!="object"?null:(e=Z5&&e[Z5]||e["@@iterator"],typeof e=="function"?e:null)}var Qt=Object.assign,ey;function id(e){if(ey===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ey=t&&t[1]||""}return`
`+ey+e}var ty=!1;function ny(e,t){if(!e||ty)return"";ty=!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(`
`),s=r.stack.split(`
`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){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<=o);break}}}finally{ty=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?id(e):""}function gW(e){switch(e.tag){case 5:return id(e.type);case 16:return id("Lazy");case 13:return id("Suspense");case 19:return id("SuspenseList");case 0:case 2:case 15:return e=ny(e.type,!1),e;case 11:return e=ny(e.type.render,!1),e;case 1:return e=ny(e.type,!0),e;default:return""}}function Yx(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 Rl:return"Fragment";case Ml:return"Portal";case qx:return"Profiler";case Jw:return"StrictMode";case Gx:return"Suspense";case Kx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pj:return(e.displayName||"Context")+".Consumer";case fj:return(e._context.displayName||"Context")+".Provider";case Qw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zw:return t=e.displayName||null,t!==null?t:Yx(e.type)||"Memo";case Ys:t=e._payload,e=e._init;try{return Yx(e(t))}catch{}}return null}function vW(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 Yx(t);case 8:return t===Jw?"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 wo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yW(e){var t=gj(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.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 Hf(e){e._valueTracker||(e._valueTracker=yW(e))}function vj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=gj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Em(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 Xx(e,t){var n=t.checked;return Qt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function eE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wo(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 yj(e,t){t=t.checked,t!=null&&Xw(e,"checked",t,!1)}function Jx(e,t){yj(e,t);var n=wo(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")?Qx(e,t.type,n):t.hasOwnProperty("defaultValue")&&Qx(e,t.type,wo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function tE(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 Qx(e,t,n){(t!=="number"||Em(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var sd=Array.isArray;function Hl(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=""+wo(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 Zx(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(pe(91));return Qt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nE(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(pe(92));if(sd(n)){if(1<n.length)throw Error(pe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:wo(n)}}function xj(e,t){var n=wo(t.value),r=wo(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 rE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _j(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 e_(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_j(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wf,bj=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(Wf=Wf||document.createElement("div"),Wf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bd={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},xW=["Webkit","ms","Moz","O"];Object.keys(bd).forEach(function(e){xW.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bd[t]=bd[e]})});function wj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||bd.hasOwnProperty(e)&&bd[e]?(""+t).trim():t+"px"}function Sj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=wj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var _W=Qt({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 t_(e,t){if(t){if(_W[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(pe(62))}}function n_(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 r_=null;function e2(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var i_=null,Wl=null,Ul=null;function iE(e){if(e=Yh(e)){if(typeof i_!="function")throw Error(pe(280));var t=e.stateNode;t&&(t=gv(t),i_(e.stateNode,e.type,t))}}function Cj(e){Wl?Ul?Ul.push(e):Ul=[e]:Wl=e}function kj(){if(Wl){var e=Wl,t=Ul;if(Ul=Wl=null,iE(e),t)for(e=0;e<t.length;e++)iE(t[e])}}function Ej(e,t){return e(t)}function Tj(){}var ry=!1;function Mj(e,t,n){if(ry)return e(t,n);ry=!0;try{return Ej(e,t,n)}finally{ry=!1,(Wl!==null||Ul!==null)&&(Tj(),kj())}}function Kd(e,t){var n=e.stateNode;if(n===null)return null;var r=gv(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(pe(231,t,typeof n));return n}var s_=!1;if(Es)try{var Cu={};Object.defineProperty(Cu,"passive",{get:function(){s_=!0}}),window.addEventListener("test",Cu,Cu),window.removeEventListener("test",Cu,Cu)}catch{s_=!1}function bW(e,t,n,r,i,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var wd=!1,Tm=null,Mm=!1,o_=null,wW={onError:function(e){wd=!0,Tm=e}};function SW(e,t,n,r,i,s,a,o,l){wd=!1,Tm=null,bW.apply(wW,arguments)}function CW(e,t,n,r,i,s,a,o,l){if(SW.apply(this,arguments),wd){if(wd){var c=Tm;wd=!1,Tm=null}else throw Error(pe(198));Mm||(Mm=!0,o_=c)}}function za(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 Rj(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 sE(e){if(za(e)!==e)throw Error(pe(188))}function kW(e){var t=e.alternate;if(!t){if(t=za(e),t===null)throw Error(pe(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return sE(i),e;if(s===r)return sE(i),t;s=s.sibling}throw Error(pe(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(pe(189))}}if(n.alternate!==r)throw Error(pe(190))}if(n.tag!==3)throw Error(pe(188));return n.stateNode.current===n?e:t}function Aj(e){return e=kW(e),e!==null?jj(e):null}function jj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jj(e);if(t!==null)return t;e=e.sibling}return null}var Lj=jr.unstable_scheduleCallback,oE=jr.unstable_cancelCallback,EW=jr.unstable_shouldYield,TW=jr.unstable_requestPaint,an=jr.unstable_now,MW=jr.unstable_getCurrentPriorityLevel,t2=jr.unstable_ImmediatePriority,Dj=jr.unstable_UserBlockingPriority,Rm=jr.unstable_NormalPriority,RW=jr.unstable_LowPriority,Nj=jr.unstable_IdlePriority,hv=null,zi=null;function AW(e){if(zi&&typeof zi.onCommitFiberRoot=="function")try{zi.onCommitFiberRoot(hv,e,void 0,(e.current.flags&128)===128)}catch{}}var pi=Math.clz32?Math.clz32:DW,jW=Math.log,LW=Math.LN2;function DW(e){return e>>>=0,e===0?32:31-(jW(e)/LW|0)|0}var Uf=64,Vf=4194304;function od(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 Am(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=od(o):(s&=a,s!==0&&(r=od(s)))}else a=n&~i,a!==0?r=od(a):s!==0&&(r=od(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&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-pi(t),i=1<<n,r|=e[n],t&=~i;return r}function NW(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 PW(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-pi(s),o=1<<a,l=i[a];l===-1?(!(o&n)||o&r)&&(i[a]=NW(o,t)):l<=t&&(e.expiredLanes|=o),s&=~o}}function a_(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Pj(){var e=Uf;return Uf<<=1,!(Uf&4194240)&&(Uf=64),e}function iy(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Gh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pi(t),e[t]=n}function OW(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-pi(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function n2(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-pi(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var xt=0;function Oj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ij,r2,$j,Bj,Fj,l_=!1,qf=[],uo=null,ho=null,fo=null,Yd=new Map,Xd=new Map,Zs=[],IW="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 aE(e,t){switch(e){case"focusin":case"focusout":uo=null;break;case"dragenter":case"dragleave":ho=null;break;case"mouseover":case"mouseout":fo=null;break;case"pointerover":case"pointerout":Yd.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xd.delete(t.pointerId)}}function ku(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Yh(t),t!==null&&r2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function $W(e,t,n,r,i){switch(t){case"focusin":return uo=ku(uo,e,t,n,r,i),!0;case"dragenter":return ho=ku(ho,e,t,n,r,i),!0;case"mouseover":return fo=ku(fo,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Yd.set(s,ku(Yd.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Xd.set(s,ku(Xd.get(s)||null,e,t,n,r,i)),!0}return!1}function zj(e){var t=ia(e.target);if(t!==null){var n=za(t);if(n!==null){if(t=n.tag,t===13){if(t=Rj(n),t!==null){e.blockedOn=t,Fj(e.priority,function(){$j(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 Gp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=c_(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);r_=r,n.target.dispatchEvent(r),r_=null}else return t=Yh(n),t!==null&&r2(t),e.blockedOn=n,!1;t.shift()}return!0}function lE(e,t,n){Gp(e)&&n.delete(t)}function BW(){l_=!1,uo!==null&&Gp(uo)&&(uo=null),ho!==null&&Gp(ho)&&(ho=null),fo!==null&&Gp(fo)&&(fo=null),Yd.forEach(lE),Xd.forEach(lE)}function Eu(e,t){e.blockedOn===t&&(e.blockedOn=null,l_||(l_=!0,jr.unstable_scheduleCallback(jr.unstable_NormalPriority,BW)))}function Jd(e){function t(i){return Eu(i,e)}if(0<qf.length){Eu(qf[0],e);for(var n=1;n<qf.length;n++){var r=qf[n];r.blockedOn===e&&(r.blockedOn=null)}}for(uo!==null&&Eu(uo,e),ho!==null&&Eu(ho,e),fo!==null&&Eu(fo,e),Yd.forEach(t),Xd.forEach(t),n=0;n<Zs.length;n++)r=Zs[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Zs.length&&(n=Zs[0],n.blockedOn===null);)zj(n),n.blockedOn===null&&Zs.shift()}var Vl=Is.ReactCurrentBatchConfig,jm=!0;function FW(e,t,n,r){var i=xt,s=Vl.transition;Vl.transition=null;try{xt=1,i2(e,t,n,r)}finally{xt=i,Vl.transition=s}}function zW(e,t,n,r){var i=xt,s=Vl.transition;Vl.transition=null;try{xt=4,i2(e,t,n,r)}finally{xt=i,Vl.transition=s}}function i2(e,t,n,r){if(jm){var i=c_(e,t,n,r);if(i===null)py(e,t,r,Lm,n),aE(e,r);else if($W(i,e,t,n,r))r.stopPropagation();else if(aE(e,r),t&4&&-1<IW.indexOf(e)){for(;i!==null;){var s=Yh(i);if(s!==null&&Ij(s),s=c_(e,t,n,r),s===null&&py(e,t,r,Lm,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else py(e,t,r,null,n)}}var Lm=null;function c_(e,t,n,r){if(Lm=null,e=e2(r),e=ia(e),e!==null)if(t=za(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Rj(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 Lm=e,null}function Hj(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(MW()){case t2:return 1;case Dj:return 4;case Rm:case RW:return 16;case Nj:return 536870912;default:return 16}default:return 16}}var no=null,s2=null,Kp=null;function Wj(){if(Kp)return Kp;var e,t=s2,n=t.length,r,i="value"in no?no.value:no.textContent,s=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[s-r];r++);return Kp=i.slice(e,1<r?1-r:void 0)}function Yp(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 Gf(){return!0}function cE(){return!1}function Nr(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Gf:cE,this.isPropagationStopped=cE,this}return Qt(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=Gf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gf)},persist:function(){},isPersistent:Gf}),t}var Bc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},o2=Nr(Bc),Kh=Qt({},Bc,{view:0,detail:0}),HW=Nr(Kh),sy,oy,Tu,fv=Qt({},Kh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:a2,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!==Tu&&(Tu&&e.type==="mousemove"?(sy=e.screenX-Tu.screenX,oy=e.screenY-Tu.screenY):oy=sy=0,Tu=e),sy)},movementY:function(e){return"movementY"in e?e.movementY:oy}}),uE=Nr(fv),WW=Qt({},fv,{dataTransfer:0}),UW=Nr(WW),VW=Qt({},Kh,{relatedTarget:0}),ay=Nr(VW),qW=Qt({},Bc,{animationName:0,elapsedTime:0,pseudoElement:0}),GW=Nr(qW),KW=Qt({},Bc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),YW=Nr(KW),XW=Qt({},Bc,{data:0}),dE=Nr(XW),JW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},QW={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"},ZW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eU(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ZW[e])?!!t[e]:!1}function a2(){return eU}var tU=Qt({},Kh,{key:function(e){if(e.key){var t=JW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?QW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:a2,charCode:function(e){return e.type==="keypress"?Yp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nU=Nr(tU),rU=Qt({},fv,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hE=Nr(rU),iU=Qt({},Kh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:a2}),sU=Nr(iU),oU=Qt({},Bc,{propertyName:0,elapsedTime:0,pseudoElement:0}),aU=Nr(oU),lU=Qt({},fv,{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}),cU=Nr(lU),uU=[9,13,27,32],l2=Es&&"CompositionEvent"in window,Sd=null;Es&&"documentMode"in document&&(Sd=document.documentMode);var dU=Es&&"TextEvent"in window&&!Sd,Uj=Es&&(!l2||Sd&&8<Sd&&11>=Sd),fE=" ",pE=!1;function Vj(e,t){switch(e){case"keyup":return uU.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Al=!1;function hU(e,t){switch(e){case"compositionend":return qj(t);case"keypress":return t.which!==32?null:(pE=!0,fE);case"textInput":return e=t.data,e===fE&&pE?null:e;default:return null}}function fU(e,t){if(Al)return e==="compositionend"||!l2&&Vj(e,t)?(e=Wj(),Kp=s2=no=null,Al=!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 Uj&&t.locale!=="ko"?null:t.data;default:return null}}var pU={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 mE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pU[e.type]:t==="textarea"}function Gj(e,t,n,r){Cj(r),t=Dm(t,"onChange"),0<t.length&&(n=new o2("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Cd=null,Qd=null;function mU(e){i6(e,0)}function pv(e){var t=Dl(e);if(vj(t))return e}function gU(e,t){if(e==="change")return t}var Kj=!1;if(Es){var ly;if(Es){var cy="oninput"in document;if(!cy){var gE=document.createElement("div");gE.setAttribute("oninput","return;"),cy=typeof gE.oninput=="function"}ly=cy}else ly=!1;Kj=ly&&(!document.documentMode||9<document.documentMode)}function vE(){Cd&&(Cd.detachEvent("onpropertychange",Yj),Qd=Cd=null)}function Yj(e){if(e.propertyName==="value"&&pv(Qd)){var t=[];Gj(t,Qd,e,e2(e)),Mj(mU,t)}}function vU(e,t,n){e==="focusin"?(vE(),Cd=t,Qd=n,Cd.attachEvent("onpropertychange",Yj)):e==="focusout"&&vE()}function yU(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pv(Qd)}function xU(e,t){if(e==="click")return pv(t)}function _U(e,t){if(e==="input"||e==="change")return pv(t)}function bU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vi=typeof Object.is=="function"?Object.is:bU;function Zd(e,t){if(vi(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(!Vx.call(t,i)||!vi(e[i],t[i]))return!1}return!0}function yE(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xE(e,t){var n=yE(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=yE(n)}}function Xj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jj(){for(var e=window,t=Em();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Em(e.document)}return t}function c2(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 wU(e){var t=Jj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Xj(n.ownerDocument.documentElement,n)){if(r!==null&&c2(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,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=xE(n,s);var a=xE(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(),s>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 SU=Es&&"documentMode"in document&&11>=document.documentMode,jl=null,u_=null,kd=null,d_=!1;function _E(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;d_||jl==null||jl!==Em(r)||(r=jl,"selectionStart"in r&&c2(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}),kd&&Zd(kd,r)||(kd=r,r=Dm(u_,"onSelect"),0<r.length&&(t=new o2("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=jl)))}function Kf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ll={animationend:Kf("Animation","AnimationEnd"),animationiteration:Kf("Animation","AnimationIteration"),animationstart:Kf("Animation","AnimationStart"),transitionend:Kf("Transition","TransitionEnd")},uy={},Qj={};Es&&(Qj=document.createElement("div").style,"AnimationEvent"in window||(delete Ll.animationend.animation,delete Ll.animationiteration.animation,delete Ll.animationstart.animation),"TransitionEvent"in window||delete Ll.transitionend.transition);function mv(e){if(uy[e])return uy[e];if(!Ll[e])return e;var t=Ll[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qj)return uy[e]=t[n];return e}var Zj=mv("animationend"),e6=mv("animationiteration"),t6=mv("animationstart"),n6=mv("transitionend"),r6=new Map,bE="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 Po(e,t){r6.set(e,t),Fa(t,[e])}for(var dy=0;dy<bE.length;dy++){var hy=bE[dy],CU=hy.toLowerCase(),kU=hy[0].toUpperCase()+hy.slice(1);Po(CU,"on"+kU)}Po(Zj,"onAnimationEnd");Po(e6,"onAnimationIteration");Po(t6,"onAnimationStart");Po("dblclick","onDoubleClick");Po("focusin","onFocus");Po("focusout","onBlur");Po(n6,"onTransitionEnd");uc("onMouseEnter",["mouseout","mouseover"]);uc("onMouseLeave",["mouseout","mouseover"]);uc("onPointerEnter",["pointerout","pointerover"]);uc("onPointerLeave",["pointerout","pointerover"]);Fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ad="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(" "),EU=new Set("cancel close invalid load scroll toggle".split(" ").concat(ad));function wE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,CW(r,t,void 0,e),e.currentTarget=null}function i6(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 s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==s&&i.isPropagationStopped())break e;wE(i,o,c),s=l}else for(a=0;a<r.length;a++){if(o=r[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==s&&i.isPropagationStopped())break e;wE(i,o,c),s=l}}}if(Mm)throw e=o_,Mm=!1,o_=null,e}function Bt(e,t){var n=t[g_];n===void 0&&(n=t[g_]=new Set);var r=e+"__bubble";n.has(r)||(s6(t,e,2,!1),n.add(r))}function fy(e,t,n){var r=0;t&&(r|=4),s6(n,e,r,t)}var Yf="_reactListening"+Math.random().toString(36).slice(2);function eh(e){if(!e[Yf]){e[Yf]=!0,hj.forEach(function(n){n!=="selectionchange"&&(EU.has(n)||fy(n,!1,e),fy(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,fy("selectionchange",!1,t))}}function s6(e,t,n,r){switch(Hj(t)){case 1:var i=FW;break;case 4:i=zW;break;default:i=i2}n=i.bind(null,t,n,e),i=void 0,!s_||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 py(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.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(;o!==null;){if(a=ia(o),a===null)return;if(l=a.tag,l===5||l===6){r=s=a;continue e}o=o.parentNode}}r=r.return}Mj(function(){var c=s,h=e2(n),d=[];e:{var f=r6.get(e);if(f!==void 0){var g=o2,_=e;switch(e){case"keypress":if(Yp(n)===0)break e;case"keydown":case"keyup":g=nU;break;case"focusin":_="focus",g=ay;break;case"focusout":_="blur",g=ay;break;case"beforeblur":case"afterblur":g=ay;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=uE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=UW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=sU;break;case Zj:case e6:case t6:g=GW;break;case n6:g=aU;break;case"scroll":g=HW;break;case"wheel":g=cU;break;case"copy":case"cut":case"paste":g=YW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=hE}var y=(t&4)!==0,v=!y&&e==="scroll",m=y?f!==null?f+"Capture":null:f;y=[];for(var p=c,x;p!==null;){x=p;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,m!==null&&(b=Kd(p,m),b!=null&&y.push(th(p,b,x)))),v)break;p=p.return}0<y.length&&(f=new g(f,_,null,n,h),d.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==r_&&(_=n.relatedTarget||n.fromElement)&&(ia(_)||_[Ts]))break e;if((g||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,g?(_=n.relatedTarget||n.toElement,g=c,_=_?ia(_):null,_!==null&&(v=za(_),_!==v||_.tag!==5&&_.tag!==6)&&(_=null)):(g=null,_=c),g!==_)){if(y=uE,b="onMouseLeave",m="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(y=hE,b="onPointerLeave",m="onPointerEnter",p="pointer"),v=g==null?f:Dl(g),x=_==null?f:Dl(_),f=new y(b,p+"leave",g,n,h),f.target=v,f.relatedTarget=x,b=null,ia(h)===c&&(y=new y(m,p+"enter",_,n,h),y.target=x,y.relatedTarget=v,b=y),v=b,g&&_)t:{for(y=g,m=_,p=0,x=y;x;x=ml(x))p++;for(x=0,b=m;b;b=ml(b))x++;for(;0<p-x;)y=ml(y),p--;for(;0<x-p;)m=ml(m),x--;for(;p--;){if(y===m||m!==null&&y===m.alternate)break t;y=ml(y),m=ml(m)}y=null}else y=null;g!==null&&SE(d,f,g,y,!1),_!==null&&v!==null&&SE(d,v,_,y,!0)}}e:{if(f=c?Dl(c):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var S=gU;else if(mE(f))if(Kj)S=_U;else{S=yU;var C=vU}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=xU);if(S&&(S=S(e,c))){Gj(d,S,n,h);break e}C&&C(e,f,c),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&Qx(f,"number",f.value)}switch(C=c?Dl(c):window,e){case"focusin":(mE(C)||C.contentEditable==="true")&&(jl=C,u_=c,kd=null);break;case"focusout":kd=u_=jl=null;break;case"mousedown":d_=!0;break;case"contextmenu":case"mouseup":case"dragend":d_=!1,_E(d,n,h);break;case"selectionchange":if(SU)break;case"keydown":case"keyup":_E(d,n,h)}var E;if(l2)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Al?Vj(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(Uj&&n.locale!=="ko"&&(Al||k!=="onCompositionStart"?k==="onCompositionEnd"&&Al&&(E=Wj()):(no=h,s2="value"in no?no.value:no.textContent,Al=!0)),C=Dm(c,k),0<C.length&&(k=new dE(k,e,null,n,h),d.push({event:k,listeners:C}),E?k.data=E:(E=qj(n),E!==null&&(k.data=E)))),(E=dU?hU(e,n):fU(e,n))&&(c=Dm(c,"onBeforeInput"),0<c.length&&(h=new dE("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=E))}i6(d,t)})}function th(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Dm(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Kd(e,n),s!=null&&r.unshift(th(e,s,i)),s=Kd(e,t),s!=null&&r.push(th(e,s,i))),e=e.return}return r}function ml(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function SE(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(l!==null&&l===r)break;o.tag===5&&c!==null&&(o=c,i?(l=Kd(n,s),l!=null&&a.unshift(th(n,l,o))):i||(l=Kd(n,s),l!=null&&a.push(th(n,l,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var TU=/\r\n?/g,MU=/\u0000|\uFFFD/g;function CE(e){return(typeof e=="string"?e:""+e).replace(TU,`
`).replace(MU,"")}function Xf(e,t,n){if(t=CE(t),CE(e)!==t&&n)throw Error(pe(425))}function Nm(){}var h_=null,f_=null;function p_(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 m_=typeof setTimeout=="function"?setTimeout:void 0,RU=typeof clearTimeout=="function"?clearTimeout:void 0,kE=typeof Promise=="function"?Promise:void 0,AU=typeof queueMicrotask=="function"?queueMicrotask:typeof kE<"u"?function(e){return kE.resolve(null).then(e).catch(jU)}:m_;function jU(e){setTimeout(function(){throw e})}function my(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),Jd(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Jd(t)}function po(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 EE(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 Fc=Math.random().toString(36).slice(2),Ni="__reactFiber$"+Fc,nh="__reactProps$"+Fc,Ts="__reactContainer$"+Fc,g_="__reactEvents$"+Fc,LU="__reactListeners$"+Fc,DU="__reactHandles$"+Fc;function ia(e){var t=e[Ni];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ts]||n[Ni]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=EE(e);e!==null;){if(n=e[Ni])return n;e=EE(e)}return t}e=n,n=e.parentNode}return null}function Yh(e){return e=e[Ni]||e[Ts],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(pe(33))}function gv(e){return e[nh]||null}var v_=[],Nl=-1;function Oo(e){return{current:e}}function Ut(e){0>Nl||(e.current=v_[Nl],v_[Nl]=null,Nl--)}function Nt(e,t){Nl++,v_[Nl]=e.current,e.current=t}var So={},qn=Oo(So),hr=Oo(!1),_a=So;function dc(e,t){var n=e.type.contextTypes;if(!n)return So;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function fr(e){return e=e.childContextTypes,e!=null}function Pm(){Ut(hr),Ut(qn)}function TE(e,t,n){if(qn.current!==So)throw Error(pe(168));Nt(qn,t),Nt(hr,n)}function o6(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(pe(108,vW(e)||"Unknown",i));return Qt({},n,r)}function Om(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||So,_a=qn.current,Nt(qn,e),Nt(hr,hr.current),!0}function ME(e,t,n){var r=e.stateNode;if(!r)throw Error(pe(169));n?(e=o6(e,t,_a),r.__reactInternalMemoizedMergedChildContext=e,Ut(hr),Ut(qn),Nt(qn,e)):Ut(hr),Nt(hr,n)}var hs=null,vv=!1,gy=!1;function a6(e){hs===null?hs=[e]:hs.push(e)}function NU(e){vv=!0,a6(e)}function Io(){if(!gy&&hs!==null){gy=!0;var e=0,t=xt;try{var n=hs;for(xt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}hs=null,vv=!1}catch(i){throw hs!==null&&(hs=hs.slice(e+1)),Lj(t2,Io),i}finally{xt=t,gy=!1}}return null}var Pl=[],Ol=0,Im=null,$m=0,Ir=[],$r=0,ba=null,ms=1,gs="";function Xo(e,t){Pl[Ol++]=$m,Pl[Ol++]=Im,Im=e,$m=t}function l6(e,t,n){Ir[$r++]=ms,Ir[$r++]=gs,Ir[$r++]=ba,ba=e;var r=ms;e=gs;var i=32-pi(r)-1;r&=~(1<<i),n+=1;var s=32-pi(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,ms=1<<32-pi(t)+i|n<<i|r,gs=s+e}else ms=1<<s|n<<i|r,gs=e}function u2(e){e.return!==null&&(Xo(e,1),l6(e,1,0))}function d2(e){for(;e===Im;)Im=Pl[--Ol],Pl[Ol]=null,$m=Pl[--Ol],Pl[Ol]=null;for(;e===ba;)ba=Ir[--$r],Ir[$r]=null,gs=Ir[--$r],Ir[$r]=null,ms=Ir[--$r],Ir[$r]=null}var Mr=null,kr=null,qt=!1,ci=null;function c6(e,t){var n=Ur(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 RE(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,Mr=e,kr=po(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mr=e,kr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ba!==null?{id:ms,overflow:gs}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ur(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Mr=e,kr=null,!0):!1;default:return!1}}function y_(e){return(e.mode&1)!==0&&(e.flags&128)===0}function x_(e){if(qt){var t=kr;if(t){var n=t;if(!RE(e,t)){if(y_(e))throw Error(pe(418));t=po(n.nextSibling);var r=Mr;t&&RE(e,t)?c6(r,n):(e.flags=e.flags&-4097|2,qt=!1,Mr=e)}}else{if(y_(e))throw Error(pe(418));e.flags=e.flags&-4097|2,qt=!1,Mr=e}}}function AE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mr=e}function Jf(e){if(e!==Mr)return!1;if(!qt)return AE(e),qt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!p_(e.type,e.memoizedProps)),t&&(t=kr)){if(y_(e))throw u6(),Error(pe(418));for(;t;)c6(e,t),t=po(t.nextSibling)}if(AE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(pe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kr=po(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kr=null}}else kr=Mr?po(e.stateNode.nextSibling):null;return!0}function u6(){for(var e=kr;e;)e=po(e.nextSibling)}function hc(){kr=Mr=null,qt=!1}function h2(e){ci===null?ci=[e]:ci.push(e)}var PU=Is.ReactCurrentBatchConfig;function Mu(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(pe(309));var r=n.stateNode}if(!r)throw Error(pe(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(pe(284));if(!n._owner)throw Error(pe(290,e))}return e}function Qf(e,t){throw e=Object.prototype.toString.call(t),Error(pe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jE(e){var t=e._init;return t(e._payload)}function d6(e){function t(m,p){if(e){var x=m.deletions;x===null?(m.deletions=[p],m.flags|=16):x.push(p)}}function n(m,p){if(!e)return null;for(;p!==null;)t(m,p),p=p.sibling;return null}function r(m,p){for(m=new Map;p!==null;)p.key!==null?m.set(p.key,p):m.set(p.index,p),p=p.sibling;return m}function i(m,p){return m=yo(m,p),m.index=0,m.sibling=null,m}function s(m,p,x){return m.index=x,e?(x=m.alternate,x!==null?(x=x.index,x<p?(m.flags|=2,p):x):(m.flags|=2,p)):(m.flags|=1048576,p)}function a(m){return e&&m.alternate===null&&(m.flags|=2),m}function o(m,p,x,b){return p===null||p.tag!==6?(p=Sy(x,m.mode,b),p.return=m,p):(p=i(p,x),p.return=m,p)}function l(m,p,x,b){var S=x.type;return S===Rl?h(m,p,x.props.children,b,x.key):p!==null&&(p.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ys&&jE(S)===p.type)?(b=i(p,x.props),b.ref=Mu(m,p,x),b.return=m,b):(b=nm(x.type,x.key,x.props,null,m.mode,b),b.ref=Mu(m,p,x),b.return=m,b)}function c(m,p,x,b){return p===null||p.tag!==4||p.stateNode.containerInfo!==x.containerInfo||p.stateNode.implementation!==x.implementation?(p=Cy(x,m.mode,b),p.return=m,p):(p=i(p,x.children||[]),p.return=m,p)}function h(m,p,x,b,S){return p===null||p.tag!==7?(p=pa(x,m.mode,b,S),p.return=m,p):(p=i(p,x),p.return=m,p)}function d(m,p,x){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Sy(""+p,m.mode,x),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case zf:return x=nm(p.type,p.key,p.props,null,m.mode,x),x.ref=Mu(m,null,p),x.return=m,x;case Ml:return p=Cy(p,m.mode,x),p.return=m,p;case Ys:var b=p._init;return d(m,b(p._payload),x)}if(sd(p)||Su(p))return p=pa(p,m.mode,x,null),p.return=m,p;Qf(m,p)}return null}function f(m,p,x,b){var S=p!==null?p.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:o(m,p,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case zf:return x.key===S?l(m,p,x,b):null;case Ml:return x.key===S?c(m,p,x,b):null;case Ys:return S=x._init,f(m,p,S(x._payload),b)}if(sd(x)||Su(x))return S!==null?null:h(m,p,x,b,null);Qf(m,x)}return null}function g(m,p,x,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return m=m.get(x)||null,o(p,m,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case zf:return m=m.get(b.key===null?x:b.key)||null,l(p,m,b,S);case Ml:return m=m.get(b.key===null?x:b.key)||null,c(p,m,b,S);case Ys:var C=b._init;return g(m,p,x,C(b._payload),S)}if(sd(b)||Su(b))return m=m.get(x)||null,h(p,m,b,S,null);Qf(p,b)}return null}function _(m,p,x,b){for(var S=null,C=null,E=p,k=p=0,T=null;E!==null&&k<x.length;k++){E.index>k?(T=E,E=null):T=E.sibling;var R=f(m,E,x[k],b);if(R===null){E===null&&(E=T);break}e&&E&&R.alternate===null&&t(m,E),p=s(R,p,k),C===null?S=R:C.sibling=R,C=R,E=T}if(k===x.length)return n(m,E),qt&&Xo(m,k),S;if(E===null){for(;k<x.length;k++)E=d(m,x[k],b),E!==null&&(p=s(E,p,k),C===null?S=E:C.sibling=E,C=E);return qt&&Xo(m,k),S}for(E=r(m,E);k<x.length;k++)T=g(E,m,k,x[k],b),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?k:T.key),p=s(T,p,k),C===null?S=T:C.sibling=T,C=T);return e&&E.forEach(function(M){return t(m,M)}),qt&&Xo(m,k),S}function y(m,p,x,b){var S=Su(x);if(typeof S!="function")throw Error(pe(150));if(x=S.call(x),x==null)throw Error(pe(151));for(var C=S=null,E=p,k=p=0,T=null,R=x.next();E!==null&&!R.done;k++,R=x.next()){E.index>k?(T=E,E=null):T=E.sibling;var M=f(m,E,R.value,b);if(M===null){E===null&&(E=T);break}e&&E&&M.alternate===null&&t(m,E),p=s(M,p,k),C===null?S=M:C.sibling=M,C=M,E=T}if(R.done)return n(m,E),qt&&Xo(m,k),S;if(E===null){for(;!R.done;k++,R=x.next())R=d(m,R.value,b),R!==null&&(p=s(R,p,k),C===null?S=R:C.sibling=R,C=R);return qt&&Xo(m,k),S}for(E=r(m,E);!R.done;k++,R=x.next())R=g(E,m,k,R.value,b),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?k:R.key),p=s(R,p,k),C===null?S=R:C.sibling=R,C=R);return e&&E.forEach(function(L){return t(m,L)}),qt&&Xo(m,k),S}function v(m,p,x,b){if(typeof x=="object"&&x!==null&&x.type===Rl&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case zf:e:{for(var S=x.key,C=p;C!==null;){if(C.key===S){if(S=x.type,S===Rl){if(C.tag===7){n(m,C.sibling),p=i(C,x.props.children),p.return=m,m=p;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ys&&jE(S)===C.type){n(m,C.sibling),p=i(C,x.props),p.ref=Mu(m,C,x),p.return=m,m=p;break e}n(m,C);break}else t(m,C);C=C.sibling}x.type===Rl?(p=pa(x.props.children,m.mode,b,x.key),p.return=m,m=p):(b=nm(x.type,x.key,x.props,null,m.mode,b),b.ref=Mu(m,p,x),b.return=m,m=b)}return a(m);case Ml:e:{for(C=x.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===x.containerInfo&&p.stateNode.implementation===x.implementation){n(m,p.sibling),p=i(p,x.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=Cy(x,m.mode,b),p.return=m,m=p}return a(m);case Ys:return C=x._init,v(m,p,C(x._payload),b)}if(sd(x))return _(m,p,x,b);if(Su(x))return y(m,p,x,b);Qf(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,x),p.return=m,m=p):(n(m,p),p=Sy(x,m.mode,b),p.return=m,m=p),a(m)):n(m,p)}return v}var fc=d6(!0),h6=d6(!1),Bm=Oo(null),Fm=null,Il=null,f2=null;function p2(){f2=Il=Fm=null}function m2(e){var t=Bm.current;Ut(Bm),e._currentValue=t}function __(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 ql(e,t){Fm=e,f2=Il=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dr=!0),e.firstContext=null)}function Xr(e){var t=e._currentValue;if(f2!==e)if(e={context:e,memoizedValue:t,next:null},Il===null){if(Fm===null)throw Error(pe(308));Il=e,Fm.dependencies={lanes:0,firstContext:e}}else Il=Il.next=e;return t}var sa=null;function g2(e){sa===null?sa=[e]:sa.push(e)}function f6(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,g2(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ms(e,r)}function Ms(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 Xs=!1;function v2(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function p6(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 Cs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ct&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ms(e,n)}return i=r.interleaved,i===null?(t.next=t,g2(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ms(e,n)}function Xp(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,n2(e,n)}}function LE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=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};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 zm(e,t,n,r){var i=e.updateQueue;Xs=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;a=0,h=c=l=null,o=s;do{var f=o.lane,g=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var _=e,y=o;switch(f=t,g=n,y.tag){case 1:if(_=y.payload,typeof _=="function"){d=_.call(g,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=y.payload,f=typeof _=="function"?_.call(g,d,f):_,f==null)break e;d=Qt({},d,f);break e;case 2:Xs=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else g={eventTime:g,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=g,l=d):h=h.next=g,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=h,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Sa|=a,e.lanes=a,e.memoizedState=d}}function DE(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(pe(191,i));i.call(r)}}}var Xh={},Hi=Oo(Xh),rh=Oo(Xh),ih=Oo(Xh);function oa(e){if(e===Xh)throw Error(pe(174));return e}function y2(e,t){switch(Nt(ih,t),Nt(rh,e),Nt(Hi,Xh),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:e_(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=e_(t,e)}Ut(Hi),Nt(Hi,t)}function pc(){Ut(Hi),Ut(rh),Ut(ih)}function m6(e){oa(ih.current);var t=oa(Hi.current),n=e_(t,e.type);t!==n&&(Nt(rh,e),Nt(Hi,n))}function x2(e){rh.current===e&&(Ut(Hi),Ut(rh))}var Xt=Oo(0);function Hm(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 vy=[];function _2(){for(var e=0;e<vy.length;e++)vy[e]._workInProgressVersionPrimary=null;vy.length=0}var Jp=Is.ReactCurrentDispatcher,yy=Is.ReactCurrentBatchConfig,wa=0,Jt=null,mn=null,wn=null,Wm=!1,Ed=!1,sh=0,OU=0;function $n(){throw Error(pe(321))}function b2(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vi(e[n],t[n]))return!1;return!0}function w2(e,t,n,r,i,s){if(wa=s,Jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Jp.current=e===null||e.memoizedState===null?FU:zU,e=n(r,i),Ed){s=0;do{if(Ed=!1,sh=0,25<=s)throw Error(pe(301));s+=1,wn=mn=null,t.updateQueue=null,Jp.current=HU,e=n(r,i)}while(Ed)}if(Jp.current=Um,t=mn!==null&&mn.next!==null,wa=0,wn=mn=Jt=null,Wm=!1,t)throw Error(pe(300));return e}function S2(){var e=sh!==0;return sh=0,e}function Ai(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?Jt.memoizedState=wn=e:wn=wn.next=e,wn}function Jr(){if(mn===null){var e=Jt.alternate;e=e!==null?e.memoizedState:null}else e=mn.next;var t=wn===null?Jt.memoizedState:wn.next;if(t!==null)wn=t,mn=e;else{if(e===null)throw Error(pe(310));mn=e,e={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},wn===null?Jt.memoizedState=wn=e:wn=wn.next=e}return wn}function oh(e,t){return typeof t=="function"?t(e):t}function xy(e){var t=Jr(),n=t.queue;if(n===null)throw Error(pe(311));n.lastRenderedReducer=e;var r=mn,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,l=null,c=s;do{var h=c.lane;if((wa&h)===h)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 d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(o=l=d,a=r):l=l.next=d,Jt.lanes|=h,Sa|=h}c=c.next}while(c!==null&&c!==s);l===null?a=r:l.next=o,vi(r,t.memoizedState)||(dr=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Jt.lanes|=s,Sa|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function _y(e){var t=Jr(),n=t.queue;if(n===null)throw Error(pe(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);vi(s,t.memoizedState)||(dr=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function g6(){}function v6(e,t){var n=Jt,r=Jr(),i=t(),s=!vi(r.memoizedState,i);if(s&&(r.memoizedState=i,dr=!0),r=r.queue,C2(_6.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||wn!==null&&wn.memoizedState.tag&1){if(n.flags|=2048,ah(9,x6.bind(null,n,r,i,t),void 0,null),Cn===null)throw Error(pe(349));wa&30||y6(n,t,i)}return i}function y6(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Jt.updateQueue,t===null?(t={lastEffect:null,stores:null},Jt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function x6(e,t,n,r){t.value=n,t.getSnapshot=r,b6(t)&&w6(e)}function _6(e,t,n){return n(function(){b6(t)&&w6(e)})}function b6(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vi(e,n)}catch{return!0}}function w6(e){var t=Ms(e,1);t!==null&&mi(t,e,1,-1)}function NE(e){var t=Ai();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:oh,lastRenderedState:e},t.queue=e,e=e.dispatch=BU.bind(null,Jt,e),[t.memoizedState,e]}function ah(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Jt.updateQueue,t===null?(t={lastEffect:null,stores:null},Jt.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 S6(){return Jr().memoizedState}function Qp(e,t,n,r){var i=Ai();Jt.flags|=e,i.memoizedState=ah(1|t,n,void 0,r===void 0?null:r)}function yv(e,t,n,r){var i=Jr();r=r===void 0?null:r;var s=void 0;if(mn!==null){var a=mn.memoizedState;if(s=a.destroy,r!==null&&b2(r,a.deps)){i.memoizedState=ah(t,n,s,r);return}}Jt.flags|=e,i.memoizedState=ah(1|t,n,s,r)}function PE(e,t){return Qp(8390656,8,e,t)}function C2(e,t){return yv(2048,8,e,t)}function C6(e,t){return yv(4,2,e,t)}function k6(e,t){return yv(4,4,e,t)}function E6(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 T6(e,t,n){return n=n!=null?n.concat([e]):null,yv(4,4,E6.bind(null,t,e),n)}function k2(){}function M6(e,t){var n=Jr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&b2(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function R6(e,t){var n=Jr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&b2(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function A6(e,t,n){return wa&21?(vi(n,t)||(n=Pj(),Jt.lanes|=n,Sa|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,dr=!0),e.memoizedState=n)}function IU(e,t){var n=xt;xt=n!==0&&4>n?n:4,e(!0);var r=yy.transition;yy.transition={};try{e(!1),t()}finally{xt=n,yy.transition=r}}function j6(){return Jr().memoizedState}function $U(e,t,n){var r=vo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},L6(e))D6(t,n);else if(n=f6(e,t,n,r),n!==null){var i=er();mi(n,e,r,i),N6(n,t,r)}}function BU(e,t,n){var r=vo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(L6(e))D6(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,vi(o,a)){var l=t.interleaved;l===null?(i.next=i,g2(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=f6(e,t,i,r),n!==null&&(i=er(),mi(n,e,r,i),N6(n,t,r))}}function L6(e){var t=e.alternate;return e===Jt||t!==null&&t===Jt}function D6(e,t){Ed=Wm=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function N6(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,n2(e,n)}}var Um={readContext:Xr,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useInsertionEffect:$n,useLayoutEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useMutableSource:$n,useSyncExternalStore:$n,useId:$n,unstable_isNewReconciler:!1},FU={readContext:Xr,useCallback:function(e,t){return Ai().memoizedState=[e,t===void 0?null:t],e},useContext:Xr,useEffect:PE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qp(4194308,4,E6.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qp(4,2,e,t)},useMemo:function(e,t){var n=Ai();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ai();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=$U.bind(null,Jt,e),[r.memoizedState,e]},useRef:function(e){var t=Ai();return e={current:e},t.memoizedState=e},useState:NE,useDebugValue:k2,useDeferredValue:function(e){return Ai().memoizedState=e},useTransition:function(){var e=NE(!1),t=e[0];return e=IU.bind(null,e[1]),Ai().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Jt,i=Ai();if(qt){if(n===void 0)throw Error(pe(407));n=n()}else{if(n=t(),Cn===null)throw Error(pe(349));wa&30||y6(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,PE(_6.bind(null,r,s,e),[e]),r.flags|=2048,ah(9,x6.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ai(),t=Cn.identifierPrefix;if(qt){var n=gs,r=ms;n=(r&~(1<<32-pi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=sh++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=OU++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zU={readContext:Xr,useCallback:M6,useContext:Xr,useEffect:C2,useImperativeHandle:T6,useInsertionEffect:C6,useLayoutEffect:k6,useMemo:R6,useReducer:xy,useRef:S6,useState:function(){return xy(oh)},useDebugValue:k2,useDeferredValue:function(e){var t=Jr();return A6(t,mn.memoizedState,e)},useTransition:function(){var e=xy(oh)[0],t=Jr().memoizedState;return[e,t]},useMutableSource:g6,useSyncExternalStore:v6,useId:j6,unstable_isNewReconciler:!1},HU={readContext:Xr,useCallback:M6,useContext:Xr,useEffect:C2,useImperativeHandle:T6,useInsertionEffect:C6,useLayoutEffect:k6,useMemo:R6,useReducer:_y,useRef:S6,useState:function(){return _y(oh)},useDebugValue:k2,useDeferredValue:function(e){var t=Jr();return mn===null?t.memoizedState=e:A6(t,mn.memoizedState,e)},useTransition:function(){var e=_y(oh)[0],t=Jr().memoizedState;return[e,t]},useMutableSource:g6,useSyncExternalStore:v6,useId:j6,unstable_isNewReconciler:!1};function si(e,t){if(e&&e.defaultProps){t=Qt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function b_(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xv={isMounted:function(e){return(e=e._reactInternals)?za(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=er(),i=vo(e),s=Cs(r,i);s.payload=t,n!=null&&(s.callback=n),t=mo(e,s,i),t!==null&&(mi(t,e,i,r),Xp(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=er(),i=vo(e),s=Cs(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=mo(e,s,i),t!==null&&(mi(t,e,i,r),Xp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=er(),r=vo(e),i=Cs(n,r);i.tag=2,t!=null&&(i.callback=t),t=mo(e,i,r),t!==null&&(mi(t,e,r,n),Xp(t,e,r))}};function OE(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!Zd(n,r)||!Zd(i,s):!0}function P6(e,t,n){var r=!1,i=So,s=t.contextType;return typeof s=="object"&&s!==null?s=Xr(s):(i=fr(t)?_a:qn.current,r=t.contextTypes,s=(r=r!=null)?dc(e,i):So),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xv,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function IE(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&&xv.enqueueReplaceState(t,t.state,null)}function w_(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},v2(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Xr(s):(s=fr(t)?_a:qn.current,i.context=dc(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(b_(e,t,s,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&&xv.enqueueReplaceState(i,i.state,null),zm(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function mc(e,t){try{var n="",r=t;do n+=gW(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function by(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function S_(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WU=typeof WeakMap=="function"?WeakMap:Map;function O6(e,t,n){n=Cs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qm||(qm=!0,D_=r),S_(e,t)},n}function I6(e,t,n){n=Cs(-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(){S_(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){S_(e,t),typeof r!="function"&&(go===null?go=new Set([this]):go.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function $E(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WU;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=rV.bind(null,e,t,n),t.then(e,e))}function BE(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 FE(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=Cs(-1,1),t.tag=2,mo(n,t,1))),n.lanes|=1),e)}var UU=Is.ReactCurrentOwner,dr=!1;function Yn(e,t,n,r){t.child=e===null?h6(t,null,n,r):fc(t,e.child,n,r)}function zE(e,t,n,r,i){n=n.render;var s=t.ref;return ql(t,i),r=w2(e,t,n,r,s,i),n=S2(),e!==null&&!dr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Rs(e,t,i)):(qt&&n&&u2(t),t.flags|=1,Yn(e,t,r,i),t.child)}function HE(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!D2(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,$6(e,t,s,r,i)):(e=nm(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:Zd,n(a,r)&&e.ref===t.ref)return Rs(e,t,i)}return t.flags|=1,e=yo(s,r),e.ref=t.ref,e.return=t,t.child=e}function $6(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Zd(s,r)&&e.ref===t.ref)if(dr=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(dr=!0);else return t.lanes=e.lanes,Rs(e,t,i)}return C_(e,t,n,r,i)}function B6(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(Bl,Sr),Sr|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Nt(Bl,Sr),Sr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Nt(Bl,Sr),Sr|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Nt(Bl,Sr),Sr|=r;return Yn(e,t,i,n),t.child}function F6(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function C_(e,t,n,r,i){var s=fr(n)?_a:qn.current;return s=dc(t,s),ql(t,i),n=w2(e,t,n,r,s,i),r=S2(),e!==null&&!dr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Rs(e,t,i)):(qt&&r&&u2(t),t.flags|=1,Yn(e,t,n,i),t.child)}function WE(e,t,n,r,i){if(fr(n)){var s=!0;Om(t)}else s=!1;if(ql(t,i),t.stateNode===null)Zp(e,t),P6(t,n,r),w_(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=Xr(c):(c=fr(n)?_a:qn.current,c=dc(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==c)&&IE(t,a,r,c),Xs=!1;var f=t.memoizedState;a.state=f,zm(t,r,a,i),l=t.memoizedState,o!==r||f!==l||hr.current||Xs?(typeof h=="function"&&(b_(t,n,h,r),l=t.memoizedState),(o=Xs||OE(t,n,o,r,f,l,c))?(d||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=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,p6(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:si(t.type,o),a.props=c,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=Xr(l):(l=fr(n)?_a:qn.current,l=dc(t,l));var g=n.getDerivedStateFromProps;(h=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==l)&&IE(t,a,r,l),Xs=!1,f=t.memoizedState,a.state=f,zm(t,r,a,i);var _=t.memoizedState;o!==d||f!==_||hr.current||Xs?(typeof g=="function"&&(b_(t,n,g,r),_=t.memoizedState),(c=Xs||OE(t,n,c,r,f,_,l)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,_,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,_,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=_),a.props=r,a.state=_,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return k_(e,t,n,r,s,i)}function k_(e,t,n,r,i,s){F6(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&ME(t,n,!1),Rs(e,t,s);r=t.stateNode,UU.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=fc(t,e.child,null,s),t.child=fc(t,null,o,s)):Yn(e,t,o,s),t.memoizedState=r.state,i&&ME(t,n,!0),t.child}function z6(e){var t=e.stateNode;t.pendingContext?TE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&TE(e,t.context,!1),y2(e,t.containerInfo)}function UE(e,t,n,r,i){return hc(),h2(i),t.flags|=256,Yn(e,t,n,r),t.child}var E_={dehydrated:null,treeContext:null,retryLane:0};function T_(e){return{baseLanes:e,cachePool:null,transitions:null}}function H6(e,t,n){var r=t.pendingProps,i=Xt.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Nt(Xt,i&1),e===null)return x_(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,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=wv(a,r,0,null),e=pa(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=T_(n),t.memoizedState=E_,e):E2(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return VU(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=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=yo(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=yo(o,s):(s=pa(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?T_(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=E_,r}return s=e.child,e=s.sibling,r=yo(s,{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 E2(e,t){return t=wv({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zf(e,t,n,r){return r!==null&&h2(r),fc(t,e.child,null,n),e=E2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function VU(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=by(Error(pe(422))),Zf(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=wv({mode:"visible",children:r.children},i,0,null),s=pa(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&fc(t,e.child,null,a),t.child.memoizedState=T_(a),t.memoizedState=E_,s);if(!(t.mode&1))return Zf(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(pe(419)),r=by(s,r,void 0),Zf(e,t,a,r)}if(o=(a&e.childLanes)!==0,dr||o){if(r=Cn,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!==s.retryLane&&(s.retryLane=i,Ms(e,i),mi(r,e,i,-1))}return L2(),r=by(Error(pe(421))),Zf(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=iV.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,kr=po(i.nextSibling),Mr=t,qt=!0,ci=null,e!==null&&(Ir[$r++]=ms,Ir[$r++]=gs,Ir[$r++]=ba,ms=e.id,gs=e.overflow,ba=t),t=E2(t,r.children),t.flags|=4096,t)}function VE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),__(e.return,t,n)}function wy(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function W6(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Yn(e,t,r.children,n),r=Xt.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&&VE(e,n,t);else if(e.tag===19)VE(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(Nt(Xt,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&&Hm(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wy(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Hm(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wy(t,!0,n,null,s);break;case"together":wy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Rs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sa|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(pe(153));if(t.child!==null){for(e=t.child,n=yo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function qU(e,t,n){switch(t.tag){case 3:z6(t),hc();break;case 5:m6(t);break;case 1:fr(t.type)&&Om(t);break;case 4:y2(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Nt(Bm,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Nt(Xt,Xt.current&1),t.flags|=128,null):n&t.child.childLanes?H6(e,t,n):(Nt(Xt,Xt.current&1),e=Rs(e,t,n),e!==null?e.sibling:null);Nt(Xt,Xt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return W6(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Nt(Xt,Xt.current),r)break;return null;case 22:case 23:return t.lanes=0,B6(e,t,n)}return Rs(e,t,n)}var U6,M_,V6,q6;U6=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}};M_=function(){};V6=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,oa(Hi.current);var s=null;switch(n){case"input":i=Xx(e,i),r=Xx(e,r),s=[];break;case"select":i=Qt({},i,{value:void 0}),r=Qt({},r,{value:void 0}),s=[];break;case"textarea":i=Zx(e,i),r=Zx(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Nm)}t_(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(qd.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(qd.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Bt("scroll",e),s||o===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};q6=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ru(e,t){if(!qt)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 Bn(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 GU(e,t,n){var r=t.pendingProps;switch(d2(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(t),null;case 1:return fr(t.type)&&Pm(),Bn(t),null;case 3:return r=t.stateNode,pc(),Ut(hr),Ut(qn),_2(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Jf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ci!==null&&(O_(ci),ci=null))),M_(e,t),Bn(t),null;case 5:x2(t);var i=oa(ih.current);if(n=t.type,e!==null&&t.stateNode!=null)V6(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(pe(166));return Bn(t),null}if(e=oa(Hi.current),Jf(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Ni]=t,r[nh]=s,e=(t.mode&1)!==0,n){case"dialog":Bt("cancel",r),Bt("close",r);break;case"iframe":case"object":case"embed":Bt("load",r);break;case"video":case"audio":for(i=0;i<ad.length;i++)Bt(ad[i],r);break;case"source":Bt("error",r);break;case"img":case"image":case"link":Bt("error",r),Bt("load",r);break;case"details":Bt("toggle",r);break;case"input":eE(r,s),Bt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Bt("invalid",r);break;case"textarea":nE(r,s),Bt("invalid",r)}t_(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&Xf(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&Xf(r.textContent,o,e),i=["children",""+o]):qd.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Bt("scroll",r)}switch(n){case"input":Hf(r),tE(r,s,!0);break;case"textarea":Hf(r),rE(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Nm)}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=_j(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[Ni]=t,e[nh]=r,U6(e,t,!1,!1),t.stateNode=e;e:{switch(a=n_(n,r),n){case"dialog":Bt("cancel",e),Bt("close",e),i=r;break;case"iframe":case"object":case"embed":Bt("load",e),i=r;break;case"video":case"audio":for(i=0;i<ad.length;i++)Bt(ad[i],e);i=r;break;case"source":Bt("error",e),i=r;break;case"img":case"image":case"link":Bt("error",e),Bt("load",e),i=r;break;case"details":Bt("toggle",e),i=r;break;case"input":eE(e,r),i=Xx(e,r),Bt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qt({},r,{value:void 0}),Bt("invalid",e);break;case"textarea":nE(e,r),i=Zx(e,r),Bt("invalid",e);break;default:i=r}t_(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="style"?Sj(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&bj(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Gd(e,l):typeof l=="number"&&Gd(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(qd.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Bt("scroll",e):l!=null&&Xw(e,s,l,a))}switch(n){case"input":Hf(e),tE(e,r,!1);break;case"textarea":Hf(e),rE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wo(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Hl(e,!!r.multiple,s,!1):r.defaultValue!=null&&Hl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Nm)}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 Bn(t),null;case 6:if(e&&t.stateNode!=null)q6(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(pe(166));if(n=oa(ih.current),oa(Hi.current),Jf(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ni]=t,(s=r.nodeValue!==n)&&(e=Mr,e!==null))switch(e.tag){case 3:Xf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xf(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ni]=t,t.stateNode=r}return Bn(t),null;case 13:if(Ut(Xt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qt&&kr!==null&&t.mode&1&&!(t.flags&128))u6(),hc(),t.flags|=98560,s=!1;else if(s=Jf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(pe(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(pe(317));s[Ni]=t}else hc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bn(t),s=!1}else ci!==null&&(O_(ci),ci=null),s=!0;if(!s)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||Xt.current&1?xn===0&&(xn=3):L2())),t.updateQueue!==null&&(t.flags|=4),Bn(t),null);case 4:return pc(),M_(e,t),e===null&&eh(t.stateNode.containerInfo),Bn(t),null;case 10:return m2(t.type._context),Bn(t),null;case 17:return fr(t.type)&&Pm(),Bn(t),null;case 19:if(Ut(Xt),s=t.memoizedState,s===null)return Bn(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Ru(s,!1);else{if(xn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Hm(e),a!==null){for(t.flags|=128,Ru(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Nt(Xt,Xt.current&1|2),t.child}e=e.sibling}s.tail!==null&&an()>gc&&(t.flags|=128,r=!0,Ru(s,!1),t.lanes=4194304)}else{if(!r)if(e=Hm(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ru(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!qt)return Bn(t),null}else 2*an()-s.renderingStartTime>gc&&n!==1073741824&&(t.flags|=128,r=!0,Ru(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=an(),t.sibling=null,n=Xt.current,Nt(Xt,r?n&1|2:n&1),t):(Bn(t),null);case 22:case 23:return j2(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Sr&1073741824&&(Bn(t),t.subtreeFlags&6&&(t.flags|=8192)):Bn(t),null;case 24:return null;case 25:return null}throw Error(pe(156,t.tag))}function KU(e,t){switch(d2(t),t.tag){case 1:return fr(t.type)&&Pm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pc(),Ut(hr),Ut(qn),_2(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return x2(t),null;case 13:if(Ut(Xt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(pe(340));hc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ut(Xt),null;case 4:return pc(),null;case 10:return m2(t.type._context),null;case 22:case 23:return j2(),null;case 24:return null;default:return null}}var ep=!1,Wn=!1,YU=typeof WeakSet=="function"?WeakSet:Set,Se=null;function $l(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){nn(e,t,r)}else n.current=null}function R_(e,t,n){try{n()}catch(r){nn(e,t,r)}}var qE=!1;function XU(e,t){if(h_=jm,e=Jj(),c2(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==s||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===s&&++h===r&&(l=a),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(f_={focusedElem:e,selectionRange:n},jm=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var y=_.memoizedProps,v=_.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:si(t.type,y),v);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(pe(163))}}catch(b){nn(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return _=qE,qE=!1,_}function Td(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 s=i.destroy;i.destroy=void 0,s!==void 0&&R_(t,n,s)}i=i.next}while(i!==r)}}function _v(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 A_(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 G6(e){var t=e.alternate;t!==null&&(e.alternate=null,G6(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[nh],delete t[g_],delete t[LU],delete t[DU])),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 K6(e){return e.tag===5||e.tag===3||e.tag===4}function GE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||K6(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 j_(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=Nm));else if(r!==4&&(e=e.child,e!==null))for(j_(e,t,n),e=e.sibling;e!==null;)j_(e,t,n),e=e.sibling}function L_(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(L_(e,t,n),e=e.sibling;e!==null;)L_(e,t,n),e=e.sibling}var Ln=null,oi=!1;function Hs(e,t,n){for(n=n.child;n!==null;)Y6(e,t,n),n=n.sibling}function Y6(e,t,n){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(hv,n)}catch{}switch(n.tag){case 5:Wn||$l(n,t);case 6:var r=Ln,i=oi;Ln=null,Hs(e,t,n),Ln=r,oi=i,Ln!==null&&(oi?(e=Ln,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ln.removeChild(n.stateNode));break;case 18:Ln!==null&&(oi?(e=Ln,n=n.stateNode,e.nodeType===8?my(e.parentNode,n):e.nodeType===1&&my(e,n),Jd(e)):my(Ln,n.stateNode));break;case 4:r=Ln,i=oi,Ln=n.stateNode.containerInfo,oi=!0,Hs(e,t,n),Ln=r,oi=i;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&R_(n,t,a),i=i.next}while(i!==r)}Hs(e,t,n);break;case 1:if(!Wn&&($l(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){nn(n,t,o)}Hs(e,t,n);break;case 21:Hs(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,Hs(e,t,n),Wn=r):Hs(e,t,n);break;default:Hs(e,t,n)}}function KE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new YU),t.forEach(function(r){var i=sV.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ri(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:Ln=o.stateNode,oi=!1;break e;case 3:Ln=o.stateNode.containerInfo,oi=!0;break e;case 4:Ln=o.stateNode.containerInfo,oi=!0;break e}o=o.return}if(Ln===null)throw Error(pe(160));Y6(s,a,i),Ln=null,oi=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){nn(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)X6(t,e),t=t.sibling}function X6(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ri(t,e),Ti(e),r&4){try{Td(3,e,e.return),_v(3,e)}catch(y){nn(e,e.return,y)}try{Td(5,e,e.return)}catch(y){nn(e,e.return,y)}}break;case 1:ri(t,e),Ti(e),r&512&&n!==null&&$l(n,n.return);break;case 5:if(ri(t,e),Ti(e),r&512&&n!==null&&$l(n,n.return),e.flags&32){var i=e.stateNode;try{Gd(i,"")}catch(y){nn(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,o=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&yj(i,s),n_(o,a);var c=n_(o,s);for(a=0;a<l.length;a+=2){var h=l[a],d=l[a+1];h==="style"?Sj(i,d):h==="dangerouslySetInnerHTML"?bj(i,d):h==="children"?Gd(i,d):Xw(i,h,d,c)}switch(o){case"input":Jx(i,s);break;case"textarea":xj(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var g=s.value;g!=null?Hl(i,!!s.multiple,g,!1):f!==!!s.multiple&&(s.defaultValue!=null?Hl(i,!!s.multiple,s.defaultValue,!0):Hl(i,!!s.multiple,s.multiple?[]:"",!1))}i[nh]=s}catch(y){nn(e,e.return,y)}}break;case 6:if(ri(t,e),Ti(e),r&4){if(e.stateNode===null)throw Error(pe(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(y){nn(e,e.return,y)}}break;case 3:if(ri(t,e),Ti(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Jd(t.containerInfo)}catch(y){nn(e,e.return,y)}break;case 4:ri(t,e),Ti(e);break;case 13:ri(t,e),Ti(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(R2=an())),r&4&&KE(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Wn=(c=Wn)||h,ri(t,e),Wn=c):ri(t,e),Ti(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(Se=e,h=e.child;h!==null;){for(d=Se=h;Se!==null;){switch(f=Se,g=f.child,f.tag){case 0:case 11:case 14:case 15:Td(4,f,f.return);break;case 1:$l(f,f.return);var _=f.stateNode;if(typeof _.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,_.props=t.memoizedProps,_.state=t.memoizedState,_.componentWillUnmount()}catch(y){nn(r,n,y)}}break;case 5:$l(f,f.return);break;case 22:if(f.memoizedState!==null){XE(d);continue}}g!==null?(g.return=f,Se=g):XE(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{i=d.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=wj("display",a))}catch(y){nn(e,e.return,y)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(y){nn(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ri(t,e),Ti(e),r&4&&KE(e);break;case 21:break;default:ri(t,e),Ti(e)}}function Ti(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(K6(n)){var r=n;break e}n=n.return}throw Error(pe(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Gd(i,""),r.flags&=-33);var s=GE(e);L_(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=GE(e);j_(e,o,a);break;default:throw Error(pe(161))}}catch(l){nn(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function JU(e,t,n){Se=e,J6(e)}function J6(e,t,n){for(var r=(e.mode&1)!==0;Se!==null;){var i=Se,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||ep;if(!a){var o=i.alternate,l=o!==null&&o.memoizedState!==null||Wn;o=ep;var c=Wn;if(ep=a,(Wn=l)&&!c)for(Se=i;Se!==null;)a=Se,l=a.child,a.tag===22&&a.memoizedState!==null?JE(i):l!==null?(l.return=a,Se=l):JE(i);for(;s!==null;)Se=s,J6(s),s=s.sibling;Se=i,ep=o,Wn=c}YE(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Se=s):YE(e)}}function YE(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Wn||_v(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Wn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:si(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&DE(t,s,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}DE(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;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 h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&Jd(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(pe(163))}Wn||t.flags&512&&A_(t)}catch(f){nn(t,t.return,f)}}if(t===e){Se=null;break}if(n=t.sibling,n!==null){n.return=t.return,Se=n;break}Se=t.return}}function XE(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Se=n;break}Se=t.return}}function JE(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{_v(4,t)}catch(l){nn(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){nn(t,i,l)}}var s=t.return;try{A_(t)}catch(l){nn(t,s,l)}break;case 5:var a=t.return;try{A_(t)}catch(l){nn(t,a,l)}}}catch(l){nn(t,t.return,l)}if(t===e){Se=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Se=o;break}Se=t.return}}var QU=Math.ceil,Vm=Is.ReactCurrentDispatcher,T2=Is.ReactCurrentOwner,qr=Is.ReactCurrentBatchConfig,ct=0,Cn=null,un=null,Dn=0,Sr=0,Bl=Oo(0),xn=0,lh=null,Sa=0,bv=0,M2=0,Md=null,lr=null,R2=0,gc=1/0,us=null,qm=!1,D_=null,go=null,tp=!1,ro=null,Gm=0,Rd=0,N_=null,em=-1,tm=0;function er(){return ct&6?an():em!==-1?em:em=an()}function vo(e){return e.mode&1?ct&2&&Dn!==0?Dn&-Dn:PU.transition!==null?(tm===0&&(tm=Pj()),tm):(e=xt,e!==0||(e=window.event,e=e===void 0?16:Hj(e.type)),e):1}function mi(e,t,n,r){if(50<Rd)throw Rd=0,N_=null,Error(pe(185));Gh(e,n,r),(!(ct&2)||e!==Cn)&&(e===Cn&&(!(ct&2)&&(bv|=n),xn===4&&eo(e,Dn)),pr(e,r),n===1&&ct===0&&!(t.mode&1)&&(gc=an()+500,vv&&Io()))}function pr(e,t){var n=e.callbackNode;PW(e,t);var r=Am(e,e===Cn?Dn:0);if(r===0)n!==null&&oE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&oE(n),t===1)e.tag===0?NU(QE.bind(null,e)):a6(QE.bind(null,e)),AU(function(){!(ct&6)&&Io()}),n=null;else{switch(Oj(r)){case 1:n=t2;break;case 4:n=Dj;break;case 16:n=Rm;break;case 536870912:n=Nj;break;default:n=Rm}n=sL(n,Q6.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Q6(e,t){if(em=-1,tm=0,ct&6)throw Error(pe(327));var n=e.callbackNode;if(Gl()&&e.callbackNode!==n)return null;var r=Am(e,e===Cn?Dn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Km(e,r);else{t=r;var i=ct;ct|=2;var s=eL();(Cn!==e||Dn!==t)&&(us=null,gc=an()+500,fa(e,t));do try{tV();break}catch(o){Z6(e,o)}while(!0);p2(),Vm.current=s,ct=i,un!==null?t=0:(Cn=null,Dn=0,t=xn)}if(t!==0){if(t===2&&(i=a_(e),i!==0&&(r=i,t=P_(e,i))),t===1)throw n=lh,fa(e,0),eo(e,r),pr(e,an()),n;if(t===6)eo(e,r);else{if(i=e.current.alternate,!(r&30)&&!ZU(i)&&(t=Km(e,r),t===2&&(s=a_(e),s!==0&&(r=s,t=P_(e,s))),t===1))throw n=lh,fa(e,0),eo(e,r),pr(e,an()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(pe(345));case 2:Jo(e,lr,us);break;case 3:if(eo(e,r),(r&130023424)===r&&(t=R2+500-an(),10<t)){if(Am(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){er(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=m_(Jo.bind(null,e,lr,us),t);break}Jo(e,lr,us);break;case 4:if(eo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-pi(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=an()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*QU(r/1960))-r,10<r){e.timeoutHandle=m_(Jo.bind(null,e,lr,us),r);break}Jo(e,lr,us);break;case 5:Jo(e,lr,us);break;default:throw Error(pe(329))}}}return pr(e,an()),e.callbackNode===n?Q6.bind(null,e):null}function P_(e,t){var n=Md;return e.current.memoizedState.isDehydrated&&(fa(e,t).flags|=256),e=Km(e,t),e!==2&&(t=lr,lr=n,t!==null&&O_(t)),e}function O_(e){lr===null?lr=e:lr.push.apply(lr,e)}function ZU(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],s=i.getSnapshot;i=i.value;try{if(!vi(s(),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 eo(e,t){for(t&=~M2,t&=~bv,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-pi(t),r=1<<n;e[n]=-1,t&=~r}}function QE(e){if(ct&6)throw Error(pe(327));Gl();var t=Am(e,0);if(!(t&1))return pr(e,an()),null;var n=Km(e,t);if(e.tag!==0&&n===2){var r=a_(e);r!==0&&(t=r,n=P_(e,r))}if(n===1)throw n=lh,fa(e,0),eo(e,t),pr(e,an()),n;if(n===6)throw Error(pe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jo(e,lr,us),pr(e,an()),null}function A2(e,t){var n=ct;ct|=1;try{return e(t)}finally{ct=n,ct===0&&(gc=an()+500,vv&&Io())}}function Ca(e){ro!==null&&ro.tag===0&&!(ct&6)&&Gl();var t=ct;ct|=1;var n=qr.transition,r=xt;try{if(qr.transition=null,xt=1,e)return e()}finally{xt=r,qr.transition=n,ct=t,!(ct&6)&&Io()}}function j2(){Sr=Bl.current,Ut(Bl)}function fa(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,RU(n)),un!==null)for(n=un.return;n!==null;){var r=n;switch(d2(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Pm();break;case 3:pc(),Ut(hr),Ut(qn),_2();break;case 5:x2(r);break;case 4:pc();break;case 13:Ut(Xt);break;case 19:Ut(Xt);break;case 10:m2(r.type._context);break;case 22:case 23:j2()}n=n.return}if(Cn=e,un=e=yo(e.current,null),Dn=Sr=t,xn=0,lh=null,M2=bv=Sa=0,lr=Md=null,sa!==null){for(t=0;t<sa.length;t++)if(n=sa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}sa=null}return e}function Z6(e,t){do{var n=un;try{if(p2(),Jp.current=Um,Wm){for(var r=Jt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Wm=!1}if(wa=0,wn=mn=Jt=null,Ed=!1,sh=0,T2.current=null,n===null||n.return===null){xn=1,lh=t,un=null;break}e:{var s=e,a=n.return,o=n,l=t;if(t=Dn,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,h=o,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var g=BE(a);if(g!==null){g.flags&=-257,FE(g,a,o,s,t),g.mode&1&&$E(s,c,t),t=g,l=c;var _=t.updateQueue;if(_===null){var y=new Set;y.add(l),t.updateQueue=y}else _.add(l);break e}else{if(!(t&1)){$E(s,c,t),L2();break e}l=Error(pe(426))}}else if(qt&&o.mode&1){var v=BE(a);if(v!==null){!(v.flags&65536)&&(v.flags|=256),FE(v,a,o,s,t),h2(mc(l,o));break e}}s=l=mc(l,o),xn!==4&&(xn=2),Md===null?Md=[s]:Md.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=O6(s,l,t);LE(s,m);break e;case 1:o=l;var p=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof p.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(go===null||!go.has(x)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=I6(s,o,t);LE(s,b);break e}}s=s.return}while(s!==null)}nL(n)}catch(S){t=S,un===n&&n!==null&&(un=n=n.return);continue}break}while(!0)}function eL(){var e=Vm.current;return Vm.current=Um,e===null?Um:e}function L2(){(xn===0||xn===3||xn===2)&&(xn=4),Cn===null||!(Sa&268435455)&&!(bv&268435455)||eo(Cn,Dn)}function Km(e,t){var n=ct;ct|=2;var r=eL();(Cn!==e||Dn!==t)&&(us=null,fa(e,t));do try{eV();break}catch(i){Z6(e,i)}while(!0);if(p2(),ct=n,Vm.current=r,un!==null)throw Error(pe(261));return Cn=null,Dn=0,xn}function eV(){for(;un!==null;)tL(un)}function tV(){for(;un!==null&&!EW();)tL(un)}function tL(e){var t=iL(e.alternate,e,Sr);e.memoizedProps=e.pendingProps,t===null?nL(e):un=t,T2.current=null}function nL(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=KU(n,t),n!==null){n.flags&=32767,un=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{xn=6,un=null;return}}else if(n=GU(n,t,Sr),n!==null){un=n;return}if(t=t.sibling,t!==null){un=t;return}un=t=e}while(t!==null);xn===0&&(xn=5)}function Jo(e,t,n){var r=xt,i=qr.transition;try{qr.transition=null,xt=1,nV(e,t,n,r)}finally{qr.transition=i,xt=r}return null}function nV(e,t,n,r){do Gl();while(ro!==null);if(ct&6)throw Error(pe(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(pe(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(OW(e,s),e===Cn&&(un=Cn=null,Dn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||tp||(tp=!0,sL(Rm,function(){return Gl(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=qr.transition,qr.transition=null;var a=xt;xt=1;var o=ct;ct|=4,T2.current=null,XU(e,n),X6(n,e),wU(f_),jm=!!h_,f_=h_=null,e.current=n,JU(n),TW(),ct=o,xt=a,qr.transition=s}else e.current=n;if(tp&&(tp=!1,ro=e,Gm=i),s=e.pendingLanes,s===0&&(go=null),AW(n.stateNode),pr(e,an()),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(qm)throw qm=!1,e=D_,D_=null,e;return Gm&1&&e.tag!==0&&Gl(),s=e.pendingLanes,s&1?e===N_?Rd++:(Rd=0,N_=e):Rd=0,Io(),null}function Gl(){if(ro!==null){var e=Oj(Gm),t=qr.transition,n=xt;try{if(qr.transition=null,xt=16>e?16:e,ro===null)var r=!1;else{if(e=ro,ro=null,Gm=0,ct&6)throw Error(pe(331));var i=ct;for(ct|=4,Se=e.current;Se!==null;){var s=Se,a=s.child;if(Se.flags&16){var o=s.deletions;if(o!==null){for(var l=0;l<o.length;l++){var c=o[l];for(Se=c;Se!==null;){var h=Se;switch(h.tag){case 0:case 11:case 15:Td(8,h,s)}var d=h.child;if(d!==null)d.return=h,Se=d;else for(;Se!==null;){h=Se;var f=h.sibling,g=h.return;if(G6(h),h===c){Se=null;break}if(f!==null){f.return=g,Se=f;break}Se=g}}}var _=s.alternate;if(_!==null){var y=_.child;if(y!==null){_.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==null)}}Se=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,Se=a;else e:for(;Se!==null;){if(s=Se,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Td(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,Se=m;break e}Se=s.return}}var p=e.current;for(Se=p;Se!==null;){a=Se;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,Se=x;else e:for(a=p;Se!==null;){if(o=Se,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:_v(9,o)}}catch(S){nn(o,o.return,S)}if(o===a){Se=null;break e}var b=o.sibling;if(b!==null){b.return=o.return,Se=b;break e}Se=o.return}}if(ct=i,Io(),zi&&typeof zi.onPostCommitFiberRoot=="function")try{zi.onPostCommitFiberRoot(hv,e)}catch{}r=!0}return r}finally{xt=n,qr.transition=t}}return!1}function ZE(e,t,n){t=mc(n,t),t=O6(e,t,1),e=mo(e,t,1),t=er(),e!==null&&(Gh(e,1,t),pr(e,t))}function nn(e,t,n){if(e.tag===3)ZE(e,e,n);else for(;t!==null;){if(t.tag===3){ZE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(go===null||!go.has(r))){e=mc(n,e),e=I6(t,e,1),t=mo(t,e,1),e=er(),t!==null&&(Gh(t,1,e),pr(t,e));break}}t=t.return}}function rV(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=er(),e.pingedLanes|=e.suspendedLanes&n,Cn===e&&(Dn&n)===n&&(xn===4||xn===3&&(Dn&130023424)===Dn&&500>an()-R2?fa(e,0):M2|=n),pr(e,t)}function rL(e,t){t===0&&(e.mode&1?(t=Vf,Vf<<=1,!(Vf&130023424)&&(Vf=4194304)):t=1);var n=er();e=Ms(e,t),e!==null&&(Gh(e,t,n),pr(e,n))}function iV(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rL(e,n)}function sV(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(pe(314))}r!==null&&r.delete(t),rL(e,n)}var iL;iL=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||hr.current)dr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dr=!1,qU(e,t,n);dr=!!(e.flags&131072)}else dr=!1,qt&&t.flags&1048576&&l6(t,$m,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zp(e,t),e=t.pendingProps;var i=dc(t,qn.current);ql(t,n),i=w2(null,t,r,e,i,n);var s=S2();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,fr(r)?(s=!0,Om(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,v2(t),i.updater=xv,t.stateNode=i,i._reactInternals=t,w_(t,r,e,n),t=k_(null,t,r,!0,s,n)):(t.tag=0,qt&&s&&u2(t),Yn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zp(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=aV(r),e=si(r,e),i){case 0:t=C_(null,t,r,e,n);break e;case 1:t=WE(null,t,r,e,n);break e;case 11:t=zE(null,t,r,e,n);break e;case 14:t=HE(null,t,r,si(r.type,e),n);break e}throw Error(pe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:si(r,i),C_(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:si(r,i),WE(e,t,r,i,n);case 3:e:{if(z6(t),e===null)throw Error(pe(387));r=t.pendingProps,s=t.memoizedState,i=s.element,p6(e,t),zm(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=mc(Error(pe(423)),t),t=UE(e,t,r,n,i);break e}else if(r!==i){i=mc(Error(pe(424)),t),t=UE(e,t,r,n,i);break e}else for(kr=po(t.stateNode.containerInfo.firstChild),Mr=t,qt=!0,ci=null,n=h6(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(hc(),r===i){t=Rs(e,t,n);break e}Yn(e,t,r,n)}t=t.child}return t;case 5:return m6(t),e===null&&x_(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,p_(r,i)?a=null:s!==null&&p_(r,s)&&(t.flags|=32),F6(e,t),Yn(e,t,a,n),t.child;case 6:return e===null&&x_(t),null;case 13:return H6(e,t,n);case 4:return y2(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fc(t,null,r,n):Yn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:si(r,i),zE(e,t,r,i,n);case 7:return Yn(e,t,t.pendingProps,n),t.child;case 8:return Yn(e,t,t.pendingProps.children,n),t.child;case 12:return Yn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Nt(Bm,r._currentValue),r._currentValue=a,s!==null)if(vi(s.value,a)){if(s.children===i.children&&!hr.current){t=Rs(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Cs(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?l.next=l:(l.next=h.next,h.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),__(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(pe(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),__(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Yn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ql(t,n),i=Xr(i),r=r(i),t.flags|=1,Yn(e,t,r,n),t.child;case 14:return r=t.type,i=si(r,t.pendingProps),i=si(r.type,i),HE(e,t,r,i,n);case 15:return $6(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:si(r,i),Zp(e,t),t.tag=1,fr(r)?(e=!0,Om(t)):e=!1,ql(t,n),P6(t,r,i),w_(t,r,i,n),k_(null,t,r,!0,e,n);case 19:return W6(e,t,n);case 22:return B6(e,t,n)}throw Error(pe(156,t.tag))};function sL(e,t){return Lj(e,t)}function oV(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 Ur(e,t,n,r){return new oV(e,t,n,r)}function D2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aV(e){if(typeof e=="function")return D2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qw)return 11;if(e===Zw)return 14}return 2}function yo(e,t){var n=e.alternate;return n===null?(n=Ur(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 nm(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")D2(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Rl:return pa(n.children,i,s,t);case Jw:a=8,i|=8;break;case qx:return e=Ur(12,n,t,i|2),e.elementType=qx,e.lanes=s,e;case Gx:return e=Ur(13,n,t,i),e.elementType=Gx,e.lanes=s,e;case Kx:return e=Ur(19,n,t,i),e.elementType=Kx,e.lanes=s,e;case mj:return wv(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fj:a=10;break e;case pj:a=9;break e;case Qw:a=11;break e;case Zw:a=14;break e;case Ys:a=16,r=null;break e}throw Error(pe(130,e==null?e:typeof e,""))}return t=Ur(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function pa(e,t,n,r){return e=Ur(7,e,r,t),e.lanes=n,e}function wv(e,t,n,r){return e=Ur(22,e,r,t),e.elementType=mj,e.lanes=n,e.stateNode={isHidden:!1},e}function Sy(e,t,n){return e=Ur(6,e,null,t),e.lanes=n,e}function Cy(e,t,n){return t=Ur(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lV(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=iy(0),this.expirationTimes=iy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=iy(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function N2(e,t,n,r,i,s,a,o,l){return e=new lV(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ur(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},v2(s),e}function cV(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ml,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oL(e){if(!e)return So;e=e._reactInternals;e:{if(za(e)!==e||e.tag!==1)throw Error(pe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(fr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(pe(171))}if(e.tag===1){var n=e.type;if(fr(n))return o6(e,n,t)}return t}function aL(e,t,n,r,i,s,a,o,l){return e=N2(n,r,!0,e,i,s,a,o,l),e.context=oL(null),n=e.current,r=er(),i=vo(n),s=Cs(r,i),s.callback=t??null,mo(n,s,i),e.current.lanes=i,Gh(e,i,r),pr(e,r),e}function Sv(e,t,n,r){var i=t.current,s=er(),a=vo(i);return n=oL(n),t.context===null?t.context=n:t.pendingContext=n,t=Cs(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=mo(i,t,a),e!==null&&(mi(e,i,a,s),Xp(e,i,a)),a}function Ym(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 e3(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function P2(e,t){e3(e,t),(e=e.alternate)&&e3(e,t)}var lL=typeof reportError=="function"?reportError:function(e){console.error(e)};function O2(e){this._internalRoot=e}Cv.prototype.render=O2.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(pe(409));Sv(e,t,null,null)};Cv.prototype.unmount=O2.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ca(function(){Sv(null,e,null,null)}),t[Ts]=null}};function Cv(e){this._internalRoot=e}Cv.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Zs.length&&t!==0&&t<Zs[n].priority;n++);Zs.splice(n,0,e),n===0&&zj(e)}};function I2(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function t3(){}function uV(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Ym(a);s.call(c)}}var a=aL(t,r,e,0,null,!1,!1,"",t3);return e._reactRootContainer=a,e[Ts]=a.current,eh(e.nodeType===8?e.parentNode:e),Ca(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var c=Ym(l);o.call(c)}}var l=N2(e,0,!1,null,null,!1,!1,"",t3);return e._reactRootContainer=l,e[Ts]=l.current,eh(e.nodeType===8?e.parentNode:e),Ca(function(){Sv(t,l,n,r)}),l}function Ev(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var l=Ym(a);o.call(l)}}Sv(t,a,e,i)}else a=uV(n,t,e,i,r);return Ym(a)}Ij=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=od(t.pendingLanes);n!==0&&(n2(t,n|1),pr(t,an()),!(ct&6)&&(gc=an()+500,Io()))}break;case 13:Ca(function(){var r=Ms(e,1);if(r!==null){var i=er();mi(r,e,1,i)}}),P2(e,1)}};r2=function(e){if(e.tag===13){var t=Ms(e,134217728);if(t!==null){var n=er();mi(t,e,134217728,n)}P2(e,134217728)}};$j=function(e){if(e.tag===13){var t=vo(e),n=Ms(e,t);if(n!==null){var r=er();mi(n,e,t,r)}P2(e,t)}};Bj=function(){return xt};Fj=function(e,t){var n=xt;try{return xt=e,t()}finally{xt=n}};i_=function(e,t,n){switch(t){case"input":if(Jx(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=gv(r);if(!i)throw Error(pe(90));vj(r),Jx(r,i)}}}break;case"textarea":xj(e,n);break;case"select":t=n.value,t!=null&&Hl(e,!!n.multiple,t,!1)}};Ej=A2;Tj=Ca;var dV={usingClientEntryPoint:!1,Events:[Yh,Dl,gv,Cj,kj,A2]},Au={findFiberByHostInstance:ia,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hV={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Is.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Aj(e),e===null?null:e.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var np=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!np.isDisabled&&np.supportsFiber)try{hv=np.inject(hV),zi=np}catch{}}Dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dV;Dr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!I2(t))throw Error(pe(200));return cV(e,t,null,n)};Dr.createRoot=function(e,t){if(!I2(e))throw Error(pe(299));var n=!1,r="",i=lL;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=N2(e,1,!1,null,null,n,!1,r,i),e[Ts]=t.current,eh(e.nodeType===8?e.parentNode:e),new O2(t)};Dr.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(pe(188)):(e=Object.keys(e).join(","),Error(pe(268,e)));return e=Aj(t),e=e===null?null:e.stateNode,e};Dr.flushSync=function(e){return Ca(e)};Dr.hydrate=function(e,t,n){if(!kv(t))throw Error(pe(200));return Ev(null,e,t,!0,n)};Dr.hydrateRoot=function(e,t,n){if(!I2(e))throw Error(pe(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=lL;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=aL(t,null,e,1,n??null,i,!1,s,a),e[Ts]=t.current,eh(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 Cv(t)};Dr.render=function(e,t,n){if(!kv(t))throw Error(pe(200));return Ev(null,e,t,!1,n)};Dr.unmountComponentAtNode=function(e){if(!kv(e))throw Error(pe(40));return e._reactRootContainer?(Ca(function(){Ev(null,null,e,!1,function(){e._reactRootContainer=null,e[Ts]=null})}),!0):!1};Dr.unstable_batchedUpdates=A2;Dr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!kv(n))throw Error(pe(200));if(e==null||e._reactInternals===void 0)throw Error(pe(38));return Ev(e,t,n,!1,r)};Dr.version="18.3.1-next-f1338f8080-20240426";function cL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(cL)}catch(e){console.error(e)}}cL(),cj.exports=Dr;var Er=cj.exports;const uL=Tn(Er);var n3=Er;Ux.createRoot=n3.createRoot,Ux.hydrateRoot=n3.hydrateRoot;var fV=typeof $i=="object"&&$i&&$i.Object===Object&&$i,pV=typeof self=="object"&&self&&self.Object===Object&&self;fV||pV||Function("return this")();var mV=typeof window<"u"?w.useLayoutEffect:w.useEffect;function yi(e,t,n,r){const i=w.useRef(t);mV(()=>{i.current=t},[t]),w.useEffect(()=>{const s=window;if(!(s&&s.addEventListener))return;const a=o=>{i.current(o)};return s.addEventListener(e,a,r),()=>{s.removeEventListener(e,a,r)}},[e,n,r])}function gV(e,t,n="mousedown",r={}){yi(n,i=>{const s=i.target;if(!s||!s.isConnected)return;(Array.isArray(e)?e.filter(o=>!!o.current).every(o=>o.current&&!o.current.contains(s)):e.current&&!e.current.contains(s))&&t(i)},void 0,r)}function vV(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,s,a=[],o="",l=e.split("/");for(l[0]||l.shift();i=l.shift();)n=i[0],n==="*"?(a.push(n),o+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=i.indexOf("?",1),s=i.indexOf(".",1),a.push(i.substring(1,~r?r:~s?s:i.length)),o+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(o+=(~r?"?":"")+"\\"+i.substring(s))):o+="/"+i;return{keys:a,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var dL={exports:{}},hL={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vc=w;function yV(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xV=typeof Object.is=="function"?Object.is:yV,_V=vc.useState,bV=vc.useEffect,wV=vc.useLayoutEffect,SV=vc.useDebugValue;function CV(e,t){var n=t(),r=_V({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return wV(function(){i.value=n,i.getSnapshot=t,ky(i)&&s({inst:i})},[e,n,t]),bV(function(){return ky(i)&&s({inst:i}),e(function(){ky(i)&&s({inst:i})})},[e]),SV(n),n}function ky(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xV(e,n)}catch{return!0}}function kV(e,t){return t()}var EV=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kV:CV;hL.useSyncExternalStore=vc.useSyncExternalStore!==void 0?vc.useSyncExternalStore:EV;dL.exports=hL;var fL=dL.exports;const TV=oj.useInsertionEffect,MV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RV=MV?w.useLayoutEffect:w.useEffect,AV=TV||RV,pL=e=>{const t=w.useRef([e,(...n)=>t[0](...n)]).current;return AV(()=>{t[0]=e}),t[1]},jV="popstate",$2="pushState",B2="replaceState",LV="hashchange",r3=[jV,$2,B2,LV],DV=e=>{for(const t of r3)addEventListener(t,e);return()=>{for(const t of r3)removeEventListener(t,e)}},mL=(e,t)=>fL.useSyncExternalStore(DV,e,t),NV=()=>location.search,PV=({ssrSearch:e=""}={})=>mL(NV,()=>e),i3=()=>location.pathname,OV=({ssrPath:e}={})=>mL(i3,e?()=>e:i3),F2=(e,{replace:t=!1,state:n=null}={})=>history[t?B2:$2](n,"",e),IV=(e={})=>[OV(e),F2],s3=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[s3]>"u"){for(const e of[$2,B2]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,s3,{value:!0})}const $V=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",gL=(e="")=>e==="/"?"":e,BV=(e,t)=>e[0]==="~"?e.slice(1):gL(t)+e,FV=(e="",t)=>$V(o3(gL(e)),o3(t)),o3=e=>{try{return decodeURI(e)}catch{return e}},vL={hook:IV,searchHook:PV,parser:vV,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},yL=w.createContext(vL),zc=()=>w.useContext(yL),xL={},_L=w.createContext(xL),zV=()=>w.useContext(_L),Tv=e=>{const[t,n]=e.hook(e);return[FV(e.base,t),pL((r,i)=>n(BV(r,e.base),i))]},$o=()=>Tv(zc()),z2=(e,t,n,r)=>{const{pattern:i,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),a=i.exec(n)||[],[o,...l]=a;return o!==void 0?[!0,(()=>{const c=s!==!1?Object.fromEntries(s.map((d,f)=>[d,l[f]])):a.groups;let h={...l};return c&&Object.assign(h,c),h})(),...r?[o]:[]]:[!1,null]},Mv=e=>z2(zc().parser,e,$o()[0]),HV=({children:e,...t})=>{var h,d;const n=zc(),r=t.hook?vL:n;let i=r;const[s,a]=((h=t.ssrPath)==null?void 0:h.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=s),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let o=w.useRef({}),l=o.current,c=l;for(let f in r){const g=f==="base"?r[f]+(t[f]||""):t[f]||r[f];l===c&&g!==c[f]&&(o.current=c={...c}),c[f]=g,g!==r[f]&&(i=c)}return w.createElement(yL.Provider,{value:i,children:e})},a3=({children:e,component:t},n)=>t?w.createElement(t,{params:n}):typeof e=="function"?e(n):e,WV=e=>{let t=w.useRef(xL),n=t.current;for(const r in e)e[r]!==n[r]&&(n=e);return Object.keys(e).length===0&&(n=e),t.current=n},na=({path:e,nest:t,match:n,...r})=>{const i=zc(),[s]=Tv(i),[a,o,l]=n??z2(i.parser,e,s,t),c=WV({...zV(),...o});if(!a)return null;const h=l?w.createElement(HV,{base:l},a3(r,c)):a3(r,c);return w.createElement(_L.Provider,{value:c,children:h})},xi=w.forwardRef((e,t)=>{const n=zc(),[r,i]=Tv(n),{to:s="",href:a=s,onClick:o,asChild:l,children:c,className:h,replace:d,state:f,...g}=e,_=pL(v=>{v.ctrlKey||v.metaKey||v.altKey||v.shiftKey||v.button!==0||(o==null||o(v),v.defaultPrevented||(v.preventDefault(),i(a,e)))}),y=n.hrefs(a[0]==="~"?a.slice(1):n.base+a,n);return l&&w.isValidElement(c)?w.cloneElement(c,{onClick:_,href:y}):w.createElement("a",{...g,onClick:_,href:y,className:h!=null&&h.call?h(r===a):h,children:c,ref:t})}),bL=e=>Array.isArray(e)?e.flatMap(t=>bL(t&&t.type===w.Fragment?t.props.children:t)):[e],wL=({children:e,location:t})=>{const n=zc(),[r]=Tv(n);for(const i of bL(e)){let s=0;if(w.isValidElement(i)&&(s=z2(n.parser,i.props.path,t||r,i.props.nest))[0])return w.cloneElement(i,{match:s})}return null};function SL(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=SL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function CL(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=SL(e))&&(r&&(r+=" "),r+=t);return r}const H2="-",UV=e=>{const t=qV(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(H2);return o[0]===""&&o.length!==1&&o.shift(),kL(o,t)||VV(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},kL=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?kL(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(H2);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},l3=/^\[(.+)\]$/,VV=e=>{if(l3.test(e)){const t=l3.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},qV=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return KV(Object.entries(e.classGroups),n).forEach(([s,a])=>{I_(a,r,s,t)}),r},I_=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:c3(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(GV(i)){I_(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{I_(a,c3(t,s),n,r)})})},c3=(e,t)=>{let n=e;return t.split(H2).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},GV=e=>e.isThemeGetter,KV=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[t+a,o])):s);return[n,i]}):e,YV=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},EL="!",XV=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const l=[];let c=0,h=0,d;for(let v=0;v<o.length;v++){let m=o[v];if(c===0){if(m===i&&(r||o.slice(v,v+s)===t)){l.push(o.slice(h,v)),h=v+s;continue}if(m==="/"){d=v;continue}}m==="["?c++:m==="]"&&c--}const f=l.length===0?o:o.substring(h),g=f.startsWith(EL),_=g?f.substring(1):f,y=d&&d>h?d-h:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:_,maybePostfixModifierPosition:y}};return n?o=>n({className:o,parseClassName:a}):a},JV=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},QV=e=>({cache:YV(e.cacheSize),parseClassName:XV(e),...UV(e)}),ZV=/\s+/,eq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(ZV);let o="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:g}=n(c);let _=!!g,y=r(_?f.substring(0,g):f);if(!y){if(!_){o=c+(o.length>0?" "+o:o);continue}if(y=r(f),!y){o=c+(o.length>0?" "+o:o);continue}_=!1}const v=JV(h).join(":"),m=d?v+EL:v,p=m+y;if(s.includes(p))continue;s.push(p);const x=i(y,_);for(let b=0;b<x.length;++b){const S=x[b];s.push(m+S)}o=c+(o.length>0?" "+o:o)}return o};function tq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=TL(t))&&(r&&(r+=" "),r+=n);return r}const TL=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=TL(e[r]))&&(n&&(n+=" "),n+=t);return n};function nq(e,...t){let n,r,i,s=a;function a(l){const c=t.reduce((h,d)=>d(h),e());return n=QV(c),r=n.cache.get,i=n.cache.set,s=o,o(l)}function o(l){const c=r(l);if(c)return c;const h=eq(l,n);return i(l,h),h}return function(){return s(tq.apply(null,arguments))}}const $t=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ML=/^\[(?:([a-z-]+):)?(.+)\]$/i,rq=/^\d+\/\d+$/,iq=new Set(["px","full","screen"]),sq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oq=/\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$/,aq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,lq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,as=e=>Kl(e)||iq.has(e)||rq.test(e),Ws=e=>Hc(e,"length",vq),Kl=e=>!!e&&!Number.isNaN(Number(e)),Ey=e=>Hc(e,"number",Kl),ju=e=>!!e&&Number.isInteger(Number(e)),uq=e=>e.endsWith("%")&&Kl(e.slice(0,-1)),Ke=e=>ML.test(e),Us=e=>sq.test(e),dq=new Set(["length","size","percentage"]),hq=e=>Hc(e,dq,RL),fq=e=>Hc(e,"position",RL),pq=new Set(["image","url"]),mq=e=>Hc(e,pq,xq),gq=e=>Hc(e,"",yq),Lu=()=>!0,Hc=(e,t,n)=>{const r=ML.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},vq=e=>oq.test(e)&&!aq.test(e),RL=()=>!1,yq=e=>lq.test(e),xq=e=>cq.test(e),_q=()=>{const e=$t("colors"),t=$t("spacing"),n=$t("blur"),r=$t("brightness"),i=$t("borderColor"),s=$t("borderRadius"),a=$t("borderSpacing"),o=$t("borderWidth"),l=$t("contrast"),c=$t("grayscale"),h=$t("hueRotate"),d=$t("invert"),f=$t("gap"),g=$t("gradientColorStops"),_=$t("gradientColorStopPositions"),y=$t("inset"),v=$t("margin"),m=$t("opacity"),p=$t("padding"),x=$t("saturate"),b=$t("scale"),S=$t("sepia"),C=$t("skew"),E=$t("space"),k=$t("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Ke,t],L=()=>[Ke,t],D=()=>["",as,Ws],N=()=>["auto",Kl,Ke],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Ke],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Kl,Ke];return{cacheSize:500,separator:":",theme:{colors:[Lu],spacing:[as,Ws],blur:["none","",Us,Ke],brightness:F(),borderColor:[e],borderRadius:["none","","full",Us,Ke],borderSpacing:L(),borderWidth:D(),contrast:F(),grayscale:j(),hueRotate:F(),invert:j(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[uq,Ws],inset:M(),margin:M(),opacity:F(),padding:L(),saturate:F(),scale:F(),sepia:j(),skew:F(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Ke]}],container:["container"],columns:[{columns:[Us]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:[...P(),Ke]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],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",ju,Ke]}],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",Ke]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",ju,Ke]}],"grid-cols":[{"grid-cols":[Lu]}],"col-start-end":[{col:["auto",{span:["full",ju,Ke]},Ke]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Lu]}],"row-start-end":[{row:["auto",{span:[ju,Ke]},Ke]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ke]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ke,t]}],"min-w":[{"min-w":[Ke,t,"min","max","fit"]}],"max-w":[{"max-w":[Ke,t,"none","full","min","max","fit","prose",{screen:[Us]},Us]}],h:[{h:[Ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Us,Ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ey]}],"font-family":[{font:[Lu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ke]}],"line-clamp":[{"line-clamp":["none",Kl,Ey]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",as,Ke]}],"list-image":[{"list-image":["none",Ke]}],"list-style-type":[{list:["none","disc","decimal",Ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",as,Ws]}],"underline-offset":[{"underline-offset":["auto",as,Ke]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke]}],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",Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),fq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",hq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...I(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:I()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[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:["",...I()]}],"outline-offset":[{"outline-offset":[as,Ke]}],"outline-w":[{outline:[as,Ws]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[as,Ws]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Us,gq]}],"shadow-color":[{shadow:[Lu]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Us,Ke]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"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":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",Ke]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",Ke]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[ju,Ke]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",Ke]}],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",Ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[as,Ws,Ey]}],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-s","border-color-e","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"]}}},bq=nq(_q),Gi=Object.create(null);Gi.open="0";Gi.close="1";Gi.ping="2";Gi.pong="3";Gi.message="4";Gi.upgrade="5";Gi.noop="6";const rm=Object.create(null);Object.keys(Gi).forEach(e=>{rm[Gi[e]]=e});const $_={type:"error",data:"parser error"},AL=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",jL=typeof ArrayBuffer=="function",LL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,W2=({type:e,data:t},n,r)=>AL&&t instanceof Blob?n?r(t):u3(t,r):jL&&(t instanceof ArrayBuffer||LL(t))?n?r(t):u3(new Blob([t]),r):r(Gi[e]+(t||"")),u3=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function d3(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ty;function wq(e,t){if(AL&&e.data instanceof Blob)return e.data.arrayBuffer().then(d3).then(t);if(jL&&(e.data instanceof ArrayBuffer||LL(e.data)))return t(d3(e.data));W2(e,!1,n=>{Ty||(Ty=new TextEncoder),t(Ty.encode(n))})}const h3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ld=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<h3.length;e++)ld[h3.charCodeAt(e)]=e;const Sq=e=>{let t=e.length*.75,n=e.length,r,i=0,s,a,o,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),h=new Uint8Array(c);for(r=0;r<n;r+=4)s=ld[e.charCodeAt(r)],a=ld[e.charCodeAt(r+1)],o=ld[e.charCodeAt(r+2)],l=ld[e.charCodeAt(r+3)],h[i++]=s<<2|a>>4,h[i++]=(a&15)<<4|o>>2,h[i++]=(o&3)<<6|l&63;return c},Cq=typeof ArrayBuffer=="function",U2=(e,t)=>{if(typeof e!="string")return{type:"message",data:DL(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:kq(e.substring(1),t)}:rm[n]?e.length>1?{type:rm[n],data:e.substring(1)}:{type:rm[n]}:$_},kq=(e,t)=>{if(Cq){const n=Sq(e);return DL(n,t)}else return{base64:!0,data:e}},DL=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},NL="",Eq=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,a)=>{W2(s,!1,o=>{r[a]=o,++i===n&&t(r.join(NL))})})},Tq=(e,t)=>{const n=e.split(NL),r=[];for(let i=0;i<n.length;i++){const s=U2(n[i],t);if(r.push(s),s.type==="error")break}return r};function Mq(){return new TransformStream({transform(e,t){wq(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 s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let My;function rp(e){return e.reduce((t,n)=>t+n.length,0)}function ip(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 Rq(e,t){My||(My=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(a,o){for(n.push(a);;){if(r===0){if(rp(n)<1)break;const l=ip(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(rp(n)<2)break;const l=ip(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(rp(n)<8)break;const l=ip(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),h=c.getUint32(0);if(h>Math.pow(2,21)-1){o.enqueue($_);break}i=h*Math.pow(2,32)+c.getUint32(4),r=3}else{if(rp(n)<i)break;const l=ip(n,i);o.enqueue(U2(s?l:My.decode(l),t)),r=0}if(i===0||i>e){o.enqueue($_);break}}}})}const PL=4;function dn(e){if(e)return Aq(e)}function Aq(e){for(var t in dn.prototype)e[t]=dn.prototype[t];return e}dn.prototype.on=dn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};dn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};dn.prototype.off=dn.prototype.removeListener=dn.prototype.removeAllListeners=dn.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};dn.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};dn.prototype.emitReserved=dn.prototype.emit;dn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};dn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Rv=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Br=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),jq="arraybuffer";function OL(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Lq=Br.setTimeout,Dq=Br.clearTimeout;function Av(e,t){t.useNativeTimers?(e.setTimeoutFn=Lq.bind(Br),e.clearTimeoutFn=Dq.bind(Br)):(e.setTimeoutFn=Br.setTimeout.bind(Br),e.clearTimeoutFn=Br.clearTimeout.bind(Br))}const Nq=1.33;function Pq(e){return typeof e=="string"?Oq(e):Math.ceil((e.byteLength||e.size)*Nq)}function Oq(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 IL(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Iq(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function $q(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class Bq extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class V2 extends dn{constructor(t){super(),this.writable=!1,Av(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Bq(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=U2(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=Iq(t);return n.length?"?"+n:""}}class Fq extends V2{constructor(){super(...arguments),this._polling=!1}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)};Tq(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,Eq(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]=IL()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let $L=!1;try{$L=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zq=$L;function Hq(){}class Wq extends Fq{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}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 Wi extends dn{constructor(t,n,r){super(),this.createRequest=t,Av(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=OL(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(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.getResponseHeader("set-cookie"))),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=Wi.requestsCount++,Wi.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=Hq,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wi.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()}}Wi.requestsCount=0;Wi.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",f3);else if(typeof addEventListener=="function"){const e="onpagehide"in Br?"pagehide":"unload";addEventListener(e,f3,!1)}}function f3(){for(let e in Wi.requests)Wi.requests.hasOwnProperty(e)&&Wi.requests[e].abort()}const Uq=function(){const e=BL({xdomain:!1});return e&&e.responseType!==null}();class Vq extends Wq{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=Uq&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Wi(BL,this.uri(),t)}}function BL(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||zq))return new XMLHttpRequest}catch{}if(!t)try{return new Br[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const FL=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class qq extends V2{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=FL?{}:OL(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=this.createSocket(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;W2(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Rv(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=IL()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Ry=Br.WebSocket||Br.MozWebSocket;class Gq extends qq{createSocket(t,n,r){return FL?new Ry(t,n,r):n?new Ry(t,n):new Ry(t)}doWrite(t,n){this.ws.send(n)}}class Kq extends V2{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=Rq(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=Mq();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:o,value:l})=>{o||(this.onPacket(l),s())}).catch(o=>{})};s();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&&Rv(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Yq={websocket:Gq,webtransport:Kq,polling:Vq},Xq=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Jq=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function B_(e){if(e.length>8e3)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=Xq.exec(e||""),s={},a=14;for(;a--;)s[Jq[a]]=i[a]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Qq(s,s.path),s.queryKey=Zq(s,s.query),s}function Qq(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 Zq(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const F_=typeof addEventListener=="function"&&typeof removeEventListener=="function",im=[];F_&&addEventListener("offline",()=>{im.forEach(e=>e())},!1);class xo extends dn{constructor(t,n){if(super(),this.binaryType=jq,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=B_(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=B_(n.host).host);Av(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=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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=$q(this.opts.query)),F_&&(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"})},im.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=PL,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 this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&xo.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}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))}onOpen(){this.readyState="open",xo.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const 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._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=Pq(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Rv(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}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 s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),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){if(xo.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),F_&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=im.indexOf(this._offlineEventListener);r!==-1&&im.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}xo.protocol=PL;class eG extends xo{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;xo.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;xo.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,h(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function o(){a("transport closed")}function l(){a("socket closed")}function c(d){n&&d.name!==n.name&&s()}const h=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",o),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",a),n.once("close",o),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let tG=class extends eG{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Yq[i]).filter(i=>!!i)),super(t,r)}};function nG(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=B_(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 s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const rG=typeof ArrayBuffer=="function",iG=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,zL=Object.prototype.toString,sG=typeof Blob=="function"||typeof Blob<"u"&&zL.call(Blob)==="[object BlobConstructor]",oG=typeof File=="function"||typeof File<"u"&&zL.call(File)==="[object FileConstructor]";function q2(e){return rG&&(e instanceof ArrayBuffer||iG(e))||sG&&e instanceof Blob||oG&&e instanceof File}function sm(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(sm(e[n]))return!0;return!1}if(q2(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return sm(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&sm(e[n]))return!0;return!1}function aG(e){const t=[],n=e.data,r=e;return r.data=z_(n,t),r.attachments=t.length,{packet:r,buffers:t}}function z_(e,t){if(!e)return e;if(q2(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]=z_(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]=z_(e[r],t));return n}return e}function lG(e,t){return e.data=H_(e.data,t),delete e.attachments,e}function H_(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]=H_(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=H_(e[n],t));return e}const cG=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],uG=5;var rt;(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"})(rt||(rt={}));class dG{constructor(t){this.replacer=t}encode(t){return(t.type===rt.EVENT||t.type===rt.ACK)&&sm(t)?this.encodeAsBinary({type:t.type===rt.EVENT?rt.BINARY_EVENT:rt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===rt.BINARY_EVENT||t.type===rt.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=aG(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function p3(e){return Object.prototype.toString.call(e)==="[object Object]"}class G2 extends dn{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===rt.BINARY_EVENT;r||n.type===rt.BINARY_ACK?(n.type=r?rt.EVENT:rt.ACK,this.reconstructor=new hG(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(q2(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(rt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===rt.BINARY_EVENT||r.type===rt.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(s,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=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(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(G2.isPayloadValid(r.type,s))r.data=s;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 rt.CONNECT:return p3(n);case rt.DISCONNECT:return n===void 0;case rt.CONNECT_ERROR:return typeof n=="string"||p3(n);case rt.EVENT:case rt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&cG.indexOf(n[0])===-1);case rt.ACK:case rt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class hG{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=lG(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const fG=Object.freeze(Object.defineProperty({__proto__:null,Decoder:G2,Encoder:dG,get PacketType(){return rt},protocol:uG},Symbol.toStringTag,{value:"Module"}));function ai(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const pG=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class HL extends dn{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=[ai(t,"open",this.onopen.bind(this)),ai(t,"packet",this.onpacket.bind(this)),ai(t,"error",this.onerror.bind(this)),ai(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){var r,i,s;if(pG.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 a={type:rt.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const h=this.ids++,d=n.pop();this._registerAckCallback(h,d),a.id=h}const o=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!o||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),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 s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},i),a=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,o)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(a,o)=>a?i(a):r(o);s.withError=!0,n.push(s),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,...s)=>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,...s)),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:rt.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),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case rt.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 rt.EVENT:case rt.BINARY_EVENT:this.onevent(t);break;case rt.ACK:case rt.BINARY_ACK:this.onack(t);break;case rt.DISCONNECT:this.ondisconnect();break;case rt.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:rt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}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:rt.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 Wc(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}Wc.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};Wc.prototype.reset=function(){this.attempts=0};Wc.prototype.setMin=function(e){this.ms=e};Wc.prototype.setMax=function(e){this.max=e};Wc.prototype.setJitter=function(e){this.jitter=e};class W_ extends dn{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,Av(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 Wc({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||fG;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,t||(this.skipReconnect=!0),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 tG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ai(n,"open",function(){r.onopen(),t&&t()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},a=ai(n,"error",s);if(this._timeout!==!1){const o=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},o);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(ai(t,"ping",this.onping.bind(this)),ai(t,"data",this.ondata.bind(this)),ai(t,"error",this.onerror.bind(this)),ai(t,"close",this.onclose.bind(this)),ai(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){Rv(()=>{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 HL(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")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),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 Du={};function Ad(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=nG(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=Du[i]&&s in Du[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return o?l=new W_(r,t):(Du[i]||(Du[i]=new W_(r,t)),l=Du[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ad,{Manager:W_,Socket:HL,io:Ad,connect:Ad});function J(...e){return bq(CL(e))}const mG=e=>{const t=/^[ \t]*(?=\S)/gm,n=e.substring(e.indexOf(`
`)).match(t);if(!n)return e;const r=n.reduce((s,a)=>Math.min(s,a.length),1/0),i=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(i,"")},cr=(e,t=0)=>e.toLocaleString(window.txBrowserLocale,{maximumFractionDigits:t}),K2=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?Ad({...t,path:"/socket.io"}):Ad("monitor",{...t,path:"/WebPipe/socket.io"})},WL=async(e,t,n=null)=>{const r=()=>navigator.clipboard.writeText(e),i=()=>{const s=document.createElement("textarea");s.id="clipboard-input-"+Math.random().toString(36).substring(2,15),s.value=e,s.style.position="fixed",s.style.opacity="0",s.style.top="0",s.style.left="0",t.appendChild(s),s.select();const a=document.execCommand("copy");return document.addEventListener("copy",()=>{setTimeout(()=>{try{t.removeChild(s),console.log("Removed clipboard temporary target:",s.id)}catch{console.log("Failed to remove clipboard temporary target:",s.id)}finally{n&&n.focus()}},0)},{once:!0,signal:AbortSignal.timeout(250)}),a};if(window.txConsts.isWebInterface&&navigator.clipboard)try{return await r()}catch{return i()}else return console.warn("Clipboard API not available, copying via textarea."),i()},Xm=e=>{if(e==="permanent")return"permanent";if(typeof e=="string")return e;const t=e.value===1?e.unit.slice(0,-1):e.unit;return`${e.value} ${t}`},gG=e=>{if(typeof e=="string")return e==="permanent"?"PERM":e;let t;return e.unit==="hours"?t="h":e.unit==="days"?t="d":e.unit==="weeks"?t="w":e.unit==="months"?t="mo":t=e.unit,`${e.value}${t}`},jv=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));jv.displayName="Card";const Lv=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("flex flex-col space-y-1.5 p-6",e),...t}));Lv.displayName="CardHeader";const Y2=w.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));Y2.displayName="CardTitle";const UL=w.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:J("text-sm text-muted-foreground",e),...t}));UL.displayName="CardDescription";const Uc=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("p-6 pt-0",e),...t}));Uc.displayName="CardContent";const Jh=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("flex items-center p-6 pt-0",e),...t}));Jh.displayName="CardFooter";var VL={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},m3=lt.createContext&&lt.createContext(VL),vG=["attr","size","title"];function yG(e,t){if(e==null)return{};var n=xG(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xG(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jm(){return Jm=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},Jm.apply(this,arguments)}function g3(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 Qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g3(Object(n),!0).forEach(function(r){_G(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _G(e,t,n){return t=bG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bG(e){var t=wG(e,"string");return typeof t=="symbol"?t:t+""}function wG(e,t){if(typeof e!="object"||!e)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 qL(e){return e&&e.map((t,n)=>lt.createElement(t.tag,Qm({key:n},t.attr),qL(t.child)))}function GL(e){return t=>lt.createElement(SG,Jm({attr:Qm({},e.attr)},t),qL(e.child))}function SG(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=yG(e,vG),o=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),lt.createElement("svg",Jm({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Qm(Qm({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&lt.createElement("title",null,s),e.children)};return m3!==void 0?lt.createElement(m3.Consumer,null,n=>t(n)):t(VL)}function CG(e){return GL({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 v3(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qh(...e){return t=>{let n=!1;const r=e.map(i=>{const s=v3(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():v3(e[i],null)}}}}function Fe(...e){return w.useCallback(Qh(...e),e)}var Co=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(kG);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return u.jsx(U_,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return u.jsx(U_,{...r,ref:t,children:n})});Co.displayName="Slot";var U_=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=TG(n);return w.cloneElement(n,{...EG(r,n.props),ref:t?Qh(t,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});U_.displayName="SlotClone";var X2=({children:e})=>u.jsx(u.Fragment,{children:e});function kG(e){return w.isValidElement(e)&&e.type===X2}function EG(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function TG(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const y3=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,x3=CL,$s=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return x3(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(c=>{const h=n==null?void 0:n[c],d=s==null?void 0:s[c];if(h===null)return null;const f=y3(h)||y3(d);return i[c][f]}),o=n&&Object.entries(n).reduce((c,h)=>{let[d,f]=h;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:d,className:f,...g}=h;return Object.entries(g).every(_=>{let[y,v]=_;return Array.isArray(v)?v.includes({...s,...o}[y]):{...s,...o}[y]===v})?[...c,d,f]:c},[]);return x3(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},Zh=$s("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",muted:"bg-muted text-muted-foreground hover:bg-secondary hover:text-seconbg-secondary-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"}}),Ae=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?Co:"button";return u.jsx(a,{className:J(Zh({variant:t,size:n,className:e})),ref:s,...i})});Ae.displayName="Button";var MG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ce=MG.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?Co:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Zm(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}var ln=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function RG(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var fn=e=>{const{present:t,children:n}=e,r=AG(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Fe(r.ref,jG(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};fn.displayName="Presence";function AG(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),s=w.useRef("none"),a=e?"mounted":"unmounted",[o,l]=RG(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=sp(r.current);s.current=o==="mounted"?c:"none"},[o]),ln(()=>{const c=r.current,h=i.current;if(h!==e){const f=s.current,g=sp(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(h&&f!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ln(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,d=g=>{const y=sp(r.current).includes(g.animationName);if(g.target===t&&y&&(l("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=g=>{g.target===t&&(s.current=sp(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sp(e){return(e==null?void 0:e.animationName)||"none"}function jG(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function LG(e,t){const n=w.createContext(t),r=s=>{const{children:a,...o}=s,l=w.useMemo(()=>o,Object.values(o));return u.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(s){const a=w.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function In(e,t=[]){let n=[];function r(s,a){const o=w.createContext(a),l=n.length;n=[...n,a];const c=d=>{var m;const{scope:f,children:g,..._}=d,y=((m=f==null?void 0:f[e])==null?void 0:m[l])||o,v=w.useMemo(()=>_,Object.values(_));return u.jsx(y.Provider,{value:v,children:g})};c.displayName=s+"Provider";function h(d,f){var y;const g=((y=f==null?void 0:f[e])==null?void 0:y[l])||o,_=w.useContext(g);if(_)return _;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,h]}const i=()=>{const s=n.map(a=>w.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,DG(i,...t)]}function DG(...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(s){const a=r.reduce((o,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Et(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var NG=w.createContext(void 0);function Ha(e){const t=w.useContext(NG);return e||t||"ltr"}function V_(e,[t,n]){return Math.min(n,Math.max(t,e))}function fe(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 PG(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var J2="ScrollArea",[KL,yOe]=In(J2),[OG,ei]=KL(J2),YL=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,l]=w.useState(null),[c,h]=w.useState(null),[d,f]=w.useState(null),[g,_]=w.useState(null),[y,v]=w.useState(null),[m,p]=w.useState(0),[x,b]=w.useState(0),[S,C]=w.useState(!1),[E,k]=w.useState(!1),T=Fe(t,M=>l(M)),R=Ha(i);return u.jsx(OG,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:o,viewport:c,onViewportChange:h,content:d,onContentChange:f,scrollbarX:g,onScrollbarXChange:_,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:k,onCornerWidthChange:p,onCornerHeightChange:b,children:u.jsx(Ce.div,{dir:R,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":m+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});YL.displayName=J2;var XL="ScrollAreaViewport",JL=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...s}=e,a=ei(XL,n),o=w.useRef(null),l=Fe(t,o,a.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("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}"},nonce:i}),u.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});JL.displayName=XL;var es="ScrollAreaScrollbar",Q2=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ei(es,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return w.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?u.jsx(IG,{...r,ref:t,forceMount:n}):i.type==="scroll"?u.jsx($G,{...r,ref:t,forceMount:n}):i.type==="auto"?u.jsx(QL,{...r,ref:t,forceMount:n}):i.type==="always"?u.jsx(Z2,{...r,ref:t}):null});Q2.displayName=es;var IG=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ei(es,e.__scopeScrollArea),[s,a]=w.useState(!1);return w.useEffect(()=>{const o=i.scrollArea;let l=0;if(o){const c=()=>{window.clearTimeout(l),a(!0)},h=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",h),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),u.jsx(fn,{present:n||s,children:u.jsx(QL,{"data-state":s?"visible":"hidden",...r,ref:t})})}),$G=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ei(es,e.__scopeScrollArea),s=e.orientation==="horizontal",a=Nv(()=>l("SCROLL_END"),100),[o,l]=PG("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 w.useEffect(()=>{if(o==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[o,i.scrollHideDelay,l]),w.useEffect(()=>{const c=i.viewport,h=s?"scrollLeft":"scrollTop";if(c){let d=c[h];const f=()=>{const g=c[h];d!==g&&(l("SCROLL"),a()),d=g};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[i.viewport,s,l,a]),u.jsx(fn,{present:n||o!=="hidden",children:u.jsx(Z2,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:fe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),QL=w.forwardRef((e,t)=>{const n=ei(es,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=w.useState(!1),o=e.orientation==="horizontal",l=Nv(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?c:h)}},10);return yc(n.viewport,l),yc(n.content,l),u.jsx(fn,{present:r||s,children:u.jsx(Z2,{"data-state":s?"visible":"hidden",...i,ref:t})})}),Z2=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=ei(es,e.__scopeScrollArea),s=w.useRef(null),a=w.useRef(0),[o,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=rD(o.viewport,o.content),h={...r,sizes:o,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function d(f,g){return UG(f,a.current,o,g)}return n==="horizontal"?u.jsx(BG,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollLeft,g=_3(f,o,i.dir);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=d(f,i.dir))}}):n==="vertical"?u.jsx(FG,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollTop,g=_3(f,o);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=d(f))}}):null}),BG=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=ei(es,e.__scopeScrollArea),[a,o]=w.useState(),l=w.useRef(null),c=Fe(t,l,s.onScrollbarXChange);return w.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),u.jsx(eD,{"data-orientation":"horizontal",...i,ref:c,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Dv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,d)=>{if(s.viewport){const f=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(f),sD(f,d)&&h.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:tg(a.paddingLeft),paddingEnd:tg(a.paddingRight)}})}})}),FG=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=ei(es,e.__scopeScrollArea),[a,o]=w.useState(),l=w.useRef(null),c=Fe(t,l,s.onScrollbarYChange);return w.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),u.jsx(eD,{"data-orientation":"vertical",...i,ref:c,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Dv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,d)=>{if(s.viewport){const f=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(f),sD(f,d)&&h.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:tg(a.paddingTop),paddingEnd:tg(a.paddingBottom)}})}})}),[zG,ZL]=KL(es),eD=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:h,onResize:d,...f}=e,g=ei(es,n),[_,y]=w.useState(null),v=Fe(t,T=>y(T)),m=w.useRef(null),p=w.useRef(""),x=g.viewport,b=r.content-r.viewport,S=Et(h),C=Et(l),E=Nv(d,10);function k(T){if(m.current){const R=T.clientX-m.current.left,M=T.clientY-m.current.top;c({x:R,y:M})}}return w.useEffect(()=>{const T=R=>{const M=R.target;(_==null?void 0:_.contains(M))&&S(R,b)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[x,_,b,S]),w.useEffect(C,[r,C]),yc(_,E),yc(g.content,E),u.jsx(zG,{scope:n,scrollbar:_,hasThumb:i,onThumbChange:Et(s),onThumbPointerUp:Et(a),onThumbPositionChange:C,onThumbPointerDown:Et(o),children:u.jsx(Ce.div,{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:fe(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),m.current=_.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),k(T))}),onPointerMove:fe(e.onPointerMove,k),onPointerUp:fe(e.onPointerUp,T=>{const R=T.target;R.hasPointerCapture(T.pointerId)&&R.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=p.current,g.viewport&&(g.viewport.style.scrollBehavior=""),m.current=null})})})}),eg="ScrollAreaThumb",tD=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ZL(eg,e.__scopeScrollArea);return u.jsx(fn,{present:n||i.hasThumb,children:u.jsx(HG,{ref:t,...r})})}),HG=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=ei(eg,n),a=ZL(eg,n),{onThumbPositionChange:o}=a,l=Fe(t,d=>a.onThumbChange(d)),c=w.useRef(void 0),h=Nv(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const d=s.viewport;if(d){const f=()=>{if(h(),!c.current){const g=VG(d,o);c.current=g,o()}};return o(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,h,o]),u.jsx(Ce.div,{"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:fe(e.onPointerDownCapture,d=>{const g=d.target.getBoundingClientRect(),_=d.clientX-g.left,y=d.clientY-g.top;a.onThumbPointerDown({x:_,y})}),onPointerUp:fe(e.onPointerUp,a.onThumbPointerUp)})});tD.displayName=eg;var eS="ScrollAreaCorner",nD=w.forwardRef((e,t)=>{const n=ei(eS,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(WG,{...e,ref:t}):null});nD.displayName=eS;var WG=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=ei(eS,n),[s,a]=w.useState(0),[o,l]=w.useState(0),c=!!(s&&o);return yc(i.scrollbarX,()=>{var d;const h=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(h),l(h)}),yc(i.scrollbarY,()=>{var d;const h=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(h),a(h)}),c?u.jsx(Ce.div,{...r,ref:t,style:{width:s,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function tg(e){return e?parseInt(e,10):0}function rD(e,t){const n=e/t;return isNaN(n)?0:n}function Dv(e){const t=rD(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function UG(e,t,n,r="ltr"){const i=Dv(n),s=i/2,a=t||s,o=i-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-o,h=n.content-n.viewport,d=r==="ltr"?[0,h]:[h*-1,0];return iD([l,c],d)(e)}function _3(e,t,n="ltr"){const r=Dv(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,a=t.content-t.viewport,o=s-r,l=n==="ltr"?[0,a]:[a*-1,0],c=V_(e,l);return iD([0,a],[0,o])(c)}function iD(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 sD(e,t){return e>0&&e<t}var VG=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,o=n.top!==s.top;(a||o)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Nv(e,t){const n=Et(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function yc(e,t){const n=Et(t);ln(()=>{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])}var oD=YL,qG=JL,GG=nD;const Qr=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(oD,{ref:r,className:J("relative overflow-hidden",e),...n,children:[u.jsx(qG,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(aD,{}),u.jsx(GG,{})]}));Qr.displayName=oD.displayName;const aD=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx(Q2,{ref:r,orientation:t,className:J("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:u.jsx(tD,{className:"relative flex-1 rounded-full bg-border"})}));aD.displayName=Q2.displayName;function KG({error:e}){const t=()=>{window.location.reload()};return u.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:u.jsx(lD,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:u.jsx(Ae,{variant:"outline",onClick:t,children:"Refresh"})})})}function YG({error:e,resetErrorBoundary:t}){return u.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:u.jsx(lD,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:u.jsx(Ae,{variant:"outline",onClick:t,children:"Go Back"})})})}function lD(e){return u.jsxs(jv,{className:"max-w-xl",children:[u.jsxs(Lv,{children:[u.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[u.jsx(CG,{className:"inline-block mr-2"}),e.title]}),u.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),u.jsxs(Uc,{children:[u.jsxs("p",{className:"truncate",children:["Page: ",u.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),u.jsxs("p",{children:["Versions: ",u.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),u.jsxs("p",{children:["Message: ",u.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),u.jsx("p",{children:"Stack:"}),u.jsx("pre",{className:"mt-1",children:u.jsx(Qr,{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})})]}),u.jsxs(Jh,{className:"flex flex-row justify-between",children:[e.resetButton,u.jsx(Ae,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:u.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}let XG=0;function Qe(e,t){const n=`atom${++XG}`,r={toString(){return n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=JG,r.write=QG),t&&(r.write=t),r}function JG(e){return e(this)}function QG(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const b3=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,w3=e=>"init"in e,S3=e=>!!e.write,ng=new WeakMap,q_=e=>{var t;return G_(e)&&!((t=ng.get(e))!=null&&t[1])},ZG=(e,t)=>{const n=ng.get(e);n&&(n[1]=!0,n[0].forEach(r=>r(t)))},eK=e=>{if(ng.has(e))return;const t=[new Set,!1];ng.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},G_=e=>typeof(e==null?void 0:e.then)=="function",C3=e=>"v"in e||"e"in e,op=e=>{if("e"in e)throw e.e;return e.v},cD=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},k3=(e,t,n,r,i)=>{var s;n.d.set(r,i.n),q_(n.v)&&cD(t,n.v,i),(s=i.m)==null||s.t.add(t),e&&tK(e,r,t)},Nu=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),jd=(e,t,n)=>{e[t].add(n)},E3=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),jd(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>jd(e,"M",i))}))},tK=(e,t,n)=>{const r=e.D.get(t);r&&r.add(n)},nK=(e,t)=>e.D.get(t),Ko=e=>{let t,n=!1;const r=i=>{try{i()}catch(s){n||(t=s,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},uD=(...[e,t,n,r])=>{const i=(m,p,x)=>{const b="v"in p,S=p.v,C=q_(p.v)?p.v:null;if(G_(x)){eK(x);for(const E of p.d.keys())cD(m,x,e(E));p.v=x}else p.v=x;delete p.e,delete p.x,(!b||!Object.is(S,p.v))&&(++p.n,C&&ZG(C,x))},s=(m,p)=>{var x;const b=e(p);if(C3(b)&&(b.m&&!b.x||Array.from(b.d).every(([R,M])=>s(m,R).n===M)))return b;b.d.clear();let S=!0;const C=R=>{if(b3(p,R)){const L=e(R);if(!C3(L))if(w3(R))i(R,L,R.init);else throw new Error("no atom init");return op(L)}const M=s(m,R);try{return op(M)}finally{if(S)k3(m,p,b,R,M);else{const L=Nu();k3(L,p,b,R,M),d(L,p,b),Ko(L)}}};let E,k;const T={get signal(){return E||(E=new AbortController),E.signal},get setSelf(){return!k&&S3(p)&&(k=(...R)=>{if(!S)return h(p,...R)}),k}};try{const R=t(p,C,T);if(i(p,b,R),G_(R)){(x=R.onCancel)==null||x.call(R,()=>E==null?void 0:E.abort());const M=()=>{if(b.m){const L=Nu();d(L,p,b),Ko(L)}};R.then(M,M)}return b}catch(R){return delete b.v,b.e=R,delete b.x,++b.n,b}finally{S=!1}},a=m=>op(s(void 0,m)),o=(m,p,x)=>{var b,S;const C=new Map;for(const E of((b=x.m)==null?void 0:b.t)||[]){const k=e(E);k.m&&C.set(E,k)}for(const E of x.p)C.set(E,e(E));return(S=nK(m,p))==null||S.forEach(E=>{C.set(E,e(E))}),C},l=(m,p,x)=>{const b=[],S=new Set,C=new Set,E=[[p,x]];for(;E.length>0;){const[k,T]=E[E.length-1];if(C.has(k)){E.pop();continue}if(S.has(k)){b.push([k,T,T.n]),C.add(k),T.x=!0,E.pop();continue}S.add(k);for(const[R,M]of o(m,k,T))k!==R&&!S.has(R)&&E.push([R,M])}jd(m,"H",()=>{const k=new Set([p]);for(let T=b.length-1;T>=0;--T){const[R,M,L]=b[T];let D=!1;for(const N of M.d.keys())if(N!==R&&k.has(N)){D=!0;break}D&&(s(m,R),d(m,R,M),L!==M.n&&(E3(m,R,M),k.add(R))),delete M.x}})},c=(m,p,...x)=>{let b=!0;const S=E=>op(s(m,E)),C=(E,...k)=>{const T=e(E);try{if(b3(p,E)){if(!w3(E))throw new Error("atom not writable");const R=T.n,M=k[0];i(E,T,M),d(m,E,T),R!==T.n&&(E3(m,E,T),l(m,E,T));return}else return c(m,E,...k)}finally{b||Ko(m)}};try{return n(p,S,C,...x)}finally{b=!1}},h=(m,...p)=>{const x=Nu();try{return c(x,m,...p)}finally{Ko(x)}},d=(m,p,x)=>{if(x.m&&!q_(x.v)){for(const b of x.d.keys())x.m.d.has(b)||(f(m,b,e(b)).t.add(p),x.m.d.add(b));for(const b of x.m.d||[])if(!x.d.has(b)){x.m.d.delete(b);const S=g(m,b,e(b));S==null||S.t.delete(p)}}},f=(m,p,x)=>{if(!x.m){s(m,p);for(const b of x.d.keys())f(m,b,e(b)).t.add(p);if(x.m={l:new Set,d:new Set(x.d.keys()),t:new Set},S3(p)){const b=x.m;let S;const C=(E,k)=>{let T=!0;S=(...R)=>{try{return c(E,p,...R)}finally{T||Ko(E)}};try{return k()}finally{T=!1}};jd(m,"L",()=>{const E=C(m,()=>r(p,(...k)=>S(...k)));E&&(b.u=k=>C(k,E))})}}return x.m},g=(m,p,x)=>{if(x.m&&!x.m.l.size&&!Array.from(x.m.t).some(b=>{var S;return(S=e(b).m)==null?void 0:S.d.has(p)})){const b=x.m.u;b&&jd(m,"L",()=>b(m)),delete x.m;for(const S of x.d.keys()){const C=g(m,S,e(S));C==null||C.t.delete(p)}return}return x.m};return{get:a,set:h,sub:(m,p)=>{const x=Nu(),b=e(m),C=f(x,m,b).l;return C.add(p),Ko(x),()=>{C.delete(p);const E=Nu();g(E,m,b),Ko(E)}},unstable_derive:m=>uD(...m(e,t,n,r))}},rK=()=>{const e=new WeakMap;return uD(r=>{let i=e.get(r);return i||(i={d:new Map,p:new Set,n:0},e.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var s;return(s=r.onMount)==null?void 0:s.call(r,...i)})};let Ay;const iK=()=>(Ay||(Ay=rK()),Ay),sK=w.createContext(void 0),dD=e=>w.useContext(sK)||iK(),hD=e=>typeof(e==null?void 0:e.then)=="function",oK=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},aK=lt.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(oK(e),e)}),jy=new WeakMap,lK=e=>{let t=jy.get(e);return t||(t=new Promise((n,r)=>{let i=e;const s=l=>c=>{i===l&&n(c)},a=l=>c=>{i===l&&r(c)},o=l=>{"onCancel"in l&&typeof l.onCancel=="function"&&l.onCancel(c=>{hD(c)?(jy.set(c,t),i=c,c.then(s(c),a(c)),o(c)):n(c)})};e.then(s(e),a(e)),o(e)}),jy.set(e,t)),t};function et(e,t){const n=dD(),[[r,i,s],a]=w.useReducer(c=>{const h=n.get(e);return Object.is(c[0],h)&&c[1]===n&&c[2]===e?c:[h,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;if((i!==n||s!==e)&&(a(),o=n.get(e)),w.useEffect(()=>{const c=n.sub(e,()=>{a()});return a(),c},[n,e,void 0]),w.useDebugValue(o),hD(o)){const c=lK(o);return aK(c)}return o}function tt(e,t){const n=dD();return w.useCallback((...i)=>n.set(e,...i),[n,e])}function mr(e,t){return[et(e),tt(e)]}function fD(e){const t=Qe(0),n=Qe(()=>({i:0}),(l,c)=>{const h=l(n);return Object.assign(h,{m:!0,peek:l,set:c}),c(t,d=>d+1),()=>{h.m=!1,a(h),o(h)}});n.onMount=l=>l();const r=Qe(l=>{l(t);const c=l(n);if(!c.m||c.irc||c.i&&!c.irf)return c.p;o(c);const h=new Map,d=y=>{const v=l(y);return h.set(y,v),v};d.peek=c.peek;const f=(...y)=>{try{return++c.i,c.set(...y)}finally{Array.from(h.keys(),l),--c.i}};function g([y,v]){return l(y)!==v}function _(){try{if(c.irf=!1,!c.m)return;a(c),c.c=i.effect(d,f)}catch(y){c.e=y,s(c)}finally{c.p=void 0,--c.i}}return f.recurse=(y,...v)=>{if(!c.fc)try{return c.irc=!0,c.set(y,...v)}finally{c.irc=!1,Array.from(h).some(g)&&s(c)}},++c.i,c.irf?_():c.p=Promise.resolve().then(_)}),i=Qe(l=>{l(r)});return i.effect=e,i;function s(l){try{l.irf=!0,l.set(t,c=>c+1)}finally{l.irf=!1}}function a(l){if(l.c)try{l.fc=!0,l.c()}finally{l.fc=!1,l.c=void 0}}function o(l){if("e"in l){const c=l.e;throw delete l.e,c}}}const pD=""+new URL("favicon_default.svg",import.meta.url).href,cK=""+new URL("favicon_online.svg",import.meta.url).href,uK=""+new URL("favicon_partial.svg",import.meta.url).href,dK=""+new URL("favicon_offline.svg",import.meta.url).href;var ks=(e=>(e.Unkown="unknown",e.Setup="setup",e.Deployer="deployer",e.Ready="ready",e))(ks||{}),Yl=(e=>(e.OFFLINE="OFFLINE",e.ONLINE="ONLINE",e.PARTIAL="PARTIAL",e))(Yl||{}),cd=(e=>(e[e.Disabled=0]="Disabled",e[e.Starting=1]="Starting",e[e.Ready=2]="Ready",e[e.Error=3]="Error",e))(cd||{});const Wa=Qe(null),mD=Qe(e=>{var t;return((t=e(Wa))==null?void 0:t.server.name)??"unconfigured"}),tS=Qe(e=>{var t;return((t=e(Wa))==null?void 0:t.configState)??ks.Unkown}),gD=Qe(e=>{var t;return((t=e(Wa))==null?void 0:t.runner)??{isIdle:!0,isChildAlive:!1}}),hK=()=>tt(Wa),vD=()=>et(Wa);function Un(e,t,n){var r=n||{},i=r.noTrailing,s=i===void 0?!1:i,a=r.noLeading,o=a===void 0?!1:a,l=r.debounceMode,c=l===void 0?void 0:l,h,d=!1,f=0;function g(){h&&clearTimeout(h)}function _(v){var m=v||{},p=m.upcomingOnly,x=p===void 0?!1:p;g(),d=!x}function y(){for(var v=arguments.length,m=new Array(v),p=0;p<v;p++)m[p]=arguments[p];var x=this,b=Date.now()-f;if(d)return;function S(){f=Date.now(),t.apply(x,m)}function C(){h=void 0}!o&&c&&!h&&S(),g(),c===void 0&&b>e?o?(f=Date.now(),s||(h=setTimeout(c?C:S,e))):S():s!==!0&&(h=setTimeout(c?C:S,c===void 0?e-b:e))}return y.cancel=_,y}function nS(e,t,n){var r=n||{},i=r.atBegin,s=i===void 0?!1:i;return Un(e,t,{debounceMode:s!==!1})}const Pv=Qe(void 0),rS=Qe(void 0),Ov=Qe(void 0),Iv=Qe(void 0),iS=Qe(0),fK=2.5*60*1e3,pK=()=>{const e=tt(Pv),t=tt(Ov),n=tt(iS);return r=>{e(r.playerDrop),t(r.svRuntime),n(Date.now())}},mK=()=>{const e=tt(Iv);return w.useCallback(Un(150,e,{noLeading:!1,noTrailing:!1}),[e])},gK=()=>{const e=tt(Pv);return t=>{e(n=>{if(!n)return n;const r=n.summaryLast6h.slice(),i=r.findIndex(([s])=>s===t);return i===-1?r.push([t,1]):r[i][1]++,{...n,summaryLast6h:r}})}},sS=()=>{const e=et(iS);return()=>{const t=Date.now();return{isExpired:t-e>fK,isStale:t-e>60*1e3,age:t-e}}},oS=Qe([]),$v=Qe(e=>e(oS).length),yD=Qe(null),vK=()=>{const e=gK(),t=tt(oS),n=tt(yD);return r=>{const i=r.findIndex(s=>s.type==="fullPlayerlist");i>0&&(r=r.slice(i));for(const s of r)s.type==="fullPlayerlist"?(t(s.playerlist),n(s.mutex)):s.type==="playerJoining"?t(a=>[...a,s]):s.type==="playerDropped"?(t(a=>a.filter(o=>o.netid!==s.netid)),s.reasonCategory&&e(s.reasonCategory)):console.error("Unknown playerlist event type",s)}},xD=Qe(0),Bv=()=>{const e=tt(xD);return()=>e(Math.random())},_D=Qe(!1),rg="txAdmin",ud=document.getElementById("favicon"),bD=Qe(rg),wD=()=>{const e=tt(bD);return t=>{t?e(t):(e(rg),document.title=rg,ud.href=pD)}},yK=fD((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(bD),r=e(Wa),i=e($v);r?(r.server.health===Yl.ONLINE?ud.href=cK:r.server.health===Yl.PARTIAL?ud.href=uK:ud.href=dK,document.title=`(${i}) ${r.server.name} · ${n}`):(ud.href=pD,document.title=rg)}),xK=150,T3=Un(xK,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function aS(e){return e.code==="KeyK"&&e.ctrlKey?(T3("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.altKey?(T3("toggleLightMode"),!0):!1}function SD(e){aS(e)&&e.preventDefault()}function Mi({legacyUrl:e}){const t=w.useRef(null),n=location.search??"",r=location.hash??"";return w.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",SD))},[]),u.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function Ue({children:e,className:t,...n}){return u.jsx("code",{className:J("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}function _K({params:e}){return wD()("Not Found"),u.jsx("div",{className:"w-full flex items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),u.jsxs("p",{className:"mt-2",children:["The page ",u.jsxs(Ue,{children:["/",e["*"]]})," does not seem to be correct."]}),u.jsx(xi,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}var CD={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),f=l(9924),g=l(844),_=l(4725),y=l(2585),v=l(3656);let m=o.AccessibilityManager=class extends g.Disposable{constructor(p,x,b,S){super(),this._terminal=p,this._coreBrowserService=b,this._renderService=S,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 f.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,v.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(p){for(let x=0;x<p;x++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,x){this._liveRegionDebouncer.refresh(p,x,this._terminal.rows)}_renderRows(p,x){const b=this._terminal.buffer,S=b.lines.length.toString();for(let C=p;C<=x;C++){const E=b.lines.get(b.ydisp+C),k=[],T=(E==null?void 0:E.translateToString(!0,void 0,void 0,k))||"",R=(b.ydisp+C+1).toString(),M=this._rowElements[C];M&&(T.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=T,this._rowColumns.set(M,k)),M.setAttribute("aria-posinset",R),M.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,x){const b=p.target,S=this._rowElements[x===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==S)return;let C,E;if(x===0?(C=b,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(C=this._rowElements.shift(),E=b,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var T;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:p.anchorNode,offset:p.anchorOffset},b={node:p.focusNode,offset:p.focusOffset};if((x.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===b.node&&x.offset>b.offset)&&([x,b]=[b,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const S=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:S,offset:((T=S.textContent)==null?void 0:T.length)??0}),!this._rowContainer.contains(b.node))return;const C=({node:R,offset:M})=>{const L=R instanceof Text?R.parentNode:R;let D=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(L);if(!N)return console.warn("columns is null. Race condition?"),null;let P=M<N.length?N[M]:N.slice(-1)[0]+1;return P>=this._terminal.cols&&(++D,P=0),{row:D,column:P}},E=C(x),k=C(b);if(E&&k){if(E.row>k.row||E.row===k.row&&E.column>=k.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(k.row-E.row)*this._terminal.cols-E.column+k.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);for(;this._rowElements.length>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=m=c([h(1,y.IInstantiationService),h(2,_.ICoreBrowserService),h(3,_.IRenderService)],m)},3614:(a,o)=>{function l(f){return f.replace(/\r?\n/g,"\r")}function c(f,g){return g?"\x1B[200~"+f+"\x1B[201~":f}function h(f,g,_,y){f=c(f=l(f),_.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),_.triggerDataEvent(f,!0),g.value=""}function d(f,g,_){const y=_.getBoundingClientRect(),v=f.clientX-y.left-10,m=f.clientY-y.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${m}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=l,o.bracketTextForPaste=c,o.copyHandler=function(f,g){f.clipboardData&&f.clipboardData.setData("text/plain",g.selectionText),f.preventDefault()},o.handlePasteEvent=function(f,g,_,y){f.stopPropagation(),f.clipboardData&&h(f.clipboardData.getData("text/plain"),g,_,y)},o.paste=h,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(f,g,_,y,v){d(f,g,_),v&&y.rightClickSelect(f),g.value=y.selectionText,g.select()}},7239:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const c=l(1505);o.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(h,d,f){this._css.set(h,d,f)}getCss(h,d){return this._css.get(h,d)}setColor(h,d,f){this._color.set(h,d,f)}getColor(h,d){return this._color.get(h,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(l,c,h,d){l.addEventListener(c,h,d);let f=!1;return{dispose:()=>{f||(f=!0,l.removeEventListener(c,h,d))}}}},3551:function(a,o,l){var c=this&&this.__decorate||function(m,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,x,b);else for(var k=m.length-1;k>=0;k--)(S=m[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(m,p){return function(x,b){p(x,b,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),f=l(8460),g=l(844),_=l(2585),y=l(4725);let v=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(m,p,x,b,S){super(),this._element=m,this._mouseService=p,this._renderService=x,this._bufferService=b,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)(()=>{var C;this._lastMouseEvent=void 0,(C=this._activeProviderReplies)==null||C.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){this._lastMouseEvent=m;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const x=m.composedPath();for(let b=0;b<x.length;b++){const S=x[b];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_handleHover(m){if(this._activeLine!==m.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(m,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,m)||(this._clearCurrentLink(),this._askForLink(m,!0))}_askForLink(m,p){var b,S;this._activeProviderReplies&&p||((b=this._activeProviderReplies)==null||b.forEach(C=>{C==null||C.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=m.y);let x=!1;for(const[C,E]of this._linkProviderService.linkProviders.entries())p?(S=this._activeProviderReplies)!=null&&S.get(C)&&(x=this._checkLinkProviderResult(C,m,x)):E.provideLinks(m.y,k=>{var R,M;if(this._isMouseOut)return;const T=k==null?void 0:k.map(L=>({link:L}));(R=this._activeProviderReplies)==null||R.set(C,T),x=this._checkLinkProviderResult(C,m,x),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)})}_removeIntersectingLinks(m,p){const x=new Set;for(let b=0;b<p.size;b++){const S=p.get(b);if(S)for(let C=0;C<S.length;C++){const E=S[C],k=E.link.range.start.y<m?0:E.link.range.start.x,T=E.link.range.end.y>m?this._bufferService.cols:E.link.range.end.x;for(let R=k;R<=T;R++){if(x.has(R)){S.splice(C--,1);break}x.add(R)}}}}_checkLinkProviderResult(m,p,x){var C;if(!this._activeProviderReplies)return x;const b=this._activeProviderReplies.get(m);let S=!1;for(let E=0;E<m;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(S=!0);if(!S&&b){const E=b.find(k=>this._linkAtPosition(k.link,p));E&&(x=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let E=0;E<this._activeProviderReplies.size;E++){const k=(C=this._activeProviderReplies.get(E))==null?void 0:C.find(T=>this._linkAtPosition(T.link,p));if(k){x=!0,this._handleNewLink(k);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._currentLink)return;const p=this._positionFromMouseEvent(m,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,p){this._currentLink&&this._lastMouseEvent&&(!m||!p||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(m.link,p)&&(this._currentLink=m,this._currentLink.state={decorations:{underline:m.link.decorations===void 0||m.link.decorations.underline,pointerCursor:m.link.decorations===void 0||m.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,m.link,this._lastMouseEvent),m.link.decorations={},Object.defineProperties(m.link.decorations,{pointerCursor:{get:()=>{var x,b;return(b=(x=this._currentLink)==null?void 0:x.state)==null?void 0:b.decorations.pointerCursor},set:x=>{var b;(b=this._currentLink)!=null&&b.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,b;return(b=(x=this._currentLink)==null?void 0:x.state)==null?void 0:b.decorations.underline},set:x=>{var b,S,C;(b=this._currentLink)!=null&&b.state&&((C=(S=this._currentLink)==null?void 0:S.state)==null?void 0:C.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(x=>{if(!this._currentLink)return;const b=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(b,S),this._lastMouseEvent)){const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._askForLink(C,!1)}})))}_linkHover(m,p,x){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(x,p.text)}_fireUnderlineEvent(m,p){const x=m.range,b=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-b-1,x.end.x,x.end.y-b-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(m,p,x){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(x,p.text)}_linkAtPosition(m,p){const x=m.range.start.y*this._bufferService.cols+m.range.start.x,b=m.range.end.y*this._bufferService.cols+m.range.end.x,S=p.y*this._bufferService.cols+p.x;return x<=S&&S<=b}_positionFromMouseEvent(m,p,x){const b=x.getCoords(m,p,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,p,x,b,S){return{x1:m,y1:p,x2:x,y2:b,cols:this._bufferService.cols,fg:S}}};o.Linkifier=v=c([h(1,y.IMouseService),h(2,y.IRenderService),h(3,_.IBufferService),h(4,y.ILinkProviderService)],v)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,l){var c=this&&this.__decorate||function(y,v,m,p){var x,b=arguments.length,S=b<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,v,m,p);else for(var C=y.length-1;C>=0;C--)(x=y[C])&&(S=(b<3?x(S):b>3?x(v,m,S):x(v,m))||S);return b>3&&S&&Object.defineProperty(v,m,S),S},h=this&&this.__param||function(y,v){return function(m,p){v(m,p,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),f=l(2585);let g=o.OscLinkProvider=class{constructor(y,v,m){this._bufferService=y,this._optionsService=v,this._oscLinkService=m}provideLinks(y,v){var T;const m=this._bufferService.buffer.lines.get(y-1);if(!m)return void v(void 0);const p=[],x=this._optionsService.rawOptions.linkHandler,b=new d.CellData,S=m.getTrimmedLength();let C=-1,E=-1,k=!1;for(let R=0;R<S;R++)if(E!==-1||m.hasContent(R)){if(m.loadCell(R,b),b.hasExtendedAttrs()&&b.extended.urlId){if(E===-1){E=R,C=b.extended.urlId;continue}k=b.extended.urlId!==C}else E!==-1&&(k=!0);if(k||E!==-1&&R===S-1){const M=(T=this._oscLinkService.getLinkData(C))==null?void 0:T.uri;if(M){const L={start:{x:E+1,y},end:{x:R+(k||R!==S-1?0:1),y}};let D=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const N=new URL(M);["http:","https:"].includes(N.protocol)||(D=!0)}catch{D=!0}D||p.push({text:M,range:L,activate:(N,P)=>x?x.activate(N,P,L):_(0,P),hover:(N,P)=>{var I;return(I=x==null?void 0:x.hover)==null?void 0:I.call(x,N,P,L)},leave:(N,P)=>{var I;return(I=x==null?void 0:x.leave)==null?void 0:I.call(x,N,P,L)}})}k=!1,b.hasExtendedAttrs()&&b.extended.urlId?(E=R,C=b.extended.urlId):(E=-1,C=-1)}}v(p)}};function _(y,v){if(confirm(`Do you want to navigate to ${v}?

WARNING: This link could potentially be dangerous`)){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=c([h(0,f.IBufferService),h(1,f.IOptionsService),h(2,f.IOscLinkService)],g)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.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,h){this._rowCount=h,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,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const c=l(3614),h=l(3656),d=l(3551),f=l(9042),g=l(3730),_=l(1680),y=l(3107),v=l(5744),m=l(2950),p=l(1296),x=l(428),b=l(4269),S=l(5114),C=l(8934),E=l(3230),k=l(9312),T=l(4725),R=l(6731),M=l(8055),L=l(8969),D=l(8460),N=l(844),P=l(6114),I=l(8437),z=l(2584),O=l(7399),j=l(5941),A=l(9074),F=l(2585),H=l(5435),B=l(4567),G=l(779);class Q extends L.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(W={}){super(W),this.browser=P,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(G.LinkProviderService),this._instantiationService.setService(T.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows(($,V)=>this.refresh($,V))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport($=>this._reportWindowsOptions($))),this.register(this._inputHandler.onColor($=>this._handleColorEvent($))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize($=>this._afterResize($.cols,$.rows))),this.register((0,N.toDisposable)(()=>{var $,V;this._customKeyEventHandler=void 0,(V=($=this.element)==null?void 0:$.parentNode)==null||V.removeChild(this.element)}))}_handleColorEvent(W){if(this._themeService)for(const $ of W){let V,U="";switch($.index){case 256:V="foreground",U="10";break;case 257:V="background",U="11";break;case 258:V="cursor",U="12";break;default:V="ansi",U="4;"+$.index}switch($.type){case 0:const X=M.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${U};${(0,j.toRgbString)(X)}${z.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors(q=>q.ansi[$.index]=M.channels.toColor(...$.color));else{const q=V;this._themeService.modifyColors(re=>re[q]=M.channels.toColor(...$.color))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(B.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.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 W=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(W);if(!$)return;const V=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,X=$.getWidth(V),q=this._renderService.dimensions.css.cell.width*X,re=this.buffer.y*this._renderService.dimensions.css.cell.height,ne=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ne+"px",this.textarea.style.top=re+"px",this.textarea.style.width=q+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",$=>{this.hasSelection()&&(0,c.copyHandler)($,this._selectionService)}));const W=$=>(0,c.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,h.addDisposableDomListener)(this.element,"paste",W)),P.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",$=>{$.button===2&&(0,c.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",$=>{(0,c.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),P.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",$=>{$.button===1&&(0,c.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",W=>this._keyUp(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",W=>this._keyDown(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",W=>this._keyPress(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",W=>this._compositionHelper.compositionupdate(W))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,h.addDisposableDomListener)(this.textarea,"input",W=>this._inputEvent(W),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(W){var V;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((V=this.element)==null?void 0:V.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,h.addDisposableDomListener)(this.screenElement,"mousemove",U=>this.updateCursorStyle(U))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),P.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(S.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(m.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(_.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(y.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(B.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,$=this.element;function V(q){const re=W._mouseService.getMouseReportCoords(q,W.screenElement);if(!re)return!1;let ne,le;switch(q.overrideType||q.type){case"mousemove":le=32,q.buttons===void 0?(ne=3,q.button!==void 0&&(ne=q.button<3?q.button:3)):ne=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":le=0,ne=q.button<3?q.button:3;break;case"mousedown":le=1,ne=q.button<3?q.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(q)===!1||W.viewport.getLinesScrolled(q)===0)return!1;le=q.deltaY<0?0:1,ne=4;break;default:return!1}return!(le===void 0||ne===void 0||ne>4)&&W.coreMouseService.triggerMouseEvent({col:re.col,row:re.row,x:re.x,y:re.y,button:ne,action:le,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:q=>(V(q),q.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(q)),wheel:q=>(V(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&V(q)},mousemove:q=>{q.buttons||V(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?U.mousemove||($.addEventListener("mousemove",X.mousemove),U.mousemove=X.mousemove):($.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&q?U.wheel||($.addEventListener("wheel",X.wheel,{passive:!1}),U.wheel=X.wheel):($.removeEventListener("wheel",U.wheel),U.wheel=null),2&q?U.mouseup||(U.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&q?U.mousedrag||(U.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)($,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return V(q),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(q)})),this.register((0,h.addDisposableDomListener)($,"wheel",q=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const re=this.viewport.getLinesScrolled(q);if(re===0)return;const ne=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let le="";for(let ve=0;ve<Math.abs(re);ve++)le+=ne;return this.coreService.triggerDataEvent(le,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,h.addDisposableDomListener)($,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,h.addDisposableDomListener)($,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(W,$){var V;(V=this._renderService)==null||V.refreshRows(W,$)}updateCursorStyle(W){var $;($=this._selectionService)!=null&&$.shouldColumnSelect(W)?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(W,$,V=0){var U;V===1?(super.scrollLines(W,$,V),this.refresh(0,this.rows-1)):(U=this.viewport)==null||U.scrollLines(W)}paste(W){(0,c.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,$,V){this._selectionService.setSelection(W,$,V)}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 W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,$){var V;(V=this._selectionService)==null||V.selectLines(W,$)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!$&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,O.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),V.type===3||V.type===2){const U=this.rows-1;return this.scrollLines(V.type===2?-U:U),this.cancel(W,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(V.cancel&&this.cancel(W,!0),!V.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==z.C0.ETX&&V.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,$){const V=W.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||W.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||W.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?V:V&&(!$.keyCode||$.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)$=W.charCode;else if(W.which===null||W.which===void 0)$=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;$=W.which}return!(!$||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=W.data;return this.coreService.triggerDataEvent($,!0),this.cancel(W),!0}return!1}resize(W,$){W!==this.cols||$!==this.rows?super.resize(W,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,$){var V,U;(V=this._charSizeService)==null||V.measure(),(U=this.viewport)==null||U.syncScrollArea(!0)}clear(){var W;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 $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(I.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var $,V;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(V=this.viewport)==null||V.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(z.C0.ESC+"[I"):this.coreService.triggerDataEvent(z.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[4;${V};${$}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.C0.ESC}[6;${X};${U}t`)}}cancel(W,$){if(this.options.cancelEvents||$)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=Q},9924:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.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,h){this._rowCount=h,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 d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=d-this._lastRefreshMs,g=this._debounceThresholdMS-f;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,o,l){var c=this&&this.__decorate||function(m,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,x,b);else for(var k=m.length-1;k>=0;k--)(S=m[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(m,p){return function(x,b){p(x,b,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),f=l(4725),g=l(8460),_=l(844),y=l(2585);let v=o.Viewport=class extends _.Disposable{constructor(m,p,x,b,S,C,E,k){super(),this._viewportElement=m,this._scrollArea=p,this._bufferService=x,this._optionsService=b,this._charSizeService=S,this._renderService=C,this._coreBrowserService=E,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,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(T=>this._activeBuffer=T.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(T=>this._renderDimensions=T)),this._handleThemeChange(k.colors),this.register(k.onChangeColors(T=>this._handleThemeChange(T))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(m){this._viewportElement.style.backgroundColor=m.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(m){if(m)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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const m=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==m&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=m),this._refreshAnimationFrame=null}syncScrollArea(m=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(m);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(m)}_handleScroll(m){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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const m=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(m*(this._smoothScrollState.target-this._smoothScrollState.origin)),m<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(m,p){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&x<this._lastRecordedBufferHeight)||(m.cancelable&&m.preventDefault(),!1)}handleWheel(m){const p=this._getPixelsScrolled(m);return p!==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+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(m,p))}scrollLines(m){if(m!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=m*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!1})}_getPixelsScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let p=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(m,p){var k;let x,b="";const S=[],C=p??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let T=m;T<C;T++){const R=E.get(T);if(!R)continue;const M=(k=E.get(T+1))==null?void 0:k.isWrapped;if(b+=R.translateToString(!M),!M||T===E.length-1){const L=document.createElement("div");L.textContent=b,S.push(L),b.length>0&&(x=L),b=""}}return{bufferElements:S,cursorElement:x}}getLinesScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let p=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(m,p){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&p.altKey||x==="ctrl"&&p.ctrlKey||x==="shift"&&p.shiftKey?m*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:m*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(m){this._lastTouchY=m.touches[0].pageY}handleTouchMove(m){const p=this._lastTouchY-m.touches[0].pageY;return this._lastTouchY=m.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(m,p))}};o.Viewport=v=c([h(2,y.IBufferService),h(3,y.IOptionsService),h(4,f.ICharSizeService),h(5,f.IRenderService),h(6,f.ICoreBrowserService),h(7,f.IThemeService)],v)},3107:function(a,o,l){var c=this&&this.__decorate||function(y,v,m,p){var x,b=arguments.length,S=b<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,v,m,p);else for(var C=y.length-1;C>=0;C--)(x=y[C])&&(S=(b<3?x(S):b>3?x(v,m,S):x(v,m))||S);return b>3&&S&&Object.defineProperty(v,m,S),S},h=this&&this.__param||function(y,v){return function(m,p){v(m,p,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),f=l(844),g=l(2585);let _=o.BufferDecorationRenderer=class extends f.Disposable{constructor(y,v,m,p,x){super(),this._screenElement=y,this._bufferService=v,this._coreBrowserService=m,this._decorationService=p,this._renderService=x,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(b=>this._removeDecoration(b))),this.register((0,f.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 p;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((p=y==null?void 0:y.options)==null?void 0:p.layer)==="top"),v.style.width=`${Math.round((y.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(y.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(y.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=y.options.x??0;return m&&m>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(y,v),v}_refreshStyle(y){const v=y.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)y.element&&(y.element.style.display="none",y.onRenderEmitter.fire(y.element));else{let m=this._decorationElements.get(y);m||(m=this._createElement(y),y.element=m,this._decorationElements.set(y,m),this._container.appendChild(m),y.onDispose(()=>{this._decorationElements.delete(y),m.remove()})),m.style.top=v*this._renderService.dimensions.css.cell.height+"px",m.style.display=this._altBufferIsActive?"none":"block",y.onRenderEmitter.fire(m)}}_refreshXPosition(y,v=y.element){if(!v)return;const m=y.options.x??0;(y.options.anchor||"left")==="right"?v.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(y){var v;(v=this._decorationElements.get(y))==null||v.remove(),this._decorationElements.delete(y),y.dispose()}};o.BufferDecorationRenderer=_=c([h(1,g.IBufferService),h(2,d.ICoreBrowserService),h(3,g.IDecorationService),h(4,d.IRenderService)],_)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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,h){return c>=l.startBufferLine-this._linePadding[h||"full"]&&c<=l.endBufferLine+this._linePadding[h||"full"]}_addLineToZone(l,c){l.startBufferLine=Math.min(l.startBufferLine,c),l.endBufferLine=Math.max(l.endBufferLine,c)}}},5744:function(a,o,l){var c=this&&this.__decorate||function(x,b,S,C){var E,k=arguments.length,T=k<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,S,C);else for(var R=x.length-1;R>=0;R--)(E=x[R])&&(T=(k<3?E(T):k>3?E(b,S,T):E(b,S))||T);return k>3&&T&&Object.defineProperty(b,S,T),T},h=this&&this.__param||function(x,b){return function(S,C){b(S,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),f=l(4725),g=l(844),_=l(2585),y={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0};let p=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,b,S,C,E,k,T){var M;super(),this._viewportElement=x,this._screenElement=b,this._bufferService=S,this._decorationService=C,this._renderService=E,this._optionsService=k,this._coreBrowserService=T,this._colorZoneStore=new d.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 R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var L;(L=this._canvas)==null||L.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 x=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=x,v.center=b,v.right=x,this._refreshDrawHeightConstants(),m.full=0,m.left=0,m.center=v.left,m.right=v.left+v.center}_refreshDrawHeightConstants(){y.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);y.left=b,y.center=b,y.right=b}_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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const b of x)b.position!=="full"&&this._renderColorZone(b);for(const b of x)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(m[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-y[x.position||"full"]/2),v[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+y[x.position||"full"]))}_queueRefresh(x,b){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=p=c([h(2,_.IBufferService),h(3,_.IDecorationService),h(4,f.IRenderService),h(5,_.IOptionsService),h(6,f.ICoreBrowserService)],p)},2950:function(a,o,l){var c=this&&this.__decorate||function(y,v,m,p){var x,b=arguments.length,S=b<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,v,m,p);else for(var C=y.length-1;C>=0;C--)(x=y[C])&&(S=(b<3?x(S):b>3?x(v,m,S):x(v,m))||S);return b>3&&S&&Object.defineProperty(v,m,S),S},h=this&&this.__param||function(y,v){return function(m,p){v(m,p,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),f=l(2585),g=l(2584);let _=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(y,v,m,p,x,b){this._textarea=y,this._compositionView=v,this._bufferService=m,this._optionsService=p,this._coreService=x,this._renderService=b,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 v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let m;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,m=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),m.length>0&&this._coreService.triggerDataEvent(m,!0)}},0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const y=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const v=this._textarea.value,m=v.replace(y,"");this._dataAlreadySent=m,v.length>y.length?this._coreService.triggerDataEvent(m,!0):v.length<y.length?this._coreService.triggerDataEvent(`${g.C0.DEL}`,!0):v.length===y.length&&v!==y&&this._coreService.triggerDataEvent(v,!0)}},0)}updateCompositionElements(y){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),m=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=p+"px",this._compositionView.style.height=m+"px",this._compositionView.style.lineHeight=m+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const b=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=p+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}y||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=_=c([h(2,f.IBufferService),h(3,f.IOptionsService),h(4,f.ICoreService),h(5,d.IRenderService)],_)},9806:(a,o)=>{function l(c,h,d){const f=d.getBoundingClientRect(),g=c.getComputedStyle(d),_=parseInt(g.getPropertyValue("padding-left")),y=parseInt(g.getPropertyValue("padding-top"));return[h.clientX-f.left-_,h.clientY-f.top-y]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(c,h,d,f,g,_,y,v,m){if(!_)return;const p=l(c,h,d);return p?(p[0]=Math.ceil((p[0]+(m?y/2:0))/y),p[1]=Math.ceil(p[1]/v),p[0]=Math.min(Math.max(p[0],1),f+(m?1:0)),p[1]=Math.min(Math.max(p[1],1),g),p):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const c=l(2584);function h(v,m,p,x){const b=v-d(v,p),S=m-d(m,p),C=Math.abs(b-S)-function(E,k,T){let R=0;const M=E-d(E,T),L=k-d(k,T);for(let D=0;D<Math.abs(M-L);D++){const N=f(E,k)==="A"?-1:1,P=T.buffer.lines.get(M+N*D);P!=null&&P.isWrapped&&R++}return R}(v,m,p);return y(C,_(f(v,m),x))}function d(v,m){let p=0,x=m.buffer.lines.get(v),b=x==null?void 0:x.isWrapped;for(;b&&v>=0&&v<m.rows;)p++,x=m.buffer.lines.get(--v),b=x==null?void 0:x.isWrapped;return p}function f(v,m){return v>m?"A":"B"}function g(v,m,p,x,b,S){let C=v,E=m,k="";for(;C!==p||E!==x;)C+=b?1:-1,b&&C>S.cols-1?(k+=S.buffer.translateBufferLineToString(E,!1,v,C),C=0,v=0,E++):!b&&C<0&&(k+=S.buffer.translateBufferLineToString(E,!1,0,v+1),C=S.cols-1,v=C,E--);return k+S.buffer.translateBufferLineToString(E,!1,v,C)}function _(v,m){const p=m?"O":"[";return c.C0.ESC+p+v}function y(v,m){v=Math.floor(v);let p="";for(let x=0;x<v;x++)p+=m;return p}o.moveToCellSequence=function(v,m,p,x){const b=p.buffer.x,S=p.buffer.y;if(!p.buffer.hasScrollback)return function(k,T,R,M,L,D){return h(T,M,L,D).length===0?"":y(g(k,T,k,T-d(T,L),!1,L).length,_("D",D))}(b,S,0,m,p,x)+h(S,m,p,x)+function(k,T,R,M,L,D){let N;N=h(T,M,L,D).length>0?M-d(M,L):T;const P=M,I=function(z,O,j,A,F,H){let B;return B=h(j,A,F,H).length>0?A-d(A,F):O,z<j&&B<=A||z>=j&&B<A?"C":"D"}(k,T,R,M,L,D);return y(g(k,N,R,P,I==="C",L).length,_(I,D))}(b,S,v,m,p,x);let C;if(S===m)return C=b>v?"D":"C",y(Math.abs(b-v),_(C,x));C=S>m?"D":"C";const E=Math.abs(S-m);return y(function(k,T){return T.cols-k}(S>m?v:b,p)+(E-1)*p.cols+1+((S>m?b:v)-1),_(C,x))}},1296:function(a,o,l){var c=this&&this.__decorate||function(D,N,P,I){var z,O=arguments.length,j=O<3?N:I===null?I=Object.getOwnPropertyDescriptor(N,P):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(D,N,P,I);else for(var A=D.length-1;A>=0;A--)(z=D[A])&&(j=(O<3?z(j):O>3?z(N,P,j):z(N,P))||j);return O>3&&j&&Object.defineProperty(N,P,j),j},h=this&&this.__param||function(D,N){return function(P,I){N(P,I,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),f=l(2550),g=l(2223),_=l(6171),y=l(6052),v=l(4725),m=l(8055),p=l(8460),x=l(844),b=l(2585),S="xterm-dom-renderer-owner-",C="xterm-rows",E="xterm-fg-",k="xterm-bg-",T="xterm-focus",R="xterm-selection";let M=1,L=o.DomRenderer=class extends x.Disposable{constructor(D,N,P,I,z,O,j,A,F,H,B,G,Q){super(),this._terminal=D,this._document=N,this._element=P,this._screenElement=I,this._viewportElement=z,this._helperContainer=O,this._linkifier2=j,this._charSizeService=F,this._optionsService=H,this._bufferService=B,this._coreBrowserService=G,this._themeService=Q,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,y.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,_.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Y=>this._injectCss(Y))),this._injectCss(this._themeService.colors),this._rowFactory=A.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Y=>this._handleLinkHover(Y))),this.register(this._linkifier2.onHideLinkUnderline(Y=>this._handleLinkLeave(Y))),this.register((0,x.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new f.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 P of this._rowElements)P.style.width=`${this.dimensions.css.canvas.width}px`,P.style.height=`${this.dimensions.css.cell.height}px`,P.style.lineHeight=`${this.dimensions.css.cell.height}px`,P.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${C} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${C} .xterm-dim { color: ${m.color.multiplyOpacity(D.foreground,.5).css};}`,N+=`${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;}`;const P=`blink_underline_${this._terminalClass}`,I=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;N+=`@keyframes ${P} { 50% {  border-bottom-style: hidden; }}`,N+=`@keyframes ${I} { 50% {  box-shadow: none; }}`,N+=`@keyframes ${z} { 0% {  background-color: ${D.cursor.css};  color: ${D.cursorAccent.css}; } 50% {  background-color: inherit;  color: ${D.cursor.css}; }}`,N+=`${this._terminalSelector} .${C}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${C}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${C}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[O,j]of D.ansi.entries())N+=`${this._terminalSelector} .${E}${O} { color: ${j.css}; }${this._terminalSelector} .${E}${O}.xterm-dim { color: ${m.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${k}${O} { background-color: ${j.css}; }`;N+=`${this._terminalSelector} .${E}${g.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(D.background).css}; }${this._terminalSelector} .${E}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${k}${g.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,N){for(let P=this._rowElements.length;P<=N;P++){const I=this._document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,N){this._refreshRowElements(D,N),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(T),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,N,P){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,N,P),this.renderRows(0,this._bufferService.rows-1),!D||!N)return;this._selectionRenderModel.update(this._terminal,D,N,P);const I=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,O=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(O>=this._bufferService.rows||j<0)return;const A=this._document.createDocumentFragment();if(P){const F=D[0]>N[0];A.appendChild(this._createSelectionElement(O,F?N[0]:D[0],F?D[0]:N[0],j-O+1))}else{const F=I===O?D[0]:0,H=O===z?N[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(O,F,H));const B=j-O-1;if(A.appendChild(this._createSelectionElement(O+1,0,this._bufferService.cols,B)),O!==j){const G=z===j?N[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(j,0,G))}}this._selectionContainer.appendChild(A)}_createSelectionElement(D,N,P,I=1){const z=this._document.createElement("div"),O=N*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(P-N);return O+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-O),z.style.height=I*this.dimensions.css.cell.height+"px",z.style.top=D*this.dimensions.css.cell.height+"px",z.style.left=`${O}px`,z.style.width=`${j}px`,z}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 D of this._rowElements)D.replaceChildren()}renderRows(D,N){const P=this._bufferService.buffer,I=P.ybase+P.y,z=Math.min(P.x,this._bufferService.cols-1),O=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=D;F<=N;F++){const H=F+P.ydisp,B=this._rowElements[F],G=P.lines.get(H);if(!B||!G)break;B.replaceChildren(...this._rowFactory.createRow(G,H,H===I,j,A,z,O,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,N,P,I,z,O){P<0&&(D=0),I<0&&(N=0);const j=this._bufferService.rows-1;P=Math.max(Math.min(P,j),0),I=Math.max(Math.min(I,j),0),z=Math.min(z,this._bufferService.cols);const A=this._bufferService.buffer,F=A.ybase+A.y,H=Math.min(A.x,z-1),B=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,Q=this._optionsService.rawOptions.cursorInactiveStyle;for(let Y=P;Y<=I;++Y){const W=Y+A.ydisp,$=this._rowElements[Y],V=A.lines.get(W);if(!$||!V)break;$.replaceChildren(...this._rowFactory.createRow(V,W,W===F,G,Q,H,B,this.dimensions.css.cell.width,this._widthCache,O?Y===P?D:0:-1,O?(Y===I?N:z)-1:-1))}}};o.DomRenderer=L=c([h(7,b.IInstantiationService),h(8,v.ICharSizeService),h(9,b.IOptionsService),h(10,b.IBufferService),h(11,v.ICoreBrowserService),h(12,v.IThemeService)],L)},3787:function(a,o,l){var c=this&&this.__decorate||function(C,E,k,T){var R,M=arguments.length,L=M<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(C,E,k,T);else for(var D=C.length-1;D>=0;D--)(R=C[D])&&(L=(M<3?R(L):M>3?R(E,k,L):R(E,k))||L);return M>3&&L&&Object.defineProperty(E,k,L),L},h=this&&this.__param||function(C,E){return function(k,T){E(k,T,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),f=l(643),g=l(511),_=l(2585),y=l(8055),v=l(4725),m=l(4269),p=l(6171),x=l(3734);let b=o.DomRendererRowFactory=class{constructor(C,E,k,T,R,M,L){this._document=C,this._characterJoinerService=E,this._optionsService=k,this._coreBrowserService=T,this._coreService=R,this._decorationService=M,this._themeService=L,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,E,k){this._selectionStart=C,this._selectionEnd=E,this._columnSelectMode=k}createRow(C,E,k,T,R,M,L,D,N,P,I){const z=[],O=this._characterJoinerService.getJoinedCharacters(E),j=this._themeService.colors;let A,F=C.getNoBgTrimmedLength();k&&F<M+1&&(F=M+1);let H=0,B="",G=0,Q=0,Y=0,W=!1,$=0,V=!1,U=0;const X=[],q=P!==-1&&I!==-1;for(let re=0;re<F;re++){C.loadCell(re,this._workCell);let ne=this._workCell.getWidth();if(ne===0)continue;let le=!1,ve=re,ae=this._workCell;if(O.length>0&&re===O[0][0]){le=!0;const ye=O.shift();ae=new m.JoinedCellData(this._workCell,C.translateToString(!0,ye[0],ye[1]),ye[1]-ye[0]),ve=ye[1]-1,ne=ae.getWidth()}const Ee=this._isCellInSelection(re,E),Me=k&&re===M,xe=q&&re>=P&&re<=I;let we=!1;this._decorationService.forEachDecorationAtCell(re,E,void 0,ye=>{we=!0});let se=ae.getChars()||f.WHITESPACE_CELL_CHAR;if(se===" "&&(ae.isUnderline()||ae.isOverline())&&(se=" "),U=ne*D-N.get(se,ae.isBold(),ae.isItalic()),A){if(H&&(Ee&&V||!Ee&&!V&&ae.bg===G)&&(Ee&&V&&j.selectionForeground||ae.fg===Q)&&ae.extended.ext===Y&&xe===W&&U===$&&!Me&&!le&&!we){ae.isInvisible()?B+=f.WHITESPACE_CELL_CHAR:B+=se,H++;continue}H&&(A.textContent=B),A=this._document.createElement("span"),H=0,B=""}else A=this._document.createElement("span");if(G=ae.bg,Q=ae.fg,Y=ae.extended.ext,W=xe,$=U,V=Ee,le&&M>=re&&M<=ve&&(M=re),!this._coreService.isCursorHidden&&Me&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&X.push("xterm-cursor-blink"),X.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(ae.isBold()&&X.push("xterm-bold"),ae.isItalic()&&X.push("xterm-italic"),ae.isDim()&&X.push("xterm-dim"),B=ae.isInvisible()?f.WHITESPACE_CELL_CHAR:ae.getChars()||f.WHITESPACE_CELL_CHAR,ae.isUnderline()&&(X.push(`xterm-underline-${ae.extended.underlineStyle}`),B===" "&&(B=" "),!ae.isUnderlineColorDefault()))if(ae.isUnderlineColorRGB())A.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(ae.getUnderlineColor()).join(",")})`;else{let ye=ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ae.isBold()&&ye<8&&(ye+=8),A.style.textDecorationColor=j.ansi[ye].css}ae.isOverline()&&(X.push("xterm-overline"),B===" "&&(B=" ")),ae.isStrikethrough()&&X.push("xterm-strikethrough"),xe&&(A.style.textDecoration="underline");let ee=ae.getFgColor(),ie=ae.getFgColorMode(),ce=ae.getBgColor(),K=ae.getBgColorMode();const te=!!ae.isInverse();if(te){const ye=ee;ee=ce,ce=ye;const ze=ie;ie=K,K=ze}let oe,he,_e,ge=!1;switch(this._decorationService.forEachDecorationAtCell(re,E,void 0,ye=>{ye.options.layer!=="top"&&ge||(ye.backgroundColorRGB&&(K=50331648,ce=ye.backgroundColorRGB.rgba>>8&16777215,oe=ye.backgroundColorRGB),ye.foregroundColorRGB&&(ie=50331648,ee=ye.foregroundColorRGB.rgba>>8&16777215,he=ye.foregroundColorRGB),ge=ye.options.layer==="top")}),!ge&&Ee&&(oe=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,ce=oe.rgba>>8&16777215,K=50331648,ge=!0,j.selectionForeground&&(ie=50331648,ee=j.selectionForeground.rgba>>8&16777215,he=j.selectionForeground)),ge&&X.push("xterm-decoration-top"),K){case 16777216:case 33554432:_e=j.ansi[ce],X.push(`xterm-bg-${ce}`);break;case 50331648:_e=y.channels.toColor(ce>>16,ce>>8&255,255&ce),this._addStyle(A,`background-color:#${S((ce>>>0).toString(16),"0",6)}`);break;default:te?(_e=j.foreground,X.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):_e=j.background}switch(oe||ae.isDim()&&(oe=y.color.multiplyOpacity(_e,.5)),ie){case 16777216:case 33554432:ae.isBold()&&ee<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ee+=8),this._applyMinimumContrast(A,_e,j.ansi[ee],ae,oe,void 0)||X.push(`xterm-fg-${ee}`);break;case 50331648:const ye=y.channels.toColor(ee>>16&255,ee>>8&255,255&ee);this._applyMinimumContrast(A,_e,ye,ae,oe,he)||this._addStyle(A,`color:#${S(ee.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(A,_e,j.foreground,ae,oe,he)||te&&X.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}X.length&&(A.className=X.join(" "),X.length=0),Me||le||we?A.textContent=B:H++,U!==this.defaultSpacing&&(A.style.letterSpacing=`${U}px`),z.push(A),re=ve}return A&&H&&(A.textContent=B),z}_applyMinimumContrast(C,E,k,T,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const L=this._getContrastCache(T);let D;if(R||M||(D=L.getColor(E.rgba,k.rgba)),D===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);D=y.color.ensureContrastRatio(R||E,M||k,N),L.setColor((R||E).rgba,(M||k).rgba,D??null)}return!!D&&(this._addStyle(C,`color:${D.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,E){C.setAttribute("style",`${C.getAttribute("style")||""}${E};`)}_isCellInSelection(C,E){const k=this._selectionStart,T=this._selectionEnd;return!(!k||!T)&&(this._columnSelectMode?k[0]<=T[0]?C>=k[0]&&E>=k[1]&&C<T[0]&&E<=T[1]:C<k[0]&&E>=k[1]&&C>=T[0]&&E<=T[1]:E>k[1]&&E<T[1]||k[1]===T[1]&&E===k[1]&&C>=k[0]&&C<T[0]||k[1]<T[1]&&E===T[1]&&C<T[0]||k[1]<T[1]&&E===k[1]&&C>=k[0])}};function S(C,E,k){for(;C.length<k;)C=E+C;return C}o.DomRendererRowFactory=b=c([h(1,v.ICharacterJoinerService),h(2,_.IOptionsService),h(3,v.ICoreBrowserService),h(4,_.ICoreService),h(5,_.IDecorationService),h(6,v.IThemeService)],b)},2550:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.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 h=l.createElement("span");h.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const f=l.createElement("span");f.classList.add("xterm-char-measure-element"),f.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=[h,d,f,g],this._container.appendChild(h),this._container.appendChild(d),this._container.appendChild(f),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,h,d){l===this._font&&c===this._fontSize&&h===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=c,this._weight=h,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,c,h){let d=0;if(!c&&!h&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const _=this._measure(l,0);return _>0&&(this._flat[d]=_),_}let f=l;c&&(f+="B"),h&&(f+="I");let g=this._holey.get(f);if(g===void 0){let _=0;c&&(_|=1),h&&(_|=2),g=this._measure(l,_),g>0&&this._holey.set(f,g)}return g}_measure(l,c){const h=this._measureElements[c];return h.textContent=l.repeat(32),h.offsetWidth/32}}},2223:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const c=l(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function l(h){return 57508<=h&&h<=57558}function c(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=c,o.allowRescaling=function(h,d,f,g){return d===1&&f>Math.ceil(1.5*g)&&h!==void 0&&h>255&&!c(h)&&!l(h)&&!function(_){return 57344<=_&&_<=63743}(h)},o.treatGlyphAsBackgroundColor=function(h){return l(h)||function(d){return 9472<=d&&d<=9631}(h)},o.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}}}},o.computeNextVariantOffset=function(h,d,f=0){return(h-(2*Math.round(d)-f))%(2*Math.round(d))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(h,d,f,g=!1){if(this.selectionStart=d,this.selectionEnd=f,!d||!f||d[0]===f[0]&&d[1]===f[1])return void this.clear();const _=h.buffers.active.ydisp,y=d[1]-_,v=f[1]-_,m=Math.max(y,0),p=Math.min(v,h.rows-1);m>=h.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=y,this.viewportEndRow=v,this.viewportCappedStartRow=m,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=f[0])}isCellSelected(h,d,f){return!!this.hasSelection&&(f-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&f>=this.viewportCappedStartRow&&d<this.endCol&&f<=this.viewportCappedEndRow:d<this.startCol&&f>=this.viewportCappedStartRow&&d>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.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,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),f=l(8460),g=l(844);let _=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,x,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new m(this._optionsService))}catch{this._measureStrategy=this.register(new v(p,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};o.CharSizeService=_=c([h(2,d.IOptionsService)],_);class y extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,b){x!==void 0&&x>0&&b!==void 0&&b>0&&(this._result.width=x,this._result.height=b)}}class v extends y{constructor(x,b,S){super(),this._document=x,this._parentElement=b,this._optionsService=S,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(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class m extends y{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var c=this&&this.__decorate||function(m,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,x,b);else for(var k=m.length-1;k>=0;k--)(S=m[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(m,p){return function(x,b){p(x,b,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),f=l(643),g=l(511),_=l(2585);class y extends d.AttributeData{constructor(p,x,b){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=x,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=y;let v=o.CharacterJoinerService=class kD{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(p){const x={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(x),x.id}deregister(p){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===p)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(p);if(!x||x.length===0)return[];const b=[],S=x.translateToString(!0);let C=0,E=0,k=0,T=x.getFg(0),R=x.getBg(0);for(let M=0;M<x.getTrimmedLength();M++)if(x.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==R){if(M-C>1){const L=this._getJoinedRanges(S,k,E,x,C);for(let D=0;D<L.length;D++)b.push(L[D])}C=M,k=E,T=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const M=this._getJoinedRanges(S,k,E,x,C);for(let L=0;L<M.length;L++)b.push(M[L])}return b}_getJoinedRanges(p,x,b,S,C){const E=p.substring(x,b);let k=[];try{k=this._characterJoiners[0].handler(E)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const R=this._characterJoiners[T].handler(E);for(let M=0;M<R.length;M++)kD._mergeRanges(k,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(k,S,C),k}_stringRangesToCellRanges(p,x,b){let S=0,C=!1,E=0,k=p[S];if(k){for(let T=b;T<this._bufferService.cols;T++){const R=x.getWidth(T),M=x.getString(T).length||f.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!C&&k[0]<=E&&(k[0]=T,C=!0),k[1]<=E){if(k[1]=T,k=p[++S],!k)break;k[0]<=E?(k[0]=T,C=!0):C=!1}E+=M}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(p,x){let b=!1;for(let S=0;S<p.length;S++){const C=p[S];if(b){if(x[1]<=C[0])return p[S-1][1]=x[1],p;if(x[1]<=C[1])return p[S-1][1]=Math.max(x[1],C[1]),p.splice(S,1),p;p.splice(S,1),S--}else{if(x[1]<=C[0])return p.splice(S,0,x),p;if(x[1]<=C[1])return C[0]=Math.min(x[0],C[0]),p;x[0]<C[1]&&(C[0]=Math.min(x[0],C[0]),b=!0)}}return b?p[p.length-1][1]=x[1]:p.push(x),p}};o.CharacterJoinerService=v=c([h(0,_.IBufferService)],v)},5114:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const c=l(844),h=l(8460),d=l(3656);class f extends c.Disposable{constructor(y,v,m){super(),this._textarea=y,this._window=v,this.mainDocument=m,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(p=>this._screenDprMonitor.setWindow(p))),this.register((0,h.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}}o.CoreBrowserService=f;class g extends c.Disposable{constructor(y){super(),this._parentWindow=y,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new h.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,d.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)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const c=l(844);class h extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const g=this.linkProviders.indexOf(f);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=h},8934:function(a,o,l){var c=this&&this.__decorate||function(_,y,v,m){var p,x=arguments.length,b=x<3?y:m===null?m=Object.getOwnPropertyDescriptor(y,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,y,v,m);else for(var S=_.length-1;S>=0;S--)(p=_[S])&&(b=(x<3?p(b):x>3?p(y,v,b):p(y,v))||b);return x>3&&b&&Object.defineProperty(y,v,b),b},h=this&&this.__param||function(_,y){return function(v,m){y(v,m,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),f=l(9806);let g=o.MouseService=class{constructor(_,y){this._renderService=_,this._charSizeService=y}getCoords(_,y,v,m,p){return(0,f.getCoords)(window,_,y,v,m,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(_,y){const v=(0,f.getCoordsRelativeToElement)(window,_,y);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=g=c([h(0,d.IRenderService),h(1,d.ICharSizeService)],g)},3230:function(a,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),f=l(4725),g=l(8460),_=l(844),y=l(7226),v=l(2585);let m=o.RenderService=class extends _.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,x,b,S,C,E,k,T){super(),this._rowCount=p,this._charSizeService=S,this._renderer=this.register(new _.MutableDisposable),this._pausedResizeTask=new y.DebouncedIdleTask,this._observerDisposable=this.register(new _.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 d.RenderDebouncer((R,M)=>this._renderRows(R,M),k),this.register(this._renderDebouncer),this.register(k.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register(T.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(k.window,x),this.register(k.onWindowChange(R=>this._registerIntersectionObserver(R,x)))}_registerIntersectionObserver(p,x){if("IntersectionObserver"in p){const b=new p.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});b.observe(x),this._observerDisposable.value=(0,_.toDisposable)(()=>b.disconnect())}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,x,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,x,this._rowCount))}_renderRows(p,x){this._renderer.value&&(p=Math.min(p,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(p,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:x}),this._onRender.fire({start:p,end:x}),this._isNextRenderRedrawOnly=!0)}resize(p,x){this._rowCount=x,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw(x=>this.refreshRows(x.start,x.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,x;this._renderer.value&&((x=(p=this._renderer.value).clearTextureAtlas)==null||x.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var b;return(b=this._renderer.value)==null?void 0:b.handleResize(p,x)}):this._renderer.value.handleResize(p,x),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)==null||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)==null||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)==null||p.handleFocus()}handleSelectionChanged(p,x,b){var S;this._selectionState.start=p,this._selectionState.end=x,this._selectionState.columnSelectMode=b,(S=this._renderer.value)==null||S.handleSelectionChanged(p,x,b)}handleCursorMove(){var p;(p=this._renderer.value)==null||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)==null||p.clear()}};o.RenderService=m=c([h(2,v.IOptionsService),h(3,f.ICharSizeService),h(4,v.IDecorationService),h(5,v.IBufferService),h(6,f.ICoreBrowserService),h(7,f.IThemeService)],m)},9312:function(a,o,l){var c=this&&this.__decorate||function(k,T,R,M){var L,D=arguments.length,N=D<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(k,T,R,M);else for(var P=k.length-1;P>=0;P--)(L=k[P])&&(N=(D<3?L(N):D>3?L(T,R,N):L(T,R))||N);return D>3&&N&&Object.defineProperty(T,R,N),N},h=this&&this.__param||function(k,T){return function(R,M){T(R,M,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),f=l(9504),g=l(456),_=l(4725),y=l(8460),v=l(844),m=l(6114),p=l(4841),x=l(511),b=l(2585),S=" ",C=new RegExp(S,"g");let E=o.SelectionService=class extends v.Disposable{constructor(k,T,R,M,L,D,N,P,I){super(),this._element=k,this._screenElement=T,this._linkifier=R,this._bufferService=M,this._coreService=L,this._mouseService=D,this._optionsService=N,this._renderService=P,this._coreBrowserService=I,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.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=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(z=>this._handleTrim(z)),this.register(this._bufferService.buffers.onBufferActivate(z=>this._handleBufferActivate(z))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!k||!T||k[0]===T[0]&&k[1]===T[1])}get selectionText(){const k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!k||!T)return"";const R=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(k[0]===T[0])return"";const L=k[0]<T[0]?k[0]:T[0],D=k[0]<T[0]?T[0]:k[0];for(let N=k[1];N<=T[1];N++){const P=R.translateBufferLineToString(N,!0,L,D);M.push(P)}}else{const L=k[1]===T[1]?T[0]:void 0;M.push(R.translateBufferLineToString(k[1],!0,k[0],L));for(let D=k[1]+1;D<=T[1]-1;D++){const N=R.lines.get(D),P=R.translateBufferLineToString(D,!0);N!=null&&N.isWrapped?M[M.length-1]+=P:M.push(P)}if(k[1]!==T[1]){const D=R.lines.get(T[1]),N=R.translateBufferLineToString(T[1],!0,0,T[0]);D&&D.isWrapped?M[M.length-1]+=N:M.push(N)}}return M.map(L=>L.replace(C," ")).join(m.isWindows?`\r
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),m.isLinux&&k&&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(k){const T=this._getMouseBufferCoords(k),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&T)&&this._areCoordsInSelection(T,R,M)}isCellInSelection(k,T){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([k,T],R,M)}_areCoordsInSelection(k,T,R){return k[1]>T[1]&&k[1]<R[1]||T[1]===R[1]&&k[1]===T[1]&&k[0]>=T[0]&&k[0]<R[0]||T[1]<R[1]&&k[1]===R[1]&&k[0]<R[0]||T[1]<R[1]&&k[1]===T[1]&&k[0]>=T[0]}_selectWordAtCursor(k,T){var L,D;const R=(D=(L=this._linkifier.currentLink)==null?void 0:L.link)==null?void 0:D.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(k);return!!M&&(this._selectWordAt(M,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,T){this._model.clearSelection(),k=Math.max(k,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const T=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(k){let T=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=R?0:(T>R&&(T-=R),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(k){return m.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const T=this._getMouseBufferCoords(k);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(k){return k.altKey&&!(m.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.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]++}T&&T[0]===this._model.selectionEnd[0]&&T[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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const T=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,f.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,R=!(!k||!T||k[0]===T[0]&&k[1]===T[1]);R?k&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,T,R)):this._oldHasSelection&&this._fireOnSelectionChange(k,T,R)}_fireOnSelectionChange(k,T,R){this._oldSelectionStart=k,this._oldSelectionEnd=T,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim(T=>this._handleTrim(T))}_convertViewportColToCharacterIndex(k,T){let R=T;for(let M=0;T>=M;M++){const L=k.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:L>1&&T!==M&&(R+=L-1)}return R}setSelection(k,T,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,T],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,T,R=!0,M=!0){if(k[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,D=L.lines.get(k[1]);if(!D)return;const N=L.translateBufferLineToString(k[1],!1);let P=this._convertViewportColToCharacterIndex(D,k[0]),I=P;const z=k[0]-P;let O=0,j=0,A=0,F=0;if(N.charAt(P)===" "){for(;P>0&&N.charAt(P-1)===" ";)P--;for(;I<N.length&&N.charAt(I+1)===" ";)I++}else{let G=k[0],Q=k[0];D.getWidth(G)===0&&(O++,G--),D.getWidth(Q)===2&&(j++,Q++);const Y=D.getString(Q).length;for(Y>1&&(F+=Y-1,I+=Y-1);G>0&&P>0&&!this._isCharWordSeparator(D.loadCell(G-1,this._workCell));){D.loadCell(G-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(O++,G--):W>1&&(A+=W-1,P-=W-1),P--,G--}for(;Q<D.length&&I+1<N.length&&!this._isCharWordSeparator(D.loadCell(Q+1,this._workCell));){D.loadCell(Q+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,Q++):W>1&&(F+=W-1,I+=W-1),I++,Q++}}I++;let H=P+z-O+A,B=Math.min(this._bufferService.cols,I-P+O+j-A-F);if(T||N.slice(P,I).trim()!==""){if(R&&H===0&&D.getCodePoint(0)!==32){const G=L.lines.get(k[1]-1);if(G&&D.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const Q=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(Q){const Y=this._bufferService.cols-Q.start;H-=Y,B+=Y}}}if(M&&H+B===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const G=L.lines.get(k[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const Q=this._getWordAt([0,k[1]+1],!1,!1,!0);Q&&(B+=Q.length)}}return{start:H,length:B}}}_selectWordAt(k,T){const R=this._getWordAt(k,T);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[R.start,k[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(k){const T=this._getWordAt(k,!0);if(T){let R=k[1];for(;T.start<0;)T.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,R]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const T=this._bufferService.buffer.getWrappedRangeForLine(k),R={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(R,this._bufferService.cols)}};o.SelectionService=E=c([h(3,b.IBufferService),h(4,b.ICoreService),h(5,_.IMouseService),h(6,b.IOptionsService),h(7,_.IRenderService),h(8,_.ICoreBrowserService)],E)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const c=l(8343);o.ICharSizeService=(0,c.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),o.IMouseService=(0,c.createDecorator)("MouseService"),o.IRenderService=(0,c.createDecorator)("RenderService"),o.ISelectionService=(0,c.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,c.createDecorator)("ThemeService"),o.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(a,o,l){var c=this&&this.__decorate||function(E,k,T,R){var M,L=arguments.length,D=L<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(E,k,T,R);else for(var N=E.length-1;N>=0;N--)(M=E[N])&&(D=(L<3?M(D):L>3?M(k,T,D):M(k,T))||D);return L>3&&D&&Object.defineProperty(k,T,D),D},h=this&&this.__param||function(E,k){return function(T,R){k(T,R,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),f=l(8055),g=l(8460),_=l(844),y=l(2585),v=f.css.toColor("#ffffff"),m=f.css.toColor("#000000"),p=f.css.toColor("#ffffff"),x=f.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let T=0;T<216;T++){const R=k[T/36%6|0],M=k[T/6%6|0],L=k[T%6];E.push({css:f.channels.toCss(R,M,L),rgba:f.channels.toRgba(R,M,L)})}for(let T=0;T<24;T++){const R=8+10*T;E.push({css:f.channels.toCss(R,R,R),rgba:f.channels.toRgba(R,R,R)})}return E})());let S=o.ThemeService=class extends _.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:m,cursor:p,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:f.color.blend(m,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:f.color.blend(m,b),ansi:o.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(E={}){const k=this._colors;if(k.foreground=C(E.foreground,v),k.background=C(E.background,m),k.cursor=C(E.cursor,p),k.cursorAccent=C(E.cursorAccent,x),k.selectionBackgroundTransparent=C(E.selectionBackground,b),k.selectionBackgroundOpaque=f.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=C(E.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=f.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=E.selectionForeground?C(E.selectionForeground,f.NULL_COLOR):void 0,k.selectionForeground===f.NULL_COLOR&&(k.selectionForeground=void 0),f.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=f.color.opacity(k.selectionBackgroundTransparent,.3)),f.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=f.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=C(E.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=C(E.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=C(E.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=C(E.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=C(E.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=C(E.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=C(E.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=C(E.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=C(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=C(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=C(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=C(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=C(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=C(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=C(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=C(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const T=Math.min(k.ansi.length-16,E.extendedAnsi.length);for(let R=0;R<T;R++)k.ansi[R+16]=C(E.extendedAnsi[R],o.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){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[E]=this._restoreColors.ansi[E]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(E){E(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(E,k){if(E!==void 0)try{return f.css.toColor(E)}catch{}return k}o.ThemeService=S=c([h(0,y.IOptionsService)],S)},6349:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const c=l(8460),h=l(844);class d extends h.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 _=new Array(g);for(let y=0;y<Math.min(g,this.length);y++)_[y]=this._array[this._getCyclicIndex(y)];this._array=_,this._maxLength=g,this._startIndex=0}get length(){return this._length}set length(g){if(g>this._length)for(let _=this._length;_<g;_++)this._array[_]=void 0;this._length=g}get(g){return this._array[this._getCyclicIndex(g)]}set(g,_){this._array[this._getCyclicIndex(g)]=_}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,_,...y){if(_){for(let v=g;v<this._length-_;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+_)];this._length-=_,this.onDeleteEmitter.fire({index:g,amount:_})}for(let v=this._length-1;v>=g;v--)this._array[this._getCyclicIndex(v+y.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<y.length;v++)this._array[this._getCyclicIndex(g+v)]=y[v];if(y.length&&this.onInsertEmitter.fire({index:g,amount:y.length}),this._length+y.length>this._maxLength){const v=this._length+y.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}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,_,y){if(!(_<=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 m=_-1;m>=0;m--)this.set(g+m+y,this.get(g+m));const v=g+_+y-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<_;v++)this.set(g+v+y,this.get(g+v))}}_getCyclicIndex(g){return(this._startIndex+g)%this._maxLength}}o.CircularList=d},1439:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(c,h=5){if(typeof c!="object")return c;const d=Array.isArray(c)?[]:{};for(const f in c)d[f]=h<=1?c[f]:c[f]&&l(c[f],h-1);return d}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,c=0,h=0,d=0;var f,g,_,y,v;function m(x){const b=x.toString(16);return b.length<2?"0"+b:b}function p(x,b){return x<b?(b+.05)/(x+.05):(x+.05)/(b+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(x){x.toCss=function(b,S,C,E){return E!==void 0?`#${m(b)}${m(S)}${m(C)}${m(E)}`:`#${m(b)}${m(S)}${m(C)}`},x.toRgba=function(b,S,C,E=255){return(b<<24|S<<16|C<<8|E)>>>0},x.toColor=function(b,S,C,E){return{css:x.toCss(b,S,C,E),rgba:x.toRgba(b,S,C,E)}}}(f||(o.channels=f={})),function(x){function b(S,C){return d=Math.round(255*C),[l,c,h]=v.toChannels(S.rgba),{css:f.toCss(l,c,h,d),rgba:f.toRgba(l,c,h,d)}}x.blend=function(S,C){if(d=(255&C.rgba)/255,d===1)return{css:C.css,rgba:C.rgba};const E=C.rgba>>24&255,k=C.rgba>>16&255,T=C.rgba>>8&255,R=S.rgba>>24&255,M=S.rgba>>16&255,L=S.rgba>>8&255;return l=R+Math.round((E-R)*d),c=M+Math.round((k-M)*d),h=L+Math.round((T-L)*d),{css:f.toCss(l,c,h),rgba:f.toRgba(l,c,h)}},x.isOpaque=function(S){return(255&S.rgba)==255},x.ensureContrastRatio=function(S,C,E){const k=v.ensureContrastRatio(S.rgba,C.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},x.opaque=function(S){const C=(255|S.rgba)>>>0;return[l,c,h]=v.toChannels(C),{css:f.toCss(l,c,h),rgba:C}},x.opacity=b,x.multiplyOpacity=function(S,C){return d=255&S.rgba,b(S,d*C/255)},x.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(g||(o.color=g={})),function(x){let b,S;try{const C=document.createElement("canvas");C.width=1,C.height=1;const E=C.getContext("2d",{willReadFrequently:!0});E&&(b=E,b.globalCompositeOperation="copy",S=b.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),f.toColor(l,c,h);case 5:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),d=parseInt(C.slice(4,5).repeat(2),16),f.toColor(l,c,h,d);case 7:return{css:C,rgba:(parseInt(C.slice(1),16)<<8|255)>>>0};case 9:return{css:C,rgba:parseInt(C.slice(1),16)>>>0}}const E=C.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 l=parseInt(E[1]),c=parseInt(E[2]),h=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,c,h,d);if(!b||!S)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=S,b.fillStyle=C,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,c,h,d]=b.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,c,h,d),css:C}}}(_||(o.css=_={})),function(x){function b(S,C,E){const k=S/255,T=C/255,R=E/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}x.relativeLuminance=function(S){return b(S>>16&255,S>>8&255,255&S)},x.relativeLuminance2=b}(y||(o.rgb=y={})),function(x){function b(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let L=E>>24&255,D=E>>16&255,N=E>>8&255,P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));for(;P<k&&(L>0||D>0||N>0);)L-=Math.max(0,Math.ceil(.1*L)),D-=Math.max(0,Math.ceil(.1*D)),N-=Math.max(0,Math.ceil(.1*N)),P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));return(L<<24|D<<16|N<<8|255)>>>0}function S(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let L=E>>24&255,D=E>>16&255,N=E>>8&255,P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));for(;P<k&&(L<255||D<255||N<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),D=Math.min(255,D+Math.ceil(.1*(255-D))),N=Math.min(255,N+Math.ceil(.1*(255-N))),P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));return(L<<24|D<<16|N<<8|255)>>>0}x.blend=function(C,E){if(d=(255&E)/255,d===1)return E;const k=E>>24&255,T=E>>16&255,R=E>>8&255,M=C>>24&255,L=C>>16&255,D=C>>8&255;return l=M+Math.round((k-M)*d),c=L+Math.round((T-L)*d),h=D+Math.round((R-D)*d),f.toRgba(l,c,h)},x.ensureContrastRatio=function(C,E,k){const T=y.relativeLuminance(C>>8),R=y.relativeLuminance(E>>8);if(p(T,R)<k){if(R<T){const D=b(C,E,k),N=p(T,y.relativeLuminance(D>>8));if(N<k){const P=S(C,E,k);return N>p(T,y.relativeLuminance(P>>8))?D:P}return D}const M=S(C,E,k),L=p(T,y.relativeLuminance(M>>8));if(L<k){const D=b(C,E,k);return L>p(T,y.relativeLuminance(D>>8))?M:D}return M}},x.reduceLuminance=b,x.increaseLuminance=S,x.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}}(v||(o.rgba=v={})),o.toPaddedHex=m,o.contrastRatio=p},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const c=l(844),h=l(2585),d=l(4348),f=l(7866),g=l(744),_=l(7302),y=l(6975),v=l(8460),m=l(1753),p=l(1480),x=l(7994),b=l(9282),S=l(5435),C=l(5981),E=l(2660);let k=!1;class T extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event(M=>{var L;(L=this._onScrollApi)==null||L.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 L in M)this.optionsService.options[L]=M[L]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new _.OptionsService(M)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(y.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(m.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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(L=>{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(L=>{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((L,D)=>this._inputHandler.parse(L,D))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,L){this._writeBuffer.write(M,L)}writeSync(M,L){this._logService.logLevel<=h.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(M,L)}input(M,L=!0){this.coreService.triggerDataEvent(M,L)}resize(M,L){isNaN(M)||isNaN(L)||(M=Math.max(M,g.MINIMUM_COLS),L=Math.max(L,g.MINIMUM_ROWS),this._bufferService.resize(M,L))}scroll(M,L=!1){this._bufferService.scroll(M,L)}scrollLines(M,L,D){this._bufferService.scrollLines(M,L,D)}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 L=M-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(M,L){return this._inputHandler.registerEscHandler(M,L)}registerDcsHandler(M,L){return this._inputHandler.registerDcsHandler(M,L)}registerCsiHandler(M,L){return this._inputHandler.registerCsiHandler(M,L)}registerOscHandler(M,L){return this._inputHandler.registerOscHandler(M,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?M=L.backend==="conpty"&&L.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(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const L of M)L.dispose()})}}}o.CoreTerminal=T},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 h=[];for(let d=0;d<this._listeners.length;d++)h.push(this._listeners[d]);for(let d=0;d<h.length;d++)h[d].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(h=>c.fire(h))},o.runAndSubscribe=function(l,c){return c(void 0),l(h=>c(h))}},5435:function(a,o,l){var c=this&&this.__decorate||function(O,j,A,F){var H,B=arguments.length,G=B<3?j:F===null?F=Object.getOwnPropertyDescriptor(j,A):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(O,j,A,F);else for(var Q=O.length-1;Q>=0;Q--)(H=O[Q])&&(G=(B<3?H(G):B>3?H(j,A,G):H(j,A))||G);return B>3&&G&&Object.defineProperty(j,A,G),G},h=this&&this.__param||function(O,j){return function(A,F){j(A,F,O)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),f=l(7116),g=l(2015),_=l(844),y=l(482),v=l(8437),m=l(8460),p=l(643),x=l(511),b=l(3734),S=l(2585),C=l(1480),E=l(6242),k=l(6351),T=l(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function L(O,j){if(O>24)return j.setWinLines||!1;switch(O){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var D;(function(O){O[O.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",O[O.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(o.WindowsOptionsReportType=D={}));let N=0;class P extends _.Disposable{getAttrData(){return this._curAttrData}constructor(j,A,F,H,B,G,Q,Y,W=new g.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=A,this._coreService=F,this._logService=H,this._optionsService=B,this._oscLinkService=G,this._coreMouseService=Q,this._unicodeService=Y,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new y.StringToUtf32,this._utf8Decoder=new y.Utf8ToUtf32,this._workCell=new x.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new m.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new m.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new m.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new m.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new m.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new m.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new m.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new m.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new m.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new m.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new m.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate($=>this._activeBuffer=$.activeBuffer)),this._parser.setCsiHandlerFallback(($,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:V.toArray()})}),this._parser.setEscHandlerFallback($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})}),this._parser.setExecuteHandlerFallback($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})}),this._parser.setOscHandlerFallback(($,V,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:V,data:U})}),this._parser.setDcsHandlerFallback(($,V,U)=>{V==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:V,payload:U})}),this._parser.setPrintHandler(($,V,U)=>this.print($,V,U)),this._parser.registerCsiHandler({final:"@"},$=>this.insertChars($)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},$=>this.scrollLeft($)),this._parser.registerCsiHandler({final:"A"},$=>this.cursorUp($)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},$=>this.scrollRight($)),this._parser.registerCsiHandler({final:"B"},$=>this.cursorDown($)),this._parser.registerCsiHandler({final:"C"},$=>this.cursorForward($)),this._parser.registerCsiHandler({final:"D"},$=>this.cursorBackward($)),this._parser.registerCsiHandler({final:"E"},$=>this.cursorNextLine($)),this._parser.registerCsiHandler({final:"F"},$=>this.cursorPrecedingLine($)),this._parser.registerCsiHandler({final:"G"},$=>this.cursorCharAbsolute($)),this._parser.registerCsiHandler({final:"H"},$=>this.cursorPosition($)),this._parser.registerCsiHandler({final:"I"},$=>this.cursorForwardTab($)),this._parser.registerCsiHandler({final:"J"},$=>this.eraseInDisplay($,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},$=>this.eraseInDisplay($,!0)),this._parser.registerCsiHandler({final:"K"},$=>this.eraseInLine($,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},$=>this.eraseInLine($,!0)),this._parser.registerCsiHandler({final:"L"},$=>this.insertLines($)),this._parser.registerCsiHandler({final:"M"},$=>this.deleteLines($)),this._parser.registerCsiHandler({final:"P"},$=>this.deleteChars($)),this._parser.registerCsiHandler({final:"S"},$=>this.scrollUp($)),this._parser.registerCsiHandler({final:"T"},$=>this.scrollDown($)),this._parser.registerCsiHandler({final:"X"},$=>this.eraseChars($)),this._parser.registerCsiHandler({final:"Z"},$=>this.cursorBackwardTab($)),this._parser.registerCsiHandler({final:"`"},$=>this.charPosAbsolute($)),this._parser.registerCsiHandler({final:"a"},$=>this.hPositionRelative($)),this._parser.registerCsiHandler({final:"b"},$=>this.repeatPrecedingCharacter($)),this._parser.registerCsiHandler({final:"c"},$=>this.sendDeviceAttributesPrimary($)),this._parser.registerCsiHandler({prefix:">",final:"c"},$=>this.sendDeviceAttributesSecondary($)),this._parser.registerCsiHandler({final:"d"},$=>this.linePosAbsolute($)),this._parser.registerCsiHandler({final:"e"},$=>this.vPositionRelative($)),this._parser.registerCsiHandler({final:"f"},$=>this.hVPosition($)),this._parser.registerCsiHandler({final:"g"},$=>this.tabClear($)),this._parser.registerCsiHandler({final:"h"},$=>this.setMode($)),this._parser.registerCsiHandler({prefix:"?",final:"h"},$=>this.setModePrivate($)),this._parser.registerCsiHandler({final:"l"},$=>this.resetMode($)),this._parser.registerCsiHandler({prefix:"?",final:"l"},$=>this.resetModePrivate($)),this._parser.registerCsiHandler({final:"m"},$=>this.charAttributes($)),this._parser.registerCsiHandler({final:"n"},$=>this.deviceStatus($)),this._parser.registerCsiHandler({prefix:"?",final:"n"},$=>this.deviceStatusPrivate($)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},$=>this.softReset($)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},$=>this.setCursorStyle($)),this._parser.registerCsiHandler({final:"r"},$=>this.setScrollRegion($)),this._parser.registerCsiHandler({final:"s"},$=>this.saveCursor($)),this._parser.registerCsiHandler({final:"t"},$=>this.windowOptions($)),this._parser.registerCsiHandler({final:"u"},$=>this.restoreCursor($)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},$=>this.insertColumns($)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},$=>this.deleteColumns($)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},$=>this.selectProtected($)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},$=>this.requestMode($,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},$=>this.requestMode($,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler($=>(this.setTitle($),this.setIconName($),!0))),this._parser.registerOscHandler(1,new E.OscHandler($=>this.setIconName($))),this._parser.registerOscHandler(2,new E.OscHandler($=>this.setTitle($))),this._parser.registerOscHandler(4,new E.OscHandler($=>this.setOrReportIndexedColor($))),this._parser.registerOscHandler(8,new E.OscHandler($=>this.setHyperlink($))),this._parser.registerOscHandler(10,new E.OscHandler($=>this.setOrReportFgColor($))),this._parser.registerOscHandler(11,new E.OscHandler($=>this.setOrReportBgColor($))),this._parser.registerOscHandler(12,new E.OscHandler($=>this.setOrReportCursorColor($))),this._parser.registerOscHandler(104,new E.OscHandler($=>this.restoreIndexedColor($))),this._parser.registerOscHandler(110,new E.OscHandler($=>this.restoreFgColor($))),this._parser.registerOscHandler(111,new E.OscHandler($=>this.restoreBgColor($))),this._parser.registerOscHandler(112,new E.OscHandler($=>this.restoreCursorColor($))),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 $ in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},()=>this.selectCharset("("+$)),this._parser.registerEscHandler({intermediates:")",final:$},()=>this.selectCharset(")"+$)),this._parser.registerEscHandler({intermediates:"*",final:$},()=>this.selectCharset("*"+$)),this._parser.registerEscHandler({intermediates:"+",final:$},()=>this.selectCharset("+"+$)),this._parser.registerEscHandler({intermediates:"-",final:$},()=>this.selectCharset("-"+$)),this._parser.registerEscHandler({intermediates:".",final:$},()=>this.selectCharset("."+$)),this._parser.registerEscHandler({intermediates:"/",final:$},()=>this.selectCharset("/"+$));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler($=>(this._logService.error("Parsing error: ",$),$)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(($,V)=>this.requestStatusString($,V)))}_preserveStack(j,A,F,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=F,this._parseStack.position=H}_logSlowResolvingAsync(j){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([j,new Promise((A,F)=>setTimeout(()=>F("#SLOW_TIMEOUT"),5e3))]).catch(A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,A){let F,H=this._activeBuffer.x,B=this._activeBuffer.y,G=0;const Q=this._parseStack.paused;if(Q){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(F),F;H=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>M&&(G=this._parseStack.position+M)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,$=>String.fromCharCode($)).join("")}"`),typeof j=="string"?j.split("").map($=>$.charCodeAt(0)):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(j.length,M))),Q||this._dirtyRowTracker.clearRange(),j.length>M)for(let $=G;$<j.length;$+=M){const V=$+M<j.length?$+M:j.length,U=typeof j=="string"?this._stringDecoder.decode(j.substring($,V),this._parseBuffer):this._utf8Decoder.decode(j.subarray($,V),this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,U))return this._preserveStack(H,B,U,$),this._logSlowResolvingAsync(F),F}else if(!Q){const $=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,B,$,0),this._logSlowResolvingAsync(F),F}this._activeBuffer.x===H&&this._activeBuffer.y===B||this._onCursorMove.fire();const Y=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(Y,this._bufferService.rows-1))}print(j,A,F){let H,B;const G=this._charsetService.charset,Q=this._optionsService.rawOptions.screenReaderMode,Y=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,V=this._curAttrData;let U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&F-A>0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let X=this._parser.precedingJoinState;for(let q=A;q<F;++q){if(H=j[q],H<127&&G){const ve=G[String.fromCharCode(H)];ve&&(H=ve.charCodeAt(0))}const re=this._unicodeService.charProperties(H,X);B=C.UnicodeService.extractWidth(re);const ne=C.UnicodeService.extractShouldJoin(re),le=ne?C.UnicodeService.extractWidth(X):0;if(X=re,Q&&this._onA11yChar.fire((0,y.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+B-le>Y){if(W){const ve=U;let ae=this._activeBuffer.x-le;for(this._activeBuffer.x=le,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),U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),le>0&&U instanceof v.BufferLine&&U.copyCellsFrom(ve,ae,0,le,!1);ae<Y;)ve.setCellFromCodepoint(ae++,0,1,V)}else if(this._activeBuffer.x=Y-1,B===2)continue}if(ne&&this._activeBuffer.x){const ve=U.getWidth(this._activeBuffer.x-1)?1:2;U.addCodepointToCell(this._activeBuffer.x-ve,H,B);for(let ae=B-le;--ae>=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if($&&(U.insertCells(this._activeBuffer.x,B-le,this._activeBuffer.getNullCell(V)),U.getWidth(Y-1)===2&&U.setCellFromCodepoint(Y-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,V)),U.setCellFromCodepoint(this._activeBuffer.x++,H,B,V),B>0)for(;--B;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=X,this._activeBuffer.x<Y&&F-A>0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,A){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,A):this._parser.registerCsiHandler(j,F=>!L(F.params[0],this._optionsService.rawOptions.windowOptions)||A(F))}registerDcsHandler(j,A){return this._parser.registerDcsHandler(j,new k.DcsHandler(A))}registerEscHandler(j,A){return this._parser.registerEscHandler(j,A)}registerOscHandler(j,A){return this._parser.registerOscHandler(j,new E.OscHandler(A))}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 j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=j,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+A)}cursorUp(j){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const A=j.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=j.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=j.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const A=j.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,A,F,H=!1,B=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);G.replaceCells(A,F,this._activeBuffer.getNullCell(this._eraseAttrData()),B),H&&(G.isWrapped=!1)}_resetBufferLine(j,A=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),F.isWrapped=!1)}eraseInDisplay(j,A=!1){let F;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);F<this._bufferService.rows;F++)this._resetBufferLine(F,A);this._dirtyRowTracker.markDirty(F);break;case 1:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,A);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(j,A=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let A=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;A--;)this._activeBuffer.lines.splice(B-1,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let A=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;A--;)this._activeBuffer.lines.splice(F,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let A=j.params[0]||1;for(;A--;)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(j){let A=j.params[0]||1;for(;A--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=j.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=j.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=j.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=j.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);H.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const A=this._parser.precedingJoinState;if(!A)return!0;const F=j.params[0]||1,H=C.UnicodeService.extractWidth(A),B=this._activeBuffer.x-H,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(B),Q=new Uint32Array(G.length*F);let Y=0;for(let $=0;$<G.length;){const V=G.codePointAt($)||0;Q[Y++]=V,$+=V>65535?2:1}let W=Y;for(let $=1;$<F;++$)Q.copyWithin(W,0,Y),W+=Y;return this.print(Q,0,W),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let A=0;A<j.length;A++)switch(j.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let A=0;A<j.length;A++)switch(j.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,f.DEFAULT_CHARSET),this._charsetService.setgCharset(1,f.DEFAULT_CHARSET),this._charsetService.setgCharset(2,f.DEFAULT_CHARSET),this._charsetService.setgCharset(3,f.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(j){for(let A=0;A<j.length;A++)switch(j.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let A=0;A<j.length;A++)switch(j.params[A]){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(),j.params[A]===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(j,A){const F=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:B}=this._coreMouseService,G=this._coreService,{buffers:Q,cols:Y}=this._bufferService,{active:W,alt:$}=Q,V=this._optionsService.rawOptions,U=ne=>ne?1:2,X=j.params[0];return q=X,re=A?X===2?4:X===4?U(G.modes.insertMode):X===12?3:X===20?U(V.convertEol):0:X===1?U(F.applicationCursorKeys):X===3?V.windowOptions.setWinLines?Y===80?2:Y===132?1:0:0:X===6?U(F.origin):X===7?U(F.wraparound):X===8?3:X===9?U(H==="X10"):X===12?U(V.cursorBlink):X===25?U(!G.isCursorHidden):X===45?U(F.reverseWraparound):X===66?U(F.applicationKeypad):X===67?4:X===1e3?U(H==="VT200"):X===1002?U(H==="DRAG"):X===1003?U(H==="ANY"):X===1004?U(F.sendFocus):X===1005?4:X===1006?U(B==="SGR"):X===1015?4:X===1016?U(B==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?U(W===$):X===2004?U(F.bracketedPasteMode):0,G.triggerDataEvent(`${d.C0.ESC}[${A?"":"?"}${q};${re}$y`),!0;var q,re}_updateAttrColor(j,A,F,H,B){return A===2?(j|=50331648,j&=-16777216,j|=b.AttributeData.fromColorRGB([F,H,B])):A===5&&(j&=-50331904,j|=33554432|255&F),j}_extractColor(j,A,F){const H=[0,0,-1,0,0,0];let B=0,G=0;do{if(H[G+B]=j.params[A+G],j.hasSubParams(A+G)){const Q=j.getSubParams(A+G);let Y=0;do H[1]===5&&(B=1),H[G+Y+1+B]=Q[Y];while(++Y<Q.length&&Y+G+1+B<H.length);break}if(H[1]===5&&G+B>=2||H[1]===2&&G+B>=5)break;H[1]&&(B=1)}while(++G+A<j.length&&G+B<H.length);for(let Q=2;Q<H.length;++Q)H[Q]===-1&&(H[Q]=0);switch(H[0]){case 38:F.fg=this._updateAttrColor(F.fg,H[1],H[3],H[4],H[5]);break;case 48:F.bg=this._updateAttrColor(F.bg,H[1],H[3],H[4],H[5]);break;case 58:F.extended=F.extended.clone(),F.extended.underlineColor=this._updateAttrColor(F.extended.underlineColor,H[1],H[3],H[4],H[5])}return G}_processUnderline(j,A){A.extended=A.extended.clone(),(!~j||j>5)&&(j=1),A.extended.underlineStyle=j,A.fg|=268435456,j===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(j){j.fg=v.DEFAULT_ATTR_DATA.fg,j.bg=v.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=j.length;let F;const H=this._curAttrData;for(let B=0;B<A;B++)F=j.params[B],F>=30&&F<=37?(H.fg&=-50331904,H.fg|=16777216|F-30):F>=40&&F<=47?(H.bg&=-50331904,H.bg|=16777216|F-40):F>=90&&F<=97?(H.fg&=-50331904,H.fg|=16777224|F-90):F>=100&&F<=107?(H.bg&=-50331904,H.bg|=16777224|F-100):F===0?this._processSGR0(H):F===1?H.fg|=134217728:F===3?H.bg|=67108864:F===4?(H.fg|=268435456,this._processUnderline(j.hasSubParams(B)?j.getSubParams(B)[0]:1,H)):F===5?H.fg|=536870912:F===7?H.fg|=67108864:F===8?H.fg|=1073741824:F===9?H.fg|=2147483648:F===2?H.bg|=134217728:F===21?this._processUnderline(2,H):F===22?(H.fg&=-134217729,H.bg&=-134217729):F===23?H.bg&=-67108865:F===24?(H.fg&=-268435457,this._processUnderline(0,H)):F===25?H.fg&=-536870913:F===27?H.fg&=-67108865:F===28?H.fg&=-1073741825:F===29?H.fg&=2147483647:F===39?(H.fg&=-67108864,H.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):F===49?(H.bg&=-67108864,H.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?B+=this._extractColor(j,B,H):F===53?H.bg|=1073741824:F===55?H.bg&=-1073741825:F===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):F===100?(H.fg&=-67108864,H.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${A};${F}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const A=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${A};${F}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(j){const A=j.params[0]||1;switch(A){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 F=A%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(j){const A=j.params[0]||1;let F;return(j.length<2||(F=j.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(j){if(!L(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const A=[],F=j.split(";");for(;F.length>1;){const H=F.shift(),B=F.shift();if(/^\d+$/.exec(H)){const G=parseInt(H);if(z(G))if(B==="?")A.push({type:0,index:G});else{const Q=(0,T.parseColor)(B);Q&&A.push({type:1,index:G,color:Q})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(j){const A=j.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(j,A){this._getCurrentLinkId()&&this._finishHyperlink();const F=j.split(":");let H;const B=F.findIndex(G=>G.startsWith("id="));return B!==-1&&(H=F[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,A){const F=j.split(";");for(let H=0;H<F.length&&!(A>=this._specialColors.length);++H,++A)if(F[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const B=(0,T.parseColor)(F[H]);B&&this._onColor.fire([{type:1,index:this._specialColors[A],color:B}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const A=[],F=j.split(";");for(let H=0;H<F.length;++H)if(/^\d+$/.exec(F[H])){const B=parseInt(F[H]);z(B)&&A.push({type:2,index:B})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,f.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(R[j[0]],f.CHARSETS[j[1]]||f.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new x.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const F=this._activeBuffer.ybase+this._activeBuffer.y+A,H=this._activeBuffer.lines.get(F);H&&(H.fill(j),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,A){const F=this._bufferService.buffer,H=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${B}${d.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,A){this._dirtyRowTracker.markRangeDirty(j,A)}}o.InputHandler=P;let I=class{constructor(O){this._bufferService=O,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(O){O<this.start?this.start=O:O>this.end&&(this.end=O)}markRangeDirty(O,j){O>j&&(N=O,O=j,j=N),O<this.start&&(this.start=O),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(O){return 0<=O&&O<256}I=c([h(0,S.IBufferService)],I)},844:(a,o)=>{function l(c){for(const h of c)h.dispose();c.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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 h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)==null||h.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}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(h,d,f){this._data[h]||(this._data[h]={}),this._data[h][d]=f}get(h,d){return this._data[h]?this._data[h][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,h,d,f,g){this._data.get(c,h)||this._data.set(c,h,new l),this._data.get(c,h).set(d,f,g)}get(c,h,d,f){var g;return(g=this._data.get(c,h))==null?void 0:g.get(d,f)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,c=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const h=l.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),o.isIpad=c==="iPad",o.isIphone=c==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),o.isLinux=c.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let l=0;o.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 h=this._getKey(c);if(h===void 0||(l=this._search(h),l===-1)||this._getKey(this._array[l])!==h)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])===h);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,h){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do h(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let h=0,d=this._array.length-1;for(;d>=h;){let f=h+d>>1;const g=this._getKey(this._array[f]);if(g>c)d=f-1;else{if(!(g<c)){for(;f>0&&this._getKey(this._array[f-1])===c;)f--;return f}h=f+1}}return h}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const c=l(6114);class h{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 _=0,y=0,v=g.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(_=Date.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,Date.now()-_),y=Math.max(_,y),m=g.timeRemaining(),1.5*y>m)return v-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-_))}ms`),void this._start();v=m}this.clear()}}class d extends h{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const _=Date.now()+g;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},9282:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const c=l(643);o.updateWindowsModeWrappedState=function(h){const d=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),f=d==null?void 0:d.get(h.cols-1),g=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);g&&f&&(g.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}o.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,f=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=c},9092:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const c=l(6349),h=l(7226),d=l(3734),f=l(8437),g=l(4634),_=l(511),y=l(643),v=l(4863),m=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(p,x,b){this._hasScrollback=p,this._optionsService=x,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=m.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,y.NULL_CELL_CHAR,y.NULL_CELL_WIDTH,y.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,y.WHITESPACE_CELL_CHAR,y.WHITESPACE_CELL_WIDTH,y.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.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(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,x){return new f.BufferLine(this._bufferService.cols,this.getNullCell(p),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const x=p+this._optionsService.rawOptions.scrollback;return x>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:x}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=f.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(p))}}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(p,x){const b=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=0;const C=this._getCorrectBufferLength(x);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<p)for(let k=0;k<this.lines.length;k++)S+=+this.lines.get(k).resize(p,b);let E=0;if(this._rows<x)for(let k=this._rows;k<x;k++)this.lines.length<x+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(p,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(p,b)));else for(let k=this._rows;k>x;k--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const k=this.lines.length-C;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=C}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,x-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(p,x),this._cols>p))for(let E=0;E<this.lines.length;E++)S+=+this.lines.get(E).resize(p,b);this._cols=p,this._rows=x,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,x){this._cols!==p&&(p>this._cols?this._reflowLarger(p,x):this._reflowSmaller(p,x))}_reflowLarger(p,x){const b=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(b.length>0){const S=(0,g.reflowLargerCreateNewLayout)(this.lines,b);(0,g.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(p,x,S.countRemoved)}}_reflowLargerAdjustViewport(p,x,b){const S=this.getNullCell(f.DEFAULT_ATTR_DATA);let C=b;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new f.BufferLine(p,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(p,x){const b=this.getNullCell(f.DEFAULT_ATTR_DATA),S=[];let C=0;for(let E=this.lines.length-1;E>=0;E--){let k=this.lines.get(E);if(!k||!k.isWrapped&&k.getTrimmedLength()<=p)continue;const T=[k];for(;k.isWrapped&&E>0;)k=this.lines.get(--E),T.unshift(k);const R=this.ybase+this.y;if(R>=E&&R<E+T.length)continue;const M=T[T.length-1].getTrimmedLength(),L=(0,g.reflowSmallerGetNewLineLengths)(T,this._cols,p),D=L.length-T.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const P=[];for(let F=0;F<D;F++){const H=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);P.push(H)}P.length>0&&(S.push({start:E+T.length+C,newLines:P}),C+=P.length),T.push(...P);let I=L.length-1,z=L[I];z===0&&(I--,z=L[I]);let O=T.length-D-1,j=M;for(;O>=0;){const F=Math.min(j,z);if(T[I]===void 0)break;if(T[I].copyCellsFrom(T[O],j-F,z-F,F,!0),z-=F,z===0&&(I--,z=L[I]),j-=F,j===0){O--;const H=Math.max(O,0);j=(0,g.getWrappedLineTrimmedLength)(T,H,this._cols)}}for(let F=0;F<T.length;F++)L[F]<p&&T[F].setCell(L[F],b);let A=D-N;for(;A-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+x-1)}if(S.length>0){const E=[],k=[];for(let I=0;I<this.lines.length;I++)k.push(this.lines.get(I));const T=this.lines.length;let R=T-1,M=0,L=S[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let D=0;for(let I=Math.min(this.lines.maxLength-1,T+C-1);I>=0;I--)if(L&&L.start>R+D){for(let z=L.newLines.length-1;z>=0;z--)this.lines.set(I--,L.newLines[z]);I++,E.push({index:R+1,amount:L.newLines.length}),D+=L.newLines.length,L=S[++M]}else this.lines.set(I,k[R--]);let N=0;for(let I=E.length-1;I>=0;I--)E[I].index+=N,this.lines.onInsertEmitter.fire(E[I]),N+=E[I].amount;const P=Math.max(0,T+C-this.lines.maxLength);P>0&&this.lines.onTrimEmitter.fire(P)}}translateBufferLineToString(p,x,b=0,S){const C=this.lines.get(p);return C?C.translateToString(x,b,S):""}getWrappedRangeForLine(p){let x=p,b=p;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:x,last:b}}setupTabStops(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let x=0;x<this.markers.length;x++)this.markers[x].line===p&&(this.markers[x].dispose(),this.markers.splice(x--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const x=new v.Marker(p);return this.markers.push(x),x.register(this.lines.onTrim(b=>{x.line-=b,x.line<0&&x.dispose()})),x.register(this.lines.onInsert(b=>{x.line>=b.index&&(x.line+=b.amount)})),x.register(this.lines.onDelete(b=>{x.line>=b.index&&x.line<b.index+b.amount&&x.dispose(),x.line>b.index&&(x.line-=b.amount)})),x.register(x.onDispose(()=>this._removeMarker(x))),x}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const c=l(3734),h=l(511),d=l(643),f=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let g=0;class _{constructor(v,m,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const x=m||h.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let b=0;b<v;++b)this.setCell(b,x);this.length=v}get(v){const m=this._data[3*v+0],p=2097151&m;return[this._data[3*v+1],2097152&m?this._combined[v]:p?(0,f.stringFromCodePoint)(p):"",m>>22,2097152&m?this._combined[v].charCodeAt(this._combined[v].length-1):p]}set(v,m){this._data[3*v+1]=m[d.CHAR_DATA_ATTR_INDEX],m[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=m[1],this._data[3*v+0]=2097152|v|m[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=m[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const m=this._data[3*v+0];return 2097152&m?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&m}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const m=this._data[3*v+0];return 2097152&m?this._combined[v]:2097151&m?(0,f.stringFromCodePoint)(2097151&m):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,m){return g=3*v,m.content=this._data[g+0],m.fg=this._data[g+1],m.bg=this._data[g+2],2097152&m.content&&(m.combinedData=this._combined[v]),268435456&m.bg&&(m.extended=this._extendedAttrs[v]),m}setCell(v,m){2097152&m.content&&(this._combined[v]=m.combinedData),268435456&m.bg&&(this._extendedAttrs[v]=m.extended),this._data[3*v+0]=m.content,this._data[3*v+1]=m.fg,this._data[3*v+2]=m.bg}setCellFromCodepoint(v,m,p,x){268435456&x.bg&&(this._extendedAttrs[v]=x.extended),this._data[3*v+0]=m|p<<22,this._data[3*v+1]=x.fg,this._data[3*v+2]=x.bg}addCodepointToCell(v,m,p){let x=this._data[3*v+0];2097152&x?this._combined[v]+=(0,f.stringFromCodePoint)(m):2097151&x?(this._combined[v]=(0,f.stringFromCodePoint)(2097151&x)+(0,f.stringFromCodePoint)(m),x&=-2097152,x|=2097152):x=m|4194304,p&&(x&=-12582913,x|=p<<22),this._data[3*v+0]=x}insertCells(v,m,p){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),m<this.length-v){const x=new h.CellData;for(let b=this.length-v-m-1;b>=0;--b)this.setCell(v+m+b,this.loadCell(v+b,x));for(let b=0;b<m;++b)this.setCell(v+b,p)}else for(let x=v;x<this.length;++x)this.setCell(x,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(v,m,p){if(v%=this.length,m<this.length-v){const x=new h.CellData;for(let b=0;b<this.length-v-m;++b)this.setCell(v+b,this.loadCell(v+m+b,x));for(let b=this.length-m;b<this.length;++b)this.setCell(b,p)}else for(let x=v;x<this.length;++x)this.setCell(x,p);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,p)}replaceCells(v,m,p,x=!1){if(x)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,p),m<this.length&&this.getWidth(m-1)===2&&!this.isProtected(m)&&this.setCellFromCodepoint(m,0,1,p);v<m&&v<this.length;)this.isProtected(v)||this.setCell(v,p),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,p),m<this.length&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m,0,1,p);v<m&&v<this.length;)this.setCell(v++,p)}resize(v,m){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const x=new Uint32Array(p);x.set(this._data),this._data=x}for(let x=this.length;x<v;++x)this.setCell(x,m)}else{this._data=this._data.subarray(0,p);const x=Object.keys(this._combined);for(let S=0;S<x.length;S++){const C=parseInt(x[S],10);C>=v&&delete this._combined[C]}const b=Object.keys(this._extendedAttrs);for(let S=0;S<b.length;S++){const C=parseInt(b[S],10);C>=v&&delete this._extendedAttrs[C]}}return this.length=v,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,m=!1){if(m)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,v);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const m in v._combined)this._combined[m]=v._combined[m];this._extendedAttrs={};for(const m in v._extendedAttrs)this._extendedAttrs[m]=v._extendedAttrs[m];this.isWrapped=v.isWrapped}clone(){const v=new _(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const m in this._combined)v._combined[m]=this._combined[m];for(const m in this._extendedAttrs)v._extendedAttrs[m]=this._extendedAttrs[m];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,m,p,x,b){const S=v._data;if(b)for(let E=x-1;E>=0;E--){for(let k=0;k<3;k++)this._data[3*(p+E)+k]=S[3*(m+E)+k];268435456&S[3*(m+E)+2]&&(this._extendedAttrs[p+E]=v._extendedAttrs[m+E])}else for(let E=0;E<x;E++){for(let k=0;k<3;k++)this._data[3*(p+E)+k]=S[3*(m+E)+k];268435456&S[3*(m+E)+2]&&(this._extendedAttrs[p+E]=v._extendedAttrs[m+E])}const C=Object.keys(v._combined);for(let E=0;E<C.length;E++){const k=parseInt(C[E],10);k>=m&&(this._combined[k-m+p]=v._combined[k])}}translateToString(v,m,p,x){m=m??0,p=p??this.length,v&&(p=Math.min(p,this.getTrimmedLength())),x&&(x.length=0);let b="";for(;m<p;){const S=this._data[3*m+0],C=2097151&S,E=2097152&S?this._combined[m]:C?(0,f.stringFromCodePoint)(C):d.WHITESPACE_CELL_CHAR;if(b+=E,x)for(let k=0;k<E.length;++k)x.push(m);m+=S>>22||1}return x&&x.push(m),b}}o.BufferLine=_},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.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,o)=>{function l(c,h,d){if(h===c.length-1)return c[h].getTrimmedLength();const f=!c[h].hasContent(d-1)&&c[h].getWidth(d-1)===1,g=c[h+1].getWidth(0)===2;return f&&g?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(c,h,d,f,g){const _=[];for(let y=0;y<c.length-1;y++){let v=y,m=c.get(++v);if(!m.isWrapped)continue;const p=[c.get(y)];for(;v<c.length&&m.isWrapped;)p.push(m),m=c.get(++v);if(f>=y&&f<v){y+=p.length-1;continue}let x=0,b=l(p,x,h),S=1,C=0;for(;S<p.length;){const k=l(p,S,h),T=k-C,R=d-b,M=Math.min(T,R);p[x].copyCellsFrom(p[S],C,b,M,!1),b+=M,b===d&&(x++,b=0),C+=M,C===k&&(S++,C=0),b===0&&x!==0&&p[x-1].getWidth(d-1)===2&&(p[x].copyCellsFrom(p[x-1],d-1,b++,1,!1),p[x-1].setCell(d-1,g))}p[x].replaceCells(b,d,g);let E=0;for(let k=p.length-1;k>0&&(k>x||p[k].getTrimmedLength()===0);k--)E++;E>0&&(_.push(y+p.length-E),_.push(E)),y+=p.length-1}return _},o.reflowLargerCreateNewLayout=function(c,h){const d=[];let f=0,g=h[f],_=0;for(let y=0;y<c.length;y++)if(g===y){const v=h[++f];c.onDeleteEmitter.fire({index:y-_,amount:v}),y+=v-1,_+=v,g=h[++f]}else d.push(y);return{layout:d,countRemoved:_}},o.reflowLargerApplyNewLayout=function(c,h){const d=[];for(let f=0;f<h.length;f++)d.push(c.get(h[f]));for(let f=0;f<d.length;f++)c.set(f,d[f]);c.length=h.length},o.reflowSmallerGetNewLineLengths=function(c,h,d){const f=[],g=c.map((m,p)=>l(c,p,h)).reduce((m,p)=>m+p);let _=0,y=0,v=0;for(;v<g;){if(g-v<d){f.push(g-v);break}_+=d;const m=l(c,y,h);_>m&&(_-=m,y++);const p=c[y].getWidth(_-1)===2;p&&_--;const x=p?d-1:d;f.push(x),v+=x}return f},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const c=l(8460),h=l(844),d=l(9092);class f extends h.Disposable{constructor(_,y){super(),this._optionsService=_,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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(_){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(_),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(_,y){this._normal.resize(_,y),this._alt.resize(_,y),this.setupTabStops(_)}setupTabStops(_){this._normal.setupTabStops(_),this._alt.setupTabStops(_)}}o.BufferSet=f},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(482),h=l(643),d=l(3734);class f extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const y=new f;return y.setFromCharData(_),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(_){this.fg=_[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(_[h.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(_[h.CHAR_DATA_CHAR_INDEX].length===2){const v=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const m=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(v-55296)+m-56320+65536|_[h.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[h.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=_[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const c=l(8460),h=l(844);class d{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=d._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,h.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=d,d._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var l,c,h;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT="	",d.LF=`
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(l||(o.C0=l={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(c||(o.C1=c={})),function(d){d.ST=`${l.ESC}\\`}(h||(o.C1_ESCAPED=h={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const c=l(2584),h={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:["'",'"']};o.evaluateKeyboardEvent=function(d,f,g,_){const y={type:0,cancel:!1,key:void 0},v=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?y.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?y.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?y.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(y.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:y.key=d.ctrlKey?"\b":c.C0.DEL,d.altKey&&(y.key=c.C0.ESC+y.key);break;case 9:if(d.shiftKey){y.key=c.C0.ESC+"[Z";break}y.key=c.C0.HT,y.cancel=!0;break;case 13:y.key=d.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,y.cancel=!0;break;case 27:y.key=c.C0.ESC,d.altKey&&(y.key=c.C0.ESC+c.C0.ESC),y.cancel=!0;break;case 37:if(d.metaKey)break;v?(y.key=c.C0.ESC+"[1;"+(v+1)+"D",y.key===c.C0.ESC+"[1;3D"&&(y.key=c.C0.ESC+(g?"b":"[1;5D"))):y.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(d.metaKey)break;v?(y.key=c.C0.ESC+"[1;"+(v+1)+"C",y.key===c.C0.ESC+"[1;3C"&&(y.key=c.C0.ESC+(g?"f":"[1;5C"))):y.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(d.metaKey)break;v?(y.key=c.C0.ESC+"[1;"+(v+1)+"A",g||y.key!==c.C0.ESC+"[1;3A"||(y.key=c.C0.ESC+"[1;5A")):y.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(d.metaKey)break;v?(y.key=c.C0.ESC+"[1;"+(v+1)+"B",g||y.key!==c.C0.ESC+"[1;3B"||(y.key=c.C0.ESC+"[1;5B")):y.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(y.key=c.C0.ESC+"[2~");break;case 46:y.key=v?c.C0.ESC+"[3;"+(v+1)+"~":c.C0.ESC+"[3~";break;case 36:y.key=v?c.C0.ESC+"[1;"+(v+1)+"H":f?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:y.key=v?c.C0.ESC+"[1;"+(v+1)+"F":f?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:d.shiftKey?y.type=2:d.ctrlKey?y.key=c.C0.ESC+"[5;"+(v+1)+"~":y.key=c.C0.ESC+"[5~";break;case 34:d.shiftKey?y.type=3:d.ctrlKey?y.key=c.C0.ESC+"[6;"+(v+1)+"~":y.key=c.C0.ESC+"[6~";break;case 112:y.key=v?c.C0.ESC+"[1;"+(v+1)+"P":c.C0.ESC+"OP";break;case 113:y.key=v?c.C0.ESC+"[1;"+(v+1)+"Q":c.C0.ESC+"OQ";break;case 114:y.key=v?c.C0.ESC+"[1;"+(v+1)+"R":c.C0.ESC+"OR";break;case 115:y.key=v?c.C0.ESC+"[1;"+(v+1)+"S":c.C0.ESC+"OS";break;case 116:y.key=v?c.C0.ESC+"[15;"+(v+1)+"~":c.C0.ESC+"[15~";break;case 117:y.key=v?c.C0.ESC+"[17;"+(v+1)+"~":c.C0.ESC+"[17~";break;case 118:y.key=v?c.C0.ESC+"[18;"+(v+1)+"~":c.C0.ESC+"[18~";break;case 119:y.key=v?c.C0.ESC+"[19;"+(v+1)+"~":c.C0.ESC+"[19~";break;case 120:y.key=v?c.C0.ESC+"[20;"+(v+1)+"~":c.C0.ESC+"[20~";break;case 121:y.key=v?c.C0.ESC+"[21;"+(v+1)+"~":c.C0.ESC+"[21~";break;case 122:y.key=v?c.C0.ESC+"[23;"+(v+1)+"~":c.C0.ESC+"[23~";break;case 123:y.key=v?c.C0.ESC+"[24;"+(v+1)+"~":c.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(g&&!_||!d.altKey||d.metaKey)!g||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?y.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(y.key=c.C0.US),d.key==="@"&&(y.key=c.C0.NUL)):d.keyCode===65&&(y.type=1);else{const m=h[d.keyCode],p=m==null?void 0:m[d.shiftKey?1:0];if(p)y.key=c.C0.ESC+p;else if(d.keyCode>=65&&d.keyCode<=90){const x=d.ctrlKey?d.keyCode-64:d.keyCode+32;let b=String.fromCharCode(x);d.shiftKey&&(b=b.toUpperCase()),y.key=c.C0.ESC+b}else if(d.keyCode===32)y.key=c.C0.ESC+(d.ctrlKey?c.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let x=d.code.slice(3,4);d.shiftKey||(x=x.toLowerCase()),y.key=c.C0.ESC+x,y.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?y.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?y.key=c.C0.NUL:d.keyCode>=51&&d.keyCode<=55?y.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?y.key=c.C0.DEL:d.keyCode===219?y.key=c.C0.ESC:d.keyCode===220?y.key=c.C0.FS:d.keyCode===221&&(y.key=c.C0.GS)}return y}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,c=0,h=l.length){let d="";for(let f=c;f<h;++f){let g=l[f];g>65535?(g-=65536,d+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):d+=String.fromCharCode(g)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const h=l.length;if(!h)return 0;let d=0,f=0;if(this._interim){const g=l.charCodeAt(f++);56320<=g&&g<=57343?c[d++]=1024*(this._interim-55296)+g-56320+65536:(c[d++]=this._interim,c[d++]=g),this._interim=0}for(let g=f;g<h;++g){const _=l.charCodeAt(g);if(55296<=_&&_<=56319){if(++g>=h)return this._interim=_,d;const y=l.charCodeAt(g);56320<=y&&y<=57343?c[d++]=1024*(_-55296)+y-56320+65536:(c[d++]=_,c[d++]=y)}else _!==65279&&(c[d++]=_)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const h=l.length;if(!h)return 0;let d,f,g,_,y=0,v=0,m=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let C,E=0;for(;(C=63&this.interim[++E])&&E<4;)S<<=6,S|=C;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;m<T;){if(m>=h)return 0;if(C=l[m++],(192&C)!=128){m--,b=!0;break}this.interim[E++]=C,S<<=6,S|=63&C}b||(k===2?S<128?m--:c[y++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(c[y++]=S):S<65536||S>1114111||(c[y++]=S)),this.interim.fill(0)}const p=h-4;let x=m;for(;x<h;){for(;!(!(x<p)||128&(d=l[x])||128&(f=l[x+1])||128&(g=l[x+2])||128&(_=l[x+3]));)c[y++]=d,c[y++]=f,c[y++]=g,c[y++]=_,x+=4;if(d=l[x++],d<128)c[y++]=d;else if((224&d)==192){if(x>=h)return this.interim[0]=d,y;if(f=l[x++],(192&f)!=128){x--;continue}if(v=(31&d)<<6|63&f,v<128){x--;continue}c[y++]=v}else if((240&d)==224){if(x>=h)return this.interim[0]=d,y;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,y;if(g=l[x++],(192&g)!=128){x--;continue}if(v=(15&d)<<12|(63&f)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;c[y++]=v}else if((248&d)==240){if(x>=h)return this.interim[0]=d,y;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,y;if(g=l[x++],(192&g)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,this.interim[2]=g,y;if(_=l[x++],(192&_)!=128){x--;continue}if(v=(7&d)<<18|(63&f)<<12|(63&g)<<6|63&_,v<65536||v>1114111)continue;c[y++]=v}}return y}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const c=l(1480),h=[[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]],d=[[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 f;o.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let g=0;g<h.length;++g)f.fill(0,h[g][0],h[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?f[g]:function(_,y){let v,m=0,p=y.length-1;if(_<y[0][0]||_>y[p][1])return!1;for(;p>=m;)if(v=m+p>>1,_>y[v][1])m=v+1;else{if(!(_<y[v][0]))return!0;p=v-1}return!1}(g,d)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,_){let y=this.wcwidth(g),v=y===0&&_!==0;if(v){const m=c.UnicodeService.extractWidth(_);m===0?v=!1:m>y&&(y=m)}return c.UnicodeService.createPropertyValue(0,y,v)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const c=l(8460),h=l(844);class d extends h.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,_){if(_!==void 0&&this._syncCalls>_)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 v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,_){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(_),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(_)}_innerWrite(g=0,_=!0){const y=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],m=this._action(v,_);if(m){const x=b=>Date.now()-y>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(y,b);return void m.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(x)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=v.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()}}o.WriteBuffer=d},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.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 h(d,f){const g=d.toString(16),_=g.length<2?"0"+g:g;switch(f){case 4:return g[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}o.parseColor=function(d){if(!d)return;let f=d.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const g=l.exec(f);if(g){const _=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/_*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/_*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/_*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),c.exec(f)&&[3,6,9,12].includes(f.length))){const g=f.length/3,_=[0,0,0];for(let y=0;y<3;++y){const v=parseInt(f.slice(g*y,g*y+g),16);_[y]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return _}},o.toRgbString=function(d,f=16){const[g,_,y]=d;return`rgb:${h(g,f)}/${h(_,f)}/${h(y,f)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const c=l(482),h=l(8742),d=l(5770),f=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(_,y){this._handlers[_]===void 0&&(this._handlers[_]=[]);const v=this._handlers[_];return v.push(y),{dispose:()=>{const m=v.indexOf(y);m!==-1&&v.splice(m,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(_,y){if(this.reset(),this._ident=_,this._active=this._handlers[_]||f,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(y);else this._handlerFb(this._ident,"HOOK",y)}put(_,y,v){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(_,y,v);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(_,y,v))}unhook(_,y=!0){if(this._active.length){let v=!1,m=this._active.length-1,p=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,v=y,p=this._stack.fallThrough,this._stack.paused=!1),!p&&v===!1){for(;m>=0&&(v=this._active[m].unhook(_),v!==!0);m--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,v;m--}for(;m>=0;m--)if(v=this._active[m].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",_);this._active=f,this._ident=0}};const g=new h.Params;g.addParam(0),o.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=g,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():g,this._data="",this._hitLimit=!1}put(_,y,v){this._hitLimit||(this._data+=(0,c.utf32ToString)(_,y,v),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let y=!1;if(this._hitLimit)y=!1;else if(_&&(y=this._handler(this._data,this._params),y instanceof Promise))return y.then(v=>(this._params=g,this._data="",this._hitLimit=!1,v));return this._params=g,this._data="",this._hitLimit=!1,y}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const c=l(844),h=l(8742),d=l(6242),f=l(6351);class g{constructor(m){this.table=new Uint8Array(m)}setDefault(m,p){this.table.fill(m<<4|p)}add(m,p,x,b){this.table[p<<8|m]=x<<4|b}addMany(m,p,x,b){for(let S=0;S<m.length;S++)this.table[p<<8|m[S]]=x<<4|b}}o.TransitionTable=g;const _=160;o.VT500_TRANSITION_TABLE=function(){const v=new g(4095),m=Array.apply(null,Array(256)).map((E,k)=>k),p=(E,k)=>m.slice(E,k),x=p(32,127),b=p(0,24);b.push(25),b.push.apply(b,p(28,32));const S=p(0,14);let C;for(C in v.setDefault(1,0),v.addMany(x,0,2,0),S)v.addMany([24,26,153,154],C,3,0),v.addMany(p(128,144),C,3,0),v.addMany(p(144,152),C,3,0),v.add(156,C,0,0),v.add(27,C,11,1),v.add(157,C,4,8),v.addMany([152,158,159],C,0,7),v.add(155,C,11,3),v.add(144,C,11,9);return v.addMany(b,0,3,0),v.addMany(b,1,3,1),v.add(127,1,0,1),v.addMany(b,8,0,8),v.addMany(b,3,3,3),v.add(127,3,0,3),v.addMany(b,4,3,4),v.add(127,4,0,4),v.addMany(b,6,3,6),v.addMany(b,5,3,5),v.add(127,5,0,5),v.addMany(b,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(x,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(p(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(x,7,0,7),v.addMany(b,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(p(64,127),3,7,0),v.addMany(p(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(p(48,60),4,8,4),v.addMany(p(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(p(32,64),6,0,6),v.add(127,6,0,6),v.addMany(p(64,127),6,0,0),v.addMany(p(32,48),3,9,5),v.addMany(p(32,48),5,9,5),v.addMany(p(48,64),5,0,6),v.addMany(p(64,127),5,7,0),v.addMany(p(32,48),4,9,5),v.addMany(p(32,48),1,9,2),v.addMany(p(32,48),2,9,2),v.addMany(p(48,127),2,10,0),v.addMany(p(48,80),1,10,0),v.addMany(p(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(p(96,127),1,10,0),v.add(80,1,11,9),v.addMany(b,9,0,9),v.add(127,9,0,9),v.addMany(p(28,32),9,0,9),v.addMany(p(32,48),9,9,12),v.addMany(p(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(b,11,0,11),v.addMany(p(32,128),11,0,11),v.addMany(p(28,32),11,0,11),v.addMany(b,10,0,10),v.add(127,10,0,10),v.addMany(p(28,32),10,0,10),v.addMany(p(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(p(32,48),10,9,12),v.addMany(b,12,0,12),v.add(127,12,0,12),v.addMany(p(28,32),12,0,12),v.addMany(p(32,48),12,9,12),v.addMany(p(48,64),12,0,11),v.addMany(p(64,127),12,12,13),v.addMany(p(64,127),10,12,13),v.addMany(p(64,127),9,12,13),v.addMany(b,13,13,13),v.addMany(x,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(_,0,2,0),v.add(_,8,5,8),v.add(_,6,0,6),v.add(_,11,0,11),v.add(_,13,13,13),v}();class y extends c.Disposable{constructor(m=o.VT500_TRANSITION_TABLE){super(),this._transitions=m,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,x,b)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,x)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,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 d.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(m,p=[64,126]){let x=0;if(m.prefix){if(m.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=m.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(m.intermediates){if(m.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<m.intermediates.length;++S){const C=m.intermediates.charCodeAt(S);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=C}}if(m.final.length!==1)throw new Error("final must be a single byte");const b=m.final.charCodeAt(0);if(p[0]>b||b>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return x<<=8,x|=b,x}identToString(m){const p=[];for(;m;)p.push(String.fromCharCode(255&m)),m>>=8;return p.reverse().join("")}setPrintHandler(m){this._printHandler=m}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(m,p){const x=this._identifier(m,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const b=this._escHandlers[x];return b.push(p),{dispose:()=>{const S=b.indexOf(p);S!==-1&&b.splice(S,1)}}}clearEscHandler(m){this._escHandlers[this._identifier(m,[48,126])]&&delete this._escHandlers[this._identifier(m,[48,126])]}setEscHandlerFallback(m){this._escHandlerFb=m}setExecuteHandler(m,p){this._executeHandlers[m.charCodeAt(0)]=p}clearExecuteHandler(m){this._executeHandlers[m.charCodeAt(0)]&&delete this._executeHandlers[m.charCodeAt(0)]}setExecuteHandlerFallback(m){this._executeHandlerFb=m}registerCsiHandler(m,p){const x=this._identifier(m);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const b=this._csiHandlers[x];return b.push(p),{dispose:()=>{const S=b.indexOf(p);S!==-1&&b.splice(S,1)}}}clearCsiHandler(m){this._csiHandlers[this._identifier(m)]&&delete this._csiHandlers[this._identifier(m)]}setCsiHandlerFallback(m){this._csiHandlerFb=m}registerDcsHandler(m,p){return this._dcsParser.registerHandler(this._identifier(m),p)}clearDcsHandler(m){this._dcsParser.clearHandler(this._identifier(m))}setDcsHandlerFallback(m){this._dcsParser.setHandlerFallback(m)}registerOscHandler(m,p){return this._oscParser.registerHandler(m,p)}clearOscHandler(m){this._oscParser.clearHandler(m)}setOscHandlerFallback(m){this._oscParser.setHandlerFallback(m)}setErrorHandler(m){this._errorHandler=m}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(m,p,x,b,S){this._parseStack.state=m,this._parseStack.handlers=p,this._parseStack.handlerPos=x,this._parseStack.transition=b,this._parseStack.chunkPos=S}parse(m,p,x){let b,S=0,C=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&T>-1){for(;T>=0&&(b=k[T](this._params),b!==!0);T--)if(b instanceof Promise)return this._parseStack.handlerPos=T,b}this._parseStack.handlers=[];break;case 4:if(x===!1&&T>-1){for(;T>=0&&(b=k[T](),b!==!0);T--)if(b instanceof Promise)return this._parseStack.handlerPos=T,b}this._parseStack.handlers=[];break;case 6:if(S=m[this._parseStack.chunkPos],b=this._dcsParser.unhook(S!==24&&S!==26,x),b)return b;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=m[this._parseStack.chunkPos],b=this._oscParser.end(S!==24&&S!==26,x),b)return b;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=E;k<p;++k){switch(S=m[k],C=this._transitions.table[this.currentState<<8|(S<160?S:_)],C>>4){case 2:for(let D=k+1;;++D){if(D>=p||(S=m[D])<32||S>126&&S<_){this._printHandler(m,k,D),k=D-1;break}if(++D>=p||(S=m[D])<32||S>126&&S<_){this._printHandler(m,k,D),k=D-1;break}if(++D>=p||(S=m[D])<32||S>126&&S<_){this._printHandler(m,k,D),k=D-1;break}if(++D>=p||(S=m[D])<32||S>126&&S<_){this._printHandler(m,k,D),k=D-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|S];let R=T?T.length-1:-1;for(;R>=0&&(b=T[R](this._params),b!==!0);R--)if(b instanceof Promise)return this._preserveStack(3,T,R,C,k),b;R<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++k<p&&(S=m[k])>47&&S<60);k--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const M=this._escHandlers[this._collect<<8|S];let L=M?M.length-1:-1;for(;L>=0&&(b=M[L](),b!==!0);L--)if(b instanceof Promise)return this._preserveStack(4,M,L,C,k),b;L<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let D=k+1;;++D)if(D>=p||(S=m[D])===24||S===26||S===27||S>127&&S<_){this._dcsParser.put(m,k,D),k=D-1;break}break;case 14:if(b=this._dcsParser.unhook(S!==24&&S!==26),b)return this._preserveStack(6,[],0,C,k),b;S===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 D=k+1;;D++)if(D>=p||(S=m[D])<32||S>127&&S<_){this._oscParser.put(m,k,D),k=D-1;break}break;case 6:if(b=this._oscParser.end(S!==24&&S!==26),b)return this._preserveStack(5,[],0,C,k),b;S===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}o.EscapeSequenceParser=y},6242:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const c=l(5770),h=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,g){this._handlers[f]===void 0&&(this._handlers[f]=[]);const _=this._handlers[f];return _.push(g),{dispose:()=>{const y=_.indexOf(g);y!==-1&&_.splice(y,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,g,_){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(f,g,_);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(f,g,_))}start(){this.reset(),this._state=1}put(f,g,_){if(this._state!==3){if(this._state===1)for(;g<_;){const y=f[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&&_-g>0&&this._put(f,g,_)}}end(f,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,y=this._active.length-1,v=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;y>=0&&(_=this._active[y].end(f),_!==!0);y--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,_;y--}for(;y>=0;y--)if(_=this._active[y].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",f);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,g,_){this._hitLimit||(this._data+=(0,h.utf32ToString)(f,g,_),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let g=!1;if(this._hitLimit)g=!1;else if(f&&(g=this._handler(this._data),g instanceof Promise))return g.then(_=>(this._data="",this._hitLimit=!1,_));return this._data="",this._hitLimit=!1,g}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class c{static fromArray(d){const f=new c;if(!d.length)return f;for(let g=Array.isArray(d[0])?1:0;g<d.length;++g){const _=d[g];if(Array.isArray(_))for(let y=0;y<_.length;++y)f.addSubParam(_[y]);else f.addParam(_)}return f}constructor(d=32,f=32){if(this.maxLength=d,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new c(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let f=0;f<this.length;++f){d.push(this.params[f]);const g=this._subParamsIdx[f]>>8,_=255&this._subParamsIdx[f];_-g>0&&d.push(Array.prototype.slice.call(this._subParams,g,_))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const f=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];return g-f>0?this._subParams.subarray(f,g):null}getSubParamsAll(){const d={};for(let f=0;f<this.length;++f){const g=this._subParamsIdx[f]>>8,_=255&this._subParamsIdx[f];_-g>0&&(d[f]=this._subParams.slice(g,_))}return d}addDigit(d){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,_=g[f-1];g[f-1]=~_?Math.min(10*_+d,l):d}}o.Params=c},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.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 h={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(h),c.dispose=()=>this._wrappedAddonDispose(h),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let h=0;h<this._addons.length;h++)if(this._addons[h]===l){c=h;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,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const c=l(3785),h=l(511);o.BufferApiView=class{constructor(d,f){this._buffer=d,this.type=f}init(d){return this._buffer=d,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(d){const f=this._buffer.lines.get(d);if(f)return new c.BufferLineApiView(f)}getNullCell(){return new h.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const c=l(511);o.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,d){if(!(h<0||h>=this._line.length))return d?(this._line.loadCell(h,d),d):this._line.loadCell(h,new c.CellData)}translateToString(h,d,f){return this._line.translateToString(h,d,f)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const c=l(8771),h=l(8460),d=l(844);class f extends d.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new h.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)}}o.BufferNamespaceApi=f},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,c){return this._core.registerCsiHandler(l,h=>c(h.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(h,d)=>c(h,d.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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,l){var c=this&&this.__decorate||function(v,m,p,x){var b,S=arguments.length,C=S<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,m,p,x);else for(var E=v.length-1;E>=0;E--)(b=v[E])&&(C=(S<3?b(C):S>3?b(m,p,C):b(m,p))||C);return S>3&&C&&Object.defineProperty(m,p,C),C},h=this&&this.__param||function(v,m){return function(p,x){m(p,x,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),f=l(844),g=l(5295),_=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let y=o.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(v,this))}resize(v,m){this.cols=v,this.rows=m,this.buffers.resize(v,m),this._onResize.fire({cols:v,rows:m})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,m=!1){const p=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===v.fg&&x.getBg(0)===v.bg||(x=p.getBlankLine(v,m),this._cachedBlankLine=x),x.isWrapped=m;const b=p.ybase+p.scrollTop,S=p.ybase+p.scrollBottom;if(p.scrollTop===0){const C=p.lines.isFull;S===p.lines.length-1?C?p.lines.recycle().copyFrom(x):p.lines.push(x.clone()):p.lines.splice(S+1,0,x.clone()),C?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const C=S-b+1;p.lines.shiftElements(b+1,C-1,-1),p.lines.set(S,x.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(v,m,p){const x=this.buffer;if(v<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else v+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const b=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+v,x.ybase),0),b!==x.ydisp&&(m||this._onScroll.fire(x.ydisp))}};o.BufferService=y=c([h(0,_.IOptionsService)],y)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.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,o,l){var c=this&&this.__decorate||function(x,b,S,C){var E,k=arguments.length,T=k<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,S,C);else for(var R=x.length-1;R>=0;R--)(E=x[R])&&(T=(k<3?E(T):k>3?E(b,S,T):E(b,S))||T);return k>3&&T&&Object.defineProperty(b,S,T),T},h=this&&this.__param||function(x,b){return function(S,C){b(S,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),f=l(8460),g=l(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function y(x,b){let S=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(S|=64,S|=x.action):(S|=3&x.button,4&x.button&&(S|=64),8&x.button&&(S|=128),x.action===32?S|=32:x.action!==0||b||(S|=3)),S}const v=String.fromCharCode,m={DEFAULT:x=>{const b=[y(x,!1)+32,x.col+32,x.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${v(b[0])}${v(b[1])}${v(b[2])}`},SGR:x=>{const b=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${y(x,!0)};${x.col};${x.row}${b}`},SGR_PIXELS:x=>{const b=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${y(x,!0)};${x.x};${x.y}${b}`}};let p=o.CoreMouseService=class extends g.Disposable{constructor(x,b){super(),this._bufferService=x,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(_))this.addProtocol(S,_[S]);for(const S of Object.keys(m))this.addEncoding(S,m[S]);this.reset()}addProtocol(x,b){this._protocols[x]=b}addEncoding(x,b){this._encodings[x]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const b=this._encodings[this._activeEncoding](x);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,b,S){if(S){if(x.x!==b.x||x.y!==b.y)return!1}else if(x.col!==b.col||x.row!==b.row)return!1;return x.button===b.button&&x.action===b.action&&x.ctrl===b.ctrl&&x.alt===b.alt&&x.shift===b.shift}};o.CoreMouseService=p=c([h(0,d.IBufferService),h(1,d.ICoreService)],p)},6975:function(a,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),f=l(8460),g=l(844),_=l(2585),y=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let m=o.CoreService=class extends g.Disposable{constructor(p,x,b){super(),this._bufferService=p,this._logService=x,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(v)}reset(){this.modes=(0,d.clone)(y),this.decPrivateModes=(0,d.clone)(v)}triggerDataEvent(p,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,()=>p.split("").map(S=>S.charCodeAt(0))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,()=>p.split("").map(x=>x.charCodeAt(0))),this._onBinary.fire(p))}};o.CoreService=m=c([h(0,_.IBufferService),h(1,_.ILogService),h(2,_.IOptionsService)],m)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const c=l(8055),h=l(8460),d=l(844),f=l(6106);let g=0,_=0;class y extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(p=>p==null?void 0:p.marker.line),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(p){if(p.marker.isDisposed)return;const x=new v(p);if(x){const b=x.marker.onDispose(()=>x.dispose());x.onDispose(()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),b.dispose())}),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,x,b){let S=0,C=0;for(const E of this._decorations.getKeyIterator(x))S=E.options.x??0,C=S+(E.options.width??1),p>=S&&p<C&&(!b||(E.options.layer??"bottom")===b)&&(yield E)}forEachDecorationAtCell(p,x,b,S){this._decorations.forEachByKey(x,C=>{g=C.options.x??0,_=g+(C.options.width??1),p>=g&&p<_&&(!b||(C.options.layer??"bottom")===b)&&S(C)})}}o.DecorationService=y;class v extends d.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(p){super(),this.options=p,this.onRenderEmitter=this.register(new h.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const c=l(2585),h=l(8343);class d{constructor(...g){this._entries=new Map;for(const[_,y]of g)this.set(_,y)}set(g,_){const y=this._entries.get(g);return this._entries.set(g,_),y}forEach(g){for(const[_,y]of this._entries.entries())g(_,y)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(c.IInstantiationService,this)}setService(f,g){this._services.set(f,g)}getService(f){return this._services.get(f)}createInstance(f,...g){const _=(0,h.getServiceDependencies)(f).sort((m,p)=>m.index-p.index),y=[];for(const m of _){const p=this._services.get(m.id);if(!p)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${m.id}.`);y.push(p)}const v=_.length>0?_[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new f(...g,...y)}}},7866:function(a,o,l){var c=this&&this.__decorate||function(v,m,p,x){var b,S=arguments.length,C=S<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,m,p,x);else for(var E=v.length-1;E>=0;E--)(b=v[E])&&(C=(S<3?b(C):S>3?b(m,p,C):b(m,p))||C);return S>3&&C&&Object.defineProperty(m,p,C),C},h=this&&this.__param||function(v,m){return function(p,x){m(p,x,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),f=l(2585),g={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let _,y=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),_=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let m=0;m<v.length;m++)typeof v[m]=="function"&&(v[m]=v[m]())}_log(v,m,p){this._evalLazyOptionalParams(p),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...p)}trace(v,...m){var p;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,v,m)}debug(v,...m){var p;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,v,m)}info(v,...m){var p;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,v,m)}warn(v,...m){var p;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,v,m)}error(v,...m){var p;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,v,m)}};o.LogService=y=c([h(0,f.IOptionsService)],y),o.setTraceLogger=function(v){_=v},o.traceCall=function(v,m,p){if(typeof p.value!="function")throw new Error("not supported");const x=p.value;p.value=function(...b){if(_.logLevel!==f.LogLevelEnum.TRACE)return x.apply(this,b);_.trace(`GlyphRenderer#${x.name}(${b.map(C=>JSON.stringify(C)).join(", ")})`);const S=x.apply(this,b);return _.trace(`GlyphRenderer#${x.name} return`,S),S}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const c=l(8460),h=l(844),d=l(6114);o.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:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends h.Disposable{constructor(y){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const m in y)if(m in v)try{const p=y[m];v[m]=this._sanitizeAndValidateOption(m,p)}catch(p){console.error(p)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,h.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(y,v){return this.onOptionChange(m=>{m===y&&v(this.rawOptions[y])})}onMultipleOptionChange(y,v){return this.onOptionChange(m=>{y.indexOf(m)!==-1&&v()})}_setupOptions(){const y=m=>{if(!(m in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);return this.rawOptions[m]},v=(m,p)=>{if(!(m in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);p=this._sanitizeAndValidateOption(m,p),this.rawOptions[m]!==p&&(this.rawOptions[m]=p,this._onOptionChange.fire(m))};for(const m in this.rawOptions){const p={get:y.bind(this,m),set:v.bind(this,m)};Object.defineProperty(this.options,m,p)}}_sanitizeAndValidateOption(y,v){switch(y){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[y]),!function(m){return m==="block"||m==="underline"||m==="bar"}(v))throw new Error(`"${v}" is not a valid value for ${y}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[y]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=f.includes(v)?v:o.DEFAULT_OPTIONS[y];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${y} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${y} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${y} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${y} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=g},2660:function(a,o,l){var c=this&&this.__decorate||function(g,_,y,v){var m,p=arguments.length,x=p<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,_,y,v);else for(var b=g.length-1;b>=0;b--)(m=g[b])&&(x=(p<3?m(x):p>3?m(_,y,x):m(_,y))||x);return p>3&&x&&Object.defineProperty(_,y,x),x},h=this&&this.__param||function(g,_){return function(y,v){_(y,v,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let f=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const _=this._bufferService.buffer;if(g.id===void 0){const b=_.addMarker(_.ybase+_.y),S={data:g,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(S,b)),this._dataByLinkId.set(S.id,S),S.id}const y=g,v=this._getEntryIdKey(y),m=this._entriesWithId.get(v);if(m)return this.addLineToLink(m.id,_.ybase+_.y),m.id;const p=_.addMarker(_.ybase+_.y),x={id:this._nextId++,key:this._getEntryIdKey(y),data:y,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(x,p)),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(g,_){const y=this._dataByLinkId.get(g);if(y&&y.lines.every(v=>v.line!==_)){const v=this._bufferService.buffer.addMarker(_);y.lines.push(v),v.onDispose(()=>this._removeMarkerFromLink(y,v))}}getLinkData(g){var _;return(_=this._dataByLinkId.get(g))==null?void 0:_.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,_){const y=g.lines.indexOf(_);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)))}};o.OscLinkService=f=c([h(0,d.IBufferService)],f)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",c="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(h){return h[c]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const d=function(f,g,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,v,m){v[l]===v?v[c].push({id:y,index:m}):(v[c]=[{id:y,index:m}],v[l]=v)})(d,f,_)};return d.toString=()=>h,o.serviceRegistry.set(h,d),d}},2585:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const c=l(8343);var h;o.IBufferService=(0,c.createDecorator)("BufferService"),o.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),o.ICoreService=(0,c.createDecorator)("CoreService"),o.ICharsetService=(0,c.createDecorator)("CharsetService"),o.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(h||(o.LogLevelEnum=h={})),o.ILogService=(0,c.createDecorator)("LogService"),o.IOptionsService=(0,c.createDecorator)("OptionsService"),o.IOscLinkService=(0,c.createDecorator)("OscLinkService"),o.IUnicodeService=(0,c.createDecorator)("UnicodeService"),o.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const c=l(8460),h=l(225);class d{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,_,y=!1){return(16777215&g)<<3|(3&_)<<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 h.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 _=0,y=0;const v=g.length;for(let m=0;m<v;++m){let p=g.charCodeAt(m);if(55296<=p&&p<=56319){if(++m>=v)return _+this.wcwidth(p);const S=g.charCodeAt(m);56320<=S&&S<=57343?p=1024*(p-55296)+S-56320+65536:_+=this.wcwidth(S)}const x=this.charProperties(p,y);let b=d.extractWidth(x);d.extractShouldJoin(x)&&(b-=d.extractWidth(y)),_+=b,y=x}return _}charProperties(g,_){return this._activeProvider.charProperties(g,_)}}o.UnicodeService=d}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=i(9042),l=i(3236),c=i(844),h=i(5741),d=i(8285),f=i(7975),g=i(7090),_=["cols","rows"];class y extends c.Disposable{constructor(m){super(),this._core=this.register(new l.Terminal(m)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};const p=b=>this._core.options[b],x=(b,S)=>{this._checkReadonlyOptions(b),this._core.options[b]=S};for(const b in this._core.options){const S={get:p.bind(this,b),set:x.bind(this,b)};Object.defineProperty(this._publicOptions,b,S)}}_checkReadonlyOptions(m){if(_.includes(m))throw new Error(`Option "${m}" 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 f.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const m=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:m.applicationCursorKeys,applicationKeypadMode:m.applicationKeypad,bracketedPasteMode:m.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:m.origin,reverseWraparoundMode:m.reverseWraparound,sendFocusMode:m.sendFocus,wraparoundMode:m.wraparound}}get options(){return this._publicOptions}set options(m){for(const p in m)this._publicOptions[p]=m[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(m,p=!0){this._core.input(m,p)}resize(m,p){this._verifyIntegers(m,p),this._core.resize(m,p)}open(m){this._core.open(m)}attachCustomKeyEventHandler(m){this._core.attachCustomKeyEventHandler(m)}attachCustomWheelEventHandler(m){this._core.attachCustomWheelEventHandler(m)}registerLinkProvider(m){return this._core.registerLinkProvider(m)}registerCharacterJoiner(m){return this._checkProposedApi(),this._core.registerCharacterJoiner(m)}deregisterCharacterJoiner(m){this._checkProposedApi(),this._core.deregisterCharacterJoiner(m)}registerMarker(m=0){return this._verifyIntegers(m),this._core.registerMarker(m)}registerDecoration(m){return this._checkProposedApi(),this._verifyPositiveIntegers(m.x??0,m.width??0,m.height??0),this._core.registerDecoration(m)}hasSelection(){return this._core.hasSelection()}select(m,p,x){this._verifyIntegers(m,p,x),this._core.select(m,p,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(m,p){this._verifyIntegers(m,p),this._core.selectLines(m,p)}dispose(){super.dispose()}scrollLines(m){this._verifyIntegers(m),this._core.scrollLines(m)}scrollPages(m){this._verifyIntegers(m),this._core.scrollPages(m)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(m){this._verifyIntegers(m),this._core.scrollToLine(m)}clear(){this._core.clear()}write(m,p){this._core.write(m,p)}writeln(m,p){this._core.write(m),this._core.write(`\r
`,p)}paste(m){this._core.paste(m)}refresh(m,p){this._verifyIntegers(m,p),this._core.refresh(m,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(m){this._addonManager.loadAddon(this,m)}static get strings(){return o}_verifyIntegers(...m){for(const p of m)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...m){for(const p of m)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}a.Terminal=y})(),s})())})(CD);var ED=CD.exports,TD={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={903:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BaseRenderLayer=void 0;const c=l(274),h=l(627),d=l(237),f=l(860),g=l(374),_=l(296),y=l(345),v=l(859),m=l(399),p=l(855);class x extends v.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var C;return(C=this._charAtlas)==null?void 0:C.pages[0].canvas}constructor(C,E,k,T,R,M,L,D,N,P){super(),this._terminal=C,this._container=E,this._alpha=R,this._themeService=M,this._bufferService=L,this._optionsService=D,this._decorationService=N,this._coreBrowserService=P,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,_.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new v.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-${k}-layer`),this._canvas.style.zIndex=T.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(I=>{this._refreshCharAtlas(I),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,v.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,E){}handleSelectionChanged(C,E,k=!1){this._selectionModel.update(this._terminal._core,C,E,k)}_setTransparency(C){if(C===this._alpha)return;const E=this._canvas;this._alpha=C,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,E),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(C){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,h.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 E=0;E<this._charAtlas.pages.length;E++)this._bitmapGenerator[E]=new b(this._charAtlas.pages[E].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,E,k,T){this._ctx.fillRect(C*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight)}_fillMiddleLineAtCells(C,E,k=1){const T=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(C*this._deviceCellWidth,(E+1)*this._deviceCellHeight-T-this._coreBrowserService.dpr,k*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(C,E,k=1,T=0){this._ctx.fillRect(C*this._deviceCellWidth,(E+1)*this._deviceCellHeight+T-this._coreBrowserService.dpr-1,k*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(C,E,k=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const T=this._coreBrowserService.dpr;this._ctx.lineWidth=T;for(let R=0;R<k;R++){const M=(C+R)*this._deviceCellWidth,L=(C+R+.5)*this._deviceCellWidth,D=(C+R+1)*this._deviceCellWidth,N=(E+1)*this._deviceCellHeight-T-1,P=N-T,I=N+T;this._ctx.moveTo(M,N),this._ctx.bezierCurveTo(M,P,L,P,L,N),this._ctx.bezierCurveTo(L,I,D,I,D,N)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(C,E,k=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const T=this._coreBrowserService.dpr;this._ctx.lineWidth=T,this._ctx.setLineDash([2*T,T]);const R=C*this._deviceCellWidth,M=(E+1)*this._deviceCellHeight-T-1;this._ctx.moveTo(R,M);for(let L=0;L<k;L++){const D=(C+k+L)*this._deviceCellWidth;this._ctx.lineTo(D,M)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(C,E,k=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const T=this._coreBrowserService.dpr;this._ctx.lineWidth=T,this._ctx.setLineDash([4*T,3*T]);const R=C*this._deviceCellWidth,M=(C+k)*this._deviceCellWidth,L=(E+1)*this._deviceCellHeight-T-1;this._ctx.moveTo(R,L),this._ctx.lineTo(M,L),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(C,E,k){this._ctx.fillRect(C*this._deviceCellWidth,E*this._deviceCellHeight,this._coreBrowserService.dpr*k,this._deviceCellHeight)}_strokeRectAtCell(C,E,k,T){const R=this._coreBrowserService.dpr;this._ctx.lineWidth=R,this._ctx.strokeRect(C*this._deviceCellWidth+R/2,E*this._deviceCellHeight+R/2,k*this._deviceCellWidth-R,T*this._deviceCellHeight-R)}_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,E,k,T){this._alpha?this._ctx.clearRect(C*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(C*this._deviceCellWidth,E*this._deviceCellHeight,k*this._deviceCellWidth,T*this._deviceCellHeight))}_fillCharTrueColor(C,E,k){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=d.TEXT_BASELINE,this._clipRow(k);let T=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(T=(0,f.tryDrawCustomChar)(this._ctx,C.getChars(),E*this._deviceCellWidth,k*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),T||this._ctx.fillText(C.getChars(),E*this._deviceCellWidth+this._deviceCharLeft,k*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(C,E,k){var N,P,I,z;const T=C.getChars(),R=C.getCode(),M=C.getWidth();if(this._cellColorResolver.resolve(C,E,this._bufferService.buffer.ydisp+k,this._deviceCellWidth),!this._charAtlas)return;let L;if(L=T&&T.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(C.getCode()||p.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!L.size.x||!L.size.y)return;this._ctx.save(),this._clipRow(k),this._bitmapGenerator[L.texturePage]&&this._charAtlas.pages[L.texturePage].canvas!==this._bitmapGenerator[L.texturePage].canvas&&((P=(N=this._bitmapGenerator[L.texturePage])==null?void 0:N.bitmap)==null||P.close(),delete this._bitmapGenerator[L.texturePage]),this._charAtlas.pages[L.texturePage].version!==((I=this._bitmapGenerator[L.texturePage])==null?void 0:I.version)&&(this._bitmapGenerator[L.texturePage]||(this._bitmapGenerator[L.texturePage]=new b(this._charAtlas.pages[L.texturePage].canvas)),this._bitmapGenerator[L.texturePage].refresh(),this._bitmapGenerator[L.texturePage].version=this._charAtlas.pages[L.texturePage].version);let D=L.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,g.allowRescaling)(R,M,L.size.x,this._deviceCellWidth)&&(D=this._deviceCellWidth-1),this._ctx.drawImage(((z=this._bitmapGenerator[L.texturePage])==null?void 0:z.bitmap)||this._charAtlas.pages[L.texturePage].canvas,L.texturePosition.x,L.texturePosition.y,L.size.x,L.size.y,E*this._deviceCellWidth+this._deviceCharLeft-L.offset.x,k*this._deviceCellHeight+this._deviceCharTop-L.offset.y,D,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,E){return`${E?"italic":""} ${C?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}o.BaseRenderLayer=x;class b{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,m.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(E=>{this._state===2?this.refresh():this._bitmap=E,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CanvasRenderer=void 0;const c=l(627),h=l(56),d=l(374),f=l(345),g=l(859),_=l(873),y=l(43),v=l(630),m=l(744);class p extends g.Disposable{constructor(b,S,C,E,k,T,R,M,L,D,N){super(),this._terminal=b,this._screenElement=S,this._bufferService=E,this._charSizeService=k,this._optionsService=T,this._coreBrowserService=L,this._themeService=N,this._observerDisposable=this.register(new g.MutableDisposable),this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const P=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new m.TextRenderLayer(this._terminal,this._screenElement,0,P,this._bufferService,this._optionsService,R,D,this._coreBrowserService,N),new v.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,D,this._optionsService,N),new y.LinkRenderLayer(this._terminal,this._screenElement,2,C,this._bufferService,this._optionsService,D,this._coreBrowserService,N),new _.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,M,this._coreBrowserService,D,N)];for(const I of this._renderLayers)(0,f.forwardEvent)(I.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,d.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,h.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(I,z)=>this._setCanvasDevicePixelDimensions(I,z)),this.register(this._coreBrowserService.onWindowChange(I=>{this._observerDisposable.value=(0,h.observeDevicePixelDimensions)(this._renderLayers[0].canvas,I,(z,O)=>this._setCanvasDevicePixelDimensions(z,O))})),this.register((0,g.toDisposable)(()=>{for(const I of this._renderLayers)I.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(b,S){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(b=>b.handleBlur())}handleFocus(){this._runOperation(b=>b.handleFocus())}handleSelectionChanged(b,S,C=!1){this._runOperation(E=>E.handleSelectionChanged(b,S,C)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(b=>b.handleCursorMove())}clear(){this._runOperation(b=>b.reset())}_runOperation(b){for(const S of this._renderLayers)b(S)}renderRows(b,S){for(const C of this._renderLayers)C.handleGridChanged(b,S)}clearTextureAtlas(){for(const b of this._renderLayers)b.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*b),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),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/b),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/b),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(b,S){this.dimensions.device.canvas.height=S,this.dimensions.device.canvas.width=b;for(const C of this._renderLayers)C.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}o.CanvasRenderer=p},873:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorRenderLayer=void 0;const c=l(457),h=l(859),d=l(399),f=l(782),g=l(903);class _ extends g.BaseRenderLayer{constructor(v,m,p,x,b,S,C,E,k,T){super(v,m,"cursor",p,!0,T,b,S,k,E),this._onRequestRedraw=x,this._coreService=C,this._cursorBlinkStateManager=this.register(new h.MutableDisposable),this._cell=new f.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(S.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(v){super.resize(v),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var v;this._clearCursor(),(v=this._cursorBlinkStateManager.value)==null||v.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var v;(v=this._cursorBlinkStateManager.value)==null||v.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var v;(v=this._cursorBlinkStateManager.value)==null||v.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 v;(v=this._cursorBlinkStateManager.value)==null||v.restartBlinkAnimation()}handleGridChanged(v,m){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(v){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,p=m-this._bufferService.buffer.ydisp;if(p<0||p>=this._bufferService.rows)return void this._clearCursor();const x=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(m).loadCell(x,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 b=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;return S&&S!=="none"&&this._cursorRenderers[S](x,p,this._cell),this._ctx.restore(),this._state.x=x,this._state.y=p,this._state.isFocused=!1,this._state.style=b,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===x&&this._state.y===p&&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"](x,p,this._cell),this._ctx.restore(),this._state.x=x,this._state.y=p,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(d.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(v,m,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(v,m,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(v,m,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(v,m,p.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(p,v,m),this._ctx.restore()}_renderUnderlineCursor(v,m,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(v,m),this._ctx.restore()}_renderOutlineCursor(v,m,p){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(v,m,p.getWidth(),1),this._ctx.restore()}}o.CursorRenderLayer=_},574:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GridCache=void 0,o.GridCache=class{constructor(){this.cache=[]}resize(l,c){for(let h=0;h<l;h++){this.cache.length<=h&&this.cache.push([]);for(let d=this.cache[h].length;d<c;d++)this.cache[h].push(void 0);this.cache[h].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,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const c=l(197),h=l(237),d=l(903);class f extends d.BaseRenderLayer{constructor(_,y,v,m,p,x,b,S,C){super(_,y,"link",v,!0,C,p,x,b,S),this.register(m.onShowLinkUnderline(E=>this._handleShowLinkUnderline(E))),this.register(m.onHideLinkUnderline(E=>this._handleHideLinkUnderline(E)))}resize(_){super.resize(_),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 _=this._state.y2-this._state.y1-1;_>0&&this._clearCells(0,this._state.y1+1,this._state.cols,_),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(_){if(_.fg===h.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:_.fg&&(0,c.is256Color)(_.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[_.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,_.y1===_.y2)this._fillBottomLineAtCells(_.x1,_.y1,_.x2-_.x1);else{this._fillBottomLineAtCells(_.x1,_.y1,_.cols-_.x1);for(let y=_.y1+1;y<_.y2;y++)this._fillBottomLineAtCells(0,y,_.cols);this._fillBottomLineAtCells(0,_.y2,_.x2)}this._state=_}_handleHideLinkUnderline(_){this._clearCurrentLink()}}o.LinkRenderLayer=f},630:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionRenderLayer=void 0;const c=l(903);class h extends c.BaseRenderLayer{constructor(f,g,_,y,v,m,p,x){super(f,g,"selection",_,!0,x,y,p,m,v),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(f){super.resize(f),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(f,g,_){super.handleSelectionChanged(f,g,_),this._redrawSelection(f,g,_)}_redrawSelection(f,g,_){if(!this._didStateChange(f,g,_,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!f||!g)return void this._clearState();const y=f[1]-this._bufferService.buffer.ydisp,v=g[1]-this._bufferService.buffer.ydisp,m=Math.max(y,0),p=Math.min(v,this._bufferService.rows-1);if(m>=this._bufferService.rows||p<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,_){const x=f[0],b=g[0]-x,S=p-m+1;this._fillCells(x,m,b,S)}else{const x=y===m?f[0]:0,b=m===v?g[0]:this._bufferService.cols;this._fillCells(x,m,b-x,1);const S=Math.max(p-m-1,0);if(this._fillCells(0,m+1,this._bufferService.cols,S),m!==p){const C=v===p?g[0]:this._bufferService.cols;this._fillCells(0,p,C,1)}}this._state.start=[f[0],f[1]],this._state.end=[g[0],g[1]],this._state.columnSelectMode=_,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(f,g,_,y){return!this._areCoordinatesEqual(f,this._state.start)||!this._areCoordinatesEqual(g,this._state.end)||_!==this._state.columnSelectMode||y!==this._state.ydisp}_areCoordinatesEqual(f,g){return!(!f||!g)&&f[0]===g[0]&&f[1]===g[1]}}o.SelectionRenderLayer=h},744:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextRenderLayer=void 0;const c=l(577),h=l(147),d=l(782),f=l(855),g=l(903),_=l(574);class y extends g.BaseRenderLayer{constructor(m,p,x,b,S,C,E,k,T,R){super(m,p,"text",x,b,R,S,C,k,T),this._characterJoinerService=E,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new d.CellData,this._state=new _.GridCache,this.register(C.onSpecificOptionChange("allowTransparency",M=>this._setTransparency(M)))}resize(m){super.resize(m);const p=this._getFont(!1,!1);this._characterWidth===m.device.char.width&&this._characterFont===p||(this._characterWidth=m.device.char.width,this._characterFont=p,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(m,p,x){for(let b=m;b<=p;b++){const S=b+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(S),E=this._characterJoinerService.getJoinedCharacters(S);for(let k=0;k<this._bufferService.cols;k++){C.loadCell(k,this._workCell);let T=this._workCell,R=!1,M=k;if(T.getWidth()!==0){if(E.length>0&&k===E[0][0]){R=!0;const L=E.shift();T=new c.JoinedCellData(this._workCell,C.translateToString(!0,L[0],L[1]),L[1]-L[0]),M=L[1]-1}!R&&this._isOverlapping(T)&&M<C.length-1&&C.getCodePoint(M+1)===f.NULL_CELL_CODE&&(T.content&=-12582913,T.content|=8388608),x(T,k,b),k=M}}}}_drawBackground(m,p){const x=this._ctx,b=this._bufferService.cols;let S=0,C=0,E=null;x.save(),this._forEachCell(m,p,(k,T,R)=>{let M=null;k.isInverse()?M=k.isFgDefault()?this._themeService.colors.foreground.css:k.isFgRGB()?`rgb(${h.AttributeData.toColorRGB(k.getFgColor()).join(",")})`:this._themeService.colors.ansi[k.getFgColor()].css:k.isBgRGB()?M=`rgb(${h.AttributeData.toColorRGB(k.getBgColor()).join(",")})`:k.isBgPalette()&&(M=this._themeService.colors.ansi[k.getBgColor()].css);let L=!1;this._decorationService.forEachDecorationAtCell(T,this._bufferService.buffer.ydisp+R,void 0,D=>{D.options.layer!=="top"&&L||(D.backgroundColorRGB&&(M=D.backgroundColorRGB.css),L=D.options.layer==="top")}),E===null&&(S=T,C=R),R!==C?(x.fillStyle=E||"",this._fillCells(S,C,b-S,1),S=T,C=R):E!==M&&(x.fillStyle=E||"",this._fillCells(S,C,T-S,1),S=T,C=R),E=M}),E!==null&&(x.fillStyle=E,this._fillCells(S,C,b-S,1)),x.restore()}_drawForeground(m,p){this._forEachCell(m,p,(x,b,S)=>this._drawChars(x,b,S))}handleGridChanged(m,p){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,m,this._bufferService.cols,p-m+1),this._drawBackground(m,p),this._drawForeground(m,p))}_isOverlapping(m){if(m.getWidth()!==1||m.getCode()<256)return!1;const p=m.getChars();if(this._characterOverlapCache.hasOwnProperty(p))return this._characterOverlapCache[p];this._ctx.save(),this._ctx.font=this._characterFont;const x=Math.floor(this._ctx.measureText(p).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[p]=x,x}}o.TextRenderLayer=y},274:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const c=l(855),h=l(160),d=l(374);let f,g=0,_=0,y=!1,v=!1,m=!1,p=0;o.CellColorResolver=class{constructor(x,b,S,C,E,k){this._terminal=x,this._optionService=b,this._selectionRenderModel=S,this._decorationService=C,this._coreBrowserService=E,this._themeService=k,this.result={fg:0,bg:0,ext:0}}resolve(x,b,S,C){if(this.result.bg=x.bg,this.result.fg=x.fg,this.result.ext=268435456&x.bg?x.extended.ext:0,_=0,g=0,v=!1,y=!1,m=!1,f=this._themeService.colors,p=0,x.getCode()!==c.NULL_CELL_CODE&&x.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));p=b*C%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(b,S,"bottom",E=>{E.backgroundColorRGB&&(_=E.backgroundColorRGB.rgba>>8&16777215,v=!0),E.foregroundColorRGB&&(g=E.foregroundColorRGB.rgba>>8&16777215,y=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,b,S),m){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:_=(16777215&this.result.fg)<<8|255;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:_=(16777215&this.result.bg)<<8|255}_=h.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else _=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(v=!0,f.selectionForeground&&(g=f.selectionForeground.rgba>>8&16777215,y=!0),(0,d.treatGlyphAsBackgroundColor)(x.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))g=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.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=(16777215&this.result.bg)<<8|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=h.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}y=!0}}this._decorationService.forEachDecorationAtCell(b,S,"top",E=>{E.backgroundColorRGB&&(_=E.backgroundColorRGB.rgba>>8&16777215,v=!0),E.foregroundColorRGB&&(g=E.foregroundColorRGB.rgba>>8&16777215,y=!0)}),v&&(_=m?-16777216&x.bg&-134217729|_|50331648:-16777216&x.bg|_|50331648),y&&(g=-16777216&x.fg&-67108865|g|50331648),67108864&this.result.fg&&(v&&!y&&(g=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&f.background.rgba>>8|50331648,y=!0),!v&&y&&(_=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&f.foreground.rgba>>8|50331648,v=!0)),f=void 0,this.result.bg=v?_:this.result.bg,this.result.fg=y?g:this.result.fg,this.result.ext&=536870911,this.result.ext|=p<<29&3758096384}}},627:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const c=l(509),h=l(197),d=[];o.acquireTextureAtlas=function(f,g,_,y,v,m,p,x){const b=(0,h.generateConfig)(y,v,m,p,g,_,x);for(let E=0;E<d.length;E++){const k=d[E],T=k.ownedBy.indexOf(f);if(T>=0){if((0,h.configEquals)(k.config,b))return k.atlas;k.ownedBy.length===1?(k.atlas.dispose(),d.splice(E,1)):k.ownedBy.splice(T,1);break}}for(let E=0;E<d.length;E++){const k=d[E];if((0,h.configEquals)(k.config,b))return k.ownedBy.push(f),k.atlas}const S=f._core,C={atlas:new c.TextureAtlas(document,b,S.unicodeService),config:b,ownedBy:[f]};return d.push(C),C.atlas},o.removeTerminalFromCache=function(f){for(let g=0;g<d.length;g++){const _=d[g].ownedBy.indexOf(f);if(_!==-1){d[g].ownedBy.length===1?(d[g].atlas.dispose(),d.splice(g,1)):d[g].ownedBy.splice(_,1);break}}}},197:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const c=l(160);o.generateConfig=function(h,d,f,g,_,y,v){const m={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:_.customGlyphs,devicePixelRatio:v,letterSpacing:_.letterSpacing,lineHeight:_.lineHeight,deviceCellWidth:h,deviceCellHeight:d,deviceCharWidth:f,deviceCharHeight:g,fontFamily:_.fontFamily,fontSize:_.fontSize,fontWeight:_.fontWeight,fontWeightBold:_.fontWeightBold,allowTransparency:_.allowTransparency,drawBoldTextInBrightColors:_.drawBoldTextInBrightColors,minimumContrastRatio:_.minimumContrastRatio,colors:m}},o.configEquals=function(h,d){for(let f=0;f<h.colors.ansi.length;f++)if(h.colors.ansi[f].rgba!==d.colors.ansi[f].rgba)return!1;return h.devicePixelRatio===d.devicePixelRatio&&h.customGlyphs===d.customGlyphs&&h.lineHeight===d.lineHeight&&h.letterSpacing===d.letterSpacing&&h.fontFamily===d.fontFamily&&h.fontSize===d.fontSize&&h.fontWeight===d.fontWeight&&h.fontWeightBold===d.fontWeightBold&&h.allowTransparency===d.allowTransparency&&h.deviceCharWidth===d.deviceCharWidth&&h.deviceCharHeight===d.deviceCharHeight&&h.drawBoldTextInBrightColors===d.drawBoldTextInBrightColors&&h.minimumContrastRatio===d.minimumContrastRatio&&h.colors.foreground.rgba===d.colors.foreground.rgba&&h.colors.background.rgba===d.colors.background.rgba},o.is256Color=function(h){return(50331648&h)==16777216||(50331648&h)==33554432}},237:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const c=l(399);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorBlinkStateManager=void 0,o.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,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tryDrawCustomChar=o.powerlineDefinitions=o.boxDrawingDefinitions=o.blockElementDefinitions=void 0;const c=l(374);o.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 h={"░":[[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]]};o.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,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"║":{1:(y,v)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╒":{1:(y,v)=>`M.5,1 L.5,${.5-v} L1,${.5-v} M.5,${.5+v} L1,${.5+v}`},"╓":{1:(y,v)=>`M${.5-y},1 L${.5-y},.5 L1,.5 M${.5+y},.5 L${.5+y},1`},"╔":{1:(y,v)=>`M1,${.5-v} L${.5-y},${.5-v} L${.5-y},1 M1,${.5+v} L${.5+y},${.5+v} L${.5+y},1`},"╕":{1:(y,v)=>`M0,${.5-v} L.5,${.5-v} L.5,1 M0,${.5+v} L.5,${.5+v}`},"╖":{1:(y,v)=>`M${.5+y},1 L${.5+y},.5 L0,.5 M${.5-y},.5 L${.5-y},1`},"╗":{1:(y,v)=>`M0,${.5+v} L${.5-y},${.5+v} L${.5-y},1 M0,${.5-v} L${.5+y},${.5-v} L${.5+y},1`},"╘":{1:(y,v)=>`M.5,0 L.5,${.5+v} L1,${.5+v} M.5,${.5-v} L1,${.5-v}`},"╙":{1:(y,v)=>`M1,.5 L${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╚":{1:(y,v)=>`M1,${.5-v} L${.5+y},${.5-v} L${.5+y},0 M1,${.5+v} L${.5-y},${.5+v} L${.5-y},0`},"╛":{1:(y,v)=>`M0,${.5+v} L.5,${.5+v} L.5,0 M0,${.5-v} L.5,${.5-v}`},"╜":{1:(y,v)=>`M0,.5 L${.5+y},.5 L${.5+y},0 M${.5-y},.5 L${.5-y},0`},"╝":{1:(y,v)=>`M0,${.5-v} L${.5-y},${.5-v} L${.5-y},0 M0,${.5+v} L${.5+y},${.5+v} L${.5+y},0`},"╞":{1:(y,v)=>`M.5,0 L.5,1 M.5,${.5-v} L1,${.5-v} M.5,${.5+v} L1,${.5+v}`},"╟":{1:(y,v)=>`M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1 M${.5+y},.5 L1,.5`},"╠":{1:(y,v)=>`M${.5-y},0 L${.5-y},1 M1,${.5+v} L${.5+y},${.5+v} L${.5+y},1 M1,${.5-v} L${.5+y},${.5-v} L${.5+y},0`},"╡":{1:(y,v)=>`M.5,0 L.5,1 M0,${.5-v} L.5,${.5-v} M0,${.5+v} L.5,${.5+v}`},"╢":{1:(y,v)=>`M0,.5 L${.5-y},.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╣":{1:(y,v)=>`M${.5+y},0 L${.5+y},1 M0,${.5+v} L${.5-y},${.5+v} L${.5-y},1 M0,${.5-v} L${.5-y},${.5-v} L${.5-y},0`},"╤":{1:(y,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v} M.5,${.5+v} L.5,1`},"╥":{1:(y,v)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},1 M${.5+y},.5 L${.5+y},1`},"╦":{1:(y,v)=>`M0,${.5-v} L1,${.5-v} M0,${.5+v} L${.5-y},${.5+v} L${.5-y},1 M1,${.5+v} L${.5+y},${.5+v} L${.5+y},1`},"╧":{1:(y,v)=>`M.5,0 L.5,${.5-v} M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"╨":{1:(y,v)=>`M0,.5 L1,.5 M${.5-y},.5 L${.5-y},0 M${.5+y},.5 L${.5+y},0`},"╩":{1:(y,v)=>`M0,${.5+v} L1,${.5+v} M0,${.5-v} L${.5-y},${.5-v} L${.5-y},0 M1,${.5-v} L${.5+y},${.5-v} L${.5+y},0`},"╪":{1:(y,v)=>`M.5,0 L.5,1 M0,${.5-v} L1,${.5-v} M0,${.5+v} L1,${.5+v}`},"╫":{1:(y,v)=>`M0,.5 L1,.5 M${.5-y},0 L${.5-y},1 M${.5+y},0 L${.5+y},1`},"╬":{1:(y,v)=>`M0,${.5+v} L${.5-y},${.5+v} L${.5-y},1 M1,${.5+v} L${.5+y},${.5+v} L${.5+y},1 M0,${.5-v} L${.5-y},${.5-v} L${.5-y},0 M1,${.5-v} L${.5+y},${.5-v} 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,v)=>`M.5,1 L.5,${.5+v/.15*.5} C.5,${.5+v/.15*.5},.5,.5,1,.5`},"╮":{1:(y,v)=>`M.5,1 L.5,${.5+v/.15*.5} C.5,${.5+v/.15*.5},.5,.5,0,.5`},"╯":{1:(y,v)=>`M.5,0 L.5,${.5-v/.15*.5} C.5,${.5-v/.15*.5},.5,.5,0,.5`},"╰":{1:(y,v)=>`M.5,0 L.5,${.5-v/.15*.5} C.5,${.5-v/.15*.5},.5,.5,1,.5`}},o.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}},o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.powerlineDefinitions[""]=o.powerlineDefinitions[""],o.tryDrawCustomChar=function(y,v,m,p,x,b,S,C){const E=o.blockElementDefinitions[v];if(E)return function(M,L,D,N,P,I){for(let z=0;z<L.length;z++){const O=L[z],j=P/8,A=I/8;M.fillRect(D+O.x*j,N+O.y*A,O.w*j,O.h*A)}}(y,E,m,p,x,b),!0;const k=h[v];if(k)return function(M,L,D,N,P,I){let z=d.get(L);z||(z=new Map,d.set(L,z));const O=M.fillStyle;if(typeof O!="string")throw new Error(`Unexpected fillStyle type "${O}"`);let j=z.get(O);if(!j){const A=L[0].length,F=L.length,H=M.canvas.ownerDocument.createElement("canvas");H.width=A,H.height=F;const B=(0,c.throwIfFalsy)(H.getContext("2d")),G=new ImageData(A,F);let Q,Y,W,$;if(O.startsWith("#"))Q=parseInt(O.slice(1,3),16),Y=parseInt(O.slice(3,5),16),W=parseInt(O.slice(5,7),16),$=O.length>7&&parseInt(O.slice(7,9),16)||1;else{if(!O.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${O}" when drawing pattern glyph`);[Q,Y,W,$]=O.substring(5,O.length-1).split(",").map(V=>parseFloat(V))}for(let V=0;V<F;V++)for(let U=0;U<A;U++)G.data[4*(V*A+U)]=Q,G.data[4*(V*A+U)+1]=Y,G.data[4*(V*A+U)+2]=W,G.data[4*(V*A+U)+3]=L[V][U]*(255*$);B.putImageData(G,0,0),j=(0,c.throwIfFalsy)(M.createPattern(H,null)),z.set(O,j)}M.fillStyle=j,M.fillRect(D,N,P,I)}(y,k,m,p,x,b),!0;const T=o.boxDrawingDefinitions[v];if(T)return function(M,L,D,N,P,I,z){M.strokeStyle=M.fillStyle;for(const[O,j]of Object.entries(L)){let A;M.beginPath(),M.lineWidth=z*Number.parseInt(O),A=typeof j=="function"?j(.15,.15/I*P):j;for(const F of A.split(" ")){const H=F[0],B=g[H];if(!B){console.error(`Could not find drawing instructions for "${H}"`);continue}const G=F.substring(1).split(",");G[0]&&G[1]&&B(M,_(G,P,I,D,N,!0,z))}M.stroke(),M.closePath()}}(y,T,m,p,x,b,C),!0;const R=o.powerlineDefinitions[v];return!!R&&(function(M,L,D,N,P,I,z,O){const j=new Path2D;j.rect(D,N,P,I),M.clip(j),M.beginPath();const A=z/12;M.lineWidth=O*A;for(const F of L.d.split(" ")){const H=F[0],B=g[H];if(!B){console.error(`Could not find drawing instructions for "${H}"`);continue}const G=F.substring(1).split(",");G[0]&&G[1]&&B(M,_(G,P,I,D,N,!1,O,(L.leftPadding??0)*(A/2),(L.rightPadding??0)*(A/2)))}L.type===1?(M.strokeStyle=M.fillStyle,M.stroke()):M.fill(),M.closePath()}(y,R,m,p,x,b,S,C),!0)};const d=new Map;function f(y,v,m=0){return Math.max(Math.min(y,v),m)}const g={C:(y,v)=>y.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]),L:(y,v)=>y.lineTo(v[0],v[1]),M:(y,v)=>y.moveTo(v[0],v[1])};function _(y,v,m,p,x,b,S,C=0,E=0){const k=y.map(T=>parseFloat(T)||parseInt(T));if(k.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T<k.length;T+=2)k[T]*=v-C*S-E*S,b&&k[T]!==0&&(k[T]=f(Math.round(k[T]+.5)-.5,v,0)),k[T]+=p+C*S;for(let T=1;T<k.length;T+=2)k[T]*=m,b&&k[T]!==0&&(k[T]=f(Math.round(k[T]+.5)-.5,m,0)),k[T]+=x;return k}},56:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const c=l(859);o.observeDevicePixelDimensions=function(h,d,f){let g=new d.ResizeObserver(_=>{const y=_.find(p=>p.target===h);if(!y)return;if(!("devicePixelContentBoxSize"in y))return g==null||g.disconnect(),void(g=void 0);const v=y.devicePixelContentBoxSize[0].inlineSize,m=y.devicePixelContentBoxSize[0].blockSize;v>0&&m>0&&f(v,m)});try{g.observe(h,{box:["device-pixel-content-box"]})}catch{g.disconnect(),g=void 0}return(0,c.toDisposable)(()=>g==null?void 0:g.disconnect())}},374:(a,o)=>{function l(h){return 57508<=h&&h<=57558}function c(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=c,o.allowRescaling=function(h,d,f,g){return d===1&&f>Math.ceil(1.5*g)&&h!==void 0&&h>255&&!c(h)&&!l(h)&&!function(_){return 57344<=_&&_<=63743}(h)},o.treatGlyphAsBackgroundColor=function(h){return l(h)||function(d){return 9472<=d&&d<=9631}(h)},o.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}}}},o.computeNextVariantOffset=function(h,d,f=0){return(h-(2*Math.round(d)-f))%(2*Math.round(d))}},296:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(h,d,f,g=!1){if(this.selectionStart=d,this.selectionEnd=f,!d||!f||d[0]===f[0]&&d[1]===f[1])return void this.clear();const _=h.buffers.active.ydisp,y=d[1]-_,v=f[1]-_,m=Math.max(y,0),p=Math.min(v,h.rows-1);m>=h.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=y,this.viewportEndRow=v,this.viewportCappedStartRow=m,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=f[0])}isCellSelected(h,d,f){return!!this.hasSelection&&(f-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&f>=this.viewportCappedStartRow&&d<this.endCol&&f<=this.viewportCappedEndRow:d<this.startCol&&f>=this.viewportCappedStartRow&&d>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new l}},509:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextureAtlas=void 0;const c=l(237),h=l(860),d=l(374),f=l(160),g=l(345),_=l(485),y=l(385),v=l(147),m=l(855),p={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 x;class b{get pages(){return this._pages}constructor(T,R,M){this._document=T,this._config=R,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new _.FourKeyMap,this._cacheMapCombined=new _.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new v.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=E(T,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,d.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const T of this.pages)T.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const T=new y.IdleTaskQueue;for(let R=33;R<126;R++)T.enqueue(()=>{if(!this._cacheMap.get(R,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT)){const M=this._drawToCache(R,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT);this._cacheMap.set(R,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const T of this._pages)T.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const R=this._pages.filter(z=>2*z.canvas.width<=(b.maxTextureSize||4096)).sort((z,O)=>O.canvas.width!==z.canvas.width?O.canvas.width-z.canvas.width:O.percentageUsed-z.percentageUsed);let M=-1,L=0;for(let z=0;z<R.length;z++)if(R[z].canvas.width!==L)M=z,L=R[z].canvas.width;else if(z-M==3)break;const D=R.slice(M,M+4),N=D.map(z=>z.glyphs[0].texturePage).sort((z,O)=>z>O?1:-1),P=this.pages.length-D.length,I=this._mergePages(D,P);I.version++;for(let z=N.length-1;z>=0;z--)this._deletePage(N[z]);this.pages.push(I),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(I.canvas)}const T=new S(this._document,this._textureSize);return this._pages.push(T),this._activePages.push(T),this._onAddTextureAtlasCanvas.fire(T.canvas),T}_mergePages(T,R){const M=2*T[0].canvas.width,L=new S(this._document,M,T);for(const[D,N]of T.entries()){const P=D*N.canvas.width%M,I=Math.floor(D/2)*N.canvas.height;L.ctx.drawImage(N.canvas,P,I);for(const O of N.glyphs)O.texturePage=R,O.sizeClipSpace.x=O.size.x/M,O.sizeClipSpace.y=O.size.y/M,O.texturePosition.x+=P,O.texturePosition.y+=I,O.texturePositionClipSpace.x=O.texturePosition.x/M,O.texturePositionClipSpace.y=O.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(N.canvas);const z=this._activePages.indexOf(N);z!==-1&&this._activePages.splice(z,1)}return L}_deletePage(T){this._pages.splice(T,1);for(let R=T;R<this._pages.length;R++){const M=this._pages[R];for(const L of M.glyphs)L.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(T,R,M,L,D){return this._getFromCacheMap(this._cacheMapCombined,T,R,M,L,D)}getRasterizedGlyph(T,R,M,L,D){return this._getFromCacheMap(this._cacheMap,T,R,M,L,D)}_getFromCacheMap(T,R,M,L,D,N=!1){return x=T.get(R,M,L,D),x||(x=this._drawToCache(R,M,L,D,N),T.set(R,M,L,D,x)),x}_getColorFromAnsiIndex(T){if(T>=this._config.colors.ansi.length)throw new Error("No color found for idx "+T);return this._config.colors.ansi[T]}_getBackgroundColor(T,R,M,L){if(this._config.allowTransparency)return f.NULL_COLOR;let D;switch(T){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(R);break;case 50331648:const N=v.AttributeData.toColorRGB(R);D=f.channels.toColor(N[0],N[1],N[2]);break;default:D=M?f.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(T,R,M,L,D,N,P,I,z,O){const j=this._getMinimumContrastColor(T,R,M,L,D,N,P,z,I,O);if(j)return j;let A;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&z&&N<8&&(N+=8),A=this._getColorFromAnsiIndex(N);break;case 50331648:const F=v.AttributeData.toColorRGB(N);A=f.channels.toColor(F[0],F[1],F[2]);break;default:A=P?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(A=f.color.opaque(A)),I&&(A=f.color.multiplyOpacity(A,c.DIM_OPACITY)),A}_resolveBackgroundRgba(T,R,M){switch(T){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(T,R,M,L){switch(T){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&L&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(T,R,M,L,D,N,P,I,z,O){if(this._config.minimumContrastRatio===1||O)return;const j=this._getContrastCache(z),A=j.getColor(T,L);if(A!==void 0)return A||void 0;const F=this._resolveBackgroundRgba(R,M,P),H=this._resolveForegroundRgba(D,N,P,I),B=f.rgba.ensureContrastRatio(F,H,this._config.minimumContrastRatio/(z?2:1));if(!B)return void j.setColor(T,L,null);const G=f.channels.toColor(B>>24&255,B>>16&255,B>>8&255);return j.setColor(T,L,G),G}_getContrastCache(T){return T?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(T,R,M,L,D=!1){const N=typeof T=="number"?String.fromCharCode(T):T,P=Math.min(this._config.deviceCellWidth*Math.max(N.length,2)+4,this._textureSize);this._tmpCanvas.width<P&&(this._tmpCanvas.width=P);const I=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<I&&(this._tmpCanvas.height=I),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=R,this._workAttributeData.extended.ext=L,this._workAttributeData.isInvisible())return p;const z=!!this._workAttributeData.isBold(),O=!!this._workAttributeData.isInverse(),j=!!this._workAttributeData.isDim(),A=!!this._workAttributeData.isItalic(),F=!!this._workAttributeData.isUnderline(),H=!!this._workAttributeData.isStrikethrough(),B=!!this._workAttributeData.isOverline();let G=this._workAttributeData.getFgColor(),Q=this._workAttributeData.getFgColorMode(),Y=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(O){const ee=G;G=Y,Y=ee;const ie=Q;Q=W,W=ie}const $=this._getBackgroundColor(W,Y,O,j);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const V=z?this._config.fontWeightBold:this._config.fontWeight,U=A?"italic":"";this._tmpCtx.font=`${U} ${V} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const X=N.length===1&&(0,d.isPowerlineGlyph)(N.charCodeAt(0)),q=N.length===1&&(0,d.isRestrictedPowerlineGlyph)(N.charCodeAt(0)),re=this._getForegroundColor(R,W,Y,M,Q,G,O,j,z,(0,d.treatGlyphAsBackgroundColor)(N.charCodeAt(0)));this._tmpCtx.fillStyle=re.css;const ne=q?0:4;let le=!1;this._config.customGlyphs!==!1&&(le=(0,h.tryDrawCustomChar)(this._tmpCtx,N,ne,ne,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ve,ae=!X;if(ve=typeof T=="number"?this._unicodeService.wcwidth(T):this._unicodeService.getStringCellWidth(T),F){this._tmpCtx.save();const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=ee%2==1?.5:0;if(this._tmpCtx.lineWidth=ee,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ae=!1,this._tmpCtx.strokeStyle=`rgb(${v.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ae=!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 ce=ne,K=Math.ceil(ne+this._config.deviceCharHeight)-ie-(D?2*ee:0),te=K+ee,oe=K+2*ee;let he=this._workAttributeData.getUnderlineVariantOffset();for(let _e=0;_e<ve;_e++){this._tmpCtx.save();const ge=ce+_e*this._config.deviceCellWidth,ye=ce+(_e+1)*this._config.deviceCellWidth,ze=ge+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(ye,K),this._tmpCtx.moveTo(ge,oe),this._tmpCtx.lineTo(ye,oe);break;case 3:const Oe=ee<=1?oe:Math.ceil(ne+this._config.deviceCharHeight-ee/2)-ie,je=ee<=1?K:Math.ceil(ne+this._config.deviceCharHeight+ee/2)-ie,Le=new Path2D;Le.rect(ge,K,this._config.deviceCellWidth,oe-K),this._tmpCtx.clip(Le),this._tmpCtx.moveTo(ge-this._config.deviceCellWidth/2,te),this._tmpCtx.bezierCurveTo(ge-this._config.deviceCellWidth/2,je,ge,je,ge,te),this._tmpCtx.bezierCurveTo(ge,Oe,ze,Oe,ze,te),this._tmpCtx.bezierCurveTo(ze,je,ye,je,ye,te),this._tmpCtx.bezierCurveTo(ye,Oe,ye+this._config.deviceCellWidth/2,Oe,ye+this._config.deviceCellWidth/2,te);break;case 4:const pt=he===0?0:he>=ee?2*ee-he:ee-he;he>=ee||pt===0?(this._tmpCtx.setLineDash([Math.round(ee),Math.round(ee)]),this._tmpCtx.moveTo(ge+pt,K),this._tmpCtx.lineTo(ye,K)):(this._tmpCtx.setLineDash([Math.round(ee),Math.round(ee)]),this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(ge+pt,K),this._tmpCtx.moveTo(ge+pt+ee,K),this._tmpCtx.lineTo(ye,K)),he=(0,d.computeNextVariantOffset)(ye-ge,ee,he);break;case 5:const Te=.6,Ie=.3,Xe=ye-ge,rn=Math.floor(Te*Xe),nt=Math.floor(Ie*Xe),mt=Xe-rn-nt;this._tmpCtx.setLineDash([rn,nt,mt]),this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(ye,K);break;default:this._tmpCtx.moveTo(ge,K),this._tmpCtx.lineTo(ye,K)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!le&&this._config.fontSize>=12&&!this._config.allowTransparency&&N!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const _e=this._tmpCtx.measureText(N);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in _e&&_e.actualBoundingBoxDescent>0){this._tmpCtx.save();const ge=new Path2D;ge.rect(ce,K-Math.ceil(ee/2),this._config.deviceCellWidth*ve,oe-K+Math.ceil(ee/2)),this._tmpCtx.clip(ge),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(N,ne,ne+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(B){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=ee%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ne,ne+ie),this._tmpCtx.lineTo(ne+this._config.deviceCharWidth*ve,ne+ie),this._tmpCtx.stroke()}if(le||this._tmpCtx.fillText(N,ne,ne+this._config.deviceCharHeight),N==="_"&&!this._config.allowTransparency){let ee=C(this._tmpCtx.getImageData(ne,ne,this._config.deviceCellWidth,this._config.deviceCellHeight),$,re,ae);if(ee)for(let ie=1;ie<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(N,ne,ne+this._config.deviceCharHeight-ie),ee=C(this._tmpCtx.getImageData(ne,ne,this._config.deviceCellWidth,this._config.deviceCellHeight),$,re,ae),ee);ie++);}if(H){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ie=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ne,ne+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.lineTo(ne+this._config.deviceCharWidth*ve,ne+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.stroke()}this._tmpCtx.restore();const Ee=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Me;if(Me=this._config.allowTransparency?function(ee){for(let ie=0;ie<ee.data.length;ie+=4)if(ee.data[ie+3]>0)return!1;return!0}(Ee):C(Ee,$,re,ae),Me)return p;const xe=this._findGlyphBoundingBox(Ee,this._workBoundingBox,P,q,le,ne);let we,se;for(;;){if(this._activePages.length===0){const ee=this._createNewPage();we=ee,se=ee.currentRow,se.height=xe.size.y;break}we=this._activePages[this._activePages.length-1],se=we.currentRow;for(const ee of this._activePages)xe.size.y<=ee.currentRow.height&&(we=ee,se=ee.currentRow);for(let ee=this._activePages.length-1;ee>=0;ee--)for(const ie of this._activePages[ee].fixedRows)ie.height<=se.height&&xe.size.y<=ie.height&&(we=this._activePages[ee],se=ie);if(se.y+xe.size.y>=we.canvas.height||se.height>xe.size.y+2){let ee=!1;if(we.currentRow.y+we.currentRow.height+xe.size.y>=we.canvas.height){let ie;for(const ce of this._activePages)if(ce.currentRow.y+ce.currentRow.height+xe.size.y<ce.canvas.height){ie=ce;break}if(ie)we=ie;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&se.y+xe.size.y<=we.canvas.height&&se.height>=xe.size.y&&se.x+xe.size.x<=we.canvas.width)ee=!0;else{const ce=this._createNewPage();we=ce,se=ce.currentRow,se.height=xe.size.y,ee=!0}}ee||(we.currentRow.height>0&&we.fixedRows.push(we.currentRow),se={x:0,y:we.currentRow.y+we.currentRow.height,height:xe.size.y},we.fixedRows.push(se),we.currentRow={x:0,y:se.y+se.height,height:0})}if(se.x+xe.size.x<=we.canvas.width)break;se===we.currentRow?(se.x=0,se.y+=se.height,se.height=0):we.fixedRows.splice(we.fixedRows.indexOf(se),1)}return xe.texturePage=this._pages.indexOf(we),xe.texturePosition.x=se.x,xe.texturePosition.y=se.y,xe.texturePositionClipSpace.x=se.x/we.canvas.width,xe.texturePositionClipSpace.y=se.y/we.canvas.height,xe.sizeClipSpace.x/=we.canvas.width,xe.sizeClipSpace.y/=we.canvas.height,se.height=Math.max(se.height,xe.size.y),se.x+=xe.size.x,we.ctx.putImageData(Ee,xe.texturePosition.x-this._workBoundingBox.left,xe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,xe.size.x,xe.size.y),we.addGlyph(xe),we.version++,xe}_findGlyphBoundingBox(T,R,M,L,D,N){R.top=0;const P=L?this._config.deviceCellHeight:this._tmpCanvas.height,I=L?this._config.deviceCellWidth:M;let z=!1;for(let O=0;O<P;O++){for(let j=0;j<I;j++){const A=O*this._tmpCanvas.width*4+4*j+3;if(T.data[A]!==0){R.top=O,z=!0;break}}if(z)break}R.left=0,z=!1;for(let O=0;O<N+I;O++){for(let j=0;j<P;j++){const A=j*this._tmpCanvas.width*4+4*O+3;if(T.data[A]!==0){R.left=O,z=!0;break}}if(z)break}R.right=I,z=!1;for(let O=N+I-1;O>=N;O--){for(let j=0;j<P;j++){const A=j*this._tmpCanvas.width*4+4*O+3;if(T.data[A]!==0){R.right=O,z=!0;break}}if(z)break}R.bottom=P,z=!1;for(let O=P-1;O>=0;O--){for(let j=0;j<I;j++){const A=O*this._tmpCanvas.width*4+4*j+3;if(T.data[A]!==0){R.bottom=O,z=!0;break}}if(z)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:R.right-R.left+1,y:R.bottom-R.top+1},sizeClipSpace:{x:R.right-R.left+1,y:R.bottom-R.top+1},offset:{x:-R.left+N+(L||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-R.top+N+(L||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}o.TextureAtlas=b;class S{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(T){this._glyphs.push(T),this._usedPixels+=T.size.x*T.size.y}constructor(T,R,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const L of M)this._glyphs.push(...L.glyphs),this._usedPixels+=L._usedPixels;this.canvas=E(T,R,R),this.ctx=(0,d.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(k,T,R,M){const L=T.rgba>>>24,D=T.rgba>>>16&255,N=T.rgba>>>8&255,P=R.rgba>>>24,I=R.rgba>>>16&255,z=R.rgba>>>8&255,O=Math.floor((Math.abs(L-P)+Math.abs(D-I)+Math.abs(N-z))/12);let j=!0;for(let A=0;A<k.data.length;A+=4)k.data[A]===L&&k.data[A+1]===D&&k.data[A+2]===N||M&&Math.abs(k.data[A]-L)+Math.abs(k.data[A+1]-D)+Math.abs(k.data[A+2]-N)<O?k.data[A+3]=0:j=!1;return j}function E(k,T,R){const M=k.createElement("canvas");return M.width=T,M.height=R,M}},577:function(a,o,l){var c=this&&this.__decorate||function(m,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,p,x,b);else for(var k=m.length-1;k>=0;k--)(S=m[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(m,p){return function(x,b){p(x,b,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(147),f=l(855),g=l(782),_=l(97);class y extends d.AttributeData{constructor(p,x,b){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=x,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=y;let v=o.CharacterJoinerService=class MD{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(p){const x={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(x),x.id}deregister(p){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===p)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(p);if(!x||x.length===0)return[];const b=[],S=x.translateToString(!0);let C=0,E=0,k=0,T=x.getFg(0),R=x.getBg(0);for(let M=0;M<x.getTrimmedLength();M++)if(x.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==R){if(M-C>1){const L=this._getJoinedRanges(S,k,E,x,C);for(let D=0;D<L.length;D++)b.push(L[D])}C=M,k=E,T=this._workCell.fg,R=this._workCell.bg}E+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const M=this._getJoinedRanges(S,k,E,x,C);for(let L=0;L<M.length;L++)b.push(M[L])}return b}_getJoinedRanges(p,x,b,S,C){const E=p.substring(x,b);let k=[];try{k=this._characterJoiners[0].handler(E)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const R=this._characterJoiners[T].handler(E);for(let M=0;M<R.length;M++)MD._mergeRanges(k,R[M])}catch(R){console.error(R)}return this._stringRangesToCellRanges(k,S,C),k}_stringRangesToCellRanges(p,x,b){let S=0,C=!1,E=0,k=p[S];if(k){for(let T=b;T<this._bufferService.cols;T++){const R=x.getWidth(T),M=x.getString(T).length||f.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!C&&k[0]<=E&&(k[0]=T,C=!0),k[1]<=E){if(k[1]=T,k=p[++S],!k)break;k[0]<=E?(k[0]=T,C=!0):C=!1}E+=M}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(p,x){let b=!1;for(let S=0;S<p.length;S++){const C=p[S];if(b){if(x[1]<=C[0])return p[S-1][1]=x[1],p;if(x[1]<=C[1])return p[S-1][1]=Math.max(x[1],C[1]),p.splice(S,1),p;p.splice(S,1),S--}else{if(x[1]<=C[0])return p.splice(S,0,x),p;if(x[1]<=C[1])return C[0]=Math.min(x[0],C[0]),p;x[0]<C[1]&&(C[0]=Math.min(x[0],C[0]),b=!0)}}return b?p[p.length-1][1]=x[1]:p.push(x),p}};o.CharacterJoinerService=v=c([h(0,_.IBufferService)],v)},160:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let l=0,c=0,h=0,d=0;var f,g,_,y,v;function m(x){const b=x.toString(16);return b.length<2?"0"+b:b}function p(x,b){return x<b?(b+.05)/(x+.05):(x+.05)/(b+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(x){x.toCss=function(b,S,C,E){return E!==void 0?`#${m(b)}${m(S)}${m(C)}${m(E)}`:`#${m(b)}${m(S)}${m(C)}`},x.toRgba=function(b,S,C,E=255){return(b<<24|S<<16|C<<8|E)>>>0},x.toColor=function(b,S,C,E){return{css:x.toCss(b,S,C,E),rgba:x.toRgba(b,S,C,E)}}}(f||(o.channels=f={})),function(x){function b(S,C){return d=Math.round(255*C),[l,c,h]=v.toChannels(S.rgba),{css:f.toCss(l,c,h,d),rgba:f.toRgba(l,c,h,d)}}x.blend=function(S,C){if(d=(255&C.rgba)/255,d===1)return{css:C.css,rgba:C.rgba};const E=C.rgba>>24&255,k=C.rgba>>16&255,T=C.rgba>>8&255,R=S.rgba>>24&255,M=S.rgba>>16&255,L=S.rgba>>8&255;return l=R+Math.round((E-R)*d),c=M+Math.round((k-M)*d),h=L+Math.round((T-L)*d),{css:f.toCss(l,c,h),rgba:f.toRgba(l,c,h)}},x.isOpaque=function(S){return(255&S.rgba)==255},x.ensureContrastRatio=function(S,C,E){const k=v.ensureContrastRatio(S.rgba,C.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},x.opaque=function(S){const C=(255|S.rgba)>>>0;return[l,c,h]=v.toChannels(C),{css:f.toCss(l,c,h),rgba:C}},x.opacity=b,x.multiplyOpacity=function(S,C){return d=255&S.rgba,b(S,d*C/255)},x.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(g||(o.color=g={})),function(x){let b,S;try{const C=document.createElement("canvas");C.width=1,C.height=1;const E=C.getContext("2d",{willReadFrequently:!0});E&&(b=E,b.globalCompositeOperation="copy",S=b.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),f.toColor(l,c,h);case 5:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),d=parseInt(C.slice(4,5).repeat(2),16),f.toColor(l,c,h,d);case 7:return{css:C,rgba:(parseInt(C.slice(1),16)<<8|255)>>>0};case 9:return{css:C,rgba:parseInt(C.slice(1),16)>>>0}}const E=C.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 l=parseInt(E[1]),c=parseInt(E[2]),h=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,c,h,d);if(!b||!S)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=S,b.fillStyle=C,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,c,h,d]=b.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,c,h,d),css:C}}}(_||(o.css=_={})),function(x){function b(S,C,E){const k=S/255,T=C/255,R=E/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}x.relativeLuminance=function(S){return b(S>>16&255,S>>8&255,255&S)},x.relativeLuminance2=b}(y||(o.rgb=y={})),function(x){function b(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let L=E>>24&255,D=E>>16&255,N=E>>8&255,P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));for(;P<k&&(L>0||D>0||N>0);)L-=Math.max(0,Math.ceil(.1*L)),D-=Math.max(0,Math.ceil(.1*D)),N-=Math.max(0,Math.ceil(.1*N)),P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));return(L<<24|D<<16|N<<8|255)>>>0}function S(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let L=E>>24&255,D=E>>16&255,N=E>>8&255,P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));for(;P<k&&(L<255||D<255||N<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),D=Math.min(255,D+Math.ceil(.1*(255-D))),N=Math.min(255,N+Math.ceil(.1*(255-N))),P=p(y.relativeLuminance2(L,D,N),y.relativeLuminance2(T,R,M));return(L<<24|D<<16|N<<8|255)>>>0}x.blend=function(C,E){if(d=(255&E)/255,d===1)return E;const k=E>>24&255,T=E>>16&255,R=E>>8&255,M=C>>24&255,L=C>>16&255,D=C>>8&255;return l=M+Math.round((k-M)*d),c=L+Math.round((T-L)*d),h=D+Math.round((R-D)*d),f.toRgba(l,c,h)},x.ensureContrastRatio=function(C,E,k){const T=y.relativeLuminance(C>>8),R=y.relativeLuminance(E>>8);if(p(T,R)<k){if(R<T){const D=b(C,E,k),N=p(T,y.relativeLuminance(D>>8));if(N<k){const P=S(C,E,k);return N>p(T,y.relativeLuminance(P>>8))?D:P}return D}const M=S(C,E,k),L=p(T,y.relativeLuminance(M>>8));if(L<k){const D=b(C,E,k);return L>p(T,y.relativeLuminance(D>>8))?M:D}return M}},x.reduceLuminance=b,x.increaseLuminance=S,x.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}}(v||(o.rgba=v={})),o.toPaddedHex=m,o.contrastRatio=p},345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 h=[];for(let d=0;d<this._listeners.length;d++)h.push(this._listeners[d]);for(let d=0;d<h.length;d++)h[d].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(h=>c.fire(h))},o.runAndSubscribe=function(l,c){return c(void 0),l(h=>c(h))}},859:(a,o)=>{function l(c){for(const h of c)h.dispose();c.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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 h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)==null||h.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}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},485:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(h,d,f){this._data[h]||(this._data[h]={}),this._data[h][d]=f}get(h,d){return this._data[h]?this._data[h][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,h,d,f,g){this._data.get(c,h)||this._data.set(c,h,new l),this._data.get(c,h).set(d,f,g)}get(c,h,d,f){var g;return(g=this._data.get(c,h))==null?void 0:g.get(d,f)}clear(){this._data.clear()}}},399:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const l=o.isNode?"node":navigator.userAgent,c=o.isNode?"node":navigator.platform;o.isFirefox=l.includes("Firefox"),o.isLegacyEdge=l.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(l),o.getSafariVersion=function(){if(!o.isSafari)return 0;const h=l.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),o.isIpad=c==="iPad",o.isIphone=c==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),o.isLinux=c.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(l)},385:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const c=l(399);class h{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 _=0,y=0,v=g.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(_=Date.now(),this._tasks[this._i]()||this._i++,_=Math.max(1,Date.now()-_),y=Math.max(_,y),m=g.timeRemaining(),1.5*y>m)return v-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-_))}ms`),void this._start();v=m}this.clear()}}class d extends h{_requestCallback(g){return setTimeout(()=>g(this._createDeadline(16)))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const _=Date.now()+g;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},147:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}o.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,f=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=f}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=c},782:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(133),h=l(855),d=l(147);class f extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const y=new f;return y.setFromCharData(_),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(_){this.fg=_[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let y=!1;if(_[h.CHAR_DATA_CHAR_INDEX].length>2)y=!0;else if(_[h.CHAR_DATA_CHAR_INDEX].length===2){const v=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const m=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(v-55296)+m-56320+65536|_[h.CHAR_DATA_WIDTH_INDEX]<<22:y=!0}else y=!0}else this.content=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[h.CHAR_DATA_WIDTH_INDEX]<<22;y&&(this.combinedData=_[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},855:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},133:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,c=0,h=l.length){let d="";for(let f=c;f<h;++f){let g=l[f];g>65535?(g-=65536,d+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):d+=String.fromCharCode(g)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const h=l.length;if(!h)return 0;let d=0,f=0;if(this._interim){const g=l.charCodeAt(f++);56320<=g&&g<=57343?c[d++]=1024*(this._interim-55296)+g-56320+65536:(c[d++]=this._interim,c[d++]=g),this._interim=0}for(let g=f;g<h;++g){const _=l.charCodeAt(g);if(55296<=_&&_<=56319){if(++g>=h)return this._interim=_,d;const y=l.charCodeAt(g);56320<=y&&y<=57343?c[d++]=1024*(_-55296)+y-56320+65536:(c[d++]=_,c[d++]=y)}else _!==65279&&(c[d++]=_)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const h=l.length;if(!h)return 0;let d,f,g,_,y=0,v=0,m=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let C,E=0;for(;(C=63&this.interim[++E])&&E<4;)S<<=6,S|=C;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;m<T;){if(m>=h)return 0;if(C=l[m++],(192&C)!=128){m--,b=!0;break}this.interim[E++]=C,S<<=6,S|=63&C}b||(k===2?S<128?m--:c[y++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(c[y++]=S):S<65536||S>1114111||(c[y++]=S)),this.interim.fill(0)}const p=h-4;let x=m;for(;x<h;){for(;!(!(x<p)||128&(d=l[x])||128&(f=l[x+1])||128&(g=l[x+2])||128&(_=l[x+3]));)c[y++]=d,c[y++]=f,c[y++]=g,c[y++]=_,x+=4;if(d=l[x++],d<128)c[y++]=d;else if((224&d)==192){if(x>=h)return this.interim[0]=d,y;if(f=l[x++],(192&f)!=128){x--;continue}if(v=(31&d)<<6|63&f,v<128){x--;continue}c[y++]=v}else if((240&d)==224){if(x>=h)return this.interim[0]=d,y;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,y;if(g=l[x++],(192&g)!=128){x--;continue}if(v=(15&d)<<12|(63&f)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;c[y++]=v}else if((248&d)==240){if(x>=h)return this.interim[0]=d,y;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,y;if(g=l[x++],(192&g)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,this.interim[2]=g,y;if(_=l[x++],(192&_)!=128){x--;continue}if(v=(7&d)<<18|(63&f)<<12|(63&g)<<6|63&_,v<65536||v>1114111)continue;c[y++]=v}}return y}}},776:function(a,o,l){var c=this&&this.__decorate||function(v,m,p,x){var b,S=arguments.length,C=S<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,m,p,x);else for(var E=v.length-1;E>=0;E--)(b=v[E])&&(C=(S<3?b(C):S>3?b(m,p,C):b(m,p))||C);return S>3&&C&&Object.defineProperty(m,p,C),C},h=this&&this.__param||function(v,m){return function(p,x){m(p,x,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(859),f=l(97),g={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let _,y=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),_=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let m=0;m<v.length;m++)typeof v[m]=="function"&&(v[m]=v[m]())}_log(v,m,p){this._evalLazyOptionalParams(p),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...p)}trace(v,...m){var p;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.trace.bind(this._optionsService.options.logger))??console.log,v,m)}debug(v,...m){var p;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.debug.bind(this._optionsService.options.logger))??console.log,v,m)}info(v,...m){var p;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.info.bind(this._optionsService.options.logger))??console.info,v,m)}warn(v,...m){var p;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.warn.bind(this._optionsService.options.logger))??console.warn,v,m)}error(v,...m){var p;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((p=this._optionsService.options.logger)==null?void 0:p.error.bind(this._optionsService.options.logger))??console.error,v,m)}};o.LogService=y=c([h(0,f.IOptionsService)],y),o.setTraceLogger=function(v){_=v},o.traceCall=function(v,m,p){if(typeof p.value!="function")throw new Error("not supported");const x=p.value;p.value=function(...b){if(_.logLevel!==f.LogLevelEnum.TRACE)return x.apply(this,b);_.trace(`GlyphRenderer#${x.name}(${b.map(C=>JSON.stringify(C)).join(", ")})`);const S=x.apply(this,b);return _.trace(`GlyphRenderer#${x.name} return`,S),S}}},726:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",c="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(h){return h[c]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const d=function(f,g,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(y,v,m){v[l]===v?v[c].push({id:y,index:m}):(v[c]=[{id:y,index:m}],v[l]=v)})(d,f,_)};return d.toString=()=>h,o.serviceRegistry.set(h,d),d}},97:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const c=l(726);var h;o.IBufferService=(0,c.createDecorator)("BufferService"),o.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),o.ICoreService=(0,c.createDecorator)("CoreService"),o.ICharsetService=(0,c.createDecorator)("CharsetService"),o.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(h||(o.LogLevelEnum=h={})),o.ILogService=(0,c.createDecorator)("LogService"),o.IOptionsService=(0,c.createDecorator)("OptionsService"),o.IOscLinkService=(0,c.createDecorator)("OscLinkService"),o.IUnicodeService=(0,c.createDecorator)("UnicodeService"),o.IDecorationService=(0,c.createDecorator)("DecorationService")}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.CanvasAddon=void 0;const o=i(345),l=i(859),c=i(776),h=i(949);class d extends l.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new o.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new o.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var g;return(g=this._renderer)==null?void 0:g.textureAtlas}activate(g){const _=g._core;if(!g.element)return void this.register(_.onWillOpen(()=>this.activate(g)));this._terminal=g;const y=_.coreService,v=_.optionsService,m=_.screenElement,p=_.linkifier,x=_,b=x._bufferService,S=x._renderService,C=x._characterJoinerService,E=x._charSizeService,k=x._coreBrowserService,T=x._decorationService,R=x._logService,M=x._themeService;(0,c.setTraceLogger)(R),this._renderer=new h.CanvasRenderer(g,m,p,b,E,v,C,y,k,T,M),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),S.setRenderer(this._renderer),S.handleResize(b.cols,b.rows),this.register((0,l.toDisposable)(()=>{var L;S.setRenderer(this._terminal._core._createRenderer()),S.handleResize(g.cols,g.rows),(L=this._renderer)==null||L.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var g;(g=this._renderer)==null||g.clearTextureAtlas()}}a.CanvasAddon=d})(),s})())})(TD);var RD=TD.exports,AD={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 s=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(s._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,s=i._renderService.dimensions;if(s.css.cell.width===0||s.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),c=Math.max(0,parseInt(o.getPropertyValue("width"))),h=window.getComputedStyle(this._terminal.element),d=l-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),f=c-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(f/s.css.cell.width)),rows:Math.max(1,Math.floor(d/s.css.cell.height))}}}})(),n})())})(AD);var jD=AD.exports,LD={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={345:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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 h=[];for(let d=0;d<this._listeners.length;d++)h.push(this._listeners[d]);for(let d=0;d<h.length;d++)h[d].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(l,c){return l(h=>c.fire(h))},o.runAndSubscribe=function(l,c){return c(void 0),l(h=>c(h))}},859:(a,o)=>{function l(c){for(const h of c)h.dispose();c.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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 h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)==null||h.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}},o.toDisposable=function(c){return{dispose:c}},o.disposeArray=l,o.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.SearchAddon=void 0;const o=i(345),l=i(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class h extends l.Disposable{constructor(f){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new l.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new l.MutableDisposable,this._onDidChangeResults=this.register(new o.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(f==null?void 0:f.highlightLimit)??1e3}activate(f){this._terminal=f,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,l.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var f;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((f=this._lastSearchOptions)!=null&&f.decorations)&&(this._highlightTimeout=setTimeout(()=>{const g=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(g,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(f){this._selectedDecoration.clear(),(0,l.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),f||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(f,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const _=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||_)&&this._highlightAllMatches(f,g);const y=this._findNextAndSelect(f,g);return this._fireResults(g),this._cachedSearchTerm=f,y}_highlightAllMatches(f,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!f||f.length===0)return void this.clearDecorations();g=g||{},this.clearDecorations(!0);const _=[];let y,v=this._find(f,0,0,g);for(;v&&((y==null?void 0:y.row)!==v.row||(y==null?void 0:y.col)!==v.col)&&!(_.length>=this._highlightLimit);)y=v,_.push(y),v=this._find(f,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 m of _){const p=this._createResultDecoration(m,g.decorations);p&&(this._highlightedLines.add(p.marker.line),this._highlightDecorations.push({decoration:p,match:m,dispose(){p.dispose()}}))}}_find(f,g,_,y){var p;if(!this._terminal||!f||f.length===0)return(p=this._terminal)==null||p.clearSelection(),void this.clearDecorations();if(_>this._terminal.cols)throw new Error(`Invalid col: ${_} to search in terminal of ${this._terminal.cols} cols`);let v;this._initLinesCache();const m={startRow:g,startCol:_};if(v=this._findInLine(f,m,y),!v)for(let x=g+1;x<this._terminal.buffer.active.baseY+this._terminal.rows&&(m.startRow=x,m.startCol=0,v=this._findInLine(f,m,y),!v);x++);return v}_findNextAndSelect(f,g){var x;if(!this._terminal||!f||f.length===0)return(x=this._terminal)==null||x.clearSelection(),this.clearDecorations(),!1;const _=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=0,v=0;_&&(this._cachedSearchTerm===f?(y=_.end.x,v=_.end.y):(y=_.start.x,v=_.start.y)),this._initLinesCache();const m={startRow:v,startCol:y};let p=this._findInLine(f,m,g);if(!p)for(let b=v+1;b<this._terminal.buffer.active.baseY+this._terminal.rows&&(m.startRow=b,m.startCol=0,p=this._findInLine(f,m,g),!p);b++);if(!p&&v!==0)for(let b=0;b<v&&(m.startRow=b,m.startCol=0,p=this._findInLine(f,m,g),!p);b++);return!p&&_&&(m.startRow=_.start.y,m.startCol=0,p=this._findInLine(f,m,g)),this._selectResult(p,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}findPrevious(f,g){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const _=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,g);this._lastSearchOptions=g,g!=null&&g.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||_)&&this._highlightAllMatches(f,g);const y=this._findPreviousAndSelect(f,g);return this._fireResults(g),this._cachedSearchTerm=f,y}_didOptionsChange(f,g){return!!g&&(f.caseSensitive!==g.caseSensitive||f.regex!==g.regex||f.wholeWord!==g.wholeWord)}_fireResults(f){if(f!=null&&f.decorations){let g=-1;if(this._selectedDecoration.value){const _=this._selectedDecoration.value.match;for(let y=0;y<this._highlightDecorations.length;y++){const v=this._highlightDecorations[y].match;if(v.row===_.row&&v.col===_.col&&v.size===_.size){g=y;break}}}this._onDidChangeResults.fire({resultIndex:g,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(f,g){var b;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!f||f.length===0)return(b=this._terminal)==null||b.clearSelection(),this.clearDecorations(),!1;const _=this._terminal.getSelectionPosition();this._terminal.clearSelection();let y=this._terminal.buffer.active.baseY+this._terminal.rows-1,v=this._terminal.cols;const m=!0;this._initLinesCache();const p={startRow:y,startCol:v};let x;if(_&&(p.startRow=y=_.start.y,p.startCol=v=_.start.x,this._cachedSearchTerm!==f&&(x=this._findInLine(f,p,g,!1),x||(p.startRow=y=_.end.y,p.startCol=v=_.end.x))),x||(x=this._findInLine(f,p,g,m)),!x){p.startCol=Math.max(p.startCol,this._terminal.cols);for(let S=y-1;S>=0&&(p.startRow=S,x=this._findInLine(f,p,g,m),!x);S--);}if(!x&&y!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let S=this._terminal.buffer.active.baseY+this._terminal.rows-1;S>=y&&(p.startRow=S,x=this._findInLine(f,p,g,m),!x);S--);return this._selectResult(x,g==null?void 0:g.decorations,g==null?void 0:g.noScroll)}_initLinesCache(){const f=this._terminal;this._linesCache||(this._linesCache=new Array(f.buffer.active.length),this._linesCacheDisposables.value=(0,l.getDisposeArrayDisposable)([f.onLineFeed(()=>this._destroyLinesCache()),f.onCursorMove(()=>this._destroyLinesCache()),f.onResize(()=>this._destroyLinesCache())])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(f,g,_){return(f===0||c.includes(g[f-1]))&&(f+_.length===g.length||c.includes(g[f+_.length]))}_findInLine(f,g,_={},y=!1){var M;const v=this._terminal,m=g.startRow,p=g.startCol,x=v.buffer.active.getLine(m);if(x!=null&&x.isWrapped)return y?void(g.startCol+=v.cols):(g.startRow--,g.startCol+=v.cols,this._findInLine(f,g,_));let b=(M=this._linesCache)==null?void 0:M[m];b||(b=this._translateBufferLineToStringWithWrap(m,!0),this._linesCache&&(this._linesCache[m]=b));const[S,C]=b,E=this._bufferColsToStringOffset(m,p),k=_.caseSensitive?f:f.toLowerCase(),T=_.caseSensitive?S:S.toLowerCase();let R=-1;if(_.regex){const L=RegExp(k,"g");let D;if(y)for(;D=L.exec(T.slice(0,E));)R=L.lastIndex-D[0].length,f=D[0],L.lastIndex-=f.length-1;else D=L.exec(T.slice(E)),D&&D[0].length>0&&(R=E+(L.lastIndex-D[0].length),f=D[0])}else y?E-k.length>=0&&(R=T.lastIndexOf(k,E-k.length)):R=T.indexOf(k,E);if(R>=0){if(_.wholeWord&&!this._isWholeWord(R,T,f))return;let L=0;for(;L<C.length-1&&R>=C[L+1];)L++;let D=L;for(;D<C.length-1&&R+f.length>=C[D+1];)D++;const N=R-C[L],P=R+f.length-C[D],I=this._stringLengthToBufferSize(m+L,N);return{term:f,col:I,row:m+L,size:this._stringLengthToBufferSize(m+D,P)-I+v.cols*(D-L)}}}_stringLengthToBufferSize(f,g){const _=this._terminal.buffer.active.getLine(f);if(!_)return 0;for(let y=0;y<g;y++){const v=_.getCell(y);if(!v)break;const m=v.getChars();m.length>1&&(g-=m.length-1);const p=_.getCell(y+1);p&&p.getWidth()===0&&g++}return g}_bufferColsToStringOffset(f,g){const _=this._terminal;let y=f,v=0,m=_.buffer.active.getLine(y);for(;g>0&&m;){for(let p=0;p<g&&p<_.cols;p++){const x=m.getCell(p);if(!x)break;x.getWidth()&&(v+=x.getCode()===0?1:x.getChars().length)}if(y++,m=_.buffer.active.getLine(y),m&&!m.isWrapped)break;g-=_.cols}return v}_translateBufferLineToStringWithWrap(f,g){var p;const _=this._terminal,y=[],v=[0];let m=_.buffer.active.getLine(f);for(;m;){const x=_.buffer.active.getLine(f+1),b=!!x&&x.isWrapped;let S=m.translateToString(!b&&g);if(b&&x){const C=m.getCell(m.length-1);C&&C.getCode()===0&&C.getWidth()===1&&((p=x.getCell(0))==null?void 0:p.getWidth())===2&&(S=S.slice(0,-1))}if(y.push(S),!b)break;v.push(v[v.length-1]+S.length),f++,m=x}return[y.join(""),v]}_selectResult(f,g,_){const y=this._terminal;if(this._selectedDecoration.clear(),!f)return y.clearSelection(),!1;if(y.select(f.col,f.row,f.size),g){const v=y.registerMarker(-y.buffer.active.baseY-y.buffer.active.cursorY+f.row);if(v){const m=y.registerDecoration({marker:v,x:f.col,width:f.size,backgroundColor:g.activeMatchBackground,layer:"top",overviewRulerOptions:{color:g.activeMatchColorOverviewRuler}});if(m){const p=[];p.push(v),p.push(m.onRender(x=>this._applyStyles(x,g.activeMatchBorder,!0))),p.push(m.onDispose(()=>(0,l.disposeArray)(p))),this._selectedDecoration.value={decoration:m,match:f,dispose(){m.dispose()}}}}}if(!_&&(f.row>=y.buffer.active.viewportY+y.rows||f.row<y.buffer.active.viewportY)){let v=f.row-y.buffer.active.viewportY;v-=Math.floor(y.rows/2),y.scrollLines(v)}return!0}_applyStyles(f,g,_){f.classList.contains("xterm-find-result-decoration")||(f.classList.add("xterm-find-result-decoration"),g&&(f.style.outline=`1px solid ${g}`)),_&&f.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(f,g){const _=this._terminal,y=_.registerMarker(-_.buffer.active.baseY-_.buffer.active.cursorY+f.row);if(!y)return;const v=_.registerDecoration({marker:y,x:f.col,width:f.size,backgroundColor:g.matchBackground,overviewRulerOptions:this._highlightedLines.has(y.line)?void 0:{color:g.matchOverviewRuler,position:"center"}});if(v){const m=[];m.push(y),m.push(v.onRender(p=>this._applyStyles(p,g.matchBorder,!1))),m.push(v.onDispose(()=>(0,l.disposeArray)(m)))}return v}}a.SearchAddon=h})(),s})())})(LD);var DD=LD.exports,ND={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,o)=>{function l(h){try{const d=new URL(h),f=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return h.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(h,d,f,g={}){this._terminal=h,this._regex=d,this._handler=f,this._options=g}provideLinks(h,d){const f=c.computeLink(h,this._regex,this._terminal,this._handler);d(this._addCallbacks(f))}_addCallbacks(h){return h.map(d=>(d.leave=this._options.leave,d.hover=(f,g)=>{if(this._options.hover){const{range:_}=d;this._options.hover(f,g,_)}},d))}};class c{static computeLink(d,f,g,_){const y=new RegExp(f.source,(f.flags||"")+"g"),[v,m]=c._getWindowedLineStrings(d-1,g),p=v.join("");let x;const b=[];for(;x=y.exec(p);){const S=x[0];if(!l(S))continue;const[C,E]=c._mapStrIdx(g,m,0,x.index),[k,T]=c._mapStrIdx(g,C,E,S.length);if(C===-1||E===-1||k===-1||T===-1)continue;const R={start:{x:E+1,y:C+1},end:{x:T,y:k+1}};b.push({range:R,text:S,activate:_})}return b}static _getWindowedLineStrings(d,f){let g,_=d,y=d,v=0,m="";const p=[];if(g=f.buffer.active.getLine(d)){const x=g.translateToString(!0);if(g.isWrapped&&x[0]!==" "){for(v=0;(g=f.buffer.active.getLine(--_))&&v<2048&&(m=g.translateToString(!0),v+=m.length,p.push(m),g.isWrapped&&m.indexOf(" ")===-1););p.reverse()}for(p.push(x),v=0;(g=f.buffer.active.getLine(++y))&&g.isWrapped&&v<2048&&(m=g.translateToString(!0),v+=m.length,p.push(m),m.indexOf(" ")===-1););}return[p,_]}static _mapStrIdx(d,f,g,_){const y=d.buffer.active,v=y.getNullCell();let m=g;for(;_;){const p=y.getLine(f);if(!p)return[-1,-1];for(let x=m;x<p.length;++x){p.getCell(x,v);const b=v.getChars();if(v.getWidth()&&(_-=b.length||1,x===p.length-1&&b==="")){const S=y.getLine(f+1);S&&S.isWrapped&&(S.getCell(0,v),v.getWidth()===2&&(_+=1))}if(_<0)return[f,x]}f++,m=0}return[f,m]}}o.LinkComputer=c}},r={};function i(a){var o=r[a];if(o!==void 0)return o.exports;var l=r[a]={exports:{}};return n[a](l,l.exports,i),l.exports}var s={};return(()=>{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=i(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(h,d){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(h=c,d={}){this._handler=h,this._options=d}activate(h){this._terminal=h;const d=this._options,f=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,f,this._handler,d))}dispose(){var h;(h=this._linkProvider)==null||h.dispose()}}})(),s})())})(ND);var PD=ND.exports;/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OD=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var wK={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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SK=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>w.createElement("svg",{ref:l,...wK,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:OD("lucide",i),...o},[...a.map(([c,h])=>w.createElement(c,h)),...Array.isArray(s)?s:[s]]));/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ue=(e,t)=>{const n=w.forwardRef(({className:r,...i},s)=>w.createElement(SK,{ref:s,iconNode:t,className:OD(`lucide-${bK(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CK=ue("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kK=ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EK=ue("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TK=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MK=ue("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ID=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RK=ue("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AK=ue("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jK=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LK=ue("ChartBar",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DK=ue("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NK=ue("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lS=ue("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ua=ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cS=ue("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uS=ue("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $D=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K_=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PK=ue("CircleAlert",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OK=ue("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IK=ue("CircleChevronRight",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $K=ue("CirclePlay",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BK=ue("CirclePlus",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FK=ue("CircleX",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BD=ue("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zK=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HK=ue("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M3=ue("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WK=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UK=ue("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VK=ue("Dna",[["path",{d:"m10 16 1.5 1.5",key:"11lckj"}],["path",{d:"m14 8-1.5-1.5",key:"1ohn8i"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m17 6-2.891-2.891",key:"xu6p2f"}],["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"m20 9 .891.891",key:"3xwk7g"}],["path",{d:"M3.109 14.109 4 15",key:"q76aoh"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m7 18 2.891 2.891",key:"1sisit"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ig=ue("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ka=ue("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qK=ue("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GK=ue("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KK=ue("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YK=ue("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XK=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FD=ue("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JK=ue("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sg=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QK=ue("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZK=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zD=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dS=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eY=ue("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nY=ue("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const og=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zt=ue("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R3=ue("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A3=ue("MemoryStick",[["path",{d:"M6 19v-3",key:"1nvgqn"}],["path",{d:"M10 19v-3",key:"iu8nkm"}],["path",{d:"M14 19v-3",key:"kcehxu"}],["path",{d:"M18 19v-3",key:"1vh91z"}],["path",{d:"M8 11V9",key:"63erz4"}],["path",{d:"M16 11V9",key:"fru6f3"}],["path",{d:"M12 11V9",key:"ha00sb"}],["path",{d:"M2 15h20",key:"16ne18"}],["path",{d:"M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z",key:"lhddv3"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lY=ue("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cY=ue("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HD=ue("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uY=ue("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dY=ue("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hS=ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y_=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gY=ue("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vY=ue("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yY=ue("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fS=ue("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WD=ue("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UD=ue("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VD=ue("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qD=ue("Skull",[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _Y=ue("SquareActivity",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bY=ue("SquareChevronRight",[["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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EY=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GD=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KD=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TY=ue("Trash",[["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"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MY=ue("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ag=ue("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pS=ue("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j3=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RY=ue("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mS=ue("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.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AY=ue("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.447.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=ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.447.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jY=ue("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),yt=w.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:J("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","bg-black/5 dark:bg-black/30 placeholder:opacity-50",e),ref:r,...n}));yt.displayName="Input";var LY="Label",Ld=w.forwardRef((e,t)=>u.jsx(Ce.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ld.displayName=LY;var YD=Ld;const DY=$s("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_n=w.forwardRef(({className:e,...t},n)=>u.jsx(YD,{ref:n,className:J(DY(),e),...t}));_n.displayName=YD.displayName;const XD=Symbol("");function Vc(e){const t=Qe(e,(n,r,i)=>{const s=typeof i=="function"?i(n(t)):i;r(t,s===XD?e:s)});return t}const NY=e=>typeof(e==null?void 0:e.then)=="function";function PY(e=()=>{try{return window.localStorage}catch{return}},t){var n;let r,i;const s={getItem:(l,c)=>{var h,d;const f=_=>{if(_=_||"",r!==_){try{i=JSON.parse(_,t==null?void 0:t.reviver)}catch{return c}r=_}return i},g=(d=(h=e())==null?void 0:h.getItem(l))!=null?d:null;return NY(g)?g.then(f):f(g)},setItem:(l,c)=>{var h;return(h=e())==null?void 0:h.setItem(l,JSON.stringify(c,void 0))},removeItem:l=>{var c;return(c=e())==null?void 0:c.removeItem(l)}},a=l=>(c,h,d)=>l(c,f=>{let g;try{g=JSON.parse(f||"")}catch{g=d}h(g)});let o;try{o=(n=e())==null?void 0:n.subscribe}catch{}return!o&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(o=(l,c)=>{if(!(e()instanceof window.Storage))return()=>{};const h=d=>{d.storageArea===e()&&d.key===l&&c(d.newValue)};return window.addEventListener("storage",h),()=>{window.removeEventListener("storage",h)}}),o&&(s.subscribe=a(o)),s}const OY=PY();function JD(e,t,n=OY,r){const i=Qe(t);return i.onMount=a=>{a(n.getItem(e,t));let o;return n.subscribe&&(o=n.subscribe(e,a,t)),o},Qe(a=>a(i),(a,o,l)=>{const c=typeof l=="function"?l(a(i)):l;return c===XD?(o(i,t),n.removeItem(e)):c instanceof Promise?c.then(h=>(o(i,h),n.setItem(e,h))):(o(i,c),n.setItem(e,c))})}const Fv=Qe(!1),QD=Qe(void 0),gS=()=>{const[e,t]=mr(Fv),[n,r]=mr(QD);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},IY=()=>{const e=tt(Fv),t=tt(QD);return n=>{e(!0),n&&t(n)}},ZD=()=>{const e=tt(Fv);return()=>{e(!1)}},zv=Qe(!1),e8=Vc({title:"",onConfirm:()=>{}}),ef=()=>{const e=tt(zv),t=tt(e8);return n=>{t(n),e(!0)}},$Y=()=>{const e=tt(zv);return()=>{e(!1)}},BY=()=>{const e=et(zv),t=et(e8);return{isOpen:e,...t}},Hv=Qe(!1),t8=Vc({title:"",onSubmit:()=>{}}),tf=()=>{const e=tt(Hv),t=tt(t8);return n=>{t(n),e(!0)}},FY=()=>{const e=tt(Hv);return()=>{e(!1)}},zY=()=>{const e=et(Hv),t=et(t8);return{isOpen:e,...t}},vS=Qe(!1),yS=Qe(!1),xS=Qe(!1),n8=()=>{const[e,t]=mr(vS);return{isSheetOpen:e,setIsSheetOpen:t}},r8=()=>{const[e,t]=mr(yS);return{isSheetOpen:e,setIsSheetOpen:t}},i8=()=>{const[e,t]=mr(xS);return{isSheetOpen:e,setIsSheetOpen:t}},Wv=()=>{const e=tt(vS),t=tt(yS),n=tt(xS);return()=>{e(!1),t(!1),n(!1)}},Uv=Vc(!1),s8=Vc(void 0),X_="playerModal",Vv=e=>{vN(X_,e)},qv=()=>{const e=tt(s8),t=tt(Uv);return n=>{const r="mutex"in n?`${n.mutex}#${n.netid}`:n.license;Vv(r),e(n),t(!0)}},_S=()=>{const e=tt(Uv);return()=>{Vv(void 0),e(!1)}},HY=()=>{const e=et(s8),[t,n]=mr(Uv);return{isModalOpen:t,playerRef:e,closeModal:()=>{Vv(void 0),n(!1)}}};function WY(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const UY=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VY=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qY={};function L3(e,t){return(qY.jsx?VY:UY).test(e)}const GY=/[ \t\n\f\r]/g;function KY(e){return typeof e=="object"?e.type==="text"?D3(e.value):!1:D3(e)}function D3(e){return e.replace(GY,"")===""}class nf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}nf.prototype.property={};nf.prototype.normal={};nf.prototype.space=null;function o8(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 nf(n,r,t)}function J_(e){return e.toLowerCase()}class ti{constructor(t,n){this.property=t,this.attribute=n}}ti.prototype.space=null;ti.prototype.boolean=!1;ti.prototype.booleanish=!1;ti.prototype.overloadedBoolean=!1;ti.prototype.number=!1;ti.prototype.commaSeparated=!1;ti.prototype.spaceSeparated=!1;ti.prototype.commaOrSpaceSeparated=!1;ti.prototype.mustUseProperty=!1;ti.prototype.defined=!1;let YY=0;const qe=Va(),cn=Va(),a8=Va(),me=Va(),Lt=Va(),Xl=Va(),wr=Va();function Va(){return 2**++YY}const Q_=Object.freeze(Object.defineProperty({__proto__:null,boolean:qe,booleanish:cn,commaOrSpaceSeparated:wr,commaSeparated:Xl,number:me,overloadedBoolean:a8,spaceSeparated:Lt},Symbol.toStringTag,{value:"Module"})),Ly=Object.keys(Q_);class bS extends ti{constructor(t,n,r,i){let s=-1;if(super(t,n),N3(this,"space",i),typeof r=="number")for(;++s<Ly.length;){const a=Ly[s];N3(this,Ly[s],(r&Q_[a])===Q_[a])}}}bS.prototype.defined=!0;function N3(e,t,n){n&&(e[t]=n)}const XY={}.hasOwnProperty;function qc(e){const t={},n={};let r;for(r in e.properties)if(XY.call(e.properties,r)){const i=e.properties[r],s=new bS(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[J_(r)]=r,n[J_(s.attribute)]=r}return new nf(t,n,e.space)}const l8=qc({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}}),c8=qc({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function u8(e,t){return t in e?e[t]:t}function d8(e,t){return u8(e,t.toLowerCase())}const h8=qc({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:d8,properties:{xmlns:null,xmlnsXLink:null}}),f8=qc({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:cn,ariaAutoComplete:null,ariaBusy:cn,ariaChecked:cn,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:Lt,ariaCurrent:null,ariaDescribedBy:Lt,ariaDetails:null,ariaDisabled:cn,ariaDropEffect:Lt,ariaErrorMessage:null,ariaExpanded:cn,ariaFlowTo:Lt,ariaGrabbed:cn,ariaHasPopup:null,ariaHidden:cn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Lt,ariaLevel:me,ariaLive:null,ariaModal:cn,ariaMultiLine:cn,ariaMultiSelectable:cn,ariaOrientation:null,ariaOwns:Lt,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:cn,ariaReadOnly:cn,ariaRelevant:null,ariaRequired:cn,ariaRoleDescription:Lt,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:cn,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null}}),JY=qc({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:d8,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xl,acceptCharset:Lt,accessKey:Lt,action:null,allow:null,allowFullScreen:qe,allowPaymentRequest:qe,allowUserMedia:qe,alt:null,as:null,async:qe,autoCapitalize:null,autoComplete:Lt,autoFocus:qe,autoPlay:qe,blocking:Lt,capture:null,charSet:null,checked:qe,cite:null,className:Lt,cols:me,colSpan:null,content:null,contentEditable:cn,controls:qe,controlsList:Lt,coords:me|Xl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:qe,defer:qe,dir:null,dirName:null,disabled:qe,download:a8,draggable:cn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:qe,formTarget:null,headers:Lt,height:me,hidden:qe,high:me,href:null,hrefLang:null,htmlFor:Lt,httpEquiv:Lt,id:null,imageSizes:null,imageSrcSet:null,inert:qe,inputMode:null,integrity:null,is:null,isMap:qe,itemId:null,itemProp:Lt,itemRef:Lt,itemScope:qe,itemType:Lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:qe,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:qe,muted:qe,name:null,nonce:null,noModule:qe,noValidate:qe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:qe,optimum:me,pattern:null,ping:Lt,placeholder:null,playsInline:qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:qe,referrerPolicy:null,rel:Lt,required:qe,reversed:qe,rows:me,rowSpan:me,sandbox:Lt,scope:null,scoped:qe,seamless:qe,selected:qe,shadowRootClonable:qe,shadowRootDelegatesFocus:qe,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:cn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:qe,useMap:null,value:cn,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Lt,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:qe,declare:qe,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:qe,noHref:qe,noShade:qe,noWrap:qe,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:cn,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:qe,disableRemotePlayback:qe,prefix:null,property:null,results:me,security:null,unselectable:null}}),QY=qc({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:u8,properties:{about:wr,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:Lt,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:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,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:Xl,g2:Xl,glyphName:Xl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:wr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,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:me,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:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wr,rev:wr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wr,requiredFeatures:wr,requiredFonts:wr,requiredFormats:wr,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:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:wr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wr,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),ZY=/^data[-\w.:]+$/i,P3=/-[a-z]/g,eX=/[A-Z]/g;function tX(e,t){const n=J_(t);let r=t,i=ti;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZY.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(P3,rX);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!P3.test(s)){let a=s.replace(eX,nX);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=bS}return new i(r,t)}function nX(e){return"-"+e.toLowerCase()}function rX(e){return e.charAt(1).toUpperCase()}const iX={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"},sX=o8([c8,l8,h8,f8,JY],"html"),wS=o8([c8,l8,h8,f8,QY],"svg");function oX(e){return e.join(" ").trim()}var p8={},O3=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,aX=/\n/g,lX=/^\s*/,cX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,uX=/^:\s*/,dX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,hX=/^[;\s]*/,fX=/^\s+|\s+$/g,pX=`
`,I3="/",$3="*",ra="",mX="comment",gX="declaration",vX=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(_){var y=_.match(aX);y&&(n+=y.length);var v=_.lastIndexOf(pX);r=~v?_.length-v:r+_.length}function s(){var _={line:n,column:r};return function(y){return y.position=new a(_),c(),y}}function a(_){this.start=_,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(_){var y=new Error(t.source+":"+n+":"+r+": "+_);if(y.reason=_,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(_){var y=_.exec(e);if(y){var v=y[0];return i(v),e=e.slice(v.length),y}}function c(){l(lX)}function h(_){var y;for(_=_||[];y=d();)y!==!1&&_.push(y);return _}function d(){var _=s();if(!(I3!=e.charAt(0)||$3!=e.charAt(1))){for(var y=2;ra!=e.charAt(y)&&($3!=e.charAt(y)||I3!=e.charAt(y+1));)++y;if(y+=2,ra===e.charAt(y-1))return o("End of comment missing");var v=e.slice(2,y-2);return r+=2,i(v),e=e.slice(y),r+=2,_({type:mX,comment:v})}}function f(){var _=s(),y=l(cX);if(y){if(d(),!l(uX))return o("property missing ':'");var v=l(dX),m=_({type:gX,property:B3(y[0].replace(O3,ra)),value:v?B3(v[0].replace(O3,ra)):ra});return l(hX),m}}function g(){var _=[];h(_);for(var y;y=f();)y!==!1&&(_.push(y),h(_));return _}return c(),g()};function B3(e){return e?e.replace(fX,ra):ra}var yX=$i&&$i.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p8,"__esModule",{value:!0});var F3=p8.default=_X,xX=yX(vX);function _X(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,xX.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var a=s.property,o=s.value;i?t(a,o,s):o&&(n=n||{},n[a]=o)}}),n}const bX=F3.default||F3,m8=g8("end"),SS=g8("start");function g8(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 wX(e){const t=SS(e),n=m8(e);if(t&&n)return{start:t,end:n}}function Dd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?z3(e.position):"start"in e||"end"in e?z3(e):"line"in e||"column"in e?Z_(e):""}function Z_(e){return H3(e&&e.line)+":"+H3(e&&e.column)}function z3(e){return Z_(e&&e.start)+"-"+Z_(e&&e.end)}function H3(e){return e&&typeof e=="number"?e:1}class Gn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=Dd(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}Gn.prototype.file="";Gn.prototype.name="";Gn.prototype.reason="";Gn.prototype.message="";Gn.prototype.stack="";Gn.prototype.column=void 0;Gn.prototype.line=void 0;Gn.prototype.ancestors=void 0;Gn.prototype.cause=void 0;Gn.prototype.fatal=void 0;Gn.prototype.place=void 0;Gn.prototype.ruleId=void 0;Gn.prototype.source=void 0;const CS={}.hasOwnProperty,SX=new Map,CX=/[A-Z]/g,kX=/-([a-z])/g,EX=new Set(["table","tbody","thead","tfoot","tr"]),TX=new Set(["td","th"]),v8="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function MX(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=OX(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=PX(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?wS:sX,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=y8(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function y8(e,t,n){if(t.type==="element")return RX(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AX(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return LX(e,t,n);if(t.type==="mdxjsEsm")return jX(e,t);if(t.type==="root")return DX(e,t,n);if(t.type==="text")return NX(e,t)}function RX(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wS,e.schema=i),e.ancestors.push(t);const s=_8(e,t.tagName,!1),a=IX(e,t);let o=ES(e,t);return EX.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!KY(l):!0})),x8(e,a,s,t),kS(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function AX(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ch(e,t.position)}function jX(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ch(e,t.position)}function LX(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=wS,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:_8(e,t.name,!0),a=$X(e,t),o=ES(e,t);return x8(e,a,s,t),kS(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function DX(e,t,n){const r={};return kS(r,ES(e,t)),e.create(t,e.Fragment,r,n)}function NX(e,t){return t.value}function x8(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kS(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function PX(e,t,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:t;return o?c(s,a,o):c(s,a)}}function OX(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=SS(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function IX(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&CS.call(t.properties,i)){const s=BX(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&TX.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function $X(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else ch(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else ch(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function ES(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:SX;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;a=l+"-"+c,i.set(l,c+1)}}const o=y8(e,s,a);o!==void 0&&n.push(o)}return n}function BX(e,t,n){const r=tX(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?WY(n):oX(n)),r.property==="style"){let i=typeof n=="object"?n:FX(e,String(n));return e.stylePropertyNameCase==="css"&&(i=zX(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?iX[r.property]||r.property:r.attribute,n]}}function FX(e,t){const n={};try{bX(t,r)}catch(i){if(!e.ignoreInvalidStyle){const s=i,a=new Gn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=v8+"#cannot-parse-style-attribute",a}}return n;function r(i,s){let a=i;a.slice(0,2)!=="--"&&(a.slice(0,4)==="-ms-"&&(a="ms-"+a.slice(4)),a=a.replace(kX,WX)),n[a]=s}}function _8(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=L3(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=L3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return CS.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ch(e)}function ch(e,t){const n=new Gn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=v8+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zX(e){const t={};let n;for(n in e)CS.call(e,n)&&(t[HX(n)]=e[n]);return t}function HX(e){let t=e.replace(CX,UX);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function WX(e,t){return t.toUpperCase()}function UX(e){return"-"+e.toLowerCase()}const Dy={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"]},VX={};function qX(e,t){const n=VX,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return b8(e,r,i)}function b8(e,t,n){if(GX(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 W3(e.children,t,n)}return Array.isArray(e)?W3(e,t,n):""}function W3(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=b8(e[i],t,n);return r.join("")}function GX(e){return!!(e&&typeof e=="object")}const U3=document.createElement("i");function TS(e){const t="&"+e+";";U3.innerHTML=t;const n=U3.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ki(e,t,n,r){const i=e.length;let s=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);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function Fr(e,t){return e.length>0?(Ki(e,e.length,0,t),e):t}const V3={}.hasOwnProperty;function KX(e){const t={};let n=-1;for(;++n<e.length;)YX(t,e[n]);return t}function YX(e,t){let n;for(n in t){const i=(V3.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){V3.call(i,a)||(i[a]=[]);const o=s[a];XX(i[a],Array.isArray(o)?o:o?[o]:[])}}}function XX(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ki(e,0,0,r)}function w8(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 Jl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pi=Bo(/[A-Za-z]/),Tr=Bo(/[\dA-Za-z]/),JX=Bo(/[#-'*+\--9=?A-Z^-~]/);function eb(e){return e!==null&&(e<32||e===127)}const tb=Bo(/\d/),QX=Bo(/[\dA-Fa-f]/),ZX=Bo(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function gr(e){return e!==null&&(e<0||e===32)}function vt(e){return e===-2||e===-1||e===32}const eJ=Bo(new RegExp("\\p{P}|\\p{S}","u")),tJ=Bo(/\s/);function Bo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gc(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&Tr(e.charCodeAt(n+1))&&Tr(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);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 Pt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return vt(l)?(e.enter(n),o(l)):t(l)}function o(l){return vt(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const nJ={tokenize:rJ};function rJ(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Pt(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return $e(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const iJ={tokenize:sJ},q3={tokenize:oJ};function sJ(e){const t=this,n=[];let r=0,i,s,a;return o;function o(x){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&p();const b=t.events.length;let S=b,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}m(r);let E=b;for(;E<t.events.length;)t.events[E][1].end={...C},E++;return Ki(t.events,S+1,0,t.events.slice(b)),t.events.length=E,c(x)}return o(x)}function c(x){if(r===n.length){if(!i)return f(x);if(i.currentConstruct&&i.currentConstruct.concrete)return _(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(q3,h,d)(x)}function h(x){return i&&p(),m(r),f(x)}function d(x){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,_(x)}function f(x){return t.containerState={},e.attempt(q3,g,_)(x)}function g(x){return r++,n.push([t.currentConstruct,t.containerState]),f(x)}function _(x){if(x===null){i&&p(),m(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),y(x)}function y(x){if(x===null){v(e.exit("chunkFlow"),!0),m(0),e.consume(x);return}return $e(x)?(e.consume(x),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(x),y)}function v(x,b){const S=t.sliceStream(x);if(b&&S.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(S),t.parser.lazy[x.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 E=t.events.length;let k=E,T,R;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(T){R=t.events[k][1].end;break}T=!0}for(m(r),C=E;C<t.events.length;)t.events[C][1].end={...R},C++;Ki(t.events,k+1,0,t.events.slice(E)),t.events.length=C}}function m(x){let b=n.length;for(;b-- >x;){const S=n[b];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function p(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function oJ(e,t,n){return Pt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function G3(e){if(e===null||gr(e)||tJ(e))return 1;if(eJ(e))return 2}function MS(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const nb={name:"attention",resolveAll:aJ,tokenize:lJ};function aJ(e,t){let n=-1,r,i,s,a,o,l,c,h;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 d={...e[r][1].end},f={...e[n][1].start};K3(d,-l),K3(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Fr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Fr(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Fr(c,MS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Fr(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=Fr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ki(e,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function lJ(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=G3(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const c=e.exit("attentionSequence"),h=G3(l),d=!h||h===2&&i||n.includes(l),f=!i||i===2&&h||n.includes(r);return c._open=!!(s===42?d:d&&(i||!f)),c._close=!!(s===42?f:f&&(h||!d)),t(l)}}function K3(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const cJ={name:"autolink",tokenize:uJ};function uJ(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"),s}function s(g){return Pi(g)?(e.consume(g),a):g===64?n(g):c(g)}function a(g){return g===43||g===45||g===46||Tr(g)?(r=1,o(g)):c(g)}function o(g){return g===58?(e.consume(g),r=0,l):(g===43||g===45||g===46||Tr(g))&&r++<32?(e.consume(g),o):(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||eb(g)?n(g):(e.consume(g),l)}function c(g){return g===64?(e.consume(g),h):JX(g)?(e.consume(g),c):n(g)}function h(g){return Tr(g)?d(g):n(g)}function d(g){return g===46?(e.consume(g),r=0,h):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):f(g)}function f(g){if((g===45||Tr(g))&&r++<63){const _=g===45?f:d;return e.consume(g),_}return n(g)}}const Gv={partial:!0,tokenize:dJ};function dJ(e,t,n){return r;function r(s){return vt(s)?Pt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||$e(s)?t(s):n(s)}}const S8={continuation:{tokenize:fJ},exit:pJ,name:"blockQuote",tokenize:hJ};function hJ(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return vt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function fJ(e,t,n){const r=this;return i;function i(a){return vt(a)?Pt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(S8,t,n)(a)}}function pJ(e){e.exit("blockQuote")}const C8={name:"characterEscape",tokenize:mJ};function mJ(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return ZX(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const k8={name:"characterReference",tokenize:gJ};function gJ(e,t,n){const r=this;let i=0,s,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,a=Tr,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=QX,h):(e.enter("characterReferenceValue"),s=7,a=tb,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===Tr&&!TS(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<s?(e.consume(d),h):n(d)}}const Y3={partial:!0,tokenize:yJ},X3={concrete:!0,name:"codeFenced",tokenize:vJ};function vJ(e,t,n){const r=this,i={partial:!0,tokenize:S};let s=0,a=0,o;return l;function l(C){return c(C)}function c(C){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(C)}function h(C){return C===o?(a++,e.consume(C),h):a<3?n(C):(e.exit("codeFencedFenceSequence"),vt(C)?Pt(e,d,"whitespace")(C):d(C))}function d(C){return C===null||$e(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Y3,y,b)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||$e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):vt(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Pt(e,g,"whitespace")(C)):C===96&&C===o?n(C):(e.consume(C),f)}function g(C){return C===null||$e(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(C))}function _(C){return C===null||$e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===o?n(C):(e.consume(C),_)}function y(C){return e.attempt(i,b,v)(C)}function v(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),m}function m(C){return s>0&&vt(C)?Pt(e,p,"linePrefix",s+1)(C):p(C)}function p(C){return C===null||$e(C)?e.check(Y3,y,b)(C):(e.enter("codeFlowValue"),x(C))}function x(C){return C===null||$e(C)?(e.exit("codeFlowValue"),p(C)):(e.consume(C),x)}function b(C){return e.exit("codeFenced"),t(C)}function S(C,E,k){let T=0;return R;function R(P){return C.enter("lineEnding"),C.consume(P),C.exit("lineEnding"),M}function M(P){return C.enter("codeFencedFence"),vt(P)?Pt(C,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):L(P)}function L(P){return P===o?(C.enter("codeFencedFenceSequence"),D(P)):k(P)}function D(P){return P===o?(T++,C.consume(P),D):T>=a?(C.exit("codeFencedFenceSequence"),vt(P)?Pt(C,N,"whitespace")(P):N(P)):k(P)}function N(P){return P===null||$e(P)?(C.exit("codeFencedFence"),E(P)):k(P)}}}function yJ(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"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ny={name:"codeIndented",tokenize:_J},xJ={partial:!0,tokenize:bJ};function _J(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Pt(e,s,"linePrefix",5)(c)}function s(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):$e(c)?e.attempt(xJ,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||$e(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function bJ(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):$e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Pt(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):$e(a)?i(a):n(a)}}const wJ={name:"codeText",previous:CJ,resolve:SJ,tokenize:kJ};function SJ(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 CJ(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function kJ(e,t,n){let r=0,i,s;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,h(d)):$e(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||$e(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class EJ{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Pu(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Pu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Pu(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Pu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Pu(this.left,n.reverse())}}}function Pu(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function E8(e){const t={};let n=-1,r,i,s,a,o,l,c;const h=new EJ(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,TJ(h,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(a=h.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return Ki(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function TJ(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[],a=n._tokenizer||r.parser[n.contentType](n.start),o=a.events,l=[],c={};let h,d,f=-1,g=n,_=0,y=0;const v=[y];for(;g;){for(;e.get(++i)[1]!==g;);s.push(i),g._tokenizer||(h=r.sliceStream(g),g.next||h.push(null),d&&a.defineSkip(g.start),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),g._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=g,g=g.next}for(g=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(y=f+1,v.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):v.pop(),f=v.length;f--;){const m=o.slice(v[f],v[f+1]),p=s.pop();l.push([p,p+m.length-1]),e.splice(p,2,m)}for(l.reverse(),f=-1;++f<l.length;)c[_+l[f][0]]=_+l[f][1],_+=l[f][1]-l[f][0]-1;return c}const MJ={resolve:AJ,tokenize:jJ},RJ={partial:!0,tokenize:LJ};function AJ(e){return E8(e),e}function jJ(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):$e(o)?e.check(RJ,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function LJ(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Pt(e,s,"linePrefix")}function s(a){if(a===null||$e(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function T8(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(m){return m===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(m),e.exit(s),f):m===null||m===32||m===41||eb(m)?n(m):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(m))}function f(m){return m===62?(e.enter(s),e.consume(m),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),g(m))}function g(m){return m===62?(e.exit("chunkString"),e.exit(o),f(m)):m===null||m===60||$e(m)?n(m):(e.consume(m),m===92?_:g)}function _(m){return m===60||m===62||m===92?(e.consume(m),g):g(m)}function y(m){return!h&&(m===null||m===41||gr(m))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(m)):h<c&&m===40?(e.consume(m),h++,y):m===41?(e.consume(m),h--,y):m===null||m===32||m===40||eb(m)?n(m):(e.consume(m),m===92?v:y)}function v(m){return m===40||m===41||m===92?(e.consume(m),y):y(m)}}function M8(e,t,n,r,i,s){const a=this;let o=0,l;return c;function c(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(s),h}function h(g){return o>999||g===null||g===91||g===93&&!l||g===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(e.exit(s),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):$e(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===null||g===91||g===93||$e(g)||o++>999?(e.exit("chunkString"),h(g)):(e.consume(g),l||(l=!vt(g)),g===92?f:d)}function f(g){return g===91||g===92||g===93?(e.consume(g),o++,d):d(g)}}function R8(e,t,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===a?(e.exit(s),l(a)):f===null?n(f):$e(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Pt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||$e(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Nd(e,t){let n;return r;function r(i){return $e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):vt(i)?Pt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const DJ={name:"definition",tokenize:PJ},NJ={partial:!0,tokenize:OJ};function PJ(e,t,n){const r=this;let i;return s;function s(g){return e.enter("definition"),a(g)}function a(g){return M8.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return i=Jl(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 gr(g)?Nd(e,c)(g):c(g)}function c(g){return T8(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return e.attempt(NJ,d,d)(g)}function d(g){return vt(g)?Pt(e,f,"whitespace")(g):f(g)}function f(g){return g===null||$e(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function OJ(e,t,n){return r;function r(o){return gr(o)?Nd(e,i)(o):n(o)}function i(o){return R8(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return vt(o)?Pt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||$e(o)?t(o):n(o)}}const IJ={name:"hardBreakEscape",tokenize:$J};function $J(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return $e(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const BJ={name:"headingAtx",resolve:FJ,tokenize:zJ};function FJ(e,t){let n=e.length-2,r=3,i,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ki(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function zJ(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||gr(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),l(h)):h===null||$e(h)?(e.exit("atxHeading"),t(h)):vt(h)?Pt(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function l(h){return h===35?(e.consume(h),l):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||gr(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const HJ=["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"],J3=["pre","script","style","textarea"],WJ={concrete:!0,name:"htmlFlow",resolveTo:qJ,tokenize:GJ},UJ={partial:!0,tokenize:YJ},VJ={partial:!0,tokenize:KJ};function qJ(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 GJ(e,t,n){const r=this;let i,s,a,o,l;return c;function c(B){return h(B)}function h(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),d}function d(B){return B===33?(e.consume(B),f):B===47?(e.consume(B),s=!0,y):B===63?(e.consume(B),i=3,r.interrupt?t:A):Pi(B)?(e.consume(B),a=String.fromCharCode(B),v):n(B)}function f(B){return B===45?(e.consume(B),i=2,g):B===91?(e.consume(B),i=5,o=0,_):Pi(B)?(e.consume(B),i=4,r.interrupt?t:A):n(B)}function g(B){return B===45?(e.consume(B),r.interrupt?t:A):n(B)}function _(B){const G="CDATA[";return B===G.charCodeAt(o++)?(e.consume(B),o===G.length?r.interrupt?t:L:_):n(B)}function y(B){return Pi(B)?(e.consume(B),a=String.fromCharCode(B),v):n(B)}function v(B){if(B===null||B===47||B===62||gr(B)){const G=B===47,Q=a.toLowerCase();return!G&&!s&&J3.includes(Q)?(i=1,r.interrupt?t(B):L(B)):HJ.includes(a.toLowerCase())?(i=6,G?(e.consume(B),m):r.interrupt?t(B):L(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):s?p(B):x(B))}return B===45||Tr(B)?(e.consume(B),a+=String.fromCharCode(B),v):n(B)}function m(B){return B===62?(e.consume(B),r.interrupt?t:L):n(B)}function p(B){return vt(B)?(e.consume(B),p):R(B)}function x(B){return B===47?(e.consume(B),R):B===58||B===95||Pi(B)?(e.consume(B),b):vt(B)?(e.consume(B),x):R(B)}function b(B){return B===45||B===46||B===58||B===95||Tr(B)?(e.consume(B),b):S(B)}function S(B){return B===61?(e.consume(B),C):vt(B)?(e.consume(B),S):x(B)}function C(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),l=B,E):vt(B)?(e.consume(B),C):k(B)}function E(B){return B===l?(e.consume(B),l=null,T):B===null||$e(B)?n(B):(e.consume(B),E)}function k(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||gr(B)?S(B):(e.consume(B),k)}function T(B){return B===47||B===62||vt(B)?x(B):n(B)}function R(B){return B===62?(e.consume(B),M):n(B)}function M(B){return B===null||$e(B)?L(B):vt(B)?(e.consume(B),M):n(B)}function L(B){return B===45&&i===2?(e.consume(B),I):B===60&&i===1?(e.consume(B),z):B===62&&i===4?(e.consume(B),F):B===63&&i===3?(e.consume(B),A):B===93&&i===5?(e.consume(B),j):$e(B)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(UJ,H,D)(B)):B===null||$e(B)?(e.exit("htmlFlowData"),D(B)):(e.consume(B),L)}function D(B){return e.check(VJ,N,H)(B)}function N(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),P}function P(B){return B===null||$e(B)?D(B):(e.enter("htmlFlowData"),L(B))}function I(B){return B===45?(e.consume(B),A):L(B)}function z(B){return B===47?(e.consume(B),a="",O):L(B)}function O(B){if(B===62){const G=a.toLowerCase();return J3.includes(G)?(e.consume(B),F):L(B)}return Pi(B)&&a.length<8?(e.consume(B),a+=String.fromCharCode(B),O):L(B)}function j(B){return B===93?(e.consume(B),A):L(B)}function A(B){return B===62?(e.consume(B),F):B===45&&i===2?(e.consume(B),A):L(B)}function F(B){return B===null||$e(B)?(e.exit("htmlFlowData"),H(B)):(e.consume(B),F)}function H(B){return e.exit("htmlFlow"),t(B)}}function KJ(e,t,n){const r=this;return i;function i(a){return $e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function YJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Gv,t,n)}}const XJ={name:"htmlText",tokenize:JJ};function JJ(e,t,n){const r=this;let i,s,a;return o;function o(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),S):A===63?(e.consume(A),x):Pi(A)?(e.consume(A),k):n(A)}function c(A){return A===45?(e.consume(A),h):A===91?(e.consume(A),s=0,_):Pi(A)?(e.consume(A),p):n(A)}function h(A){return A===45?(e.consume(A),g):n(A)}function d(A){return A===null?n(A):A===45?(e.consume(A),f):$e(A)?(a=d,z(A)):(e.consume(A),d)}function f(A){return A===45?(e.consume(A),g):d(A)}function g(A){return A===62?I(A):A===45?f(A):d(A)}function _(A){const F="CDATA[";return A===F.charCodeAt(s++)?(e.consume(A),s===F.length?y:_):n(A)}function y(A){return A===null?n(A):A===93?(e.consume(A),v):$e(A)?(a=y,z(A)):(e.consume(A),y)}function v(A){return A===93?(e.consume(A),m):y(A)}function m(A){return A===62?I(A):A===93?(e.consume(A),m):y(A)}function p(A){return A===null||A===62?I(A):$e(A)?(a=p,z(A)):(e.consume(A),p)}function x(A){return A===null?n(A):A===63?(e.consume(A),b):$e(A)?(a=x,z(A)):(e.consume(A),x)}function b(A){return A===62?I(A):x(A)}function S(A){return Pi(A)?(e.consume(A),C):n(A)}function C(A){return A===45||Tr(A)?(e.consume(A),C):E(A)}function E(A){return $e(A)?(a=E,z(A)):vt(A)?(e.consume(A),E):I(A)}function k(A){return A===45||Tr(A)?(e.consume(A),k):A===47||A===62||gr(A)?T(A):n(A)}function T(A){return A===47?(e.consume(A),I):A===58||A===95||Pi(A)?(e.consume(A),R):$e(A)?(a=T,z(A)):vt(A)?(e.consume(A),T):I(A)}function R(A){return A===45||A===46||A===58||A===95||Tr(A)?(e.consume(A),R):M(A)}function M(A){return A===61?(e.consume(A),L):$e(A)?(a=M,z(A)):vt(A)?(e.consume(A),M):T(A)}function L(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,D):$e(A)?(a=L,z(A)):vt(A)?(e.consume(A),L):(e.consume(A),N)}function D(A){return A===i?(e.consume(A),i=void 0,P):A===null?n(A):$e(A)?(a=D,z(A)):(e.consume(A),D)}function N(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||gr(A)?T(A):(e.consume(A),N)}function P(A){return A===47||A===62||gr(A)?T(A):n(A)}function I(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function z(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return vt(A)?Pt(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):j(A)}function j(A){return e.enter("htmlTextData"),a(A)}}const RS={name:"labelEnd",resolveAll:tQ,resolveTo:nQ,tokenize:rQ},QJ={tokenize:iQ},ZJ={tokenize:sQ},eQ={tokenize:oQ};function tQ(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ki(e,0,e.length,n),e}function nQ(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){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&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},h={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=Fr(o,e.slice(s+1,s+r+3)),o=Fr(o,[["enter",h,t]]),o=Fr(o,MS(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=Fr(o,[["exit",h,t],e[a-2],e[a-1],["exit",c,t]]),o=Fr(o,e.slice(a+1)),o=Fr(o,[["exit",l,t]]),Ki(e,s,e.length,o),e}function rQ(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(f){return s?s._inactive?d(f):(a=r.parser.defined.includes(Jl(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(QJ,h,a?h:d)(f):f===91?e.attempt(ZJ,h,a?c:d)(f):a?h(f):d(f)}function c(f){return e.attempt(eQ,h,d)(f)}function h(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function iQ(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return gr(d)?Nd(e,s)(d):s(d)}function s(d){return d===41?h(d):T8(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return gr(d)?Nd(e,l)(d):h(d)}function o(d){return n(d)}function l(d){return d===34||d===39||d===40?R8(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return gr(d)?Nd(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function sQ(e,t,n){const r=this;return i;function i(o){return M8.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Jl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function oQ(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const aQ={name:"labelStartImage",resolveAll:RS.resolveAll,tokenize:lQ};function lQ(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const cQ={name:"labelStartLink",resolveAll:RS.resolveAll,tokenize:uQ};function uQ(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"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Py={name:"lineEnding",tokenize:dQ};function dQ(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Pt(e,t,"linePrefix")}}const om={name:"thematicBreak",tokenize:hQ};function hQ(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||$e(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),vt(c)?Pt(e,o,"whitespace")(c):o(c))}}const sr={continuation:{tokenize:gQ},exit:yQ,name:"list",tokenize:mQ},fQ={partial:!0,tokenize:xQ},pQ={partial:!0,tokenize:vQ};function mQ(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(g){const _=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:tb(g)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(om,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 tb(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(Gv,r.interrupt?n:h,e.attempt(fQ,f,d))}function h(g){return r.containerState.initialBlankLine=!0,s++,f(g)}function d(g){return vt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),f):n(g)}function f(g){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function gQ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Gv,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Pt(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!vt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pQ,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Pt(e,e.attempt(sr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function vQ(e,t,n){const r=this;return Pt(e,i,"listItemIndent",r.containerState.size+1);function i(s){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(s):n(s)}}function yQ(e){e.exit(this.containerState.type)}function xQ(e,t,n){const r=this;return Pt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!vt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Q3={name:"setextUnderline",resolveTo:_Q,tokenize:bQ};function _Q(e,t){let n=e.length,r,i,s;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),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function bQ(e,t,n){const r=this;let i;return s;function s(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),vt(c)?Pt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||$e(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const wQ={tokenize:SQ};function SQ(e){const t=this,n=e.attempt(Gv,r,e.attempt(this.parser.constructs.flowInitial,i,Pt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(MJ,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const CQ={resolveAll:j8()},kQ=A8("string"),EQ=A8("text");function A8(e){return{resolveAll:j8(e==="text"?TQ:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(h){return c(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),l}function l(h){return c(h)?(n.exit("data"),s(h)):(n.consume(h),l)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const g=d[f];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function j8(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function TQ(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 s=i.length,a=-1,o=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(c===-2)l=!0,o++;else if(c!==-1){s++;break}}if(o){const c={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...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}const MQ={42:sr,43:sr,45:sr,48:sr,49:sr,50:sr,51:sr,52:sr,53:sr,54:sr,55:sr,56:sr,57:sr,62:S8},RQ={91:DJ},AQ={[-2]:Ny,[-1]:Ny,32:Ny},jQ={35:BJ,42:om,45:[Q3,om],60:WJ,61:Q3,95:om,96:X3,126:X3},LQ={38:k8,92:C8},DQ={[-5]:Py,[-4]:Py,[-3]:Py,33:aQ,38:k8,42:nb,60:[cJ,XJ],91:cQ,92:[IJ,C8],93:RS,95:nb,96:wJ},NQ={null:[nb,CQ]},PQ={null:[42,95]},OQ={null:[]},IQ=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:PQ,contentInitial:RQ,disable:OQ,document:MQ,flow:jQ,flowInitial:AQ,insideSpan:NQ,string:LQ,text:DQ},Symbol.toStringTag,{value:"Module"}));function $Q(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:E(S),check:E(C),consume:p,enter:x,exit:b,interrupt:E(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:y,events:[],now:_,parser:e,previous:null,sliceSerialize:f,sliceStream:g,write:d};let h=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(M){return a=Fr(a,M),v(),a[a.length-1]!==null?[]:(k(t,0),c.events=MS(s,c.events,c),c.events)}function f(M,L){return FQ(g(M),L)}function g(M){return BQ(a,M)}function _(){const{_bufferIndex:M,_index:L,line:D,column:N,offset:P}=r;return{_bufferIndex:M,_index:L,line:D,column:N,offset:P}}function y(M){i[M.line]=M.column,R()}function v(){let M;for(;r._index<a.length;){const L=a[r._index];if(typeof L=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<L.length;)m(L.charCodeAt(r._bufferIndex));else m(L)}}function m(M){h=h(M)}function p(M){$e(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,R()):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 x(M,L){const D=L||{};return D.type=M,D.start=_(),c.events.push(["enter",D,c]),o.push(D),D}function b(M){const L=o.pop();return L.end=_(),c.events.push(["exit",L,c]),L}function S(M,L){k(M,L.from)}function C(M,L){L.restore()}function E(M,L){return D;function D(N,P,I){let z,O,j,A;return Array.isArray(N)?H(N):"tokenize"in N?H([N]):F(N);function F(Y){return W;function W($){const V=$!==null&&Y[$],U=$!==null&&Y.null,X=[...Array.isArray(V)?V:V?[V]:[],...Array.isArray(U)?U:U?[U]:[]];return H(X)($)}}function H(Y){return z=Y,O=0,Y.length===0?I:B(Y[O])}function B(Y){return W;function W($){return A=T(),j=Y,Y.partial||(c.currentConstruct=Y),Y.name&&c.parser.constructs.disable.null.includes(Y.name)?Q():Y.tokenize.call(L?Object.assign(Object.create(c),L):c,l,G,Q)($)}}function G(Y){return M(j,A),P}function Q(Y){return A.restore(),++O<z.length?B(z[O]):I}}}function k(M,L){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&Ki(c.events,L,c.events.length-L,M.resolve(c.events.slice(L),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function T(){const M=_(),L=c.previous,D=c.currentConstruct,N=c.events.length,P=Array.from(o);return{from:N,restore:I};function I(){r=M,c.previous=L,c.currentConstruct=D,c.events.length=N,o=P,R()}}function R(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function BQ(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function FQ(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){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(s)}i=s===-2,r.push(a)}return r.join("")}function zQ(e){const r={constructs:KX([IQ,...(e||{}).extensions||[]]),content:i(nJ),defined:[],document:i(iJ),flow:i(wQ),lazy:{},string:i(kQ),text:i(EQ)};return r;function i(s){return a;function a(o){return $Q(r,s,o)}}}function HQ(e){for(;!E8(e););return e}const Z3=/[\0\t\n\r]/g;function WQ(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let c,h,d,f,g;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Z3.lastIndex=d,c=Z3.exec(s),f=c&&c.index!==void 0?c.index:s.length,g=s.charCodeAt(f),!c){t=s.slice(d);break}if(g===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),e+=f-d),g){case 0:{l.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,l.push(-2);e++<h;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const UQ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VQ(e){return e.replace(UQ,qQ)}function qQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return w8(n.slice(s?2:1),s?16:10)}return TS(n)||e}const L8={}.hasOwnProperty;function GQ(e,t,n){return typeof t!="string"&&(n=t,t=void 0),KQ(n)(HQ(zQ(n).document().write(WQ()(e,t,!0))))}function KQ(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Me),autolinkProtocol:T,autolinkEmail:T,atxHeading:s(le),blockQuote:s(U),characterEscape:T,characterReference:T,codeFenced:s(X),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(X,a),codeText:s(q,a),codeTextData:T,data:T,codeFlowValue:T,definition:s(re),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(ne),hardBreakEscape:s(ve),hardBreakTrailing:s(ve),htmlFlow:s(ae,a),htmlFlowData:T,htmlText:s(ae,a),htmlTextData:T,image:s(Ee),label:a,link:s(Me),listItem:s(we),listItemValue:f,listOrdered:s(xe,d),listUnordered:s(xe),paragraph:s(se),reference:B,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(le),strong:s(ee),thematicBreak:s(ce)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:V,autolinkProtocol:$,blockQuote:l(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:Q,characterReferenceMarkerNumeric:Q,characterReferenceValue:Y,characterReference:W,codeFenced:l(v),codeFencedFence:y,codeFencedFenceInfo:g,codeFencedFenceMeta:_,codeFlowValue:R,codeIndented:l(m),codeText:l(P),codeTextData:R,data:R,definition:l(),definitionDestinationString:b,definitionLabelString:p,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(D),htmlFlowData:R,htmlText:l(N),htmlTextData:R,image:l(z),label:j,labelText:O,lineEnding:M,link:l(I),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:G,resourceDestinationString:A,resourceTitleString:F,resource:H,setextHeading:l(k),setextHeadingLineSequence:E,setextHeadingText:C,strong:l(),thematicBreak:l()}};D8(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let te={type:"root",children:[]};const oe={stack:[te],tokenStack:[],config:t,enter:o,exit:c,buffer:a,resume:h,data:n},he=[];let _e=-1;for(;++_e<K.length;)if(K[_e][1].type==="listOrdered"||K[_e][1].type==="listUnordered")if(K[_e][0]==="enter")he.push(_e);else{const ge=he.pop();_e=i(K,ge,_e)}for(_e=-1;++_e<K.length;){const ge=t[K[_e][0]];L8.call(ge,K[_e][1].type)&&ge[K[_e][1].type].call(Object.assign({sliceSerialize:K[_e][2].sliceSerialize},oe),K[_e][1])}if(oe.tokenStack.length>0){const ge=oe.tokenStack[oe.tokenStack.length-1];(ge[1]||e4).call(oe,void 0,ge[0])}for(te.position={start:Vs(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Vs(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)te=t.transforms[_e](te)||te;return te}function i(K,te,oe){let he=te-1,_e=-1,ge=!1,ye,ze,Oe,je;for(;++he<=oe;){const Le=K[he];switch(Le[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Le[0]==="enter"?_e++:_e--,je=void 0;break}case"lineEndingBlank":{Le[0]==="enter"&&(ye&&!je&&!_e&&!Oe&&(Oe=he),je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:je=void 0}if(!_e&&Le[0]==="enter"&&Le[1].type==="listItemPrefix"||_e===-1&&Le[0]==="exit"&&(Le[1].type==="listUnordered"||Le[1].type==="listOrdered")){if(ye){let pt=he;for(ze=void 0;pt--;){const Te=K[pt];if(Te[1].type==="lineEnding"||Te[1].type==="lineEndingBlank"){if(Te[0]==="exit")continue;ze&&(K[ze][1].type="lineEndingBlank",ge=!0),Te[1].type="lineEnding",ze=pt}else if(!(Te[1].type==="linePrefix"||Te[1].type==="blockQuotePrefix"||Te[1].type==="blockQuotePrefixWhitespace"||Te[1].type==="blockQuoteMarker"||Te[1].type==="listItemIndent"))break}Oe&&(!ze||Oe<ze)&&(ye._spread=!0),ye.end=Object.assign({},ze?K[ze][1].start:Le[1].end),K.splice(ze||he,0,["exit",ye,Le[2]]),he++,oe++}if(Le[1].type==="listItemPrefix"){const pt={type:"listItem",_spread:!1,start:Object.assign({},Le[1].start),end:void 0};ye=pt,K.splice(he,0,["enter",pt,Le[2]]),he++,oe++,Oe=void 0,je=!0}}}return K[te][1]._spread=ge,oe}function s(K,te){return oe;function oe(he){o.call(this,K(he),he),te&&te.call(this,he)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(K,te,oe){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([te,oe||void 0]),K.position={start:Vs(te.start),end:void 0}}function l(K){return te;function te(oe){K&&K.call(this,oe),c.call(this,oe)}}function c(K,te){const oe=this.stack.pop(),he=this.tokenStack.pop();if(he)he[0].type!==K.type&&(te?te.call(this,K,he[0]):(he[1]||e4).call(this,K,he[0]));else throw new Error("Cannot close `"+K.type+"` ("+Dd({start:K.start,end:K.end})+"): it’s not open");oe.position.end=Vs(K.end)}function h(){return qX(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(K){if(this.data.expectingFirstListItemValue){const te=this.stack[this.stack.length-2];te.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function g(){const K=this.resume(),te=this.stack[this.stack.length-1];te.lang=K}function _(){const K=this.resume(),te=this.stack[this.stack.length-1];te.meta=K}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const K=this.resume(),te=this.stack[this.stack.length-1];te.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const K=this.resume(),te=this.stack[this.stack.length-1];te.value=K.replace(/(\r?\n|\r)$/g,"")}function p(K){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.label=te,oe.identifier=Jl(this.sliceSerialize(K)).toLowerCase()}function x(){const K=this.resume(),te=this.stack[this.stack.length-1];te.title=K}function b(){const K=this.resume(),te=this.stack[this.stack.length-1];te.url=K}function S(K){const te=this.stack[this.stack.length-1];if(!te.depth){const oe=this.sliceSerialize(K).length;te.depth=oe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function E(K){const te=this.stack[this.stack.length-1];te.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function T(K){const oe=this.stack[this.stack.length-1].children;let he=oe[oe.length-1];(!he||he.type!=="text")&&(he=ie(),he.position={start:Vs(K.start),end:void 0},oe.push(he)),this.stack.push(he)}function R(K){const te=this.stack.pop();te.value+=this.sliceSerialize(K),te.position.end=Vs(K.end)}function M(K){const te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=te.children[te.children.length-1];oe.position.end=Vs(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(te.type)&&(T.call(this,K),R.call(this,K))}function L(){this.data.atHardBreak=!0}function D(){const K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function N(){const K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function P(){const K=this.resume(),te=this.stack[this.stack.length-1];te.value=K}function I(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=te,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function z(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const te=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=te,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function O(K){const te=this.sliceSerialize(K),oe=this.stack[this.stack.length-2];oe.label=VQ(te),oe.identifier=Jl(te).toLowerCase()}function j(){const K=this.stack[this.stack.length-1],te=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const he=K.children;oe.children=he}else oe.alt=te}function A(){const K=this.resume(),te=this.stack[this.stack.length-1];te.url=K}function F(){const K=this.resume(),te=this.stack[this.stack.length-1];te.title=K}function H(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function G(K){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.label=te,oe.identifier=Jl(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function Q(K){this.data.characterReferenceType=K.type}function Y(K){const te=this.sliceSerialize(K),oe=this.data.characterReferenceType;let he;oe?(he=w8(te,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):he=TS(te);const _e=this.stack[this.stack.length-1];_e.value+=he}function W(K){const te=this.stack.pop();te.position.end=Vs(K.end)}function $(K){R.call(this,K);const te=this.stack[this.stack.length-1];te.url=this.sliceSerialize(K)}function V(K){R.call(this,K);const te=this.stack[this.stack.length-1];te.url="mailto:"+this.sliceSerialize(K)}function U(){return{type:"blockquote",children:[]}}function X(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ne(){return{type:"emphasis",children:[]}}function le(){return{type:"heading",depth:0,children:[]}}function ve(){return{type:"break"}}function ae(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function xe(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function we(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function se(){return{type:"paragraph",children:[]}}function ee(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}function Vs(e){return{line:e.line,column:e.column,offset:e.offset}}function D8(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?D8(e,r):YQ(e,r)}}function YQ(e,t){let n;for(n in t)if(L8.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 e4(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Dd({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dd({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dd({start:t.start,end:t.end})+") is still open")}function XQ(e){const t=this;t.parser=n;function n(r){return GQ(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function JQ(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 QQ(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function ZQ(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 eZ(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tZ(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nZ(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Gc(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),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 rZ(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 iZ(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function N8(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),s=i[0];s&&s.type==="text"?s.value="["+s.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 sZ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return N8(e,t);const i={src:Gc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function oZ(e,t){const n={src:Gc(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 aZ(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 lZ(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return N8(e,t);const i={href:Gc(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function cZ(e,t){const n={href:Gc(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 uZ(e,t,n){const r=e.all(t),i=n?dZ(n):P8(t),s={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const h=r[o];(i||o!==0||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
`}),h.type==="element"&&h.tagName==="p"&&!i?a.push(...h.children):a.push(h)}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:s,children:a};return e.patch(t,c),e.applyData(t,c)}function dZ(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=P8(n[r])}return t}function P8(e){const t=e.spread;return t??e.children.length>1}function hZ(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 s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function fZ(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pZ(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mZ(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gZ(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)},o=SS(t.children[1]),l=m8(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function vZ(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l<o;){const d=t.children[l],f={},g=a?a[l]:void 0;g&&(f.align=g);let _={type:"element",tagName:s,properties:f,children:[]};d&&(_.children=e.all(d),e.patch(d,_),_=e.applyData(d,_)),c.push(_)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function yZ(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const t4=9,n4=32;function xZ(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(r4(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(r4(t.slice(i),i>0,!1)),s.join("")}function r4(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===t4||s===n4;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===t4||s===n4;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _Z(e,t){const n={type:"text",value:xZ(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function bZ(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const wZ={blockquote:JQ,break:QQ,code:ZQ,delete:eZ,emphasis:tZ,footnoteReference:nZ,heading:rZ,html:iZ,imageReference:sZ,image:oZ,inlineCode:aZ,linkReference:lZ,link:cZ,listItem:uZ,list:hZ,paragraph:fZ,root:pZ,strong:mZ,table:gZ,tableCell:yZ,tableRow:vZ,text:_Z,thematicBreak:bZ,toml:ap,yaml:ap,definition:ap,footnoteDefinition:ap};function ap(){}const O8=-1,Kv=0,lg=1,cg=2,AS=3,jS=4,LS=5,DS=6,I8=7,$8=8,i4=typeof self=="object"?self:globalThis,SZ=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case Kv:case O8:return n(a,i);case lg:{const o=n([],i);for(const l of a)o.push(r(l));return o}case cg:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case AS:return n(new Date(a),i);case jS:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case LS:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case DS:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case I8:{const{name:o,message:l}=a;return n(new i4[o](l),i)}case $8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new i4[s](a),i)};return r},s4=e=>SZ(new Map,e)(0),gl="",{toString:CZ}={},{keys:kZ}=Object,Ou=e=>{const t=typeof e;if(t!=="object"||!e)return[Kv,t];const n=CZ.call(e).slice(8,-1);switch(n){case"Array":return[lg,gl];case"Object":return[cg,gl];case"Date":return[AS,gl];case"RegExp":return[jS,gl];case"Map":return[LS,gl];case"Set":return[DS,gl]}return n.includes("Array")?[lg,n]:n.includes("Error")?[I8,n]:[cg,n]},lp=([e,t])=>e===Kv&&(t==="function"||t==="symbol"),EZ=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=Ou(a);switch(o){case Kv:{let h=a;switch(l){case"bigint":o=$8,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([O8],a)}return i([o,h],a)}case lg:{if(l)return i([l,[...a]],a);const h=[],d=i([o,h],a);for(const f of a)h.push(s(f));return d}case cg:{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 s(a.toJSON());const h=[],d=i([o,h],a);for(const f of kZ(a))(e||!lp(Ou(a[f])))&&h.push([s(f),s(a[f])]);return d}case AS:return i([o,a.toISOString()],a);case jS:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case LS:{const h=[],d=i([o,h],a);for(const[f,g]of a)(e||!(lp(Ou(f))||lp(Ou(g))))&&h.push([s(f),s(g)]);return d}case DS:{const h=[],d=i([o,h],a);for(const f of a)(e||!lp(Ou(f)))&&h.push(s(f));return d}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},o4=(e,{json:t,lossy:n}={})=>{const r=[];return EZ(!(t||n),!!t,new Map,r)(e),r},ug=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?s4(o4(e,t)):structuredClone(e):(e,t)=>s4(o4(e,t));function TZ(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 MZ(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function RZ(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||TZ,r=e.options.footnoteBackLabel||MZ,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const h=e.all(c),d=String(c.identifier).toUpperCase(),f=Gc(d.toLowerCase());let g=0;const _=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++g<=y;){_.length>0&&_.push({type:"text",value:" "});let p=typeof n=="string"?n:n(l,g);typeof p=="string"&&(p={type:"text",value:p}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,g),className:["data-footnote-backref"]},children:Array.isArray(p)?p:[p]})}const v=h[h.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const p=v.children[v.children.length-1];p&&p.type==="text"?p.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(..._)}else h.push(..._);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(h,!0)};e.patch(c,m),o.push(m)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...ug(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const B8=function(e){if(e==null)return DZ;if(typeof e=="function")return Yv(e);if(typeof e=="object")return Array.isArray(e)?AZ(e):jZ(e);if(typeof e=="string")return LZ(e);throw new Error("Expected function, string, or object as test")};function AZ(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=B8(e[n]);return Yv(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function jZ(e){const t=e;return Yv(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function LZ(e){return Yv(t);function t(n){return n&&n.type===e}}function Yv(e){return t;function t(n,r,i){return!!(NZ(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function DZ(){return!0}function NZ(e){return e!==null&&typeof e=="object"&&"type"in e}const F8=[],PZ=!0,a4=!1,OZ="skip";function IZ(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=B8(i),a=r?-1:1;o(e,void 0,[])();function o(l,c,h){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const g=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(g?"<"+g+">":""))+")"})}return f;function f(){let g=F8,_,y,v;if((!t||s(l,c,h[h.length-1]||void 0))&&(g=$Z(n(l,h)),g[0]===a4))return g;if("children"in l&&l.children){const m=l;if(m.children&&g[0]!==OZ)for(y=(r?m.children.length:-1)+a,v=h.concat(m);y>-1&&y<m.children.length;){const p=m.children[y];if(_=o(p,y,v)(),_[0]===a4)return _;y=typeof _[1]=="number"?_[1]:y+a}}return g}}}function $Z(e){return Array.isArray(e)?e:typeof e=="number"?[PZ,e]:e==null?F8:[e]}function z8(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),IZ(e,s,o,i);function o(l,c){const h=c[c.length-1],d=h?h.children.indexOf(l):void 0;return a(l,d,h)}}const rb={}.hasOwnProperty,BZ={};function FZ(e,t){const n=t||BZ,r=new Map,i=new Map,s=new Map,a={...wZ,...n.handlers},o={all:c,applyData:HZ,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:zZ,wrap:UZ};return z8(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const d=h.type==="definition"?r:i,f=String(h.identifier).toUpperCase();d.has(f)||d.set(f,h)}}),o;function l(h,d){const f=h.type,g=o.handlers[f];if(rb.call(o.handlers,f)&&g)return g(o,h,d);if(o.options.passThrough&&o.options.passThrough.includes(f)){if("children"in h){const{children:y,...v}=h,m=ug(v);return m.children=o.all(h),m}return ug(h)}return(o.options.unknownHandler||WZ)(o,h,d)}function c(h){const d=[];if("children"in h){const f=h.children;let g=-1;for(;++g<f.length;){const _=o.one(f[g],h);if(_){if(g&&f[g-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=l4(_.value)),!Array.isArray(_)&&_.type==="element")){const y=_.children[0];y&&y.type==="text"&&(y.value=l4(y.value))}Array.isArray(_)?d.push(..._):d.push(_)}}}return d}}function zZ(e,t){e.position&&(t.position=wX(e))}function HZ(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=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"&&s&&Object.assign(n.properties,ug(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function WZ(e,t){const n=t.data||{},r="value"in t&&!(rb.call(n,"hProperties")||rb.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 UZ(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 l4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function c4(e,t){const n=FZ(e,t),r=n.one(e,void 0),i=RZ(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function VZ(e,t){return e&&"run"in e?async function(n,r){const i=c4(n,{file:r,...t});await e.run(i,r)}:function(n,r){return c4(n,{file:r,...e||t})}}function u4(e){if(e)throw e}var am=Object.prototype.hasOwnProperty,H8=Object.prototype.toString,d4=Object.defineProperty,h4=Object.getOwnPropertyDescriptor,f4=function(t){return typeof Array.isArray=="function"?Array.isArray(t):H8.call(t)==="[object Array]"},p4=function(t){if(!t||H8.call(t)!=="[object Object]")return!1;var n=am.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&am.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||am.call(t,i)},m4=function(t,n){d4&&n.name==="__proto__"?d4(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},g4=function(t,n){if(n==="__proto__")if(am.call(t,n)){if(h4)return h4(t,n).value}else return;return t[n]},qZ=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=g4(o,n),i=g4(t,n),o!==i&&(h&&i&&(p4(i)||(s=f4(i)))?(s?(s=!1,a=r&&f4(r)?r:[]):a=r&&p4(r)?r:{},m4(o,{name:n,newValue:e(h,a,i)})):typeof i<"u"&&m4(o,{name:n,newValue:i}));return o};const Oy=Tn(qZ);function ib(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 GZ(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...c){const h=e[++s];let d=-1;if(l){a(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,h?KZ(h,o)(...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 KZ(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const ji={basename:YZ,dirname:XZ,extname:JZ,join:QZ,sep:"/"};function YZ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rf(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function XZ(e){if(rf(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 JZ(e){rf(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function QZ(...e){let t=-1,n;for(;++t<e.length;)rf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":ZZ(n)}function ZZ(e){rf(e);const t=e.codePointAt(0)===47;let n=eee(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function eee(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===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,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=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,s=0}else o===46&&s>-1?s++:s=-1}return n}function rf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tee={cwd:nee};function nee(){return"/"}function sb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ree(e){if(typeof e=="string")e=new URL(e);else if(!sb(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 iee(e)}function iee(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 Iy=["history","path","basename","stem","extname","dirname"];class W8{constructor(t){let n;t?sb(t)?n={path:t}:typeof t=="string"||see(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":tee.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Iy.length;){const s=Iy[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Iy.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?ji.basename(this.path):void 0}set basename(t){By(t,"basename"),$y(t,"basename"),this.path=ji.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ji.dirname(this.path):void 0}set dirname(t){v4(this.basename,"dirname"),this.path=ji.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ji.extname(this.path):void 0}set extname(t){if($y(t,"extname"),v4(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=ji.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sb(t)&&(t=ree(t)),By(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ji.basename(this.path,this.extname):void 0}set stem(t){By(t,"stem"),$y(t,"stem"),this.path=ji.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 Gn(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 $y(e,t){if(e&&e.includes(ji.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ji.sep+"`")}function By(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function v4(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function see(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oee=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},aee={}.hasOwnProperty;class NS extends oee{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=GZ()}copy(){const t=new NS;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Oy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Hy("data",this.frozen),this.namespace[t]=n,this):aee.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Hy("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=cp(t),r=this.parser||this.Parser;return Fy("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fy("process",this.parser||this.Parser),zy("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=cp(t),l=r.parse(o);r.run(l,o,function(h,d,f){if(h||!d||!f)return c(h);const g=d,_=r.stringify(g,f);uee(_)?f.value=_:f.result=_,c(h,f)});function c(h,d){h||!d?a(h):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Fy("processSync",this.parser||this.Parser),zy("processSync",this.compiler||this.Compiler),this.process(t,i),x4("processSync","process",n),r;function i(s,a){n=!0,u4(s),r=a}}run(t,n,r){y4(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=cp(n);i.run(t,l,c);function c(h,d,f){const g=d||t;h?o(h):a?a(g):r(void 0,g,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),x4("runSync","run",r),i;function s(a,o){u4(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=cp(n),i=this.compiler||this.Compiler;return zy("stringify",i),y4(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Hy("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...d]=c;l(h,d)}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");o(c.plugins),c.settings&&(i.settings=Oy(!0,i.settings,c.settings))}function o(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const d=c[h];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,h){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...h]);else if(h.length>0){let[g,..._]=h;const y=r[f][1];ib(y)&&ib(g)&&(g=Oy(!0,y,g)),r[f]=[c,g,..._]}}}}const lee=new NS().freeze();function Fy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function zy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Hy(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 y4(e){if(!ib(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x4(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function cp(e){return cee(e)?e:new W8(e)}function cee(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uee(e){return typeof e=="string"||dee(e)}function dee(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hee="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_4=[],b4={allowDangerousHtml:!0},fee=/^(https?|ircs?|mailto|xmpp)$/i,pee=[{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 mee(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,a=e.disallowedElements,o=e.rehypePlugins||_4,l=e.remarkPlugins||_4,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b4}:b4,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||gee,g=lee().use(XQ).use(l).use(VZ,c).use(o),_=new W8;typeof r=="string"&&(_.value=r);for(const p of pee)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+hee+p.id,void 0);const y=g.parse(_);let v=g.runSync(y,_);return i&&(v={type:"element",tagName:"div",properties:{className:i},children:v.type==="root"?v.children:[v]}),z8(v,m),MX(v,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(p,x,b){if(p.type==="raw"&&b&&typeof x=="number")return h?b.children.splice(x,1):b.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let S;for(S in Dy)if(Object.hasOwn(Dy,S)&&Object.hasOwn(p.properties,S)){const C=p.properties[S],E=Dy[S];(E===null||E.includes(p.tagName))&&(p.properties[S]=f(String(C||""),S,p))}}if(p.type==="element"){let S=t?!t.includes(p.tagName):a?a.includes(p.tagName):!1;if(!S&&n&&typeof x=="number"&&(S=!n(p,x,b)),S&&b&&typeof x=="number")return d&&p.children?b.children.splice(x,1,...p.children):b.children.splice(x,1),x}}}function gee(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||fee.test(e.slice(0,t))?e:""}function vee({text:e}){const t=e.split(/\s+/),n=t.pop(),r=t.length?t.join(" ")+" ":null;return u.jsxs(u.Fragment,{children:[r,u.jsxs("span",{className:"whitespace-nowrap",children:[n,u.jsx(ka,{className:"inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0 selection:bg-inherit"})]})]})}function yn({children:e,href:t,className:n,rel:r,...i}){const s=$o()[1],a=(t==null?void 0:t.startsWith("http"))||(t==null?void 0:t.startsWith("//")),o=l=>{t&&(l.preventDefault(),a?Xc(t):s(t??"/"))};return u.jsx("a",{...i,rel:r??"noopener noreferrer",href:t,className:J("text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer",n),onClick:o,children:a&&typeof e=="string"?u.jsx(vee,{text:e}):e})}const yee={code:({children:e})=>u.jsx(Ue,{className:"not-prose [.prose-toast_&:not(pre_*)]:bg-muted/65",children:e}),pre:({children:e})=>u.jsx("pre",{className:"not-prose p-2 whitespace-pre-wrap [overflow-wrap:_anywhere] break-all rounded bg-muted [.prose-toast_&]:bg-muted/65 [.prose-toast_&>code]:bg-transparent",children:e}),a:({children:e,href:t})=>u.jsx(yn,{href:t,children:e})};function w4({md:e,isSmall:t,isTitle:n,isToast:r}){return u.jsx(mee,{components:yee,className:J("prose dark:prose-invert prose-zinc",t&&"prose-sm",n&&"tracking-wide",r&&"prose-toast"),children:mG(e.replace(/\n/g,`  
`))})}let xee={data:""},_ee=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||xee,bee=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,wee=/\/\*[^]*?\*\/|  +/g,S4=/\n+/g,to=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?to(a,s):s+"{"+to(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=to(a,t?t.replace(/([^,])+/g,o=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,o):o?o+" "+l:l)):s):a!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=to.p?to.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},ls={},U8=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+U8(e[n]);return t}return e},See=(e,t,n,r,i)=>{let s=U8(e),a=ls[s]||(ls[s]=(l=>{let c=0,h=11;for(;c<l.length;)h=101*h+l.charCodeAt(c++)>>>0;return"go"+h})(s));if(!ls[a]){let l=s!==e?e:(c=>{let h,d,f=[{}];for(;h=bee.exec(c.replace(wee,""));)h[4]?f.shift():h[3]?(d=h[3].replace(S4," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][h[1]]=h[2].replace(S4," ").trim();return f[0]})(e);ls[a]=to(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let o=n&&ls.g?ls.g:null;return n&&(ls.g=ls[a]),((l,c,h,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=h?l+c.data:c.data+l)})(ls[a],t,r,o),a},Cee=(e,t,n)=>e.reduce((r,i,s)=>{let a=t[s];if(a&&a.call){let o=a(n),l=o&&o.props&&o.props.className||/^go/.test(o)&&o;a=l?"."+l:o&&typeof o=="object"?o.props?"":to(o,""):o===!1?"":o}return r+i+(a??"")},"");function Xv(e){let t=this||{},n=e.call?e(t.p):e;return See(n.unshift?n.raw?Cee(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,_ee(t.target),t.g,t.o,t.k)}let V8,ob,ab;Xv.bind({g:1});let As=Xv.bind({k:1});function kee(e,t,n,r){to.p=t,V8=e,ob=n,ab=r}function Fo(e,t){let n=this||{};return function(){let r=arguments;function i(s,a){let o=Object.assign({},s),l=o.className||i.className;n.p=Object.assign({theme:ob&&ob()},o),n.o=/ *go\d+/.test(l),o.className=Xv.apply(n,r)+(l?" "+l:"");let c=e;return e[0]&&(c=o.as||e,delete o.as),ab&&c[0]&&ab(o),V8(c,o)}return i}}var Eee=e=>typeof e=="function",dg=(e,t)=>Eee(e)?e(t):e,Tee=(()=>{let e=0;return()=>(++e).toString()})(),q8=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Mee=20,G8=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,Mee)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return G8(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.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(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},lm=[],cm={toasts:[],pausedAt:void 0},qa=e=>{cm=G8(cm,e),lm.forEach(t=>{t(cm)})},Ree={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Aee=(e={})=>{let[t,n]=w.useState(cm);w.useEffect(()=>(lm.push(n),()=>{let i=lm.indexOf(n);i>-1&&lm.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,a,o;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((a=e[i.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||Ree[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},jee=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||Tee()}),sf=e=>(t,n)=>{let r=jee(t,e,n);return qa({type:2,toast:r}),r.id},Xn=(e,t)=>sf("blank")(e,t);Xn.error=sf("error");Xn.success=sf("success");Xn.loading=sf("loading");Xn.custom=sf("custom");Xn.dismiss=e=>{qa({type:3,toastId:e})};Xn.remove=e=>qa({type:4,toastId:e});Xn.promise=(e,t,n)=>{let r=Xn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?dg(t.success,i):void 0;return s?Xn.success(s,{id:r,...n,...n==null?void 0:n.success}):Xn.dismiss(r),i}).catch(i=>{let s=t.error?dg(t.error,i):void 0;s?Xn.error(s,{id:r,...n,...n==null?void 0:n.error}):Xn.dismiss(r)}),e};var Lee=(e,t)=>{qa({type:1,toast:{id:e,height:t}})},Dee=()=>{qa({type:5,time:Date.now()})},Pd=new Map,Nee=1e3,Pee=(e,t=Nee)=>{if(Pd.has(e))return;let n=setTimeout(()=>{Pd.delete(e),qa({type:4,toastId:e})},t);Pd.set(e,n)},Oee=e=>{let{toasts:t,pausedAt:n}=Aee(e);w.useEffect(()=>{if(n)return;let s=Date.now(),a=t.map(o=>{if(o.duration===1/0)return;let l=(o.duration||0)+o.pauseDuration-(s-o.createdAt);if(l<0){o.visible&&Xn.dismiss(o.id);return}return setTimeout(()=>Xn.dismiss(o.id),l)});return()=>{a.forEach(o=>o&&clearTimeout(o))}},[t,n]);let r=w.useCallback(()=>{n&&qa({type:6,time:Date.now()})},[n]),i=w.useCallback((s,a)=>{let{reverseOrder:o=!1,gutter:l=8,defaultPosition:c}=a||{},h=t.filter(g=>(g.position||c)===(s.position||c)&&g.height),d=h.findIndex(g=>g.id===s.id),f=h.filter((g,_)=>_<d&&g.visible).length;return h.filter(g=>g.visible).slice(...o?[f+1]:[0,f]).reduce((g,_)=>g+(_.height||0)+l,0)},[t]);return w.useEffect(()=>{t.forEach(s=>{if(s.dismissed)Pee(s.id,s.removeDelay);else{let a=Pd.get(s.id);a&&(clearTimeout(a),Pd.delete(s.id))}})},[t]),{toasts:t,handlers:{updateHeight:Lee,startPause:Dee,endPause:r,calculateOffset:i}}},Iee=As`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
 transform: scale(1) rotate(45deg);
  opacity: 1;
}`,$ee=As`
from {
  transform: scale(0);
  opacity: 0;
}
to {
  transform: scale(1);
  opacity: 1;
}`,Bee=As`
from {
  transform: scale(0) rotate(90deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(90deg);
	opacity: 1;
}`,Fee=Fo("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#ff4b4b"};
  position: relative;
  transform: rotate(45deg);

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

  &:after,
  &:before {
    content: '';
    animation: ${$ee} 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: ${Bee} 0.15s ease-out forwards;
    animation-delay: 180ms;
    transform: rotate(90deg);
  }
`,zee=As`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,Hee=Fo("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: ${zee} 1s linear infinite;
`,Wee=As`
from {
  transform: scale(0) rotate(45deg);
	opacity: 0;
}
to {
  transform: scale(1) rotate(45deg);
	opacity: 1;
}`,Uee=As`
0% {
	height: 0;
	width: 0;
	opacity: 0;
}
40% {
  height: 0;
	width: 6px;
	opacity: 1;
}
100% {
  opacity: 1;
  height: 10px;
}`,Vee=Fo("div")`
  width: 20px;
  opacity: 0;
  height: 20px;
  border-radius: 10px;
  background: ${e=>e.primary||"#61d345"};
  position: relative;
  transform: rotate(45deg);

  animation: ${Wee} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
  animation-delay: 100ms;
  &:after {
    content: '';
    box-sizing: border-box;
    animation: ${Uee} 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;
  }
`,qee=Fo("div")`
  position: absolute;
`,Gee=Fo("div")`
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 20px;
  min-height: 20px;
`,Kee=As`
from {
  transform: scale(0.6);
  opacity: 0.4;
}
to {
  transform: scale(1);
  opacity: 1;
}`,Yee=Fo("div")`
  position: relative;
  transform: scale(0.6);
  opacity: 0.4;
  min-width: 20px;
  animation: ${Kee} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
    forwards;
`,Xee=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?w.createElement(Yee,null,t):t:n==="blank"?null:w.createElement(Gee,null,w.createElement(Hee,{...r}),n!=="loading"&&w.createElement(qee,null,n==="error"?w.createElement(Fee,{...r}):w.createElement(Vee,{...r})))},Jee=e=>`
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,Qee=e=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
`,Zee="0%{opacity:0;} 100%{opacity:1;}",ete="0%{opacity:1;} 100%{opacity:0;}",tte=Fo("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;
`,nte=Fo("div")`
  display: flex;
  justify-content: center;
  margin: 4px 10px;
  color: inherit;
  flex: 1 1 auto;
  white-space: pre-line;
`,rte=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=q8()?[Zee,ete]:[Jee(n),Qee(n)];return{animation:t?`${As(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${As(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},ite=w.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?rte(e.position||t||"top-center",e.visible):{opacity:0},s=w.createElement(Xee,{toast:e}),a=w.createElement(nte,{...e.ariaProps},dg(e.message,e));return w.createElement(tte,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):w.createElement(w.Fragment,null,s,a))});kee(w.createElement);var ste=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=w.useCallback(a=>{if(a){let o=()=>{let l=a.getBoundingClientRect().height;r(e,l)};o(),new MutationObserver(o).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return w.createElement("div",{ref:s,className:t,style:n},i)},ote=(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:q8()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},ate=Xv`
  z-index: 9999;
  > * {
    pointer-events: auto;
  }
`,up=16,lte=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:o,handlers:l}=Oee(n);return w.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:up,left:up,right:up,bottom:up,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},o.map(c=>{let h=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),f=ote(h,d);return w.createElement(ste,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?ate:"",style:f},c.type==="custom"?dg(c.message,c):i?i(c):w.createElement(ite,{toast:c,position:h}))}))},hg=Xn;const cte=["default","loading","info","success","warning","error"],ute=$s(`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"}}),dte={default:u.jsx(IK,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:u.jsx(Zt,{className:"animate-spin"}),info:u.jsx(dS,{className:"stroke-info animate-toastbar-icon"}),success:u.jsx(OK,{className:"stroke-success animate-toastbar-icon"}),warning:u.jsx(PK,{className:"stroke-warning animate-toastbar-icon"}),error:u.jsx(cY,{className:"stroke-destructive animate-toastbar-icon"})},hte=({t:e,type:t,data:n})=>{const[r,i]=w.useState(0);return w.useEffect(()=>{let s=null;const a=()=>{s&&clearInterval(s)};return t==="loading"&&e.visible?s=setInterval(()=>{i(o=>o+1)},1e3):s&&a(),a},[t,e.visible]),u.jsxs("div",{className:J(ute({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[u.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?u.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:u.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):dte[t]}),u.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?u.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?u.jsxs(u.Fragment,{children:[n.title?u.jsx(w4,{md:`**${n.title}**`,isSmall:!0,isTitle:!0,isToast:!0}):null,u.jsx(w4,{md:n.msg,isSmall:!0,isToast:!0})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold mb-1",children:n.title}),u.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&u.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",u.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",onClick:dh,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),u.jsxs("button",{onClick:()=>hg.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[u.jsx(yr,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})};function fte(){return u.jsx(lte,{reverseOrder:!0,containerStyle:{top:"var(--content-offset)",zIndex:60}})}const Qo=(e,t,n={})=>{const i=(typeof t=="string"?t:t.msg).split(/\s+/).length;let s;return i<15?s=5e3:i<25?s=7500:i<50?s=1e4:s=15e3,n.duration??(n.duration=e==="loading"?1/0:s),hg.custom(a=>u.jsx(hte,{t:a,type:e,data:t}),n)},pte=(e,t)=>Qo(e.type,e,t),We=Object.assign(pte,{default:(e,t)=>Qo("default",e,t),loading:(e,t)=>Qo("loading",e,t),info:(e,t)=>Qo("info",e,t),success:(e,t)=>Qo("success",e,t),warning:(e,t)=>Qo("warning",e,t),error:(e,t)=>Qo("error",e,t),dismiss:hg.dismiss,remove:hg.remove}),PS=Vc(!1),K8=Vc(void 0),lb="actionModal",Y8=e=>{vN(lb,e)},OS=()=>{const e=tt(K8),t=tt(PS);return n=>{Y8(n),e(n),t(!0)}},mte=()=>{const e=et(K8),[t,n]=mr(PS);return{isModalOpen:t,actionRef:e,closeModal:()=>{Y8(void 0),n(!1)}}};var C4=Object.prototype.hasOwnProperty;function fg(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&fg(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(C4.call(e,n)&&++r&&!C4.call(t,n)||!(n in t)||!fg(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ps=new WeakMap,io=()=>{},Jn=io(),cb=Object,dt=e=>e===Jn,Oi=e=>typeof e=="function",ko=(e,t)=>({...e,...t}),X8=e=>Oi(e.then),Wy={},dp={},IS="undefined",Jv=typeof window!=IS,ub=typeof document!=IS,gte=()=>Jv&&typeof window.requestAnimationFrame!=IS,J8=(e,t)=>{const n=ps.get(e);return[()=>!dt(t)&&e.get(t)||Wy,r=>{if(!dt(t)){const i=e.get(t);t in dp||(dp[t]=i),n[5](t,ko(i,r),i||Wy)}},n[6],()=>!dt(t)&&t in dp?dp[t]:!dt(t)&&e.get(t)||Wy]};let db=!0;const vte=()=>db,[hb,fb]=Jv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[io,io],yte=()=>{const e=ub&&document.visibilityState;return dt(e)||e!=="hidden"},xte=e=>(ub&&document.addEventListener("visibilitychange",e),hb("focus",e),()=>{ub&&document.removeEventListener("visibilitychange",e),fb("focus",e)}),_te=e=>{const t=()=>{db=!0,e()},n=()=>{db=!1};return hb("online",t),hb("offline",n),()=>{fb("online",t),fb("offline",n)}},bte={isOnline:vte,isVisible:yte},wte={initFocus:xte,initReconnect:_te},k4=!lt.useId,uh=!Jv||"Deno"in globalThis,Ste=e=>gte()?window.requestAnimationFrame(e):setTimeout(e,1),Uy=uh?w.useEffect:w.useLayoutEffect,Vy=typeof navigator<"u"&&navigator.connection,E4=!uh&&Vy&&(["slow-2g","2g"].includes(Vy.effectiveType)||Vy.saveData),hp=new WeakMap,qy=(e,t)=>cb.prototype.toString.call(e)===`[object ${t}]`;let Cte=0;const pb=e=>{const t=typeof e,n=qy(e,"Date"),r=qy(e,"RegExp"),i=qy(e,"Object");let s,a;if(cb(e)===e&&!n&&!r){if(s=hp.get(e),s)return s;if(s=++Cte+"~",hp.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=pb(e[a])+",";hp.set(e,s)}if(i){s="#";const o=cb.keys(e).sort();for(;!dt(a=o.pop());)dt(e[a])||(s+=a+":"+pb(e[a])+",");hp.set(e,s)}}else s=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},$S=e=>{if(Oi(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?pb(e):"",[e,t]};let kte=0;const mb=()=>++kte,Q8=0,Z8=1,eN=2,Ete=3;var Iu={__proto__:null,ERROR_REVALIDATE_EVENT:Ete,FOCUS_EVENT:Q8,MUTATE_EVENT:eN,RECONNECT_EVENT:Z8};async function tN(...e){const[t,n,r,i]=e,s=ko({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const o=s.rollbackOnError;let l=s.optimisticData;const c=f=>typeof o=="function"?o(f):o!==!1,h=s.throwOnError;if(Oi(n)){const f=n,g=[],_=t.keys();for(const y of _)!/^\$(inf|sub)\$/.test(y)&&f(t.get(y)._k)&&g.push(y);return Promise.all(g.map(d))}return d(n);async function d(f){const[g]=$S(f);if(!g)return;const[_,y]=J8(t,g),[v,m,p,x]=ps.get(t),b=()=>{const D=v[g];return(Oi(s.revalidate)?s.revalidate(_().data,f):s.revalidate!==!1)&&(delete p[g],delete x[g],D&&D[0])?D[0](eN).then(()=>_().data):_().data};if(e.length<3)return b();let S=r,C;const E=mb();m[g]=[E,0];const k=!dt(l),T=_(),R=T.data,M=T._c,L=dt(M)?R:M;if(k&&(l=Oi(l)?l(L,R):l,y({data:l,_c:L})),Oi(S))try{S=S(L)}catch(D){C=D}if(S&&X8(S))if(S=await S.catch(D=>{C=D}),E!==m[g][0]){if(C)throw C;return S}else C&&k&&c(C)&&(a=!0,y({data:L,_c:Jn}));if(a&&!C)if(Oi(a)){const D=a(S,L);y({data:D,error:Jn,_c:Jn})}else y({data:S,error:Jn,_c:Jn});if(m[g][1]=mb(),Promise.resolve(b()).then(()=>{y({_c:Jn})}),C){if(h)throw C;return}return S}}const T4=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Tte=(e,t)=>{if(!ps.has(e)){const n=ko(wte,t),r={},i=tN.bind(Jn,e);let s=io;const a={},o=(h,d)=>{const f=a[h]||[];return a[h]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(h,d,f)=>{e.set(h,d);const g=a[h];if(g)for(const _ of g)_(d,f)},c=()=>{if(!ps.has(e)&&(ps.set(e,[r,{},{},{},i,l,o]),!uh)){const h=n.initFocus(setTimeout.bind(Jn,T4.bind(Jn,r,Q8))),d=n.initReconnect(setTimeout.bind(Jn,T4.bind(Jn,r,Z8)));s=()=>{h&&h(),d&&d(),ps.delete(e)}}};return c(),[e,i,c,s]}return[e,ps.get(e)[4]]},Mte=(e,t,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!dt(s)&&a>s||setTimeout(r,o,i)},Rte=fg,[nN,rN]=Tte(new Map),Ate=ko({onLoadingSlow:io,onSuccess:io,onError:io,onErrorRetry:Mte,onDiscarded:io,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:E4?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:E4?5e3:3e3,compare:Rte,isPaused:()=>!1,cache:nN,mutate:rN,fallback:{}},bte),jte=(e,t)=>{const n=ko(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=ko(i,a))}return n},Lte=w.createContext({}),Dte="$inf$",iN=Jv&&window.__SWR_DEVTOOLS_USE__,Nte=iN?window.__SWR_DEVTOOLS_USE__:[],Pte=()=>{iN&&(window.__SWR_DEVTOOLS_REACT__=lt)},Ote=e=>Oi(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Ite=()=>ko(Ate,w.useContext(Lte)),$te=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=$S(t),[,,,o]=ps.get(nN);if(a.startsWith(Dte))return n(...s);const l=o[a];return dt(l)?n(...s):(delete o[a],l)}),r),Bte=Nte.concat($te),Fte=e=>function(...n){const r=Ite(),[i,s,a]=Ote(n),o=jte(r,a);let l=e;const{use:c}=o,h=(c||[]).concat(Bte);for(let d=h.length;d--;)l=h[d](l);return l(i,s||o.fetcher||null,o)},zte=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};Pte();const Gy=lt.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ky={dedupe:!0},Hte=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:h,refreshWhenOffline:d,keepPreviousData:f}=n,[g,_,y,v]=ps.get(r),[m,p]=$S(e),x=w.useRef(!1),b=w.useRef(!1),S=w.useRef(m),C=w.useRef(t),E=w.useRef(n),k=()=>E.current,T=()=>k().isVisible()&&k().isOnline(),[R,M,L,D]=J8(r,m),N=w.useRef({}).current,P=dt(a)?dt(n.fallback)?Jn:n.fallback[m]:a,I=(q,re)=>{for(const ne in N){const le=ne;if(le==="data"){if(!i(q[le],re[le])&&(!dt(q[le])||!i(Q,re[le])))return!1}else if(re[le]!==q[le])return!1}return!0},z=w.useMemo(()=>{const q=!m||!t?!1:dt(o)?k().isPaused()||s?!1:l!==!1:o,re=Me=>{const xe=ko(Me);return delete xe._k,q?{isValidating:!0,isLoading:!0,...xe}:xe},ne=R(),le=D(),ve=re(ne),ae=ne===le?ve:re(le);let Ee=ve;return[()=>{const Me=re(R());return I(Me,Ee)?(Ee.data=Me.data,Ee.isLoading=Me.isLoading,Ee.isValidating=Me.isValidating,Ee.error=Me.error,Ee):(Ee=Me,Me)},()=>ae]},[r,m]),O=fL.useSyncExternalStore(w.useCallback(q=>L(m,(re,ne)=>{I(ne,re)||q()}),[r,m]),z[0],z[1]),j=!x.current,A=g[m]&&g[m].length>0,F=O.data,H=dt(F)?P&&X8(P)?Gy(P):P:F,B=O.error,G=w.useRef(H),Q=f?dt(F)?G.current:F:H,Y=A&&!dt(B)?!1:j&&!dt(o)?o:k().isPaused()?!1:s?dt(H)?!1:l:dt(H)||l,W=!!(m&&t&&j&&Y),$=dt(O.isValidating)?W:O.isValidating,V=dt(O.isLoading)?W:O.isLoading,U=w.useCallback(async q=>{const re=C.current;if(!m||!re||b.current||k().isPaused())return!1;let ne,le,ve=!0;const ae=q||{},Ee=!y[m]||!ae.dedupe,Me=()=>k4?!b.current&&m===S.current&&x.current:m===S.current,xe={isValidating:!1,isLoading:!1},we=()=>{M(xe)},se=()=>{const ie=y[m];ie&&ie[1]===le&&delete y[m]},ee={isValidating:!0};dt(R().data)&&(ee.isLoading=!0);try{if(Ee&&(M(ee),n.loadingTimeout&&dt(R().data)&&setTimeout(()=>{ve&&Me()&&k().onLoadingSlow(m,n)},n.loadingTimeout),y[m]=[re(p),mb()]),[ne,le]=y[m],ne=await ne,Ee&&setTimeout(se,n.dedupingInterval),!y[m]||y[m][1]!==le)return Ee&&Me()&&k().onDiscarded(m),!1;xe.error=Jn;const ie=_[m];if(!dt(ie)&&(le<=ie[0]||le<=ie[1]||ie[1]===0))return we(),Ee&&Me()&&k().onDiscarded(m),!1;const ce=R().data;xe.data=i(ce,ne)?ce:ne,Ee&&Me()&&k().onSuccess(ne,m,n)}catch(ie){se();const ce=k(),{shouldRetryOnError:K}=ce;ce.isPaused()||(xe.error=ie,Ee&&Me()&&(ce.onError(ie,m,ce),(K===!0||Oi(K)&&K(ie))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||T())&&ce.onErrorRetry(ie,m,ce,te=>{const oe=g[m];oe&&oe[0]&&oe[0](Iu.ERROR_REVALIDATE_EVENT,te)},{retryCount:(ae.retryCount||0)+1,dedupe:!0})))}return ve=!1,we(),!0},[m,r]),X=w.useCallback((...q)=>tN(r,S.current,...q),[]);if(Uy(()=>{C.current=t,E.current=n,dt(F)||(G.current=F)}),Uy(()=>{if(!m)return;const q=U.bind(Jn,Ky);let re=0;const le=zte(m,g,(ve,ae={})=>{if(ve==Iu.FOCUS_EVENT){const Ee=Date.now();k().revalidateOnFocus&&Ee>re&&T()&&(re=Ee+k().focusThrottleInterval,q())}else if(ve==Iu.RECONNECT_EVENT)k().revalidateOnReconnect&&T()&&q();else{if(ve==Iu.MUTATE_EVENT)return U();if(ve==Iu.ERROR_REVALIDATE_EVENT)return U(ae)}});return b.current=!1,S.current=m,x.current=!0,M({_k:p}),Y&&(dt(H)||uh?q():Ste(q)),()=>{b.current=!0,le()}},[m]),Uy(()=>{let q;function re(){const le=Oi(c)?c(R().data):c;le&&q!==-1&&(q=setTimeout(ne,le))}function ne(){!R().error&&(h||k().isVisible())&&(d||k().isOnline())?U(Ky).then(re):re()}return re(),()=>{q&&(clearTimeout(q),q=-1)}},[c,h,d,m]),w.useDebugValue(Q),s&&dt(H)&&m){if(!k4&&uh)throw new Error("Fallback data is required when using Suspense in SSR.");C.current=t,E.current=n,b.current=!1;const q=v[m];if(!dt(q)){const re=X(q);Gy(re)}if(dt(B)){const re=U(Ky);dt(Q)||(re.status="fulfilled",re.value=!0),Gy(re)}else throw B}return{mutate:X,get data(){return N.data=!0,Q},get error(){return N.error=!0,B},get isValidating(){return N.isValidating=!0,$},get isLoading(){return N.isLoading=!0,V}}},Kc=Fte(Hte),Wte="https://monitor/WebPipe",Ute=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,sN={"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};var pg=(e=>(e[e.DEFAULT=7500]="DEFAULT",e[e.LONG=15e3]="LONG",e[e.REALLY_LONG=3e4]="REALLY_LONG",e[e.REALLY_REALLY_LONG=45e3]="REALLY_REALLY_LONG",e))(pg||{});class gb extends Error{constructor(n,r){super();pl(this,"title");pl(this,"message");this.title=n,this.message=r}}const oN=()=>{const e=Kte(),t=BS();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=Wte+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...sN,"User-Agent":Ute,"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("useAuthedFetcher",(a==null?void 0:a.reason)??"unknown"),new Error("Session expired");return a}},Eo=async(e,t={})=>{const n=t.method??"GET",r=n==="POST"&&t.body?JSON.stringify(t.body):void 0;return await(await fetch(e,{headers:sN,signal:AbortSignal.timeout(t.timeout??7500),...t,method:n,body:r})).json()},wt=e=>{const t=w.useRef(void 0),n=w.useRef(void 0),r=oN();return e.abortOnUnmount??(e.abortOnUnmount=!1),w.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&We.dismiss(n.current))},[]),async i=>{var c,h;t.current=new AbortController;let s=e.path;if(i.pathParams)for(const[d,f]of Object.entries(i.pathParams)){const g=new RegExp(`/:${d}(/|$)`),_=s.replace(g,`/${f}$1`);if(_===s)throw new Error(`[useBackendApi] pathParam '${d}' not found in path '${e.path}'`);s=_}if(i.queryParams){const d=new URLSearchParams;for(const[f,g]of Object.entries(i.queryParams))(typeof g=="string"||typeof g=="number"||typeof g=="boolean")&&d.append(f,g.toString());s+=`?${d.toString()}`}const a=`${e.method} ${e.path}`,o=(d,f)=>{if(n.current&&We.error({title:d,msg:f},{id:n.current}),i.error)try{i.error(f,n.current)}catch(g){console.log("[ERROR CB ERROR]",a,g)}else throw new gb(d,f)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=We.loading(i.toastLoadingMessage):i.toastId?n.current=i.toastId:n.current&&(We.dismiss(n.current),n.current=void 0);const l=setTimeout(()=>{var d,f;(d=t.current)!=null&&d.signal.aborted||(console.log("[TIMEOUT]",a),(f=t.current)==null||f.abort("timeout"),o("Request Timeout","If you closed txAdmin, please restart it and try again."))},i.timeout??7500);try{console.log("[>>]",a);const d=await r(s,{method:e.method,body:i.data},t.current);if(clearTimeout(l),(c=t.current)!=null&&c.signal.aborted)return;if(e.throwGenericErrors&&"error"in d)throw new gb("API Error",d.error);if(i.genericHandler&&n.current&&("error"in d?We.error({title:i.genericHandler.errorTitle,msg:d.error},{id:n.current}):We.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(d==null?void 0:d.type)=="string"&&typeof(d==null?void 0:d.msg)=="string"&&cte.includes(d==null?void 0:d.type)&&typeof We[d.type]=="function"&&We[d.type](d,{id:n.current}),i.success)try{i.success(d,n.current)}catch(f){console.log("[SUCCESS CB ERROR]",a,f)}return d}catch(d){if((h=t.current)!=null&&h.signal.aborted)return;clearTimeout(l);let f="unknown error";const g=d;typeof g.message!="string"?f=JSON.stringify(g):g.message.startsWith("NetworkError")?f=`Network error.
If you closed txAdmin, please restart it and try again.`:g.message.startsWith("JSON.parse:")?f="Invalid JSON response from server.":f=g.message,f.includes("unmount")?console.warn("[UNMOUNTED]",a):(console.error("[ERROR]",a,f),o("Request Error",f))}finally{if(i.finally)try{i.finally()}catch(d){console.log("[FINALLY CB ERROR]",a,d)}}}},Yc=Qe(window.txConsts.preAuth),aN=Qe(e=>!!e(Yc)),Vte=Qe(e=>{const t=e(Yc);return t?t.csrfToken:void 0}),qte=Qe(e=>{const t=e(Yc);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),Gte=()=>et(aN),Kte=()=>et(Vte),Yte=()=>tt(Yc),rr=()=>{const e=et(qte);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}},BS=()=>{const e=tt(Yc);return(t="unknown",n="unknown",r=xc.EXPIRED)=>{console.log("[useExpireAuthData] Logout notice received:",{src:t,reason:n,reasonHash:r}),e(!1),US(r)}},Ga=()=>{const[e,t]=mr(Yc);return{authData:e,setAuthData:t,logout:()=>Eo("/auth/logout",{method:"POST"}).then(r=>{r.logout?(console.log("[useAuth] Manually triggered logout."),t(!1),US(xc.LOGOUT)):console.error("Failed to logout:",r)}).catch(r=>{console.log("Error sending logout request:",r)})}},Xte=fD((e,t)=>{e(aN)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t(Fv,!1),t(zv,!1),t(Hv,!1),t(vS,!1),t(yS,!1),t(xS,!1),t(Uv,!1),t(PS,!1),t(Wa,null),t(Pv,void 0),t(rS,void 0),t(Ov,void 0),t(Iv,void 0),t(iS,0),We.dismiss(),rN(()=>!0,void 0,{revalidate:!1}))});function qs({children:e}){return u.jsx("p",{className:"whitespace-pre-wrap text-secondary-foreground leading-relaxed pb-2",children:e})}function of({error:e}){var r,i;e.returnTo=e.returnTo??"/login";let t=null,n=null;if("errorTitle"in e)t=e.errorTitle,n=u.jsx(qs,{children:e.errorMessage});else if(e.errorCode==="invalid_session")t="Invalid Browser Session.",n=u.jsxs(qs,{children:["You may have restarted txAdmin right before entering this page. ",u.jsx("br",{}),"Please return and try again."]});else if(e.errorCode==="clock_desync")t="Please Update/Synchronize your VPS clock.",n=u.jsx(qs,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."});else if(e.errorCode==="timeout")t="Connection to FiveM servers timed out.",n=u.jsx(qs,{children:"Please try again or login using your existing username and backup password."});else if(e.errorCode==="end_user_aborted")t="Login Aborted",n=u.jsxs(qs,{children:["The Cfx.re login process was aborted. ",u.jsx("br",{}),"Return to the login page to try again."]});else if(e.errorCode==="end_user_logout")t="Login Aborted",n=u.jsxs(qs,{children:["The Cfx.re login process was aborted because you logged out of the Cfx.re account. ",u.jsx("br",{}),"Return to the login page to try again."]});else if(e.errorCode==="master_already_set")t="Master Account Already Set",n=u.jsxs(qs,{children:["Please go back to the login page to continue. ",u.jsx("br",{})]});else if(e.errorCode==="not_admin"){const s=((r=e.errorContext)==null?void 0:r.identifier)??"unknown";t=`The Cfx.re account '${((i=e.errorContext)==null?void 0:i.name)??"unknown"}' is not an admin.`,n=u.jsxs(qs,{children:["The account above with identifier ",u.jsx(Ue,{children:s})," is not assigned to any account registered on txAdmin. ",u.jsx("br",{}),"You can also try to login using your username and backup password."]})}else t="Unknown Error:",n=u.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:u.jsx("pre",{className:"text-left whitespace-pre-wrap",children:JSON.stringify(e,null,2)})});return u.jsxs("div",{className:"p-4",children:[u.jsx("h3",{className:"text-2xl font-bold text-destructive-inline mb-4",children:t}),n,u.jsx(Jh,{className:"w-full flex justify-center mt-4 pb-0",children:u.jsx(xi,{href:e.returnTo,asChild:!0,children:u.jsxs(Ae,{className:"x",children:[u.jsx(kK,{className:"inline mr-2 h-4 w-4"}),"Try Again"]})})})]})}const mg=()=>{const e=new URLSearchParams(window.location.search),t=e.get("error"),n=e.get("error_description");if(t==="access_denied"&&n==="End-User aborted interaction")return{errorCode:"end_user_aborted"};if(t==="access_denied"&&n==="End-User aborted interaction (logout)")return{errorCode:"end_user_logout"}},af=e=>{var t;return(t=e.message)!=null&&t.startsWith("NetworkError")?{errorTitle:"Network Error",errorMessage:"If you closed txAdmin, please restart it and try again."}:{errorTitle:"Unknown Error",errorMessage:e.message??"😵"}};var FS="Avatar",[Jte,xOe]=In(FS),[Qte,lN]=Jte(FS),cN=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=w.useState("idle");return u.jsx(Qte,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:u.jsx(Ce.span,{...r,ref:t})})});cN.displayName=FS;var uN="AvatarImage",dN=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,a=lN(uN,n),o=Zte(r,s.referrerPolicy),l=Et(c=>{i(c),a.onImageLoadingStatusChange(c)});return ln(()=>{o!=="idle"&&l(o)},[o,l]),o==="loaded"?u.jsx(Ce.img,{...s,ref:t,src:r}):null});dN.displayName=uN;var hN="AvatarFallback",fN=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=lN(hN,n),[a,o]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&s.imageLoadingStatus!=="loaded"?u.jsx(Ce.span,{...i,ref:t}):null});fN.displayName=hN;function Zte(e,t){const[n,r]=w.useState("idle");return ln(()=>{if(!e){r("error");return}let i=!0;const s=new window.Image,a=o=>()=>{i&&r(o)};return r("loading"),s.onload=a("loaded"),s.onerror=a("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var pN=cN,mN=dN,gN=fN;const zS=w.forwardRef(({className:e,...t},n)=>u.jsx(pN,{ref:n,className:J("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));zS.displayName=pN.displayName;const HS=w.forwardRef(({className:e,...t},n)=>u.jsx(mN,{ref:n,className:J("aspect-square h-full w-full",e),...t}));HS.displayName=mN.displayName;const WS=w.forwardRef(({className:e,...t},n)=>u.jsx(gN,{ref:n,className:J("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));WS.displayName=gN.displayName;function M4({serverName:e,gameName:t,iconFilename:n,className:r,extraClasses:i}){let s;t==="fivem"?s="/img/fivem-server-icon.png":t==="redm"?s="/img/redm-server-icon.png":s="/img/unknown-server-icon.png";let a=s;return n&&/^icon-([a-f0-9]{16})\.png$/.test(n)&&(a=`/.runtime/${n}`),u.jsxs(zS,{className:J(r,i),children:[u.jsx(HS,{src:a,alt:e}),u.jsx(WS,{asChild:!0,children:u.jsx("img",{src:s,className:"aspect-square rounded-md h-full w-full"})})]})}function ene(e){return u.jsxs("div",{className:"relative flex shrink-0",children:[u.jsx(M4,{...e,extraClasses:"size-14 xs:size-16 rounded-md z-10"}),u.jsx(M4,{...e,extraClasses:"size-14 xs:size-16 absolute blur-lg z-0 scale-90"})]})}function tne(){return u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"text-xl xs:text-2xl text-primary/85 font-semibold line-clamp-1",children:"Welcome to txAdmin!"}),u.jsx("div",{className:"text-sm xs:text-base font-normal tracking-wide text-muted-foreground",children:"please login to continue"})]})}function nne(){const e=window.txConsts.server;return!e||!e.name||!e.game&&!e.icon?u.jsx(tne,{}):u.jsxs(u.Fragment,{children:[u.jsx(ene,{iconFilename:e.icon,serverName:e.name,gameName:e.game}),u.jsxs("div",{className:"grow xs:h-full flex flex-col xs:justify-between",children:[u.jsx("div",{className:"text-xl xs:text-2xl font-semibold line-clamp-1",children:e.name}),u.jsx("div",{className:"text-sm xs:text-base text-muted-foreground",children:"Login to continue"})]})]})}var xc=(e=>(e.NONE="",e.LOGOUT="#logout",e.EXPIRED="#expired",e.UPDATED="#updated",e.MASTER_ALREADY_SET="#master_already_set",e.SHUTDOWN="#shutdown",e))(xc||{});function rne(){const{setAuthData:e}=Ga(),t=w.useRef(null),n=w.useRef(null),[r,i]=w.useState(),[s,a]=w.useState(!1),o=$o()[1],l=f=>{const{errorTitle:g,errorMessage:_}=af(f);i(`${g}:
${_}`)},c=f=>{f==="no_admins_setup"?(i(`No admins set up.
Redirecting...`),o("/addMaster/pin")):i(f)},h=async()=>{var f,g;try{a(!0);const _=await Eo(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",body:{username:((f=t.current)==null?void 0:f.value)??"",password:((g=n.current)==null?void 0:g.value)??""}});"error"in _?_.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):c(_.error):e(_)}catch(_){l(_)}finally{a(!1)}},d=async()=>{try{a(!0);const f=await Eo(`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`);"error"in f?(c(f.error),a(!1)):(console.log("Redirecting to",f.authUrl),window.location.href=f.authUrl)}catch(f){l(f),a(!1)}};return w.useEffect(()=>{try{const f=localStorage.getItem("authCredsAutofill");if(f){const[g,_]=JSON.parse(f);t.current.value=g??"",n.current.value=_??""}}catch(f){console.error("Username/Pass autofill failed",f)}},[]),w.useEffect(()=>{const f=window.location.hash;f&&(f==="#logout"?i("Logged Out."):f==="#expired"?i("Session Expired."):f==="#updated"?i(`txAdmin updated!
Please login again.`):f==="#master_already_set"?i("Master account already configured."):f==="#shutdown"&&i(`The txAdmin server shut down.
Please start it again to be able to login.`),window.location.hash="")},[]),u.jsxs("form",{onSubmit:f=>{f.preventDefault(),h()},className:"w-full rounded-[inherit]",children:[u.jsx(Lv,{className:"rounded-t-[inherit]",children:u.jsx(Y2,{className:"h-14 xs:h-16 flex flex-row justify-center items-center gap-4",children:u.jsx(nne,{})})}),u.jsxs(Uc,{className:"flex flex-col pt-4 gap-4 border-t rounded-b-[inherit] bg-card",children:[r&&u.jsx("div",{className:"text-center text-sm whitespace-pre-wrap text-destructive-inline",children:r}),u.jsxs("div",{className:"flex flex-col xs:grid grid-cols-8 gap-2 xs:gap-4 items-baseline",children:[u.jsx(_n,{className:"col-span-2",htmlFor:"frm-login",children:"Username"}),u.jsx(yt,{id:"frm-login",ref:t,type:"text",placeholder:"username",autoCapitalize:"off",autoComplete:"off",className:"col-span-6",required:!0})]}),u.jsxs("div",{className:"flex flex-col xs:grid grid-cols-8 gap-2 xs:gap-4 items-baseline",children:[u.jsx(_n,{className:"col-span-2",htmlFor:"frm-password",children:"Password"}),u.jsx(yt,{id:"frm-password",ref:n,type:"password",placeholder:"password",autoCapitalize:"off",autoComplete:"off",className:"col-span-6",required:!0})]}),u.jsxs(Ae,{variant:"outline",disabled:s,children:[s?u.jsx(Zt,{className:"mr-2 h-4 w-4 animate-spin"}):u.jsx(R3,{className:"inline mr-2 h-4 w-4"})," Login"]}),u.jsxs(Ae,{className:"cfxrebtn",variant:"outline",disabled:s,onClick:d,children:[s?u.jsx(Zt,{className:"mr-2 h-4 w-4 animate-spin"}):u.jsx(R3,{className:"inline mr-2 h-4 w-4"})," Login with Cfx.re"]})]})]})}function ine(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}function US(e=xc.NONE){const t=window.location.pathname+window.location.search+window.location.hash,n=t==="/"||t.startsWith("/login")?`/login${e}`:`/login?r=${encodeURIComponent(t)}${e}`;window.history.replaceState(null,"",n)}const Xc=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},dh=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),Xc(r))},vN=(e,t)=>{if(typeof e!="string"||!e.length)throw new Error("setUrlSearchParam: paramName must be a non-empty string");const n=new URL(window.location.toString());t?n.searchParams.set(e,t):n.searchParams.delete(e),window.history.replaceState({},"",n)},sne=e=>{const t=new URL(window.location.href);e?t.hash=e:t.hash="",window.history.replaceState(null,"",t.toString())},one=JD("liveConsoleCommandHistory",[]),ane=JD("liveConsoleCommandBookmarks",[]),lne=50,yN=()=>{const[e,t]=mr(one);return{history:e,setHistory:t,appendHistory:n=>{const r=e.filter(i=>i!==n);r.unshift(n)>lne&&r.pop(),t(r)},wipeHistory:()=>{t([])}}},cne=()=>{const[e,t]=mr(ane);return{bookmarks:e,addBookmark:n=>{e.includes(n)||t([n,...e])},removeBookmark:n=>{t(e.filter(r=>r!==n))}}};function fp({icon:e,title:t,disabled:n,onClick:r}){return u.jsxs("div",{tabIndex:0,className:J(`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:[u.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"}),u.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t})]})}function une(e){const{history:t,appendHistory:n}=yN(),[r,i]=w.useState(-1),s=w.useRef(""),a=e.termInputRef,{hasPerm:o}=rr(),l=o("console.write"),c=et(gD);w.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected,a]);const h=()=>{if(!a.current)return;r===-1&&(s.current=a.current.value??"");const y=r+1;t[y]&&(a.current.value=t[y],i(y))},d=()=>{if(!a.current)return;const y=r-1;y===-1?(a.current.value=s.current,i(y)):t[y]&&(a.current.value=t[y],i(y))},f=()=>{if(!a.current)return;const y=a.current.value.trim();i(-1),a.current.value="",s.current="",y&&(n(y),e.consoleWrite(y))},g=y=>{e.isConnected&&(y.key==="ArrowUp"?(h(),y.preventDefault()):y.key==="ArrowDown"?(d(),y.preventDefault()):y.key==="Enter"&&(f(),y.preventDefault()))};let _;return l?c.isChildAlive?e.isConnected||(_="Socket connection lost."):_="The server is not running.":_="You do not have permission to write to the console.",u.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:[u.jsxs("div",{className:"flex items-center grow",children:[u.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:u.jsx("path",{d:"m9 18 6-6-6-6"})}),u.jsx(yt,{ref:a,className:J("w-full",!!_&&"placeholder:text-destructive placeholder:opacity-100"),placeholder:_??"Type a command...",type:"text",disabled:!!_,onKeyDown:g,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),u.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[u.jsx(fp,{icon:MK,title:"Saved",onClick:e.toggleSaveSheet}),u.jsx(fp,{icon:yY,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),u.jsx(fp,{icon:KD,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),u.jsx(fp,{icon:GK,title:"Download",disabled:!e.isConnected,onClick:()=>{Xc("/fxserver/downloadLog")}})]})]})}function dne(){return u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.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:[u.jsx("polyline",{points:"4 17 10 11 4 5"}),u.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),u.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]})})}function vl({title:e,onClick:t,isActive:n,children:r}){return u.jsx("button",{title:e,className:J("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 Yy="No results",hne={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function xN({show:e,setShow:t,searchAddon:n}){const[r,i]=w.useState(!1),[s,a]=w.useState(!1),[o,l]=w.useState(!1),c=w.useRef(null),[h,d]=w.useState(Yy),f=S=>{n.clearDecorations(),S&&d(S)},g=S=>({decorations:hne,caseSensitive:r,wholeWord:s,regex:o,...S});w.useEffect(()=>{var S;e?(S=c.current)==null||S.focus():f(Yy)},[e]),w.useEffect(()=>{if(!n)return;const S=n.onDidChangeResults(({resultIndex:C,resultCount:E})=>{d(C===-1?Yy:`${C+1}/${E}`)});return()=>{S.dispose()}},[]);const _=()=>{!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()))},v=S=>{c.current&&(console.log("search input keydown",S.code),S.code==="Enter"&&(S.shiftKey?_():y(),S.preventDefault()))},m=S=>{c.current&&y()},p=()=>{c.current&&(i(!r),f(),n.findNext(c.current.value,g({caseSensitive:!r})))},x=()=>{c.current&&(a(!s),f(),n.findNext(c.current.value,g({wholeWord:!s})))},b=()=>{c.current&&(l(!o),f(),n.findNext(c.current.value,g({regex:!o})))};return yi("message",S=>{var C;S.data.type==="liveConsoleSearchHotkey"&&(S.data.action==="previous"?_():S.data.action==="next"?y():S.data.action==="focus"&&((C=c.current)==null||C.focus()))}),e?u.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:[u.jsxs("div",{className:"relative",children:[u.jsx(yt,{ref:c,className:"h-8",placeholder:"Search string",onKeyDown:v,onChange:m,onBlur:()=>{n.clearActiveDecoration()}}),u.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[u.jsx(vl,{title:"Case Sensitive",isActive:r,onClick:p,children:u.jsx(jK,{className:"h-5 w-5"})}),u.jsx(vl,{title:"Whole Word",isActive:s,onClick:x,children:u.jsx(AY,{className:"h-5 w-5"})}),u.jsx(vl,{title:"Regex",isActive:o,onClick:b,children:u.jsx(mY,{className:"h-4 w-5"})})]})]}),u.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:h}),u.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[u.jsx(vl,{title:"Previous",onClick:_,children:u.jsx(EK,{className:"h-5 w-5"})}),u.jsx(vl,{title:"Next",onClick:y,children:u.jsx(CK,{className:"h-5 w-5"})}),u.jsx(vl,{title:"Close",onClick:()=>{t(!1)},children:u.jsx(yr,{className:"h-5 w-5"})})]})]}):null}function fne({isOpen:e,closeSheet:t}){return u.jsx("div",{className:J("absolute inset-0 z-20","bg-black/60 duration-300","data-[state=open]:pointer-events-auto data-[state=closed]:pointer-events-none","data-[state=open]:opacity-100","data-[state=closed]:opacity-0"),"data-state":e?"open":"closed",onClick:t})}function pne({closeSheet:e}){return u.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:u.jsx(yr,{className:"h-8 w-8"})})}function R4({cmd:e,type:t,onClick:n,onFavAction:r}){const i=s=>{s.stopPropagation(),r()};return u.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:[u.jsx("span",{className:"py-1 line-clamp-4 font-mono group-hover:text-primary",children:e}),u.jsx("div",{className:"min-w-max",children:u.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"?u.jsxs(u.Fragment,{children:[u.jsx(CY,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Save"})]}):u.jsxs(u.Fragment,{children:[u.jsx(SY,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Remove"})]})})})]})}function mne({toTermInput:e}){const{history:t,wipeHistory:n}=yN(),{bookmarks:r,addBookmark:i,removeBookmark:s}=cne(),a=tf(),o=()=>{We.success("History cleared"),n()},l=()=>{a({title:"Save Command",message:"Enter the command to save:",submitLabel:"Save",onSubmit:c=>{c&&i(c)}})};return u.jsxs("div",{className:"flex flex-row gap-4 max-h-full",children:[u.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[u.jsx("h2",{className:"text-xl font-bold",children:"History"}),u.jsxs(Qr,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[u.jsx("button",{onClick:o,className:"w-full py-2 rounded-lg bg-secondary hover:bg-primary hover:text-primary-foreground font-sans tracking-wider mb-2",children:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(yr,{className:"w-4 h-4 inline"}),"Clear History"]})}),u.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:t.map((c,h)=>u.jsx(R4,{cmd:c,type:"history",onClick:()=>e(c),onFavAction:()=>i(c)},h))}),t.length===0&&u.jsx("div",{className:"w-full h-auto text-center italic tracking-wider",children:"The command history is empty."})]})]}),u.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[u.jsx("h2",{className:"text-xl font-bold",children:"Saved"}),u.jsxs(Qr,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[u.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:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(hS,{className:"w-4 h-4 inline"}),"Add New"]})}),u.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide  pb-4",children:r.map((c,h)=>u.jsx(R4,{cmd:c,type:"saved",onClick:()=>e(c),onFavAction:()=>s(c)},h))}),r.length===0&&u.jsxs("div",{className:"w-full h-auto text-center italic tracking-wider",children:["There are no saved commands. ",u.jsx("br",{}),"To save a command, click the star icon next to it."]})]})]})]})}function gne({isOpen:e,closeSheet:t,toTermInput:n}){return u.jsxs(u.Fragment,{children:[u.jsx(fne,{isOpen:e,closeSheet:t}),u.jsxs("div",{"data-state":e?"open":"closed",className:J("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:[u.jsx(pne,{closeSheet:t}),u.jsx(mne,{toTermInput:n})]})]})}class _N{constructor(t,n){pl(this,"btnRef");pl(this,"containerElement");pl(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 vne={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"},bN={theme:vne,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},dd={WHITE:"\x1B[0;37m",GRAY:"\x1B[1;90m",YELLOW:"\x1B[0;33m",RESET:"\x1B[0m"},yne=/[\x00-\x08\x0B-\x1A\x1C-\x1F\x7F]|(?:\x1B\[|\x9B)[\d;]+[@-K]/g,xne=/\x1B[^m]*?m/g,VS=e=>e.replace(yne,"").replace(xne,""),_ne=e=>/^{§[0-9a-f]{8}}/.test(e)?{ts:parseInt(e.slice(2,10),16),content:e.slice(11)}:{ts:null,content:e},wN=(e,t)=>t.timestampDisabled?"":new Date(e*1e3).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:t.timestampForceHour12??window.txBrowserHour12})+dd.RESET+" ",bne=(e,t)=>{if(t.copyTimestamp&&t.copyTag)return e;const n=/^(?<ts>\d{2}:\d{2}:\d{2}(?: [AP]M)? )?(?<tag>\[.{20}] )?(?<content>.*)?/,r=e.match(n);if(!r)return e;const{ts:i,tag:s,content:a}=r.groups??{};let o="";return t.copyTimestamp&&(o+=i??""),t.copyTag&&(o+=s??""),o+(a??"").trimEnd()},wne=async(e,t,n,r=null)=>{const i=e.split(/\r?\n/).map(s=>bne(s,n)).join(`\r
`).replace(/(\r?\n)+$/,`\r
`);return WL(i,t,r)},A4=(e,t)=>{console.groupCollapsed("getNumFontVariantsLoaded:",t);const n=s=>s.toLowerCase().replace(/^["']|["']$/g,""),r=n(getComputedStyle(document.documentElement).getPropertyValue(e));if(!r)return console.error("No --font-mono value found"),0;console.log("--font-mono:",r);let i=0;for(const s of document.fonts){if(n(s.family)!==r)continue;const a=s.status==="loaded",o=a?"green":"red";console.log(`%c${s.status}:`,`color: ${o}`,s.unicodeRange),a&&i++}return console.log("Loaded:",i),console.groupEnd(),i},Sne=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]{3,}/,SN="\x1B[3m",Cne=e=>{if(Sne.test(e))return{markerData:{classes:"bg-warning text-warning-foreground",labelShort:"RTL",labelLong:"VIEW RIGHT-TO-LEFT TEXT",onClick:()=>{We.warning({title:"Bidirectional Text Detected:",md:!0,msg:`Due to limitations, the terminal cannot display RTL text.
This is what the text is supposed to look like:

${VS(e)}`},{duration:7500})}}}},CN=e=>JSON.parse(e.replace(/\u037e/g,";").replace(/\\"/g,'"')),kne=e=>{const t=VS(e),n=/^(?<bar>.)\s+TXADMIN\1 txaEvent "(?<arg0>\w+)" "(?<arg1>.*)"$/,r=t.match(n);if(!r||!r.groups)return;const{arg0:i,arg1:s}=r.groups,a=CN(s),o=`txaEvent "${i}" "${s}"`,l=`${SN}<broadcasting txAdmin:events:${i}>`;return{newLine:e.replace(o,l),markerData:{classes:"bg-info text-info-foreground",labelShort:"EVENT",labelLong:"VIEW EVENT",onClick:()=>{We.info({title:`txAdmin:events:${i}:`,md:!0,msg:"```json\n"+JSON.stringify(a,null,2)+"\n```"},{duration:7500})}}}},Ene=e=>{const t=VS(e),n=/^(?<bar>.)\s+TXADMIN\1 txaInitialData "(?<arg0>.*)"$/,r=t.match(n);if(!r||!r.groups)return;console.log("getTermLineInitialData",r.groups);const{arg0:i}=r.groups,s=CN(i),a=`txaInitialData "${i}"`,o=`${SN}<txaInitialData>`;return{newLine:e.replace(a,o),markerData:{classes:"bg-info text-info-foreground",labelShort:"CMD",labelLong:"VIEW COMMAND",onClick:()=>{We.info({title:"Initial Player Data:",md:!0,msg:"```json\n"+JSON.stringify(s,null,2)+"\n```"},{duration:7500})}}}},Tne=(e,t)=>{const n=e.registerMarker(-1),r=e.registerDecoration({layer:"top",marker:n});return r&&r.onRender(i=>{if(i.innerHTML)return;const s="rgba(255,255,255, 0.01)",a="rgba(255,255,255, 0.05)",o=document.createElement("button");o.className=J("absolute right-0 px-1 py-0 text-2xs rounded overflow-hidden text-nowrap transition-all",t.classes),o.innerText=t.labelShort,o.onclick=t.onClick;const l=()=>{o.style.width=`calc(${o.innerText.length+1}ch + 0.5rem)`};o.onmouseenter=()=>{o.innerText=t.labelLong,l(),i.style.backgroundColor=a},o.onmouseleave=()=>{o.innerText=t.labelShort,l(),i.style.backgroundColor=s},l(),i.classList.add("rounded"),i.style.backgroundColor=s,i.style.width="100%",i.replaceChildren(o)}),!!r};let qS=!1,gg;try{const e=localStorage.getItem("liveConsoleTimestamp");e==="24h"?gg=!1:e==="12h"?gg=!0:e==="off"&&(qS=!0)}catch{}let GS=!1,KS=!0;try{const e=localStorage.getItem("liveConsoleCopyOpts");if(typeof e=="string"){const t=e.split(",");GS=t.includes("ts"),KS=t.includes("tag")}}catch{}const $u=150,j4=wN(Date.now(),{timestampDisabled:qS,timestampForceHour12:gg,copyTimestamp:GS,copyTag:KS}).replace(/\w/g,"-");function Mne(){const[e,t]=w.useState(!1),[n,r]=w.useState(!1),[i,s]=w.useState(!1),a=w.useRef(null),o=w.useRef({ts:0,lastEol:!0,prefix:j4}),l=Bv(),c=w.useMemo(()=>({timestampDisabled:qS,timestampForceHour12:gg,copyTimestamp:GS,copyTag:KS}),[]),h=w.useRef(null),d=w.useRef(null),f=w.useMemo(()=>new ED.Terminal(bN),[]),g=w.useMemo(()=>new jD.FitAddon,[]),_=w.useMemo(()=>new DD.SearchAddon,[]),y=(M,L)=>{Xc(L)},v=w.useMemo(()=>new PD.WebLinksAddon(y),[]),m=Un($u,M=>{window.postMessage({type:"liveConsoleSearchHotkey",action:M})},{noTrailing:!0}),p=()=>{if(!d.current||!f.element||!g){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const M=g.proposeDimensions();M?f.resize(M.cols,M.rows):console.log("refitTerminal: no proposed dimensions")};yi("resize",nS(100,p)),w.useEffect(()=>{if(d.current&&h.current&&!f.element){console.log("live console xterm init"),d.current.innerHTML="",f.loadAddon(g),f.loadAddon(_),f.loadAddon(v),f.loadAddon(new RD.CanvasAddon),f.loadAddon(new _N(h.current,d.current)),f.open(d.current),f.write("\x1B[?25l"),p();const M=Un($u,()=>{f.scrollLines(Math.min(1,2-f.rows))},{noTrailing:!0}),L=Un($u,()=>{f.scrollLines(Math.max(1,f.rows-2))},{noTrailing:!0}),D=Un($u,()=>{f.scrollToTop()},{noTrailing:!0}),N=Un($u,()=>{f.scrollToBottom()},{noTrailing:!0});f.attachCustomKeyEventHandler(P=>{if(P.code==="F5"&&!P.ctrlKey)return!1;if(P.code==="Escape")return!1;if(P.code==="KeyF"&&(P.ctrlKey||P.metaKey))return!1;if(P.code==="F3")return!1;if(P.code==="KeyC"&&(P.ctrlKey||P.metaKey)){const I=f.getSelection();return I&&(wne(I,f.element,c,a.current).then(z=>{z===!1&&We.error("Failed to copy to clipboard :(")}).catch(z=>{We.error({title:"Failed to copy to clipboard:",msg:z.message})}),f.clearSelection()),!1}else{if(P.code==="PageUp")return M(),!1;if(P.code==="PageDown")return L(),!1;if(P.code==="Home")return D(),!1;if(P.code==="End")return N(),!1;if(aS(P))return!1}return!0})}},[f]),yi("keydown",M=>{M.code==="F5"&&!M.ctrlKey?n&&(l(),M.preventDefault()):M.code==="Escape"?(_.clearDecorations(),s(!1)):M.code==="KeyF"&&(M.ctrlKey||M.metaKey)?(i?m("focus"):s(!0),M.preventDefault()):M.code==="F3"&&(m(M.shiftKey?"previous":"next"),M.preventDefault())});const x=M=>{const L=M.split(/\r?\n/);let D=!1;L.length&&!L[L.length-1]&&(L.pop(),D=!0);let N=!1;for(let P=0;P<L.length;P++){N=!1;let I=L[P];try{const{ts:A,content:F}=_ne(I);A&&(N=!0,I=F,o.current.ts=A,o.current.prefix=wN(A,c))}catch(A){o.current.prefix=j4,console.warn("Failed to parse timestamp from:",I,A.message)}let z;try{const A=kne(I)??Ene(I)??Cne(I);A&&A.markerData&&(z=()=>Tne(f,A.markerData)),A&&A.newLine&&(I=A.newLine)}catch(A){console.error("Failed to process marker:",A.message)}const O=N?dd.WHITE:dd.GRAY,j=o.current.lastEol?O+o.current.prefix:"";P<L.length-1||D?(f.writeln(j+I,z),o.current.lastEol=!0):(f.write(j+I,z),o.current.lastEol=!1)}},b=w.useRef(0),S=w.useRef(null);w.useEffect(()=>(S.current=K2(["liveconsole"]),S.current.on("connect",()=>{console.log("LiveConsole Socket.IO Connected."),r(!0)}),S.current.on("disconnect",M=>{console.log("LiveConsole Socket.IO Disonnected:",M);const L=b.current+1;b.current=L,setTimeout(()=>{b.current===L&&r(!1)},500)}),S.current.on("error",M=>{console.log("LiveConsole Socket.IO",M)}),S.current.on("consoleData",function(M){x(M)}),()=>{var M,L;(M=S.current)==null||M.removeAllListeners(),(L=S.current)==null||L.disconnect()}),[]),w.useEffect(()=>{if(A4("--font-mono","INITIAL EFFECT"))return;const M=()=>{A4("--font-mono","ON FONT LOADING DONE"),l()};return document.fonts.addEventListener("loadingdone",M),()=>{document.fonts.removeEventListener("loadingdone",M)}},[]);const C=M=>{!n||!S.current||(M==="cls"||M==="clear"?E():S.current.emit("consoleCommand",M))},E=()=>{f.clear(),_.clearDecorations(),s(!1),f.write(`${dd.YELLOW}[console cleared]${dd.RESET}
`)},k=()=>{s(!i)},T=()=>{t(!e)},R=M=>{a.current&&(a.current.value=M,a.current.focus()),t(!1)};return u.jsxs("div",{className:"dark text-primary flex flex-col h-contentvh w-full bg-card border md:rounded-xl overflow-clip",children:[u.jsx(dne,{}),u.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[n?null:u.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:u.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[u.jsx(Zt,{className:"w-16 h-16 animate-spin"}),u.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),u.jsx(gne,{isOpen:e,closeSheet:()=>t(!1),toTermInput:M=>R(M)}),u.jsx("div",{ref:d,className:"absolute top-1 left-2 right-0 bottom-0"}),u.jsx(xN,{show:i,setShow:s,searchAddon:_}),u.jsx("button",{ref:h,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{f.scrollToBottom()},children:u.jsx($D,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),u.jsx(une,{termInputRef:a,isConnected:n,consoleWrite:C,consoleClear:E,toggleSaveSheet:T,toggleSearchBar:k})]})}const Rne=e=>1- --e*e*e*e,L4=1e3/60,pp=({countTo:e,duration:t=1250})=>{const[n,r]=w.useState(0);return w.useEffect(()=>{let i=0;const s=Math.round(t/L4),a=setInterval(()=>{i++;const o=Rne(i/s);r(e*o),i===s&&clearInterval(a)},L4)},[]),Math.floor(n).toLocaleString("en-US")};function mp(){return u.jsx("div",{className:"h-7 w-28 animate-pulse rounded-md bg-muted"})}function kN({callouts:e}){return e.length!==4?null:u.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:[u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[0].label}),u.jsx("div",{className:"hidden xs:block",children:e[0].icon})]}),e[0].value===!1?u.jsx(mp,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[0].prefix,u.jsx(pp,{countTo:e[0].value})]})]}),u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[1].label}),u.jsx("div",{className:"hidden xs:block",children:e[1].icon})]}),e[1].value===!1?u.jsx(mp,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[1].prefix,u.jsx(pp,{countTo:e[1].value})]})]}),u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[2].label}),u.jsx("div",{className:"hidden xs:block",children:e[2].icon})]}),e[2].value===!1?u.jsx(mp,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[2].prefix,u.jsx(pp,{countTo:e[2].value})]})]}),u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[3].label}),u.jsx("div",{className:"hidden xs:block",children:e[3].icon})]}),e[3].value===!1?u.jsx(mp,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[3].prefix,u.jsx(pp,{countTo:e[3].value})]})]})]})}function Zr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Ane({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,o=Et(n),l=w.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&o(d)}else i(c)},[s,e,i,o]);return[a,l]}function Ane({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),s=Et(t);return w.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function lf(e){const t=e+"CollectionProvider",[n,r]=In(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:_,children:y}=g,v=lt.useRef(null),m=lt.useRef(new Map).current;return u.jsx(i,{scope:_,itemMap:m,collectionRef:v,children:y})};a.displayName=t;const o=e+"CollectionSlot",l=lt.forwardRef((g,_)=>{const{scope:y,children:v}=g,m=s(o,y),p=Fe(_,m.collectionRef);return u.jsx(Co,{ref:p,children:v})});l.displayName=o;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=lt.forwardRef((g,_)=>{const{scope:y,children:v,...m}=g,p=lt.useRef(null),x=Fe(_,p),b=s(c,y);return lt.useEffect(()=>(b.itemMap.set(p,{ref:p,...m}),()=>void b.itemMap.delete(p))),u.jsx(Co,{[h]:"",ref:x,children:v})});d.displayName=c;function f(g){const _=s(e+"CollectionConsumer",g);return lt.useCallback(()=>{const v=_.collectionRef.current;if(!v)return[];const m=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(_.itemMap.values()).sort((b,S)=>m.indexOf(b.ref.current)-m.indexOf(S.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}function jne(e,t=globalThis==null?void 0:globalThis.document){const n=Et(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Lne="DismissableLayer",vb="dismissableLayer.update",Dne="dismissableLayer.pointerDownOutside",Nne="dismissableLayer.focusOutside",D4,EN=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jc=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,c=w.useContext(EN),[h,d]=w.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=w.useState({}),_=Fe(t,E=>d(E)),y=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=y.indexOf(v),p=h?y.indexOf(h):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,b=p>=m,S=Ine(E=>{const k=E.target,T=[...c.branches].some(R=>R.contains(k));!b||T||(i==null||i(E),a==null||a(E),E.defaultPrevented||o==null||o())},f),C=$ne(E=>{const k=E.target;[...c.branches].some(R=>R.contains(k))||(s==null||s(E),a==null||a(E),E.defaultPrevented||o==null||o())},f);return jne(E=>{p===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},f),w.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(D4=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),N4(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=D4)}},[h,f,n,c]),w.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),N4())},[h,c]),w.useEffect(()=>{const E=()=>g({});return document.addEventListener(vb,E),()=>document.removeEventListener(vb,E)},[]),u.jsx(Ce.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:fe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:fe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:fe(e.onPointerDownCapture,S.onPointerDownCapture)})});Jc.displayName=Lne;var Pne="DismissableLayerBranch",One=w.forwardRef((e,t)=>{const n=w.useContext(EN),r=w.useRef(null),i=Fe(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Ce.div,{...e,ref:i})});One.displayName=Pne;function Ine(e,t=globalThis==null?void 0:globalThis.document){const n=Et(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){TN(Dne,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $ne(e,t=globalThis==null?void 0:globalThis.document){const n=Et(e),r=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!r.current&&TN(Nne,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function N4(){const e=new CustomEvent(vb);document.dispatchEvent(e)}function TN(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Zm(i,s):i.dispatchEvent(s)}var Xy=0;function YS(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??P4()),document.body.insertAdjacentElement("beforeend",e[1]??P4()),Xy++,()=>{Xy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Xy--}},[])}function P4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function Bne(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function MN(...e){return t=>e.forEach(n=>Bne(n,t))}function Fne(...e){return w.useCallback(MN(...e),e)}var RN=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(Hne);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return u.jsx(yb,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return u.jsx(yb,{...r,ref:t,children:n})});RN.displayName="Slot";var yb=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=Une(n);return w.cloneElement(n,{...Wne(r,n.props),ref:t?MN(t,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});yb.displayName="SlotClone";var zne=({children:e})=>u.jsx(u.Fragment,{children:e});function Hne(e){return w.isValidElement(e)&&e.type===zne}function Wne(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{s(...o),i(...o)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Une(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],qne=Vne.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?RN:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Jy="focusScope.autoFocusOnMount",Qy="focusScope.autoFocusOnUnmount",O4={bubbles:!1,cancelable:!0},Gne="FocusScope",Qv=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=w.useState(null),c=Et(i),h=Et(s),d=w.useRef(null),f=Fne(t,y=>l(y)),g=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let y=function(x){if(g.paused||!o)return;const b=x.target;o.contains(b)?d.current=b:Ks(d.current,{select:!0})},v=function(x){if(g.paused||!o)return;const b=x.relatedTarget;b!==null&&(o.contains(b)||Ks(d.current,{select:!0}))},m=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&Ks(o)};document.addEventListener("focusin",y),document.addEventListener("focusout",v);const p=new MutationObserver(m);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",v),p.disconnect()}}},[r,o,g.paused]),w.useEffect(()=>{if(o){$4.add(g);const y=document.activeElement;if(!o.contains(y)){const m=new CustomEvent(Jy,O4);o.addEventListener(Jy,c),o.dispatchEvent(m),m.defaultPrevented||(Kne(Zne(AN(o)),{select:!0}),document.activeElement===y&&Ks(o))}return()=>{o.removeEventListener(Jy,c),setTimeout(()=>{const m=new CustomEvent(Qy,O4);o.addEventListener(Qy,h),o.dispatchEvent(m),m.defaultPrevented||Ks(y??document.body,{select:!0}),o.removeEventListener(Qy,h),$4.remove(g)},0)}}},[o,c,h,g]);const _=w.useCallback(y=>{if(!n&&!r||g.paused)return;const v=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,m=document.activeElement;if(v&&m){const p=y.currentTarget,[x,b]=Yne(p);x&&b?!y.shiftKey&&m===b?(y.preventDefault(),n&&Ks(x,{select:!0})):y.shiftKey&&m===x&&(y.preventDefault(),n&&Ks(b,{select:!0})):m===p&&y.preventDefault()}},[n,r,g.paused]);return u.jsx(qne.div,{tabIndex:-1,...a,ref:f,onKeyDown:_})});Qv.displayName=Gne;function Kne(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ks(r,{select:t}),document.activeElement!==n)return}function Yne(e){const t=AN(e),n=I4(t,e),r=I4(t.reverse(),e);return[n,r]}function AN(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 I4(e,t){for(const n of e)if(!Xne(n,{upTo:t}))return n}function Xne(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 Jne(e){return e instanceof HTMLInputElement&&"select"in e}function Ks(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Jne(e)&&t&&e.select()}}var $4=Qne();function Qne(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=B4(e,t),e.unshift(t)},remove(t){var n;e=B4(e,t),(n=e[0])==null||n.resume()}}}function B4(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Zne(e){return e.filter(t=>t.tagName!=="A")}var ere=oj.useId||(()=>{}),tre=0;function Rr(e){const[t,n]=w.useState(ere());return ln(()=>{n(r=>r??String(tre++))},[e]),t?`radix-${t}`:""}const nre=["top","right","bottom","left"],To=Math.min,Cr=Math.max,vg=Math.round,gp=Math.floor,Ui=e=>({x:e,y:e}),rre={left:"right",right:"left",bottom:"top",top:"bottom"},ire={start:"end",end:"start"};function xb(e,t,n){return Cr(e,To(t,n))}function js(e,t){return typeof e=="function"?e(t):e}function Ls(e){return e.split("-")[0]}function Qc(e){return e.split("-")[1]}function XS(e){return e==="x"?"y":"x"}function JS(e){return e==="y"?"height":"width"}function Mo(e){return["top","bottom"].includes(Ls(e))?"y":"x"}function QS(e){return XS(Mo(e))}function sre(e,t,n){n===void 0&&(n=!1);const r=Qc(e),i=QS(e),s=JS(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=yg(a)),[a,yg(a)]}function ore(e){const t=yg(e);return[_b(e),t,_b(t)]}function _b(e){return e.replace(/start|end/g,t=>ire[t])}function are(e,t,n){const r=["left","right"],i=["right","left"],s=["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?s:a;default:return[]}}function lre(e,t,n,r){const i=Qc(e);let s=are(Ls(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(_b)))),s}function yg(e){return e.replace(/left|right|bottom|top/g,t=>rre[t])}function cre(e){return{top:0,right:0,bottom:0,left:0,...e}}function jN(e){return typeof e!="number"?cre(e):{top:e,right:e,bottom:e,left:e}}function xg(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function F4(e,t,n){let{reference:r,floating:i}=e;const s=Mo(t),a=QS(t),o=JS(a),l=Ls(t),c=s==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let g;switch(l){case"top":g={x:h,y:r.y-i.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-i.width,y:d};break;default:g={x:r.x,y:r.y}}switch(Qc(t)){case"start":g[a]-=f*(n&&c?-1:1);break;case"end":g[a]+=f*(n&&c?-1:1);break}return g}const ure=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:d}=F4(c,r,l),f=r,g={},_=0;for(let y=0;y<o.length;y++){const{name:v,fn:m}=o[y],{x:p,y:x,data:b,reset:S}=await m({x:h,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});h=p??h,d=x??d,g={...g,[v]:{...g[v],...b}},S&&_<=50&&(_++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:h,y:d}=F4(c,f,l)),y=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:g}};async function hh(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:g=0}=js(t,e),_=jN(g),v=o[f?d==="floating"?"reference":"floating":d],m=xg(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:l})),p=d==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),b=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},S=xg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:x,strategy:l}):p);return{top:(m.top-S.top+_.top)/b.y,bottom:(S.bottom-m.bottom+_.bottom)/b.y,left:(m.left-S.left+_.left)/b.x,right:(S.right-m.right+_.right)/b.x}}const dre=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:l}=t,{element:c,padding:h=0}=js(e,t)||{};if(c==null)return{};const d=jN(h),f={x:n,y:r},g=QS(i),_=JS(g),y=await a.getDimensions(c),v=g==="y",m=v?"top":"left",p=v?"bottom":"right",x=v?"clientHeight":"clientWidth",b=s.reference[_]+s.reference[g]-f[g]-s.floating[_],S=f[g]-s.reference[g],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let E=C?C[x]:0;(!E||!await(a.isElement==null?void 0:a.isElement(C)))&&(E=o.floating[x]||s.floating[_]);const k=b/2-S/2,T=E/2-y[_]/2-1,R=To(d[m],T),M=To(d[p],T),L=R,D=E-y[_]-M,N=E/2-y[_]/2+k,P=xb(L,N,D),I=!l.arrow&&Qc(i)!=null&&N!==P&&s.reference[_]/2-(N<L?R:M)-y[_]/2<0,z=I?N<L?N-L:N-D:0;return{[g]:f[g]+z,data:{[g]:P,centerOffset:N-P-z,...I&&{alignmentOffset:z}},reset:I}}}),hre=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:y=!0,...v}=js(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const m=Ls(i),p=Mo(o),x=Ls(o)===o,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(x||!y?[yg(o)]:ore(o)),C=_!=="none";!f&&C&&S.push(...lre(o,y,_,b));const E=[o,...S],k=await hh(t,v),T=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&T.push(k[m]),d){const N=sre(i,a,b);T.push(k[N[0]],k[N[1]])}if(R=[...R,{placement:i,overflows:T}],!T.every(N=>N<=0)){var M,L;const N=(((M=s.flip)==null?void 0:M.index)||0)+1,P=E[N];if(P)return{data:{index:N,overflows:R},reset:{placement:P}};let I=(L=R.filter(z=>z.overflows[0]<=0).sort((z,O)=>z.overflows[1]-O.overflows[1])[0])==null?void 0:L.placement;if(!I)switch(g){case"bestFit":{var D;const z=(D=R.filter(O=>{if(C){const j=Mo(O.placement);return j===p||j==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(j=>j>0).reduce((j,A)=>j+A,0)]).sort((O,j)=>O[1]-j[1])[0])==null?void 0:D[0];z&&(I=z);break}case"initialPlacement":I=o;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function z4(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function H4(e){return nre.some(t=>e[t]>=0)}const fre=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=js(e,t);switch(r){case"referenceHidden":{const s=await hh(t,{...i,elementContext:"reference"}),a=z4(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:H4(a)}}}case"escaped":{const s=await hh(t,{...i,altBoundary:!0}),a=z4(s,n.floating);return{data:{escapedOffsets:a,escaped:H4(a)}}}default:return{}}}}};async function pre(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Ls(n),o=Qc(n),l=Mo(n)==="y",c=["left","top"].includes(a)?-1:1,h=s&&l?-1:1,d=js(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof _=="number"&&(g=o==="end"?_*-1:_),l?{x:g*h,y:f*c}:{x:f*c,y:g*h}}const mre=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=t,l=await pre(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:a}}}}},gre=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:v=>{let{x:m,y:p}=v;return{x:m,y:p}}},...l}=js(e,t),c={x:n,y:r},h=await hh(t,l),d=Mo(Ls(i)),f=XS(d);let g=c[f],_=c[d];if(s){const v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",p=g+h[v],x=g-h[m];g=xb(p,g,x)}if(a){const v=d==="y"?"top":"left",m=d==="y"?"bottom":"right",p=_+h[v],x=_-h[m];_=xb(p,_,x)}const y=o.fn({...t,[f]:g,[d]:_});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:s,[d]:a}}}}}},vre=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:o=0,mainAxis:l=!0,crossAxis:c=!0}=js(e,t),h={x:n,y:r},d=Mo(i),f=XS(d);let g=h[f],_=h[d];const y=js(o,t),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+v.mainAxis,S=s.reference[f]+s.reference[x]-v.mainAxis;g<b?g=b:g>S&&(g=S)}if(c){var m,p;const x=f==="y"?"width":"height",b=["top","left"].includes(Ls(i)),S=s.reference[d]-s.floating[x]+(b&&((m=a.offset)==null?void 0:m[d])||0)+(b?0:v.crossAxis),C=s.reference[d]+s.reference[x]+(b?0:((p=a.offset)==null?void 0:p[d])||0)-(b?v.crossAxis:0);_<S?_=S:_>C&&(_=C)}return{[f]:g,[d]:_}}}},yre=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:o}=t,{apply:l=()=>{},...c}=js(e,t),h=await hh(t,c),d=Ls(i),f=Qc(i),g=Mo(i)==="y",{width:_,height:y}=s.floating;let v,m;d==="top"||d==="bottom"?(v=d,m=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(m=d,v=f==="end"?"top":"bottom");const p=y-h.top-h.bottom,x=_-h.left-h.right,b=To(y-h[v],p),S=To(_-h[m],x),C=!t.middlewareData.shift;let E=b,k=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=p),C&&!f){const R=Cr(h.left,0),M=Cr(h.right,0),L=Cr(h.top,0),D=Cr(h.bottom,0);g?k=_-2*(R!==0||M!==0?R+M:Cr(h.left,h.right)):E=y-2*(L!==0||D!==0?L+D:Cr(h.top,h.bottom))}await l({...t,availableWidth:k,availableHeight:E});const T=await a.getDimensions(o.floating);return _!==T.width||y!==T.height?{reset:{rects:!0}}:{}}}};function Zv(){return typeof window<"u"}function Zc(e){return LN(e)?(e.nodeName||"").toLowerCase():"#document"}function Ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ts(e){var t;return(t=(LN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function LN(e){return Zv()?e instanceof Node||e instanceof Ar(e).Node:!1}function _i(e){return Zv()?e instanceof Element||e instanceof Ar(e).Element:!1}function Yi(e){return Zv()?e instanceof HTMLElement||e instanceof Ar(e).HTMLElement:!1}function W4(e){return!Zv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ar(e).ShadowRoot}function cf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=bi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function xre(e){return["table","td","th"].includes(Zc(e))}function e0(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ZS(e){const t=eC(),n=_i(e)?bi(e):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 _re(e){let t=Ro(e);for(;Yi(t)&&!_c(t);){if(ZS(t))return t;if(e0(t))return null;t=Ro(t)}return null}function eC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _c(e){return["html","body","#document"].includes(Zc(e))}function bi(e){return Ar(e).getComputedStyle(e)}function t0(e){return _i(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ro(e){if(Zc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||W4(e)&&e.host||ts(e);return W4(t)?t.host:t}function DN(e){const t=Ro(e);return _c(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yi(t)&&cf(t)?t:DN(t)}function fh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=DN(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ar(i);if(s){const o=bb(a);return t.concat(a,a.visualViewport||[],cf(i)?i:[],o&&n?fh(o):[])}return t.concat(i,fh(i,[],n))}function bb(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function NN(e){const t=bi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Yi(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=vg(n)!==s||vg(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function tC(e){return _i(e)?e:e.contextElement}function Ql(e){const t=tC(e);if(!Yi(t))return Ui(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=NN(t);let a=(s?vg(n.width):n.width)/r,o=(s?vg(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const bre=Ui(0);function PN(e){const t=Ar(e);return!eC()||!t.visualViewport?bre:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wre(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ar(e)?!1:t}function Ea(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=tC(e);let a=Ui(1);t&&(r?_i(r)&&(a=Ql(r)):a=Ql(e));const o=wre(s,n,r)?PN(s):Ui(0);let l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(s){const f=Ar(s),g=r&&_i(r)?Ar(r):r;let _=f,y=bb(_);for(;y&&r&&g!==_;){const v=Ql(y),m=y.getBoundingClientRect(),p=bi(y),x=m.left+(y.clientLeft+parseFloat(p.paddingLeft))*v.x,b=m.top+(y.clientTop+parseFloat(p.paddingTop))*v.y;l*=v.x,c*=v.y,h*=v.x,d*=v.y,l+=x,c+=b,_=Ar(y),y=bb(_)}}return xg({width:h,height:d,x:l,y:c})}function nC(e,t){const n=t0(e).scrollLeft;return t?t.left+n:Ea(ts(e)).left+n}function ON(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:nC(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function Sre(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=ts(r),o=t?e0(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Ui(1);const h=Ui(0),d=Yi(r);if((d||!d&&!s)&&((Zc(r)!=="body"||cf(a))&&(l=t0(r)),Yi(r))){const g=Ea(r);c=Ql(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const f=a&&!d&&!s?ON(a,l,!0):Ui(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+f.x,y:n.y*c.y-l.scrollTop*c.y+h.y+f.y}}function Cre(e){return Array.from(e.getClientRects())}function kre(e){const t=ts(e),n=t0(e),r=e.ownerDocument.body,i=Cr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Cr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+nC(e);const o=-n.scrollTop;return bi(r).direction==="rtl"&&(a+=Cr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function Ere(e,t){const n=Ar(e),r=ts(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,l=0;if(i){s=i.width,a=i.height;const c=eC();(!c||c&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function Tre(e,t){const n=Ea(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Yi(e)?Ql(e):Ui(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:a,height:o,x:l,y:c}}function U4(e,t,n){let r;if(t==="viewport")r=Ere(e,n);else if(t==="document")r=kre(ts(e));else if(_i(t))r=Tre(t,n);else{const i=PN(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return xg(r)}function IN(e,t){const n=Ro(e);return n===t||!_i(n)||_c(n)?!1:bi(n).position==="fixed"||IN(n,t)}function Mre(e,t){const n=t.get(e);if(n)return n;let r=fh(e,[],!1).filter(o=>_i(o)&&Zc(o)!=="body"),i=null;const s=bi(e).position==="fixed";let a=s?Ro(e):e;for(;_i(a)&&!_c(a);){const o=bi(a),l=ZS(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||cf(a)&&!l&&IN(e,a))?r=r.filter(h=>h!==a):i=o,a=Ro(a)}return t.set(e,r),r}function Rre(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?e0(t)?[]:Mre(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((c,h)=>{const d=U4(t,h,i);return c.top=Cr(d.top,c.top),c.right=To(d.right,c.right),c.bottom=To(d.bottom,c.bottom),c.left=Cr(d.left,c.left),c},U4(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Are(e){const{width:t,height:n}=NN(e);return{width:t,height:n}}function jre(e,t,n){const r=Yi(t),i=ts(t),s=n==="fixed",a=Ea(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=Ui(0);if(r||!r&&!s)if((Zc(t)!=="body"||cf(i))&&(o=t0(t)),r){const f=Ea(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=nC(i));const c=i&&!r&&!s?ON(i,o):Ui(0),h=a.left+o.scrollLeft-l.x-c.x,d=a.top+o.scrollTop-l.y-c.y;return{x:h,y:d,width:a.width,height:a.height}}function Zy(e){return bi(e).position==="static"}function V4(e,t){if(!Yi(e)||bi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ts(e)===n&&(n=n.ownerDocument.body),n}function $N(e,t){const n=Ar(e);if(e0(e))return n;if(!Yi(e)){let i=Ro(e);for(;i&&!_c(i);){if(_i(i)&&!Zy(i))return i;i=Ro(i)}return n}let r=V4(e,t);for(;r&&xre(r)&&Zy(r);)r=V4(r,t);return r&&_c(r)&&Zy(r)&&!ZS(r)?n:r||_re(e)||n}const Lre=async function(e){const t=this.getOffsetParent||$N,n=this.getDimensions,r=await n(e.floating);return{reference:jre(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Dre(e){return bi(e).direction==="rtl"}const Nre={convertOffsetParentRelativeRectToViewportRelativeRect:Sre,getDocumentElement:ts,getClippingRect:Rre,getOffsetParent:$N,getElementRects:Lre,getClientRects:Cre,getDimensions:Are,getScale:Ql,isElement:_i,isRTL:Dre};function Pre(e,t){let n=null,r;const i=ts(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,l){o===void 0&&(o=!1),l===void 0&&(l=1),s();const{left:c,top:h,width:d,height:f}=e.getBoundingClientRect();if(o||t(),!d||!f)return;const g=gp(h),_=gp(i.clientWidth-(c+d)),y=gp(i.clientHeight-(h+f)),v=gp(c),p={rootMargin:-g+"px "+-_+"px "+-y+"px "+-v+"px",threshold:Cr(0,To(1,l))||1};let x=!0;function b(S){const C=S[0].intersectionRatio;if(C!==l){if(!x)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(b,{...p,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,p)}n.observe(e)}return a(!0),s}function Ore(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=tC(e),h=i||s?[...c?fh(c):[],...fh(t)]:[];h.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const d=c&&o?Pre(c,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(m=>{let[p]=m;p&&p.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let _,y=l?Ea(e):null;l&&v();function v(){const m=Ea(e);y&&(m.x!==y.x||m.y!==y.y||m.width!==y.width||m.height!==y.height)&&n(),y=m,_=requestAnimationFrame(v)}return n(),()=>{var m;h.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d==null||d(),(m=g)==null||m.disconnect(),g=null,l&&cancelAnimationFrame(_)}}const Ire=mre,$re=gre,Bre=hre,Fre=yre,zre=fre,q4=dre,Hre=vre,Wre=(e,t,n)=>{const r=new Map,i={platform:Nre,...n},s={...i.platform,_c:r};return ure(e,t,{...i,platform:s})};var um=typeof document<"u"?w.useLayoutEffect:w.useEffect;function _g(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(!_g(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 s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!_g(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function BN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function G4(e,t){const n=BN(e);return Math.round(t*n)/n}function ex(e){const t=w.useRef(e);return um(()=>{t.current=e}),t}function Ure(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:l,open:c}=e,[h,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=w.useState(r);_g(f,r)||g(r);const[_,y]=w.useState(null),[v,m]=w.useState(null),p=w.useCallback(O=>{O!==C.current&&(C.current=O,y(O))},[]),x=w.useCallback(O=>{O!==E.current&&(E.current=O,m(O))},[]),b=s||_,S=a||v,C=w.useRef(null),E=w.useRef(null),k=w.useRef(h),T=l!=null,R=ex(l),M=ex(i),L=ex(c),D=w.useCallback(()=>{if(!C.current||!E.current)return;const O={placement:t,strategy:n,middleware:f};M.current&&(O.platform=M.current),Wre(C.current,E.current,O).then(j=>{const A={...j,isPositioned:L.current!==!1};N.current&&!_g(k.current,A)&&(k.current=A,Er.flushSync(()=>{d(A)}))})},[f,t,n,M,L]);um(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[c]);const N=w.useRef(!1);um(()=>(N.current=!0,()=>{N.current=!1}),[]),um(()=>{if(b&&(C.current=b),S&&(E.current=S),b&&S){if(R.current)return R.current(b,S,D);D()}},[b,S,D,R,T]);const P=w.useMemo(()=>({reference:C,floating:E,setReference:p,setFloating:x}),[p,x]),I=w.useMemo(()=>({reference:b,floating:S}),[b,S]),z=w.useMemo(()=>{const O={position:n,left:0,top:0};if(!I.floating)return O;const j=G4(I.floating,h.x),A=G4(I.floating,h.y);return o?{...O,transform:"translate("+j+"px, "+A+"px)",...BN(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:A}},[n,o,I.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:D,refs:P,elements:I,floatingStyles:z}),[h,D,P,I,z])}const Vre=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?q4({element:r.current,padding:i}).fn(n):{}:r?q4({element:r,padding:i}).fn(n):{}}}},qre=(e,t)=>({...Ire(e),options:[e,t]}),Gre=(e,t)=>({...$re(e),options:[e,t]}),Kre=(e,t)=>({...Hre(e),options:[e,t]}),Yre=(e,t)=>({...Bre(e),options:[e,t]}),Xre=(e,t)=>({...Fre(e),options:[e,t]}),Jre=(e,t)=>({...zre(e),options:[e,t]}),Qre=(e,t)=>({...Vre(e),options:[e,t]});var Zre="Arrow",FN=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return u.jsx(Ce.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});FN.displayName=Zre;var eie=FN;function n0(e){const[t,n]=w.useState(void 0);return ln(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,o=c.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var rC="Popper",[zN,eu]=In(rC),[tie,HN]=zN(rC),WN=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return u.jsx(tie,{scope:t,anchor:r,onAnchorChange:i,children:n})};WN.displayName=rC;var UN="PopperAnchor",VN=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=HN(UN,n),a=w.useRef(null),o=Fe(t,a);return w.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:u.jsx(Ce.div,{...i,ref:o})});VN.displayName=UN;var iC="PopperContent",[nie,rie]=zN(iC),qN=w.forwardRef((e,t)=>{var W,$,V,U,X,q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:_,...y}=e,v=HN(iC,n),[m,p]=w.useState(null),x=Fe(t,re=>p(re)),[b,S]=w.useState(null),C=n0(b),E=(C==null?void 0:C.width)??0,k=(C==null?void 0:C.height)??0,T=r+(s!=="center"?"-"+s:""),R=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(c)?c:[c],L=M.length>0,D={padding:R,boundary:M.filter(sie),altBoundary:L},{refs:N,floatingStyles:P,placement:I,isPositioned:z,middlewareData:O}=Ure({strategy:"fixed",placement:T,whileElementsMounted:(...re)=>Ore(...re,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[qre({mainAxis:i+k,alignmentAxis:a}),l&&Gre({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Kre():void 0,...D}),l&&Yre({...D}),Xre({...D,apply:({elements:re,rects:ne,availableWidth:le,availableHeight:ve})=>{const{width:ae,height:Ee}=ne.reference,Me=re.floating.style;Me.setProperty("--radix-popper-available-width",`${le}px`),Me.setProperty("--radix-popper-available-height",`${ve}px`),Me.setProperty("--radix-popper-anchor-width",`${ae}px`),Me.setProperty("--radix-popper-anchor-height",`${Ee}px`)}}),b&&Qre({element:b,padding:o}),oie({arrowWidth:E,arrowHeight:k}),f&&Jre({strategy:"referenceHidden",...D})]}),[j,A]=YN(I),F=Et(_);ln(()=>{z&&(F==null||F())},[z,F]);const H=(W=O.arrow)==null?void 0:W.x,B=($=O.arrow)==null?void 0:$.y,G=((V=O.arrow)==null?void 0:V.centerOffset)!==0,[Q,Y]=w.useState();return ln(()=>{m&&Y(window.getComputedStyle(m).zIndex)},[m]),u.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:z?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(U=O.transformOrigin)==null?void 0:U.x,(X=O.transformOrigin)==null?void 0:X.y].join(" "),...((q=O.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(nie,{scope:n,placedSide:j,onArrowChange:S,arrowX:H,arrowY:B,shouldHideArrow:G,children:u.jsx(Ce.div,{"data-side":j,"data-align":A,...y,ref:x,style:{...y.style,animation:z?void 0:"none"}})})})});qN.displayName=iC;var GN="PopperArrow",iie={top:"bottom",right:"left",bottom:"top",left:"right"},KN=w.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=rie(GN,r),a=iie[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(eie,{...i,ref:n,style:{...i.style,display:"block"}})})});KN.displayName=GN;function sie(e){return e!==null}var oie=e=>({name:"transformOrigin",options:e,fn(t){var v,m,p;const{placement:n,rects:r,middlewareData:i}=t,a=((v=i.arrow)==null?void 0:v.centerOffset)!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,h]=YN(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((m=i.arrow)==null?void 0:m.x)??0)+o/2,g=(((p=i.arrow)==null?void 0:p.y)??0)+l/2;let _="",y="";return c==="bottom"?(_=a?d:`${f}px`,y=`${-l}px`):c==="top"?(_=a?d:`${f}px`,y=`${r.floating.height+l}px`):c==="right"?(_=`${-l}px`,y=a?d:`${g}px`):c==="left"&&(_=`${r.floating.width+l}px`,y=a?d:`${g}px`),{data:{x:_,y}}}});function YN(e){const[t,n="center"]=e.split("-");return[t,n]}var sC=WN,oC=VN,aC=qN,lC=KN,aie="Portal",r0=w.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=w.useState(!1);ln(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?uL.createPortal(u.jsx(Ce.div,{...r,ref:t}),a):null});r0.displayName=aie;var tx="rovingFocusGroup.onEntryFocus",lie={bubbles:!1,cancelable:!0},i0="RovingFocusGroup",[wb,XN,cie]=lf(i0),[uie,tu]=In(i0,[cie]),[die,hie]=uie(i0),JN=w.forwardRef((e,t)=>u.jsx(wb.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(wb.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(fie,{...e,ref:t})})}));JN.displayName=i0;var fie=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=w.useRef(null),g=Fe(t,f),_=Ha(s),[y=null,v]=Zr({prop:a,defaultProp:o,onChange:l}),[m,p]=w.useState(!1),x=Et(c),b=XN(n),S=w.useRef(!1),[C,E]=w.useState(0);return w.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(tx,x),()=>k.removeEventListener(tx,x)},[x]),u.jsx(die,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:y,onItemFocus:w.useCallback(k=>v(k),[v]),onItemShiftTab:w.useCallback(()=>p(!0),[]),onFocusableItemAdd:w.useCallback(()=>E(k=>k+1),[]),onFocusableItemRemove:w.useCallback(()=>E(k=>k-1),[]),children:u.jsx(Ce.div,{tabIndex:m||C===0?-1:0,"data-orientation":r,...d,ref:g,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{S.current=!0}),onFocus:fe(e.onFocus,k=>{const T=!S.current;if(k.target===k.currentTarget&&T&&!m){const R=new CustomEvent(tx,lie);if(k.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=b().filter(I=>I.focusable),L=M.find(I=>I.active),D=M.find(I=>I.id===y),P=[L,D,...M].filter(Boolean).map(I=>I.ref.current);e7(P,h)}}S.current=!1}),onBlur:fe(e.onBlur,()=>p(!1))})})}),QN="RovingFocusGroupItem",ZN=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...a}=e,o=Rr(),l=s||o,c=hie(QN,n),h=c.currentTabStopId===l,d=XN(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=c;return w.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),u.jsx(wb.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:u.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:fe(e.onMouseDown,_=>{r?c.onItemFocus(l):_.preventDefault()}),onFocus:fe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:fe(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){c.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const y=gie(_,c.orientation,c.dir);if(y!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let m=d().filter(p=>p.focusable).map(p=>p.ref.current);if(y==="last")m.reverse();else if(y==="prev"||y==="next"){y==="prev"&&m.reverse();const p=m.indexOf(_.currentTarget);m=c.loop?vie(m,p+1):m.slice(p+1)}setTimeout(()=>e7(m))}})})})});ZN.displayName=QN;var pie={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mie(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gie(e,t,n){const r=mie(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pie[r]}function e7(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vie(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cC=JN,uC=ZN,yie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},yl=new WeakMap,vp=new WeakMap,yp={},nx=0,t7=function(e){return e&&(e.host||t7(e.parentNode))},xie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=t7(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})},_ie=function(e,t,n,r){var i=xie(t,Array.isArray(e)?e:[e]);yp[n]||(yp[n]=new WeakMap);var s=yp[n],a=[],o=new Set,l=new Set(i),c=function(d){!d||o.has(d)||(o.add(d),c(d.parentNode))};i.forEach(c);var h=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(o.has(f))h(f);else try{var g=f.getAttribute(r),_=g!==null&&g!=="false",y=(yl.get(f)||0)+1,v=(s.get(f)||0)+1;yl.set(f,y),s.set(f,v),a.push(f),y===1&&_&&vp.set(f,!0),v===1&&f.setAttribute(n,"true"),_||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return h(t),o.clear(),nx++,function(){a.forEach(function(d){var f=yl.get(d)-1,g=s.get(d)-1;yl.set(d,f),s.set(d,g),f||(vp.has(d)||d.removeAttribute(r),vp.delete(d)),g||d.removeAttribute(n)}),nx--,nx||(yl=new WeakMap,yl=new WeakMap,vp=new WeakMap,yp={})}},dC=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=yie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),_ie(r,i,n,"aria-hidden")):function(){return null}},Ii=function(){return Ii=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ii.apply(this,arguments)};function n7(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 bie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var dm="right-scroll-bar-position",hm="width-before-scroll-bar",wie="with-scroll-bars-hidden",Sie="--removed-body-scroll-bar-size";function rx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cie(e,t){var n=w.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}var kie=typeof window<"u"?w.useLayoutEffect:w.useEffect,K4=new WeakMap;function Eie(e,t){var n=Cie(null,function(r){return e.forEach(function(i){return rx(i,r)})});return kie(function(){var r=K4.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(o){s.has(o)||rx(o,null)}),s.forEach(function(o){i.has(o)||rx(o,a)})}K4.set(n,e)},[e]),n}function Tie(e){return e}function Mie(e,t){t===void 0&&(t=Tie);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(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var l=function(){var h=a;a=[],h.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(h){a.push(h),c()},filter:function(h){return a=a.filter(h),n}}}};return i}function Rie(e){e===void 0&&(e={});var t=Mie(null);return t.options=Ii({async:!0,ssr:!1},e),t}var r7=function(e){var t=e.sideCar,n=n7(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 w.createElement(r,Ii({},n))};r7.isSideCarExport=!0;function Aie(e,t){return e.useMedium(t),r7}var i7=Rie(),ix=function(){},s0=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:ix,onWheelCapture:ix,onTouchMoveCapture:ix}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,l=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,g=e.noIsolation,_=e.inert,y=e.allowPinchZoom,v=e.as,m=v===void 0?"div":v,p=e.gapMode,x=n7(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=f,S=Eie([n,t]),C=Ii(Ii({},x),i);return w.createElement(w.Fragment,null,h&&w.createElement(b,{sideCar:i7,removeScrollBar:c,shards:d,noIsolation:g,inert:_,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:p}),a?w.cloneElement(w.Children.only(o),Ii(Ii({},C),{ref:S})):w.createElement(m,Ii({},C,{className:l,ref:S}),o))});s0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};s0.classNames={fullWidth:hm,zeroRight:dm};var jie=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lie(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jie();return t&&e.setAttribute("nonce",t),e}function Die(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Nie(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Pie=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lie())&&(Die(t,n),Nie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Oie=function(){var e=Pie();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},s7=function(){var e=Oie(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Iie={left:0,top:0,right:0,gap:0},sx=function(e){return parseInt(e||"",10)||0},$ie=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[sx(n),sx(r),sx(i)]},Bie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Iie;var t=$ie(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])}},Fie=s7(),Zl="data-scroll-locked",zie=function(e,t,n,r){var i=e.left,s=e.top,a=e.right,o=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(wie,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(Zl,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(dm,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(hm,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(dm," .").concat(dm,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(hm," .").concat(hm,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(Zl,`] {
    `).concat(Sie,": ").concat(o,`px;
  }
`)},Y4=function(){var e=parseInt(document.body.getAttribute(Zl)||"0",10);return isFinite(e)?e:0},Hie=function(){w.useEffect(function(){return document.body.setAttribute(Zl,(Y4()+1).toString()),function(){var e=Y4()-1;e<=0?document.body.removeAttribute(Zl):document.body.setAttribute(Zl,e.toString())}},[])},Wie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Hie();var s=w.useMemo(function(){return Bie(i)},[i]);return w.createElement(Fie,{styles:zie(s,!t,i,n?"":"!important")})},Sb=!1;if(typeof window<"u")try{var xp=Object.defineProperty({},"passive",{get:function(){return Sb=!0,!0}});window.addEventListener("test",xp,xp),window.removeEventListener("test",xp,xp)}catch{Sb=!1}var xl=Sb?{passive:!1}:!1,Uie=function(e){return e.tagName==="TEXTAREA"},o7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Uie(e)&&n[t]==="visible")},Vie=function(e){return o7(e,"overflowY")},qie=function(e){return o7(e,"overflowX")},X4=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=a7(e,r);if(i){var s=l7(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Kie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},a7=function(e,t){return e==="v"?Vie(t):qie(t)},l7=function(e,t){return e==="v"?Gie(t):Kie(t)},Yie=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xie=function(e,t,n,r,i){var s=Yie(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,l=t.contains(o),c=!1,h=a>0,d=0,f=0;do{var g=l7(e,o),_=g[0],y=g[1],v=g[2],m=y-v-s*_;(_||m)&&a7(e,o)&&(d+=m,f+=_),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(h&&(Math.abs(d)<1||!i)||!h&&(Math.abs(f)<1||!i))&&(c=!0),c},_p=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},J4=function(e){return[e.deltaX,e.deltaY]},Q4=function(e){return e&&"current"in e?e.current:e},Jie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Qie=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Zie=0,_l=[];function ese(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(Zie++)[0],s=w.useState(s7)[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=bie([e.lockRef.current],(e.shards||[]).map(Q4),!0).filter(Boolean);return y.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=w.useCallback(function(y,v){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!a.current.allowPinchZoom;var m=_p(y),p=n.current,x="deltaX"in y?y.deltaX:p[0]-m[0],b="deltaY"in y?y.deltaY:p[1]-m[1],S,C=y.target,E=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in y&&E==="h"&&C.type==="range")return!1;var k=X4(E,C);if(!k)return!0;if(k?S=E:(S=E==="v"?"h":"v",k=X4(E,C)),!k)return!1;if(!r.current&&"changedTouches"in y&&(x||b)&&(r.current=S),!S)return!0;var T=r.current||S;return Xie(T,v,y,T==="h"?x:b,!0)},[]),l=w.useCallback(function(y){var v=y;if(!(!_l.length||_l[_l.length-1]!==s)){var m="deltaY"in v?J4(v):_p(v),p=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Jie(S.delta,m)})[0];if(p&&p.should){v.cancelable&&v.preventDefault();return}if(!p){var x=(a.current.shards||[]).map(Q4).filter(Boolean).filter(function(S){return S.contains(v.target)}),b=x.length>0?o(v,x[0]):!a.current.noIsolation;b&&v.cancelable&&v.preventDefault()}}},[]),c=w.useCallback(function(y,v,m,p){var x={name:y,delta:v,target:m,should:p,shadowParent:tse(m)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),h=w.useCallback(function(y){n.current=_p(y),r.current=void 0},[]),d=w.useCallback(function(y){c(y.type,J4(y),y.target,o(y,e.lockRef.current))},[]),f=w.useCallback(function(y){c(y.type,_p(y),y.target,o(y,e.lockRef.current))},[]);w.useEffect(function(){return _l.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,xl),document.addEventListener("touchmove",l,xl),document.addEventListener("touchstart",h,xl),function(){_l=_l.filter(function(y){return y!==s}),document.removeEventListener("wheel",l,xl),document.removeEventListener("touchmove",l,xl),document.removeEventListener("touchstart",h,xl)}},[]);var g=e.removeScrollBar,_=e.inert;return w.createElement(w.Fragment,null,_?w.createElement(s,{styles:Qie(i)}):null,g?w.createElement(Wie,{gapMode:e.gapMode}):null)}function tse(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nse=Aie(i7,ese);var o0=w.forwardRef(function(e,t){return w.createElement(s0,Ii({},e,{ref:t,sideCar:nse}))});o0.classNames=s0.classNames;var Cb=["Enter"," "],rse=["ArrowDown","PageUp","Home"],c7=["ArrowUp","PageDown","End"],ise=[...rse,...c7],sse={ltr:[...Cb,"ArrowRight"],rtl:[...Cb,"ArrowLeft"]},ose={ltr:["ArrowLeft"],rtl:["ArrowRight"]},uf="Menu",[ph,ase,lse]=lf(uf),[Ka,u7]=In(uf,[lse,eu,tu]),a0=eu(),d7=tu(),[cse,Ya]=Ka(uf),[use,df]=Ka(uf),h7=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=e,o=a0(t),[l,c]=w.useState(null),h=w.useRef(!1),d=Et(s),f=Ha(i);return w.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),u.jsx(sC,{...o,children:u.jsx(cse,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:u.jsx(use,{scope:t,onClose:w.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:f,modal:a,children:r})})})};h7.displayName=uf;var dse="MenuAnchor",hC=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=a0(n);return u.jsx(oC,{...i,...r,ref:t})});hC.displayName=dse;var fC="MenuPortal",[hse,f7]=Ka(fC,{forceMount:void 0}),p7=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=Ya(fC,t);return u.jsx(hse,{scope:t,forceMount:n,children:u.jsx(fn,{present:n||s.open,children:u.jsx(r0,{asChild:!0,container:i,children:r})})})};p7.displayName=fC;var Gr="MenuContent",[fse,pC]=Ka(Gr),m7=w.forwardRef((e,t)=>{const n=f7(Gr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Ya(Gr,e.__scopeMenu),a=df(Gr,e.__scopeMenu);return u.jsx(ph.Provider,{scope:e.__scopeMenu,children:u.jsx(fn,{present:r||s.open,children:u.jsx(ph.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(pse,{...i,ref:t}):u.jsx(mse,{...i,ref:t})})})})}),pse=w.forwardRef((e,t)=>{const n=Ya(Gr,e.__scopeMenu),r=w.useRef(null),i=Fe(t,r);return w.useEffect(()=>{const s=r.current;if(s)return dC(s)},[]),u.jsx(mC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mse=w.forwardRef((e,t)=>{const n=Ya(Gr,e.__scopeMenu);return u.jsx(mC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mC=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:f,onDismiss:g,disableOutsideScroll:_,...y}=e,v=Ya(Gr,n),m=df(Gr,n),p=a0(n),x=d7(n),b=ase(n),[S,C]=w.useState(null),E=w.useRef(null),k=Fe(t,E,v.onContentChange),T=w.useRef(0),R=w.useRef(""),M=w.useRef(0),L=w.useRef(null),D=w.useRef("right"),N=w.useRef(0),P=_?o0:w.Fragment,I=_?{as:Co,allowPinchZoom:!0}:void 0,z=j=>{var W,$;const A=R.current+j,F=b().filter(V=>!V.disabled),H=document.activeElement,B=(W=F.find(V=>V.ref.current===H))==null?void 0:W.textValue,G=F.map(V=>V.textValue),Q=Tse(G,A,B),Y=($=F.find(V=>V.textValue===Q))==null?void 0:$.ref.current;(function V(U){R.current=U,window.clearTimeout(T.current),U!==""&&(T.current=window.setTimeout(()=>V(""),1e3))})(A),Y&&setTimeout(()=>Y.focus())};w.useEffect(()=>()=>window.clearTimeout(T.current),[]),YS();const O=w.useCallback(j=>{var F,H;return D.current===((F=L.current)==null?void 0:F.side)&&Rse(j,(H=L.current)==null?void 0:H.area)},[]);return u.jsx(fse,{scope:n,searchRef:R,onItemEnter:w.useCallback(j=>{O(j)&&j.preventDefault()},[O]),onItemLeave:w.useCallback(j=>{var A;O(j)||((A=E.current)==null||A.focus(),C(null))},[O]),onTriggerLeave:w.useCallback(j=>{O(j)&&j.preventDefault()},[O]),pointerGraceTimerRef:M,onPointerGraceIntentChange:w.useCallback(j=>{L.current=j},[]),children:u.jsx(P,{...I,children:u.jsx(Qv,{asChild:!0,trapped:i,onMountAutoFocus:fe(s,j=>{var A;j.preventDefault(),(A=E.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:f,onDismiss:g,children:u.jsx(cC,{asChild:!0,...x,dir:m.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:fe(l,j=>{m.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(aC,{role:"menu","aria-orientation":"vertical","data-state":j7(v.open),"data-radix-menu-content":"",dir:m.dir,...p,...y,ref:k,style:{outline:"none",...y.style},onKeyDown:fe(y.onKeyDown,j=>{const F=j.target.closest("[data-radix-menu-content]")===j.currentTarget,H=j.ctrlKey||j.altKey||j.metaKey,B=j.key.length===1;F&&(j.key==="Tab"&&j.preventDefault(),!H&&B&&z(j.key));const G=E.current;if(j.target!==G||!ise.includes(j.key))return;j.preventDefault();const Y=b().filter(W=>!W.disabled).map(W=>W.ref.current);c7.includes(j.key)&&Y.reverse(),kse(Y)}),onBlur:fe(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:fe(e.onPointerMove,mh(j=>{const A=j.target,F=N.current!==j.clientX;if(j.currentTarget.contains(A)&&F){const H=j.clientX>N.current?"right":"left";D.current=H,N.current=j.clientX}}))})})})})})})});m7.displayName=Gr;var gse="MenuGroup",gC=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ce.div,{role:"group",...r,ref:t})});gC.displayName=gse;var vse="MenuLabel",g7=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ce.div,{...r,ref:t})});g7.displayName=vse;var bg="MenuItem",Z4="menu.itemSelect",l0=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=w.useRef(null),a=df(bg,e.__scopeMenu),o=pC(bg,e.__scopeMenu),l=Fe(t,s),c=w.useRef(!1),h=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Z4,{bubbles:!0,cancelable:!0});d.addEventListener(Z4,g=>r==null?void 0:r(g),{once:!0}),Zm(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return u.jsx(v7,{...i,ref:l,disabled:n,onClick:fe(e.onClick,h),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:fe(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:fe(e.onKeyDown,d=>{const f=o.searchRef.current!=="";n||f&&d.key===" "||Cb.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});l0.displayName=bg;var v7=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,a=pC(bg,n),o=d7(n),l=w.useRef(null),c=Fe(t,l),[h,d]=w.useState(!1),[f,g]=w.useState("");return w.useEffect(()=>{const _=l.current;_&&g((_.textContent??"").trim())},[s.children]),u.jsx(ph.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:u.jsx(uC,{asChild:!0,...o,focusable:!r,children:u.jsx(Ce.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:fe(e.onPointerMove,mh(_=>{r?a.onItemLeave(_):(a.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fe(e.onPointerLeave,mh(_=>a.onItemLeave(_))),onFocus:fe(e.onFocus,()=>d(!0)),onBlur:fe(e.onBlur,()=>d(!1))})})})}),yse="MenuCheckboxItem",y7=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return u.jsx(S7,{scope:e.__scopeMenu,checked:n,children:u.jsx(l0,{role:"menuitemcheckbox","aria-checked":wg(n)?"mixed":n,...i,ref:t,"data-state":yC(n),onSelect:fe(i.onSelect,()=>r==null?void 0:r(wg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});y7.displayName=yse;var x7="MenuRadioGroup",[xse,_se]=Ka(x7,{value:void 0,onValueChange:()=>{}}),_7=w.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=Et(r);return u.jsx(xse,{scope:e.__scopeMenu,value:n,onValueChange:s,children:u.jsx(gC,{...i,ref:t})})});_7.displayName=x7;var b7="MenuRadioItem",w7=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=_se(b7,e.__scopeMenu),s=n===i.value;return u.jsx(S7,{scope:e.__scopeMenu,checked:s,children:u.jsx(l0,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":yC(s),onSelect:fe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});w7.displayName=b7;var vC="MenuItemIndicator",[S7,bse]=Ka(vC,{checked:!1}),C7=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=bse(vC,n);return u.jsx(fn,{present:r||wg(s.checked)||s.checked===!0,children:u.jsx(Ce.span,{...i,ref:t,"data-state":yC(s.checked)})})});C7.displayName=vC;var wse="MenuSeparator",k7=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});k7.displayName=wse;var Sse="MenuArrow",E7=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=a0(n);return u.jsx(lC,{...i,...r,ref:t})});E7.displayName=Sse;var Cse="MenuSub",[_Oe,T7]=Ka(Cse),hd="MenuSubTrigger",M7=w.forwardRef((e,t)=>{const n=Ya(hd,e.__scopeMenu),r=df(hd,e.__scopeMenu),i=T7(hd,e.__scopeMenu),s=pC(hd,e.__scopeMenu),a=w.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},h=w.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return w.useEffect(()=>h,[h]),w.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),l(null)}},[o,l]),u.jsx(hC,{asChild:!0,...c,children:u.jsx(v7,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":j7(n.open),...e,ref:Qh(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:fe(e.onPointerMove,mh(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:fe(e.onPointerLeave,mh(d=>{var g,_;h();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const y=(_=n.content)==null?void 0:_.dataset.side,v=y==="right",m=v?-5:5,p=f[v?"left":"right"],x=f[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:p,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:p,y:f.bottom}],side:y}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:fe(e.onKeyDown,d=>{var g;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||sse[r.dir].includes(d.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),d.preventDefault())})})})});M7.displayName=hd;var R7="MenuSubContent",A7=w.forwardRef((e,t)=>{const n=f7(Gr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Ya(Gr,e.__scopeMenu),a=df(Gr,e.__scopeMenu),o=T7(R7,e.__scopeMenu),l=w.useRef(null),c=Fe(t,l);return u.jsx(ph.Provider,{scope:e.__scopeMenu,children:u.jsx(fn,{present:r||s.open,children:u.jsx(ph.Slot,{scope:e.__scopeMenu,children:u.jsx(mC,{id:o.contentId,"aria-labelledby":o.triggerId,...i,ref:c,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:fe(e.onFocusOutside,h=>{h.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:fe(e.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:fe(e.onKeyDown,h=>{var g;const d=h.currentTarget.contains(h.target),f=ose[a.dir].includes(h.key);d&&f&&(s.onOpenChange(!1),(g=o.trigger)==null||g.focus(),h.preventDefault())})})})})})});A7.displayName=R7;function j7(e){return e?"open":"closed"}function wg(e){return e==="indeterminate"}function yC(e){return wg(e)?"indeterminate":e?"checked":"unchecked"}function kse(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ese(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Tse(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Ese(e,Math.max(s,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 Mse(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s].x,l=t[s].y,c=t[a].x,h=t[a].y;l>r!=h>r&&n<(c-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function Rse(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Mse(n,t)}function mh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ase=h7,jse=hC,Lse=p7,Dse=m7,Nse=gC,Pse=g7,Ose=l0,Ise=y7,$se=_7,Bse=w7,Fse=C7,zse=k7,Hse=E7,Wse=M7,Use=A7,xC="DropdownMenu",[Vse,bOe]=In(xC,[u7]),ir=u7(),[qse,L7]=Vse(xC),D7=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=ir(t),c=w.useRef(null),[h=!1,d]=Zr({prop:i,defaultProp:s,onChange:a});return u.jsx(qse,{scope:t,triggerId:Rr(),triggerRef:c,contentId:Rr(),open:h,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:o,children:u.jsx(Ase,{...l,open:h,onOpenChange:d,dir:r,modal:o,children:n})})};D7.displayName=xC;var N7="DropdownMenuTrigger",P7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=L7(N7,n),a=ir(n);return u.jsx(jse,{asChild:!0,...a,children:u.jsx(Ce.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Qh(t,s.triggerRef),onPointerDown:fe(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:fe(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});P7.displayName=N7;var Gse="DropdownMenuPortal",O7=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ir(t);return u.jsx(Lse,{...r,...n})};O7.displayName=Gse;var I7="DropdownMenuContent",$7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=L7(I7,n),s=ir(n),a=w.useRef(!1);return u.jsx(Dse,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:fe(e.onCloseAutoFocus,o=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:fe(e.onInteractOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,h=l.button===2||c;(!i.modal||h)&&(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)"}})});$7.displayName=I7;var Kse="DropdownMenuGroup",Yse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Nse,{...i,...r,ref:t})});Yse.displayName=Kse;var Xse="DropdownMenuLabel",B7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Pse,{...i,...r,ref:t})});B7.displayName=Xse;var Jse="DropdownMenuItem",F7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Ose,{...i,...r,ref:t})});F7.displayName=Jse;var Qse="DropdownMenuCheckboxItem",z7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Ise,{...i,...r,ref:t})});z7.displayName=Qse;var Zse="DropdownMenuRadioGroup",H7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx($se,{...i,...r,ref:t})});H7.displayName=Zse;var eoe="DropdownMenuRadioItem",W7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Bse,{...i,...r,ref:t})});W7.displayName=eoe;var toe="DropdownMenuItemIndicator",U7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Fse,{...i,...r,ref:t})});U7.displayName=toe;var noe="DropdownMenuSeparator",V7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(zse,{...i,...r,ref:t})});V7.displayName=noe;var roe="DropdownMenuArrow",ioe=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Hse,{...i,...r,ref:t})});ioe.displayName=roe;var soe="DropdownMenuSubTrigger",q7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Wse,{...i,...r,ref:t})});q7.displayName=soe;var ooe="DropdownMenuSubContent",G7=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=ir(n);return u.jsx(Use,{...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)"}})});G7.displayName=ooe;var aoe=D7,loe=P7,coe=O7,K7=$7,Y7=B7,X7=F7,J7=z7,uoe=H7,Q7=W7,Z7=U7,eP=V7,tP=q7,nP=G7;const ec=aoe,tc=loe,rP=uoe,doe=w.forwardRef(({className:e,inset:t,children:n,...r},i)=>u.jsxs(tP,{ref:i,className:J("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,u.jsx(cS,{className:"ml-auto"})]}));doe.displayName=tP.displayName;const hoe=w.forwardRef(({className:e,...t},n)=>u.jsx(nP,{ref:n,className:J("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}));hoe.displayName=nP.displayName;const ma=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(coe,{children:u.jsx(K7,{ref:r,sideOffset:t,className:J("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})}));ma.displayName=K7.displayName;const Bi=w.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(X7,{ref:r,className:J("relative flex cursor-default select-none items-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));Bi.displayName=X7.displayName;const kb=w.forwardRef(({className:e,children:t,checked:n,...r},i)=>u.jsxs(J7,{ref:i,className:J("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Z7,{children:u.jsx(lS,{className:"h-4 w-4"})})}),t]}));kb.displayName=J7.displayName;const _C=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Q7,{ref:r,className:J("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Z7,{children:u.jsx(BD,{className:"h-2 w-2 fill-current"})})}),t]}));_C.displayName=Q7.displayName;const Sg=w.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(Y7,{ref:r,className:J("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Sg.displayName=Y7.displayName;const aa=w.forwardRef(({className:e,...t},n)=>u.jsx(eP,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));aa.displayName=eP.displayName;const gh=[{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."}],iP=[{label:"Is Admin",value:"isAdmin"},{label:"Is Online",value:"isOnline"},{label:"Has Whitelisted ID",value:"isWhitelisted"},{label:"Has Profile Notes",value:"hasNote"}],bp=Un(1250,e=>{e()},{noLeading:!0});function foe({doSearch:e,initialState:t}){const n=w.useRef(null),[r,i]=w.useState(!1),[s,a]=w.useState(!1),[o,l]=w.useState(t.search.type),[c,h]=w.useState(t.filters),[d,f]=w.useState(!!t.search.value),[g,_]=w.useState(t.rememberSearchType),y=()=>{if(!n.current)return;const S=n.current.value.trim();e({value:S,type:o},c,g)};w.useEffect(()=>{y()},[o,c]);const v=S=>{S.key==="Enter"?(bp.cancel({upcomingOnly:!0}),y()):S.key==="Escape"?(n.current.value="",bp(y),f(!1)):(bp(y),f(!0))},m=()=>{n.current.value="",bp.cancel({upcomingOnly:!0}),y(),f(!1)},p=(S,C)=>{h(C?E=>[...E,S]:E=>E.filter(k=>k!==S))};yi("keydown",S=>{var C;S.code==="KeyF"&&(S.ctrlKey||S.metaKey)&&((C=n.current)==null||C.focus(),S.preventDefault())});const x=gh.find(S=>S.value===o);if(!x)throw new Error(`Invalid search type: ${o}`);const b=c.length?`${c.length} Filter${c.length>1?"s":""}`:"No filters";return u.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[u.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[u.jsxs("div",{className:"relative min-w-44 grow",children:[u.jsx(yt,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:n,placeholder:x.placeholder,defaultValue:t.search.value,onKeyDown:v}),d?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:m,children:u.jsx(yr,{})}):u.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:u.jsx(Ue,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),u.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[u.jsxs(ec,{children:[u.jsx(tc,{asChild:!0,children:u.jsxs(Ae,{variant:"outline",role:"combobox","aria-expanded":r,onClick:()=>i(!r),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 ",x.label,u.jsx(K_,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(ma,{className:"w-48",children:[u.jsx(Sg,{children:"Search Type"}),u.jsx(aa,{}),u.jsx(rP,{value:o,onValueChange:l,children:gh.map(S=>u.jsx(_C,{value:S.value,className:"cursor-pointer",children:S.label},S.value))}),u.jsx(aa,{}),u.jsx(kb,{checked:g,className:"cursor-pointer",onCheckedChange:_,children:"Remember Option"})]})]}),u.jsxs(ec,{children:[u.jsx(tc,{asChild:!0,children:u.jsxs(Ae,{variant:"outline",role:"combobox","aria-expanded":s,onClick:()=>a(!s),className:"xs:w-44 justify-between border-input bg-black/5 dark:bg-black/30 hover:dark:bg-primary grow md:grow-0",children:[b,u.jsx(K_,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(ma,{className:"w-44",children:[u.jsx(Sg,{children:"Search Filters"}),u.jsx(aa,{}),iP.map(S=>u.jsx(kb,{checked:c.includes(S.value),className:"cursor-pointer",onCheckedChange:C=>{p(S.value,C)},children:S.label},S.value)),u.jsx(aa,{}),u.jsxs(Bi,{className:"cursor-pointer",onClick:()=>h([]),children:[u.jsx(XK,{className:"mr-2 h-4 w-4"}),"Clear Filters"]})]})]}),u.jsx("div",{className:"flex justify-end flex-grow",children:u.jsxs(ec,{children:[u.jsx(tc,{asChild:!0,children:u.jsxs(Ae,{variant:"outline",className:"grow md:grow-0",children:["More",u.jsx(Ua,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(ma,{children:[u.jsx(Bi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(xi,{href:"/ban-identifiers",className:"cursor-pointer",children:[u.jsx(ka,{className:"inline mr-1 h-4"}),"Ban Identifiers"]})}),u.jsx(Bi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(xi,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[u.jsx(ka,{className:"inline mr-1 h-4"}),"Prune Players/HWIDs"]})})]})]})})]})]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:x.description})]})}function bl(e,t,n){let r=n.initialDeps??[],i;return()=>{var s,a,o,l;let c;n.key&&((s=n.debug)!=null&&s.call(n))&&(c=Date.now());const h=e();if(!(h.length!==r.length||h.some((g,_)=>r[_]!==g)))return i;r=h;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=t(...h),n.key&&((o=n.debug)!=null&&o.call(n))){const g=Math.round((Date.now()-c)*100)/100,_=Math.round((Date.now()-f)*100)/100,y=_/16,v=(m,p)=>{for(m=String(m);m.length<p;)m=" "+m;return m};console.info(`%c⏱ ${v(_,5)} /${v(g,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,i),i}}function ox(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const poe=(e,t)=>Math.abs(e-t)<1,moe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},goe=e=>e,voe=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},yoe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;t({width:Math.round(o),height:Math.round(l)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const o=a[0];if(o!=null&&o.borderBoxSize){const l=o.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},eT={passive:!0},xoe=typeof window>"u"?!0:"onscrollend"in window,_oe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&xoe?()=>{}:moe(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:h,isRtl:d}=e.options;i=h?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),t(i,c)},o=a(!0),l=a(!1);return l(),n.addEventListener("scroll",o,eT),n.addEventListener("scrollend",l,eT),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",l)}},boe=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},woe=(e,{adjustments:t=0,behavior:n},r)=>{var i,s;const a=e+t;(s=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class Soe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var s;return(s=r())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=r())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:goe,rangeExtractor:voe,onChange:()=>{},measureElement:boe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=bl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,s=new Map;for(let a=r-1;a>=0;a--){const o=n[a];if(i.has(o.lane))continue;const l=s.get(o.lane);if(l==null||o.end>l.end?s.set(o.lane,o):o.end<l.end&&i.set(o.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=bl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,s,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a}),{key:!1}),this.getMeasurements=bl(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let h=l;h<n;h++){const d=s(h),f=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),g=f?f.end+this.options.gap:r+i,_=o.get(d),y=typeof _=="number"?_:this.options.estimateSize(h),v=g+y,m=f?f.lane:h%this.options.lanes;c[h]={index:h,start:g,size:y,end:v,key:d,lane:m}}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=bl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?Coe({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=bl(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,s)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:i,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const i=this.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const a=s.key,o=this.elementsCache.get(a);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,a=r-s;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=bl(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;s<a;s++){const o=n[s],l=r[o];i.push(l)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return ox(r[sP(0,r.length-1,i=>ox(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&n>=s+i&&(r="end"),r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const o=i.start-this.options.scrollPaddingStart+(i.size-s)/2;switch(r){case"center":return[this.getOffsetForAlignment(o,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:i})},this.scrollToIndex=(n,{align:r="auto",behavior:i}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const s=this.getOffsetForIndex(n,r);if(!s)return;const[a,o]=s;this._scrollToOffset(a,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=ox(this.getOffsetForIndex(n,o));poe(c,this.getScrollOffset())||this.scrollToIndex(n,{align:o,behavior:i})}else this.scrollToIndex(n,{align:o,behavior:i})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;return r.length===0?i=this.options.paddingStart:i=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(s=>s.end)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const sP=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(s<r)e=i+1;else if(s>r)t=i-1;else return i}return e>0?e-1:0};function Coe({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=sP(0,r,o=>e[o].start,n);let a=s;for(;a<r&&e[a].end<n+t;)a++;return{startIndex:s,endIndex:a}}const tT=typeof document<"u"?w.useLayoutEffect:w.useEffect;function koe(e){const t=w.useReducer(()=>({}),{})[1],n={...e,onChange:(i,s)=>{var a;s?Er.flushSync(t):t(),(a=e.onChange)==null||a.call(e,i,s)}},[r]=w.useState(()=>new Soe(n));return r.setOptions(n),tT(()=>r._didMount(),[]),tT(()=>r._willUpdate()),r}function bC(e){return koe({observeElementRect:yoe,observeElementOffset:_oe,scrollToFn:woe,...e})}var Cg={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 oP(e){var t=function(r,i){var s=rT({},t,i||{});return Toe(r,s)};return rT(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 c0=oP({});function Eoe(e){var t=[e.language];if(Vi(e,"fallbacks"))if(Moe(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(Vi(e.languages,r))return e.languages[r];if(Vi(Cg,r))return Cg[r]}throw new Error("No language found.")}function Toe(e,t){var n,r,i;e=Math.abs(e);var s=Eoe(t),a=[],o,l,c;for(n=0,r=t.units.length;n<r;n++){if(o=t.units[n],l=t.unitMeasures[o],n+1===r)if(Vi(t,"maxDecimalPoints")){var h=Math.pow(10,t.maxDecimalPoints),d=e/l;c=parseFloat((Math.floor(h*d)/h).toFixed(t.maxDecimalPoints))}else c=e/l;else c=Math.floor(e/l);a.push({unitCount:c,unitName:o}),e-=c*l}var f=0;for(n=0;n<a.length;n++)if(a[n].unitCount){f=n;break}if(t.round){var g,_;for(n=a.length-1;n>=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)_=a[n-1],g=t.unitMeasures[_.unitName]/t.unitMeasures[i.unitName],(i.unitCount%g===0||t.largest&&t.largest-1<n-f)&&(_.unitCount+=i.unitCount/g,i.unitCount=0)}var y=[];for(n=0,a.length;n<r&&(i=a[n],i.unitCount&&y.push(nT(i.unitCount,i.unitName,s,t)),y.length!==t.largest);n++);if(y.length){var v;if(Vi(t,"delimiter")?v=t.delimiter:Vi(s,"delimiter")?v=s.delimiter:v=", ",!t.conjunction||y.length===1)return y.join(v);if(y.length===2)return y.join(t.conjunction);if(y.length>2)return y.slice(0,-1).join(v)+(t.serialComma?",":"")+t.conjunction+y.slice(-1)}else return nT(0,t.units[t.units.length-1],s,t)}function nT(e,t,n,r){var i;Vi(r,"decimal")?i=r.decimal:Vi(n,"decimal")?i=n.decimal:i=".";var s;typeof n._formatCount=="function"?s=n._formatCount(e,i):s=e.toString().replace(".",i);var a=n[t],o;return typeof a=="function"?o=a(e):o=a,n._numberFirst?o+r.spacer+s:s+r.spacer+o}function rT(e){for(var t,n=1;n<arguments.length;n++){t=arguments[n];for(var r in t)Vi(t,r)&&(e[r]=t[r])}return e}var Moe=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function Vi(e,t){return Object.prototype.hasOwnProperty.call(e,t)}c0.getSupportedLanguages=function(){var t=[];for(var n in Cg)Vi(Cg,n)&&n!=="gr"&&t.push(n);return t};c0.humanizer=oP;const Roe=new Date().getFullYear(),kg=c0.humanizer({round:!0,fallbacks:["en"]}),u0=c0.humanizer({round:!0,spacer:"",language:"shortEn",fallbacks:["en"]}),d0=e=>new Date(e<1e10?e*1e3:e),bc=(e,t="2-digit",n="2-digit",r,i)=>e.toLocaleTimeString(window.txBrowserLocale,{hour:t,minute:n,second:r,hour12:i}),Aoe=(e,t="2-digit",n="2-digit",r,i)=>bc(d0(e),t,n,r,i),wc=(e,t="long")=>e.toLocaleDateString(window.txBrowserLocale,{dateStyle:t}),aP=(e,t="long")=>wc(d0(e),t),joe=(e,t="long",n="medium")=>e.toLocaleString(window.txBrowserLocale,{dateStyle:t,timeStyle:n}),vs=(e,t="long",n="medium")=>joe(d0(e),t,n),vh=e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},Eb=e=>{const t=d0(e),n=t.getFullYear()!==Roe;return t.toLocaleString(window.txBrowserLocale,{year:n?"numeric":void 0,month:n?"numeric":"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Loe=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:n,className:J("w-full caption-bottom text-sm",e),...t})}));Loe.displayName="Table";const wC=w.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:J("[&_tr]:border-b",e),...t}));wC.displayName="TableHeader";const SC=w.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:J("[&_tr:last-child]:border-0",e),...t}));SC.displayName="TableBody";const Doe=w.forwardRef(({className:e,...t},n)=>u.jsx("tfoot",{ref:n,className:J("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Doe.displayName="TableFooter";const hf=w.forwardRef(({className:e,...t},n)=>u.jsx("tr",{ref:n,className:J("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));hf.displayName="TableRow";const Noe=w.forwardRef(({className:e,...t},n)=>u.jsx("th",{ref:n,className:J("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Noe.displayName="TableHead";const Hr=w.forwardRef(({className:e,...t},n)=>u.jsx("td",{ref:n,className:J("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Hr.displayName="TableCell";const Poe=w.forwardRef(({className:e,...t},n)=>u.jsx("caption",{ref:n,className:J("mt-4 text-sm text-muted-foreground",e),...t}));Poe.displayName="TableCaption";function Ooe({rowData:e,modalOpener:t}){const n=()=>{t({license:e.license})};return u.jsxs(hf,{onClick:n,className:"cursor-pointer",children:[u.jsxs(Hr,{className:"px-4 py-2 flex justify-between border-r",children:[u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.displayName}),u.jsxs("div",{className:"hidden md:inline-flex items-center gap-1",children:[u.jsx(_Y,{className:J("h-5",e.isOnline?"text-success-inline animate-pulse":"text-muted")}),u.jsx(VD,{className:J("h-5",e.isAdmin?"text-warning-inline":"text-muted")}),u.jsx(YK,{className:J("h-5",e.notes?"text-secondary-foreground":"text-muted")})]})]}),u.jsx(Hr,{className:"min-w-[8rem] px-4 py-2 border-r",children:u0(e.playTime*6e4)}),u.jsx(Hr,{className:"min-w-[10rem] px-4 py-2 border-r",children:Eb(e.tsJoined)}),u.jsx(Hr,{className:"min-w-[10rem] px-4 py-2",children:Eb(e.tsLastConnection)})]})}function Ioe({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=u.jsx(Zt,{className:"mx-auto animate-spin"}):r?s=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),u.jsx("br",{}),u.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=u.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No players found."}):s=u.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",u.jsx("br",{}),u.jsxs("i",{children:["(this is a bug, please report it in ",u.jsx(yn,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),u.jsx(hf,{children:u.jsx(Hr,{colSpan:4,className:"px-4 py-2 text-center",children:s})})}function ax({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":u.jsx(u.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return u.jsxs("th",{onClick:l,className:J("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",s&&"font-medium dark:bg-zinc-700",i),children:[e,u.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function $oe({search:e,filters:t}){const n=w.useRef(null),[r,i]=w.useState([]),[s,a]=w.useState(!1),[o,l]=w.useState(!0),[c,h]=w.useState(null),[d,f]=w.useState({key:"tsJoined",desc:!0}),[g,_]=w.useState(!1),y=qv(),v=wt({method:"GET",path:"/player/search",abortOnUnmount:!0}),m=async E=>{l(!0),h(null),E&&_(!0);const k=T=>{h(T),E&&i([])};try{const T={sortingKey:d.key,sortingDesc:d.desc};e.value&&(T.searchValue=e.value,T.searchType=e.type),t.length&&(T.filters=t.join(",")),!E&&r.length&&(T.offsetParam=r[r.length-1][d.key],T.offsetLicense=r[r.length-1].license);const R=await v({queryParams:T});if(R===void 0)return k("Request failed.");if("error"in R)return k(`Request failed: ${R.error}`);h(null),a(R.hasReachedEnd),_(!1),R.players.length?i(M=>E?R.players:[...M,...R.players]):i([])}catch(T){k(`Failed to fetch more data: ${T.message}`)}finally{l(!1),_(!1)}},p=bC({isScrollingResetDelay:0,count:r.length+1,getScrollElement:()=>{var E;return(E=n.current)==null?void 0:E.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),x=p.getVirtualItems(),b=p.getTotalSize();let S=null,C=null;if(x.length>0){const E=x[0].start-p.options.scrollMargin;E>0&&(S=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:E}})}));const k=b-x[x.length-1].end;k>0&&(C=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:k}})}))}return w.useEffect(()=>{if(!r.length||!x.length)return;const E=x[x.length-1].index;r.length<=E&&!s&&!o&&m()},[r,x,s,o]),w.useEffect(()=>{p.scrollToIndex(0),m(!0)},[e,t,d]),u.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:u.jsx(Qr,{className:"h-full",ref:n,children:u.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[u.jsx(wC,{children:u.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[u.jsx("th",{className:"py-2 px-4 font-light tracking-wider text-left text-muted-foreground",children:"Display Name"}),u.jsx(ax,{label:"Play Time",sortKey:"playTime",sortingState:d,setSorting:f}),u.jsx(ax,{label:"First Joined",sortKey:"tsJoined",sortingState:d,setSorting:f}),u.jsx(ax,{label:"Last Connection",sortKey:"tsLastConnection",sortingState:d,setSorting:f})]})}),u.jsxs(SC,{className:J(g&&"opacity-25"),children:[S,x.map(E=>E.index>r.length-1?u.jsx(Ioe,{playersCount:r.length,hasReachedEnd:s,loadError:c,isFetching:o,retryFetch:m},E.key):u.jsx(Ooe,{rowData:r[E.index],modalOpener:y},E.key)),C]})]})})})}const Boe=w.memo(foe),Foe=w.memo($oe),zoe=w.memo(kN),Tb="playerSearchRememberType",Hoe=()=>{const e=localStorage.getItem(Tb);return!e||!gh.some(t=>t.value===e)?!1:e},Woe=e=>{e?localStorage.setItem(Tb,e):localStorage.removeItem(Tb)},Uoe=(e,t)=>{const n=new URL(window.location.toString());e&&e.value&&e.type?(n.searchParams.set("searchType",e.type),n.searchParams.set("searchQuery",e.value)):(n.searchParams.delete("searchType"),n.searchParams.delete("searchQuery")),t.length?n.searchParams.set("filters",t.join(",")):n.searchParams.delete("filters"),window.history.replaceState({},"",n)},Voe=()=>{var l;const e=new URLSearchParams(window.location.search),t=gh.map(c=>c.value),n=e.get("searchType"),r=e.get("searchQuery"),i=iP.map(c=>c.value),s=(l=e.get("filters"))==null?void 0:l.split(",").filter(c=>i.includes(c));let a=gh[0].value,o=!1;try{const c=Hoe();c&&(a=c,o=!0)}catch(c){console.error("Failed to get stored search type:",c)}return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:a,value:""},filters:s??[],rememberSearchType:o}};function qoe(){const[e,t]=w.useState(void 0),[n,r]=w.useState(void 0),i=wt({method:"GET",path:"/player/stats",abortOnUnmount:!0});w.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=w.useCallback((l,c,h)=>{r({search:l,filters:c}),Uoe(l,c);try{Woe(h?l.type:!1)}catch(d){console.error("Failed to set stored search type:",d)}},[]),a=w.useMemo(Voe,[]),o=w.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Players",value:l?e.total:!1,icon:u.jsx(mS,{})},{label:"Players Last 24h",value:l?e.playedLast24h:!1,icon:u.jsx(RK,{})},{label:"New Players Last 24h",value:l?e.joinedLast24h:!1,icon:u.jsx(j3,{}),prefix:"+"},{label:"New Players Last 7d",value:l?e.joinedLast7d:!1,icon:u.jsx(j3,{}),prefix:"+"}]},[e]);return u.jsxs("div",{className:"flex flex-col min-w-96 w-full h-contentvh",children:[u.jsx(zoe,{callouts:o}),u.jsx(Boe,{doSearch:s,initialState:a}),n?u.jsx(Foe,{search:n.search,filters:n.filters}):null]})}function ff(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Goe="VisuallyHidden",CC=w.forwardRef((e,t)=>u.jsx(Ce.span,{...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}}));CC.displayName=Goe;var lP=CC,Koe=[" ","Enter","ArrowUp","ArrowDown"],Yoe=[" ","Enter"],pf="Select",[h0,f0,Xoe]=lf(pf),[nu,wOe]=In(pf,[Xoe,eu]),p0=eu(),[Joe,zo]=nu(pf),[Qoe,Zoe]=nu(pf),cP=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:c,name:h,autoComplete:d,disabled:f,required:g,form:_}=e,y=p0(t),[v,m]=w.useState(null),[p,x]=w.useState(null),[b,S]=w.useState(!1),C=Ha(c),[E=!1,k]=Zr({prop:r,defaultProp:i,onChange:s}),[T,R]=Zr({prop:a,defaultProp:o,onChange:l}),M=w.useRef(null),L=v?_||!!v.closest("form"):!0,[D,N]=w.useState(new Set),P=Array.from(D).map(I=>I.props.value).join(";");return u.jsx(sC,{...y,children:u.jsxs(Joe,{required:g,scope:t,trigger:v,onTriggerChange:m,valueNode:p,onValueNodeChange:x,valueNodeHasChildren:b,onValueNodeHasChildrenChange:S,contentId:Rr(),value:T,onValueChange:R,open:E,onOpenChange:k,dir:C,triggerPointerDownPosRef:M,disabled:f,children:[u.jsx(h0.Provider,{scope:t,children:u.jsx(Qoe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(I=>{N(z=>new Set(z).add(I))},[]),onNativeOptionRemove:w.useCallback(I=>{N(z=>{const O=new Set(z);return O.delete(I),O})},[]),children:n})}),L?u.jsxs(NP,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:d,value:T,onChange:I=>R(I.target.value),disabled:f,form:_,children:[T===void 0?u.jsx("option",{value:""}):null,Array.from(D)]},P):null]})})};cP.displayName=pf;var uP="SelectTrigger",dP=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=p0(n),a=zo(uP,n),o=a.disabled||r,l=Fe(t,a.onTriggerChange),c=f0(n),h=w.useRef("touch"),[d,f,g]=PP(y=>{const v=c().filter(x=>!x.disabled),m=v.find(x=>x.value===a.value),p=OP(v,y,m);p!==void 0&&a.onValueChange(p.value)}),_=y=>{o||(a.onOpenChange(!0),g()),y&&(a.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return u.jsx(oC,{asChild:!0,...s,children:u.jsx(Ce.button,{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:o,"data-disabled":o?"":void 0,"data-placeholder":DP(a.value)?"":void 0,...i,ref:l,onClick:fe(i.onClick,y=>{y.currentTarget.focus(),h.current!=="mouse"&&_(y)}),onPointerDown:fe(i.onPointerDown,y=>{h.current=y.pointerType;const v=y.target;v.hasPointerCapture(y.pointerId)&&v.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(_(y),y.preventDefault())}),onKeyDown:fe(i.onKeyDown,y=>{const v=d.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&f(y.key),!(v&&y.key===" ")&&Koe.includes(y.key)&&(_(),y.preventDefault())})})})});dP.displayName=uP;var hP="SelectValue",fP=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,l=zo(hP,n),{onValueNodeHasChildrenChange:c}=l,h=s!==void 0,d=Fe(t,l.onValueNodeChange);return ln(()=>{c(h)},[c,h]),u.jsx(Ce.span,{...o,ref:d,style:{pointerEvents:"none"},children:DP(l.value)?u.jsx(u.Fragment,{children:a}):s})});fP.displayName=hP;var eae="SelectIcon",pP=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(Ce.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});pP.displayName=eae;var tae="SelectPortal",mP=e=>u.jsx(r0,{asChild:!0,...e});mP.displayName=tae;var Ta="SelectContent",gP=w.forwardRef((e,t)=>{const n=zo(Ta,e.__scopeSelect),[r,i]=w.useState();if(ln(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Er.createPortal(u.jsx(vP,{scope:e.__scopeSelect,children:u.jsx(h0.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),s):null}return u.jsx(yP,{...e,ref:t})});gP.displayName=Ta;var ii=10,[vP,Ho]=nu(Ta),nae="SelectContentImpl",yP=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:c,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:_,hideWhenDetached:y,avoidCollisions:v,...m}=e,p=zo(Ta,n),[x,b]=w.useState(null),[S,C]=w.useState(null),E=Fe(t,W=>b(W)),[k,T]=w.useState(null),[R,M]=w.useState(null),L=f0(n),[D,N]=w.useState(!1),P=w.useRef(!1);w.useEffect(()=>{if(x)return dC(x)},[x]),YS();const I=w.useCallback(W=>{const[$,...V]=L().map(q=>q.ref.current),[U]=V.slice(-1),X=document.activeElement;for(const q of W)if(q===X||(q==null||q.scrollIntoView({block:"nearest"}),q===$&&S&&(S.scrollTop=0),q===U&&S&&(S.scrollTop=S.scrollHeight),q==null||q.focus(),document.activeElement!==X))return},[L,S]),z=w.useCallback(()=>I([k,x]),[I,k,x]);w.useEffect(()=>{D&&z()},[D,z]);const{onOpenChange:O,triggerPointerDownPosRef:j}=p;w.useEffect(()=>{if(x){let W={x:0,y:0};const $=U=>{var X,q;W={x:Math.abs(Math.round(U.pageX)-(((X=j.current)==null?void 0:X.x)??0)),y:Math.abs(Math.round(U.pageY)-(((q=j.current)==null?void 0:q.y)??0))}},V=U=>{W.x<=10&&W.y<=10?U.preventDefault():x.contains(U.target)||O(!1),document.removeEventListener("pointermove",$),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",V,{capture:!0})}}},[x,O,j]),w.useEffect(()=>{const W=()=>O(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[O]);const[A,F]=PP(W=>{const $=L().filter(X=>!X.disabled),V=$.find(X=>X.ref.current===document.activeElement),U=OP($,W,V);U&&setTimeout(()=>U.ref.current.focus())}),H=w.useCallback((W,$,V)=>{const U=!P.current&&!V;(p.value!==void 0&&p.value===$||U)&&(T(W),U&&(P.current=!0))},[p.value]),B=w.useCallback(()=>x==null?void 0:x.focus(),[x]),G=w.useCallback((W,$,V)=>{const U=!P.current&&!V;(p.value!==void 0&&p.value===$||U)&&M(W)},[p.value]),Q=r==="popper"?Mb:xP,Y=Q===Mb?{side:o,sideOffset:l,align:c,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:g,sticky:_,hideWhenDetached:y,avoidCollisions:v}:{};return u.jsx(vP,{scope:n,content:x,viewport:S,onViewportChange:C,itemRefCallback:H,selectedItem:k,onItemLeave:B,itemTextRefCallback:G,focusSelectedItem:z,selectedItemText:R,position:r,isPositioned:D,searchRef:A,children:u.jsx(o0,{as:Co,allowPinchZoom:!0,children:u.jsx(Qv,{asChild:!0,trapped:p.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:fe(i,W=>{var $;($=p.trigger)==null||$.focus({preventScroll:!0}),W.preventDefault()}),children:u.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:u.jsx(Q,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:W=>W.preventDefault(),...m,...Y,onPlaced:()=>N(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...m.style},onKeyDown:fe(m.onKeyDown,W=>{const $=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!$&&W.key.length===1&&F(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let U=L().filter(X=>!X.disabled).map(X=>X.ref.current);if(["ArrowUp","End"].includes(W.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const X=W.target,q=U.indexOf(X);U=U.slice(q+1)}setTimeout(()=>I(U)),W.preventDefault()}})})})})})})});yP.displayName=nae;var rae="SelectItemAlignedPosition",xP=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=zo(Ta,n),a=Ho(Ta,n),[o,l]=w.useState(null),[c,h]=w.useState(null),d=Fe(t,E=>h(E)),f=f0(n),g=w.useRef(!1),_=w.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:m,focusSelectedItem:p}=a,x=w.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&c&&y&&v&&m){const E=s.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),R=m.getBoundingClientRect();if(s.dir!=="rtl"){const X=R.left-k.left,q=T.left-X,re=E.left-q,ne=E.width+re,le=Math.max(ne,k.width),ve=window.innerWidth-ii,ae=V_(q,[ii,Math.max(ii,ve-le)]);o.style.minWidth=ne+"px",o.style.left=ae+"px"}else{const X=k.right-R.right,q=window.innerWidth-T.right-X,re=window.innerWidth-E.right-q,ne=E.width+re,le=Math.max(ne,k.width),ve=window.innerWidth-ii,ae=V_(q,[ii,Math.max(ii,ve-le)]);o.style.minWidth=ne+"px",o.style.right=ae+"px"}const M=f(),L=window.innerHeight-ii*2,D=y.scrollHeight,N=window.getComputedStyle(c),P=parseInt(N.borderTopWidth,10),I=parseInt(N.paddingTop,10),z=parseInt(N.borderBottomWidth,10),O=parseInt(N.paddingBottom,10),j=P+I+D+O+z,A=Math.min(v.offsetHeight*5,j),F=window.getComputedStyle(y),H=parseInt(F.paddingTop,10),B=parseInt(F.paddingBottom,10),G=E.top+E.height/2-ii,Q=L-G,Y=v.offsetHeight/2,W=v.offsetTop+Y,$=P+I+W,V=j-$;if($<=G){const X=M.length>0&&v===M[M.length-1].ref.current;o.style.bottom="0px";const q=c.clientHeight-y.offsetTop-y.offsetHeight,re=Math.max(Q,Y+(X?B:0)+q+z),ne=$+re;o.style.height=ne+"px"}else{const X=M.length>0&&v===M[0].ref.current;o.style.top="0px";const re=Math.max(G,P+y.offsetTop+(X?H:0)+Y)+V;o.style.height=re+"px",y.scrollTop=$-G+y.offsetTop}o.style.margin=`${ii}px 0`,o.style.minHeight=A+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,s.trigger,s.valueNode,o,c,y,v,m,s.dir,r]);ln(()=>x(),[x]);const[b,S]=w.useState();ln(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const C=w.useCallback(E=>{E&&_.current===!0&&(x(),p==null||p(),_.current=!1)},[x,p]);return u.jsx(sae,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:u.jsx(Ce.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});xP.displayName=rae;var iae="SelectPopperPosition",Mb=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ii,...s}=e,a=p0(n);return u.jsx(aC,{...a,...s,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})});Mb.displayName=iae;var[sae,kC]=nu(Ta,{}),Rb="SelectViewport",_P=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=Ho(Rb,n),a=kC(Rb,n),o=Fe(t,s.onViewportChange),l=w.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("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}"},nonce:r}),u.jsx(h0.Slot,{scope:n,children:u.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:fe(i.onScroll,c=>{const h=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const g=Math.abs(l.current-h.scrollTop);if(g>0){const _=window.innerHeight-ii*2,y=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),m=Math.max(y,v);if(m<_){const p=m+g,x=Math.min(_,p),b=p-x;d.style.height=x+"px",d.style.bottom==="0px"&&(h.scrollTop=b>0?b:0,d.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});_P.displayName=Rb;var bP="SelectGroup",[oae,aae]=nu(bP),lae=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Rr();return u.jsx(oae,{scope:n,id:i,children:u.jsx(Ce.div,{role:"group","aria-labelledby":i,...r,ref:t})})});lae.displayName=bP;var wP="SelectLabel",SP=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=aae(wP,n);return u.jsx(Ce.div,{id:i.id,...r,ref:t})});SP.displayName=wP;var Eg="SelectItem",[cae,CP]=nu(Eg),kP=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=zo(Eg,n),l=Ho(Eg,n),c=o.value===r,[h,d]=w.useState(s??""),[f,g]=w.useState(!1),_=Fe(t,p=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,p,r,i)}),y=Rr(),v=w.useRef("touch"),m=()=>{i||(o.onValueChange(r),o.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 u.jsx(cae,{scope:n,value:r,disabled:i,textId:y,isSelected:c,onItemTextChange:w.useCallback(p=>{d(x=>x||((p==null?void 0:p.textContent)??"").trim())},[]),children:u.jsx(h0.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:u.jsx(Ce.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:_,onFocus:fe(a.onFocus,()=>g(!0)),onBlur:fe(a.onBlur,()=>g(!1)),onClick:fe(a.onClick,()=>{v.current!=="mouse"&&m()}),onPointerUp:fe(a.onPointerUp,()=>{v.current==="mouse"&&m()}),onPointerDown:fe(a.onPointerDown,p=>{v.current=p.pointerType}),onPointerMove:fe(a.onPointerMove,p=>{var x;v.current=p.pointerType,i?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(a.onPointerLeave,p=>{var x;p.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:fe(a.onKeyDown,p=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&p.key===" "||(Yoe.includes(p.key)&&m(),p.key===" "&&p.preventDefault())})})})})});kP.displayName=Eg;var fd="SelectItemText",EP=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=zo(fd,n),o=Ho(fd,n),l=CP(fd,n),c=Zoe(fd,n),[h,d]=w.useState(null),f=Fe(t,m=>d(m),l.onItemTextChange,m=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,m,l.value,l.disabled)}),g=h==null?void 0:h.textContent,_=w.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:v}=c;return ln(()=>(y(_),()=>v(_)),[y,v,_]),u.jsxs(u.Fragment,{children:[u.jsx(Ce.span,{id:l.textId,...s,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Er.createPortal(s.children,a.valueNode):null]})});EP.displayName=fd;var TP="SelectItemIndicator",MP=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return CP(TP,n).isSelected?u.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});MP.displayName=TP;var Ab="SelectScrollUpButton",RP=w.forwardRef((e,t)=>{const n=Ho(Ab,e.__scopeSelect),r=kC(Ab,e.__scopeSelect),[i,s]=w.useState(!1),a=Fe(t,r.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollTop>0;s(c)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?u.jsx(jP,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});RP.displayName=Ab;var jb="SelectScrollDownButton",AP=w.forwardRef((e,t)=>{const n=Ho(jb,e.__scopeSelect),r=kC(jb,e.__scopeSelect),[i,s]=w.useState(!1),a=Fe(t,r.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)<c;s(h)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?u.jsx(jP,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});AP.displayName=jb;var jP=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=Ho("SelectScrollButton",n),a=w.useRef(null),o=f0(n),l=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),ln(()=>{var h;const c=o().find(d=>d.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),u.jsx(Ce.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:fe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:fe(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:fe(i.onPointerLeave,()=>{l()})})}),uae="SelectSeparator",LP=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});LP.displayName=uae;var Lb="SelectArrow",dae=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=p0(n),s=zo(Lb,n),a=Ho(Lb,n);return s.open&&a.position==="popper"?u.jsx(lC,{...i,...r,ref:t}):null});dae.displayName=Lb;function DP(e){return e===""||e===void 0}var NP=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=w.useRef(null),s=Fe(t,i),a=ff(n);return w.useEffect(()=>{const o=i.current,l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&h){const d=new Event("change",{bubbles:!0});h.call(o,n),o.dispatchEvent(d)}},[a,n]),u.jsx(CC,{asChild:!0,children:u.jsx("select",{...r,ref:s,defaultValue:n})})});NP.displayName="BubbleSelect";function PP(e){const t=Et(e),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(a=>{const o=n.current+a;t(o),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(o)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function OP(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=hae(e,Math.max(s,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 hae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var IP=cP,m0=dP,fae=fP,pae=pP,$P=mP,g0=gP,BP=_P,FP=SP,v0=kP,zP=EP,mae=MP,y0=RP,x0=AP,HP=LP;const Pn=IP,On=fae,kn=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(m0,{ref:r,className:J("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,u.jsx(pae,{asChild:!0,children:u.jsx(Ua,{className:"h-4 w-4 opacity-50"})})]}));kn.displayName=m0.displayName;const WP=w.forwardRef(({className:e,...t},n)=>u.jsx(y0,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(uS,{className:"h-4 w-4"})}));WP.displayName=y0.displayName;const UP=w.forwardRef(({className:e,...t},n)=>u.jsx(x0,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Ua,{className:"h-4 w-4"})}));UP.displayName=x0.displayName;const En=w.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>u.jsx($P,{children:u.jsxs(g0,{ref:i,className:J("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:[u.jsx(WP,{}),u.jsx(BP,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(UP,{})]})}));En.displayName=g0.displayName;const gae=w.forwardRef(({className:e,...t},n)=>u.jsx(FP,{ref:n,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));gae.displayName=FP.displayName;const be=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(v0,{ref:r,className:J("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(mae,{children:u.jsx(lS,{className:"h-4 w-4"})})}),u.jsx(zP,{children:t})]}));be.displayName=v0.displayName;const EC=w.forwardRef(({className:e,...t},n)=>u.jsx(HP,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));EC.displayName=HP.displayName;const Tg=[{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."}],so="!any",wp=Un(1250,e=>{e()},{noLeading:!0});function vae({doSearch:e,initialState:t,adminStats:n}){const{authData:r}=Ga(),i=w.useRef(null),[s,a]=w.useState(!1),[o,l]=w.useState(t.search.type),[c,h]=w.useState(!!t.search.value),[d,f]=w.useState(t.filterbyType),[g,_]=w.useState(t.filterbyAdmin),y=()=>{if(!i.current)return;const S=i.current.value.trim();e({value:S,type:o},d!==so?d:void 0,g!==so?g:void 0)};w.useEffect(()=>{y()},[o,d,g]);const v=S=>{S.key==="Enter"?(wp.cancel({upcomingOnly:!0}),y()):S.key==="Escape"?(i.current.value="",wp(y),h(!1)):(wp(y),h(!0))},m=()=>{i.current.value="",wp.cancel({upcomingOnly:!0}),y(),h(!1)};yi("keydown",S=>{var C;S.code==="KeyF"&&(S.ctrlKey||S.metaKey)&&((C=i.current)==null||C.focus(),S.preventDefault())});const p=Tg.find(S=>S.value===o);if(!p)throw new Error(`Invalid search type: ${o}`);if(!r)throw new Error("authData is not available");const x=w.useMemo(()=>n.filter(S=>S.name!==r.name),[n,r.name]),b=w.useMemo(()=>{var S;return((S=n.find(C=>C.name===r.name))==null?void 0:S.actions)||0},[n,r.name]);return u.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[u.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[u.jsxs("div",{className:"relative min-w-44 grow",children:[u.jsx(yt,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:i,placeholder:p.placeholder,defaultValue:t.search.value,onKeyDown:v}),c?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:m,children:u.jsx(yr,{})}):u.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:u.jsx(Ue,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),u.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[u.jsxs(ec,{children:[u.jsx(tc,{asChild:!0,children:u.jsxs(Ae,{variant:"outline",role:"combobox","aria-expanded":s,onClick:()=>a(!s),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 ",p.label,u.jsx(K_,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(ma,{className:"w-48",children:[u.jsx(Sg,{children:"Search Type"}),u.jsx(aa,{}),u.jsx(rP,{value:o,onValueChange:l,children:Tg.map(S=>u.jsx(_C,{value:S.value,className:"cursor-pointer",children:S.label},S.value))})]})]}),u.jsxs(Pn,{defaultValue:d,onValueChange:f,children:[u.jsx(kn,{className:"w-36 grow md:grow-0",children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:so,className:"cursor-pointer",children:"Any type"}),u.jsx(be,{value:"ban",className:"cursor-pointer",children:"Bans"}),u.jsx(be,{value:"warn",className:"cursor-pointer",children:"Warns"})]})]}),u.jsxs(Pn,{defaultValue:g,onValueChange:_,children:[u.jsx(kn,{className:"w-36 grow md:grow-0",children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:so,className:"cursor-pointer",children:"By any admin"}),u.jsxs(be,{value:r.name,className:"cursor-pointer",children:[r.name," ",u.jsxs("span",{className:"opacity-50",children:["(",b,")"]})]}),u.jsx(EC,{}),x.map(S=>u.jsxs(be,{className:"cursor-pointer",value:S.name,children:[S.name," ",u.jsxs("span",{className:"opacity-50",children:["(",S.actions,")"]})]},S.name))]})]}),u.jsx("div",{className:"flex justify-end flex-grow",children:u.jsxs(ec,{children:[u.jsx(tc,{asChild:!0,children:u.jsxs(Ae,{variant:"outline",className:"grow md:grow-0",children:["More",u.jsx(Ua,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(ma,{children:[u.jsx(Bi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(xi,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[u.jsx(ka,{className:"inline mr-1 h-4"}),"Bulk Remove"]})}),u.jsx(Bi,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(xi,{href:"/settings/ban-templates",className:"cursor-pointer",children:[u.jsx(ka,{className:"inline mr-1 h-4"}),"Ban Templates"]})})]})]})})]})]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:p.description})]})}function yae({action:e,modalOpener:t}){const n=()=>{t(e.id)};let r,i;if(e.type==="warn")r=u.jsx("div",{className:"flex items-center px-1 bg-warning-hint text-warning",children:u.jsx(ag,{className:"size-5"})}),i=u.jsx("span",{className:"tracking-wider text-warning",children:e.id});else if(e.type==="ban")r=u.jsx("div",{className:"flex items-center px-1 bg-destructive-hint text-destructive",children:u.jsx(sg,{className:"size-5"})}),i=u.jsx("span",{className:"tracking-wider text-destructive",children:e.id});else throw new Error(`Invalid action type: ${e.type}`);let s;return e.isRevoked?s=u.jsx(pS,{className:"size-4"}):e.banExpiration?e.banExpiration==="permanent"?s=u.jsx(EY,{className:"size-4"}):e.banExpiration==="active"&&(s=u.jsx(GD,{className:"size-4"})):e.type==="warn"&&!e.warnAcked&&(s=u.jsx(zD,{className:"size-4"})),u.jsxs(hf,{onClick:n,className:"cursor-pointer",children:[u.jsx(Hr,{className:J("w-[10.4rem] border-r p-0",e.isRevoked&&"opacity-40"),children:u.jsxs("div",{className:"flex justify-start gap-2",children:[r,u.jsx("div",{className:"p-2 font-mono",children:i}),u.jsx("div",{className:"flex-grow flex justify-end items-center my-auto pr-2 text-muted-foreground",children:s})]})}),u.jsx(Hr,{className:"px-4 py-2 border-r",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.playerName?e.playerName:u.jsx("span",{className:"text-muted-foreground italic",children:"unknown"})})}),u.jsx(Hr,{className:"px-4 py-2 border-r",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.reason})}),u.jsx(Hr,{className:"px-4 py-2 border-r",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.author})}),u.jsx(Hr,{className:"min-w-[10rem] px-4 py-2",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:Eb(e.timestamp)})})]})}function xae({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=u.jsx(Zt,{className:"mx-auto animate-spin"}):r?s=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),u.jsx("br",{}),u.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=u.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No actions found."}):s=u.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",u.jsx("br",{}),u.jsxs("i",{children:["(this is a bug, please report it in ",u.jsx(yn,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),u.jsx(hf,{children:u.jsx(Hr,{colSpan:5,className:"px-4 py-2 text-center",children:s})})}function _ae({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":u.jsx(u.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return u.jsxs("th",{onClick:l,className:J("py-2 px-4 text-left font-light tracking-wider cursor-pointer hover:bg-zinc-300 hover:dark:bg-zinc-600",s&&"font-medium dark:bg-zinc-700",i),children:[e,u.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function Sp({label:e,className:t}){return u.jsx("th",{className:J("py-2 px-4 font-light tracking-wider text-left text-muted-foreground",t),children:e})}function bae({search:e,filterbyType:t,filterbyAdmin:n}){const r=w.useRef(null),[i,s]=w.useState([]),[a,o]=w.useState(!1),[l,c]=w.useState(!1),[h,d]=w.useState(null),[f,g]=w.useState({key:"timestamp",desc:!0}),[_,y]=w.useState(!1),v=OS(),m=wt({method:"GET",path:"/history/search",abortOnUnmount:!0}),p=async k=>{c(!0),d(null),k&&y(!0);const T=R=>{d(R),k&&s([])};try{const R={sortingKey:f.key,sortingDesc:f.desc};e.value&&(R.searchValue=e.value,R.searchType=e.type),t&&t!==so&&(R.filterbyType=t),n&&n!==so&&(R.filterbyAdmin=n),!k&&i.length&&(R.offsetParam=i[i.length-1][f.key],R.offsetActionId=i[i.length-1].id);const M=await m({queryParams:R});if(M===void 0)return T("Request failed.");if("error"in M)return T(`Request failed: ${M.error}`);d(null),o(M.hasReachedEnd),y(!1),M.history.length?s(L=>k?M.history:[...L,...M.history]):s([])}catch(R){T(`Failed to fetch more data: ${R.message}`)}finally{c(!1),y(!1)}},x=bC({isScrollingResetDelay:0,count:i.length+1,getScrollElement:()=>{var k;return(k=r.current)==null?void 0:k.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),b=x.getVirtualItems(),S=x.getTotalSize();let C=null,E=null;if(b.length>0){const k=b[0].start-x.options.scrollMargin;k>0&&(C=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:k}})}));const T=S-b[b.length-1].end;T>0&&(E=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:T}})}))}return w.useEffect(()=>{if(!i.length||!b.length)return;const k=b[b.length-1].index;i.length<=k&&!a&&!l&&p()},[i,b,a,l]),w.useEffect(()=>{x.scrollToIndex(0),p(!0)},[e,t,n,f]),u.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:u.jsx(Qr,{className:"h-full",ref:r,children:u.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[u.jsx(wC,{children:u.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[u.jsx(Sp,{label:"Action"}),u.jsx(Sp,{label:"Player"}),u.jsx(Sp,{label:"Reason"}),u.jsx(Sp,{label:"Author"}),u.jsx(_ae,{label:"Date Time",sortKey:"timestamp",sortingState:f,setSorting:g})]})}),u.jsxs(SC,{className:J(_&&"opacity-25"),children:[C,b.map(k=>k.index>i.length-1?u.jsx(xae,{playersCount:i.length,hasReachedEnd:a,loadError:h,isFetching:l,retryFetch:p},k.key):u.jsx(yae,{action:i[k.index],modalOpener:v},k.key)),E]})]})})})}const wae=w.memo(vae),Sae=w.memo(bae),Cae=w.memo(kN),kae=(e,t,n)=>{const r=new URL(window.location.toString());e&&e.type&&e.value?(r.searchParams.set("searchType",e.type),r.searchParams.set("searchQuery",e.value)):(r.searchParams.delete("searchType"),r.searchParams.delete("searchQuery")),t&&t!=="!any"?r.searchParams.set("filterbyType",t):r.searchParams.delete("filterbyType"),n&&n!=="!any"?r.searchParams.set("filterbyAdmin",n):r.searchParams.delete("filterbyAdmin"),window.history.replaceState({},"",r)},Eae=()=>{const e=new URLSearchParams(window.location.search),t=Tg.map(i=>i.value),n=e.get("searchType"),r=e.get("searchQuery");return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:Tg[0].value,value:""},filterbyType:e.get("filterbyType")??so,filterbyAdmin:e.get("filterbyAdmin")??so}};function Tae(){const[e,t]=w.useState(void 0),[n,r]=w.useState(void 0),i=wt({method:"GET",path:"/history/stats",abortOnUnmount:!0});w.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=w.useCallback((l,c,h)=>{r({search:l,filterbyType:c,filterbyAdmin:h}),kae(l,c,h)},[]),a=w.useMemo(Eae,[]),o=w.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Warns",value:l?e.totalWarns:!1,icon:u.jsx(ag,{})},{label:"New Warns Last 7d",value:l?e.warnsLast7d:!1,icon:u.jsx(ag,{}),prefix:"+"},{label:"Total Bans",value:l?e.totalBans:!1,icon:u.jsx(sg,{})},{label:"New Bans Last 7d",value:l?e.bansLast7d:!1,icon:u.jsx(sg,{}),prefix:"+"}]},[e]);return u.jsxs("div",{className:"flex flex-col min-w-96 w-full h-contentvh",children:[u.jsx(Cae,{callouts:o}),e&&!("error"in e)?u.jsx(wae,{doSearch:s,initialState:a,adminStats:e.groupedByAdmins}):null,n?u.jsx(Sae,{search:n.search,filterbyType:n.filterbyType,filterbyAdmin:n.filterbyAdmin}):null]})}var TC="Dialog",[VP,qP]=In(TC),[Mae,Ci]=VP(TC),GP=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=w.useRef(null),l=w.useRef(null),[c=!1,h]=Zr({prop:r,defaultProp:i,onChange:s});return u.jsx(Mae,{scope:t,triggerRef:o,contentRef:l,contentId:Rr(),titleId:Rr(),descriptionId:Rr(),open:c,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(d=>!d),[h]),modal:a,children:n})};GP.displayName=TC;var KP="DialogTrigger",YP=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ci(KP,n),s=Fe(t,i.triggerRef);return u.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":AC(i.open),...r,ref:s,onClick:fe(e.onClick,i.onOpenToggle)})});YP.displayName=KP;var MC="DialogPortal",[Rae,XP]=VP(MC,{forceMount:void 0}),JP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Ci(MC,t);return u.jsx(Rae,{scope:t,forceMount:n,children:w.Children.map(r,a=>u.jsx(fn,{present:n||s.open,children:u.jsx(r0,{asChild:!0,container:i,children:a})}))})};JP.displayName=MC;var Mg="DialogOverlay",QP=w.forwardRef((e,t)=>{const n=XP(Mg,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ci(Mg,e.__scopeDialog);return s.modal?u.jsx(fn,{present:r||s.open,children:u.jsx(Aae,{...i,ref:t})}):null});QP.displayName=Mg;var Aae=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ci(Mg,n);return u.jsx(o0,{as:Co,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ce.div,{"data-state":AC(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ma="DialogContent",ZP=w.forwardRef((e,t)=>{const n=XP(Ma,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ci(Ma,e.__scopeDialog);return u.jsx(fn,{present:r||s.open,children:s.modal?u.jsx(jae,{...i,ref:t}):u.jsx(Lae,{...i,ref:t})})});ZP.displayName=Ma;var jae=w.forwardRef((e,t)=>{const n=Ci(Ma,e.__scopeDialog),r=w.useRef(null),i=Fe(t,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return dC(s)},[]),u.jsx(eO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault())})}),Lae=w.forwardRef((e,t)=>{const n=Ci(Ma,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return u.jsx(eO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),eO=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=Ci(Ma,n),l=w.useRef(null),c=Fe(t,l);return YS(),u.jsxs(u.Fragment,{children:[u.jsx(Qv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx(Jc,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":AC(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Nae,{titleId:o.titleId}),u.jsx(Oae,{contentRef:l,descriptionId:o.descriptionId})]})]})}),RC="DialogTitle",tO=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ci(RC,n);return u.jsx(Ce.h2,{id:i.titleId,...r,ref:t})});tO.displayName=RC;var nO="DialogDescription",rO=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ci(nO,n);return u.jsx(Ce.p,{id:i.descriptionId,...r,ref:t})});rO.displayName=nO;var iO="DialogClose",sO=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ci(iO,n);return u.jsx(Ce.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>i.onOpenChange(!1))})});sO.displayName=iO;function AC(e){return e?"open":"closed"}var oO="DialogTitleWarning",[Dae,aO]=LG(oO,{contentName:Ma,titleName:RC,docsSlug:"dialog"}),Nae=({titleId:e})=>{const t=aO(oO),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Pae="DialogDescriptionWarning",Oae=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${aO(Pae).contentName}}.`;return w.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},jC=GP,Iae=YP,LC=JP,mf=QP,gf=ZP,vf=tO,yf=rO,_0=sO;const Xa=jC,$ae=LC,lO=w.forwardRef(({className:e,...t},n)=>u.jsx(mf,{ref:n,className:J("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));lO.displayName=mf.displayName;const Wo=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs($ae,{children:[u.jsx(lO,{}),u.jsxs(gf,{ref:r,className:J("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,u.jsxs(_0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(yr,{className:"h-6 w-6"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Wo.displayName=gf.displayName;const Uo=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Uo.displayName="DialogHeader";const xf=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xf.displayName="DialogFooter";const Vo=w.forwardRef(({className:e,...t},n)=>u.jsx(vf,{ref:n,className:J("text-lg font-semibold leading-none tracking-tight","attempt-word-wrap",e),...t}));Vo.displayName=vf.displayName;const cO=w.forwardRef(({className:e,...t},n)=>u.jsx(yf,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));cO.displayName=yf.displayName;const Bae=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[i,s]=w.useState(!0);w.useEffect(()=>{if(e){i&&(e.style.minHeight=`${r+2}px`,n>r&&(e.style.maxHeight=`${n}px`),s(!1)),e.style.height=`${r+2}px`;const o=e.scrollHeight;o>n?e.style.height=`${n}px`:e.style.height=`${o+2}px`}},[e,t])},_f=w.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:i,...s},a)=>{const o=w.useRef(null),[l,c]=w.useState("");return Bae({textAreaRef:o.current,triggerAutoSize:l,maxHeight:e,minHeight:t}),w.useImperativeHandle(a,()=>({textArea:o.current,maxHeight:e,minHeight:t})),w.useEffect(()=>{c(i)},[i,s==null?void 0:s.defaultValue,s==null?void 0:s.placeholder]),u.jsx("textarea",{...s,value:i,ref:o,className:J("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 placeholder:opacity-50",n),onChange:h=>{c(h.target.value),r==null||r(h)}})});_f.displayName="AutosizeTextarea";const Fae=["2 hours","8 hours","1 days","2 days","1 weeks","2 weeks","permanent"];function zae({reasonData:e,onSave:t,isDialogOpen:n,setIsDialogOpen:r}){let i="",s="2 days",a,o="days";e&&(i=e.reason,Fae.includes(Xm(e.duration))||e.duration==="permanent"?s=Xm(e.duration):(s="custom",a=e.duration.value,o=e.duration.unit));const l=w.useRef(null),c=w.useRef(null),[h,d]=w.useState(s),[f,g]=w.useState(o);w.useEffect(()=>{const y=setTimeout(()=>{n||(d(s),g(o),l.current&&(l.current.textArea.value=""),c.current&&(c.current.value=""))},500);return()=>clearTimeout(y)},[n]);const _=y=>{y.preventDefault();const v=y.currentTarget,m=(e==null?void 0:e.id)||null,p=v.reason.value.trim();if(v.reason.value=p,p.length<3)return v.reason.focus(),We.warning("Reason must be at least 3 characters long");let x;if(h==="permanent")x="permanent";else if(h==="custom"){if(v.durationMultiplier.value<=0)return v.durationMultiplier.focus(),We.warning("Custom duration must be a positive number");x={value:parseInt(v.durationMultiplier.value),unit:f}}else{const[b,S]=h.split(" ");x={value:parseInt(b),unit:S}}t({id:m,reason:p,duration:x})};return u.jsx(Xa,{open:n,onOpenChange:r,children:u.jsx(Wo,{className:"md:max-w-xl",children:u.jsx("form",{onSubmit:_,children:u.jsxs("div",{className:"space-y-4",children:[u.jsx(Uo,{children:u.jsxs(Vo,{children:[e?"Edit":"Add"," Template"]})}),u.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[u.jsx(_n,{htmlFor:"banReason",className:"col-span-6 sm:col-auto",children:"Reason"}),u.jsx(_f,{id:"reason",placeholder:"The reason for the ban, rule violated, etc.",className:"col-span-full sm:col-span-5",defaultValue:i,ref:l,maxHeight:160,minLength:3,autoFocus:!0,required:!0,onChangeCapture:y=>{const v=y.target;v.value.includes(`
`)&&(v.value=v.value.replace(/\s*\r*\n+\s*/g," "))}})]}),u.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[u.jsx(_n,{htmlFor:"durationSelect",className:"col-span-6 sm:col-auto",children:"Duration"}),u.jsxs("div",{className:"col-span-full sm:col-span-5 space-y-1",children:[u.jsxs(Pn,{onValueChange:d,defaultValue:h,children:[u.jsx(kn,{id:"durationSelect",className:"tracking-wide",children:u.jsx(On,{placeholder:"Select Duration"})}),u.jsxs(En,{className:"tracking-wide",children:[u.jsx(be,{value:"custom",className:"font-bold",children:"Custom (set below)"}),u.jsx(be,{value:"2 hours",children:"2 HOURS"}),u.jsx(be,{value:"8 hours",children:"8 HOURS"}),u.jsx(be,{value:"1 days",children:"1 DAY"}),u.jsx(be,{value:"2 days",children:"2 DAYS"}),u.jsx(be,{value:"1 weeks",children:"1 WEEK"}),u.jsx(be,{value:"2 weeks",children:"2 WEEKS"}),u.jsx(be,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),u.jsxs("div",{className:"flex flex-row gap-2",children:[u.jsx(yt,{id:"durationMultiplier",type:"number",placeholder:"123",defaultValue:a,disabled:h!=="custom",ref:c,min:1,max:99,required:!0}),u.jsxs(Pn,{onValueChange:g,defaultValue:f,children:[u.jsx(kn,{id:"durationUnits",className:"tracking-wide",disabled:h!=="custom",children:u.jsx(On,{})}),u.jsxs(En,{className:"tracking-wide",children:[u.jsx(be,{value:"hours",children:"HOURS"}),u.jsx(be,{value:"days",children:"DAYS"}),u.jsx(be,{value:"weeks",children:"WEEKS"}),u.jsx(be,{value:"months",children:"MONTHS"})]})]})]})]})]}),u.jsx(xf,{children:u.jsx(Ae,{type:"submit",children:"Save changes"})})]})})})})}function Hae({id:e,reason:t,duration:n,onEdit:r,onRemove:i,disabled:s}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grow sm:flex items-center justify-items-start gap-2",children:[u.jsx("span",{className:"line-clamp-5 md:line-clamp-3",children:t}),u.jsx("div",{className:J("bg-black/5 dark:bg-black/40 px-2 py-0.5 my-1 sm:my-0 border text-sm rounded w-max shrink-0 uppercase select-none",n==="permanent"?"border-destructive bg-destructive-hint text-destructive":"border-primary text-primary opacity-85"),children:Xm(n)})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:J("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-primary hover:scale-110"),onClick:()=>r(e),disabled:s,children:u.jsx(fS,{className:"size-6"})}),u.jsx("button",{className:J("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-destructive hover:scale-110"),onClick:()=>i(e),disabled:s,children:u.jsx(yr,{className:"size-6"})})]})]})}function Wae({onClick:e,disabled:t}){return u.jsxs("li",{onClick:e,className:J("rounded-lg bg-card border px-2 py-3 flex gap-3",t?"opacity-50 cursor-not-allowed":"hover:bg-primary hover:text-primary-foreground cursor-pointer"),children:[u.jsx(hS,{className:"size-6"}),u.jsx("span",{children:"Add New Reason"})]})}function Uae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return w.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const b0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ru(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function DC(e){return"nodeType"in e}function xr(e){var t,n;return e?ru(e)?e:DC(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function NC(e){const{Document:t}=xr(e);return e instanceof t}function bf(e){return ru(e)?!1:e instanceof xr(e).HTMLElement}function uO(e){return e instanceof xr(e).SVGElement}function iu(e){return e?ru(e)?e.document:DC(e)?NC(e)?e:bf(e)||uO(e)?e.ownerDocument:document:document:document}const Xi=b0?w.useLayoutEffect:w.useEffect;function PC(e){const t=w.useRef(e);return Xi(()=>{t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function Vae(){const e=w.useRef(null),t=w.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=w.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function yh(e,t){t===void 0&&(t=[e]);const n=w.useRef(e);return Xi(()=>{n.current!==e&&(n.current=e)},t),n}function wf(e,t){const n=w.useRef();return w.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Rg(e){const t=PC(e),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Db(e){const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}let lx={};function Sf(e,t){return w.useMemo(()=>{if(t)return t;const n=lx[e]==null?0:lx[e]+1;return lx[e]=n,e+"-"+n},[e,t])}function dO(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,a)=>{const o=Object.entries(a);for(const[l,c]of o){const h=s[l];h!=null&&(s[l]=h+e*c)}return s},{...t})}}const nc=dO(1),xh=dO(-1);function qae(e){return"clientX"in e&&"clientY"in e}function OC(e){if(!e)return!1;const{KeyboardEvent:t}=xr(e.target);return t&&e instanceof t}function Gae(e){if(!e)return!1;const{TouchEvent:t}=xr(e.target);return t&&e instanceof t}function Nb(e){if(Gae(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return qae(e)?{x:e.clientX,y:e.clientY}:null}const _h=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[_h.Translate.toString(e),_h.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),iT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Kae(e){return e.matches(iT)?e:e.querySelector(iT)}const Yae={display:"none"};function Xae(e){let{id:t,value:n}=e;return lt.createElement("div",{id:t,style:Yae},n)}function Jae(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return lt.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function Qae(){const[e,t]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const hO=w.createContext(null);function Zae(e){const t=w.useContext(hO);w.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ele(){const[e]=w.useState(()=>new Set),t=w.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[w.useCallback(r=>{let{type:i,event:s}=r;e.forEach(a=>{var o;return(o=a[i])==null?void 0:o.call(a,s)})},[e]),t]}const tle={draggable:`
    To pick up a draggable item, press the space bar.
    While dragging, use the arrow keys to move the item.
    Press space again to drop the item in its new position, or press escape to cancel.
  `},nle={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function rle(e){let{announcements:t=nle,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=tle}=e;const{announce:s,announcement:a}=Qae(),o=Sf("DndLiveRegion"),[l,c]=w.useState(!1);if(w.useEffect(()=>{c(!0)},[]),Zae(w.useMemo(()=>({onDragStart(d){let{active:f}=d;s(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:g}=d;t.onDragMove&&s(t.onDragMove({active:f,over:g}))},onDragOver(d){let{active:f,over:g}=d;s(t.onDragOver({active:f,over:g}))},onDragEnd(d){let{active:f,over:g}=d;s(t.onDragEnd({active:f,over:g}))},onDragCancel(d){let{active:f,over:g}=d;s(t.onDragCancel({active:f,over:g}))}}),[s,t])),!l)return null;const h=lt.createElement(lt.Fragment,null,lt.createElement(Xae,{id:r,value:i.draggable}),lt.createElement(Jae,{id:o,announcement:a}));return n?Er.createPortal(h,n):h}var gn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(gn||(gn={}));function Ag(){}function sT(e,t){return w.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ile(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return w.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const wi=Object.freeze({x:0,y:0});function fO(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pO(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function sle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function oT(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function mO(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function aT(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const ole=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=aT(t,t.left,t.top),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=fO(aT(l),i);s.push({id:o,data:{droppableContainer:a,value:c}})}}return s.sort(pO)},ale=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=oT(t),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=oT(l),h=i.reduce((f,g,_)=>f+fO(c[_],g),0),d=Number((h/4).toFixed(4));s.push({id:o,data:{droppableContainer:a,value:d}})}}return s.sort(pO)};function lle(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=i-r,o=s-n;if(r<i&&n<s){const l=t.width*t.height,c=e.width*e.height,h=a*o,d=h/(l+c-h);return Number(d.toFixed(4))}return 0}const cle=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const s of r){const{id:a}=s,o=n.get(a);if(o){const l=lle(o,t);l>0&&i.push({id:a,data:{droppableContainer:s,value:l}})}}return i.sort(sle)};function ule(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function gO(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wi}function dle(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((a,o)=>({...a,top:a.top+e*o.y,bottom:a.bottom+e*o.y,left:a.left+e*o.x,right:a.right+e*o.x}),{...n})}}const hle=dle(1);function fle(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ple(e,t,n){const r=fle(t);if(!r)return e;const{scaleX:i,scaleY:s,x:a,y:o}=r,l=e.left-a-(1-i)*parseFloat(n),c=e.top-o-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?e.width/i:e.width,d=s?e.height/s:e.height;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l}}const mle={ignoreTransform:!1};function su(e,t){t===void 0&&(t=mle);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:h}=xr(e).getComputedStyle(e);c&&(n=ple(n,c,h))}const{top:r,left:i,width:s,height:a,bottom:o,right:l}=n;return{top:r,left:i,width:s,height:a,bottom:o,right:l}}function lT(e){return su(e,{ignoreTransform:!0})}function gle(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function vle(e,t){return t===void 0&&(t=xr(e).getComputedStyle(e)),t.position==="fixed"}function yle(e,t){t===void 0&&(t=xr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function w0(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(NC(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!bf(i)||uO(i)||n.includes(i))return n;const s=xr(e).getComputedStyle(i);return i!==e&&yle(i,s)&&n.push(i),vle(i,s)?n:r(i.parentNode)}return e?r(e):n}function vO(e){const[t]=w0(e,1);return t??null}function cx(e){return!b0||!e?null:ru(e)?e:DC(e)?NC(e)||e===iu(e).scrollingElement?window:bf(e)?e:null:null}function yO(e){return ru(e)?e.scrollX:e.scrollLeft}function xO(e){return ru(e)?e.scrollY:e.scrollTop}function Pb(e){return{x:yO(e),y:xO(e)}}var Sn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Sn||(Sn={}));function _O(e){return!b0||!e?!1:e===document.scrollingElement}function bO(e){const t={x:0,y:0},n=_O(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,o=e.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:a,isRight:o,maxScroll:r,minScroll:t}}const xle={x:.2,y:.2};function _le(e,t,n,r,i){let{top:s,left:a,right:o,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=xle);const{isTop:c,isBottom:h,isLeft:d,isRight:f}=bO(e),g={x:0,y:0},_={x:0,y:0},y={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+y.height?(g.y=Sn.Backward,_.y=r*Math.abs((t.top+y.height-s)/y.height)):!h&&l>=t.bottom-y.height&&(g.y=Sn.Forward,_.y=r*Math.abs((t.bottom-y.height-l)/y.height)),!f&&o>=t.right-y.width?(g.x=Sn.Forward,_.x=r*Math.abs((t.right-y.width-o)/y.width)):!d&&a<=t.left+y.width&&(g.x=Sn.Backward,_.x=r*Math.abs((t.left+y.width-a)/y.width)),{direction:g,speed:_}}function ble(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function wO(e){return e.reduce((t,n)=>nc(t,Pb(n)),wi)}function wle(e){return e.reduce((t,n)=>t+yO(n),0)}function Sle(e){return e.reduce((t,n)=>t+xO(n),0)}function Cle(e,t){if(t===void 0&&(t=su),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);vO(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const kle=[["x",["left","right"],wle],["y",["top","bottom"],Sle]];class IC{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=w0(n),i=wO(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,o]of kle)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=o(r),h=i[s]-c;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Od{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Ele(e){const{EventTarget:t}=xr(e);return e instanceof t?e:iu(e)}function ux(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Pr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Pr||(Pr={}));function cT(e){e.preventDefault()}function Tle(e){e.stopPropagation()}var it;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(it||(it={}));const SO={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},Mle=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case it.Right:return{...n,x:n.x+25};case it.Left:return{...n,x:n.x-25};case it.Down:return{...n,y:n.y+25};case it.Up:return{...n,y:n.y-25}}};class $C{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Od(iu(n)),this.windowListeners=new Od(xr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Pr.Resize,this.handleCancel),this.windowListeners.add(Pr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Pr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Cle(r),n(wi)}handleKeyDown(t){if(OC(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=SO,coordinateGetter:a=Mle,scrollBehavior:o="smooth"}=i,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,h=c?{x:c.left,y:c.top}:wi;this.referenceCoordinates||(this.referenceCoordinates=h);const d=a(t,{active:n,context:r.current,currentCoordinates:h});if(d){const f=xh(d,h),g={x:0,y:0},{scrollableAncestors:_}=r.current;for(const y of _){const v=t.code,{isTop:m,isRight:p,isLeft:x,isBottom:b,maxScroll:S,minScroll:C}=bO(y),E=ble(y),k={x:Math.min(v===it.Right?E.right-E.width/2:E.right,Math.max(v===it.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(v===it.Down?E.bottom-E.height/2:E.bottom,Math.max(v===it.Down?E.top:E.top+E.height/2,d.y))},T=v===it.Right&&!p||v===it.Left&&!x,R=v===it.Down&&!b||v===it.Up&&!m;if(T&&k.x!==d.x){const M=y.scrollLeft+f.x,L=v===it.Right&&M<=S.x||v===it.Left&&M>=C.x;if(L&&!f.y){y.scrollTo({left:M,behavior:o});return}L?g.x=y.scrollLeft-M:g.x=v===it.Right?y.scrollLeft-S.x:y.scrollLeft-C.x,g.x&&y.scrollBy({left:-g.x,behavior:o});break}else if(R&&k.y!==d.y){const M=y.scrollTop+f.y,L=v===it.Down&&M<=S.y||v===it.Up&&M>=C.y;if(L&&!f.x){y.scrollTo({top:M,behavior:o});return}L?g.y=y.scrollTop-M:g.y=v===it.Down?y.scrollTop-S.y:y.scrollTop-C.y,g.y&&y.scrollBy({top:-g.y,behavior:o});break}}this.handleMove(t,nc(xh(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}$C.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=SO,onActivation:i}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const o=s.activatorNode.current;return o&&e.target!==o?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function uT(e){return!!(e&&"distance"in e)}function dT(e){return!!(e&&"delay"in e)}class BC{constructor(t,n,r){var i;r===void 0&&(r=Ele(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=iu(a),this.documentListeners=new Od(this.document),this.listeners=new Od(r),this.windowListeners=new Od(xr(a)),this.initialCoordinates=(i=Nb(s))!=null?i:wi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Pr.Resize,this.handleCancel),this.windowListeners.add(Pr.DragStart,cT),this.windowListeners.add(Pr.VisibilityChange,this.handleCancel),this.windowListeners.add(Pr.ContextMenu,cT),this.documentListeners.add(Pr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(dT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(uT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Pr.Click,Tle,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Pr.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:o}}=s;if(!i)return;const l=(n=Nb(t))!=null?n:wi,c=xh(i,l);if(!r&&o){if(uT(o)){if(o.tolerance!=null&&ux(c,o.tolerance))return this.handleCancel();if(ux(c,o.distance))return this.handleStart()}if(dT(o)&&ux(c,o.tolerance))return this.handleCancel();this.handlePending(o,c);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===it.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Rle={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class FC extends BC{constructor(t){const{event:n}=t,r=iu(n.target);super(t,Rle,r)}}FC.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Ale={move:{name:"mousemove"},end:{name:"mouseup"}};var Ob;(function(e){e[e.RightClick=2]="RightClick"})(Ob||(Ob={}));class jle extends BC{constructor(t){super(t,Ale,iu(t.event.target))}}jle.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Ob.RightClick?!1:(r==null||r({event:n}),!0)}}];const dx={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Lle extends BC{constructor(t){super(t,dx)}static setup(){return window.addEventListener(dx.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(dx.move.name,t)};function t(){}}}Lle.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Id;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Id||(Id={}));var jg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(jg||(jg={}));function Dle(e){let{acceleration:t,activator:n=Id.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:o=jg.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:h,delta:d,threshold:f}=e;const g=Ple({delta:d,disabled:!s}),[_,y]=Vae(),v=w.useRef({x:0,y:0}),m=w.useRef({x:0,y:0}),p=w.useMemo(()=>{switch(n){case Id.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Id.DraggableRect:return i}},[n,i,l]),x=w.useRef(null),b=w.useCallback(()=>{const C=x.current;if(!C)return;const E=v.current.x*m.current.x,k=v.current.y*m.current.y;C.scrollBy(E,k)},[]),S=w.useMemo(()=>o===jg.TreeOrder?[...c].reverse():c,[o,c]);w.useEffect(()=>{if(!s||!c.length||!p){y();return}for(const C of S){if((r==null?void 0:r(C))===!1)continue;const E=c.indexOf(C),k=h[E];if(!k)continue;const{direction:T,speed:R}=_le(C,k,p,t,f);for(const M of["x","y"])g[M][T[M]]||(R[M]=0,T[M]=0);if(R.x>0||R.y>0){y(),x.current=C,_(b,a),v.current=R,m.current=T;return}}v.current={x:0,y:0},m.current={x:0,y:0},y()},[t,b,r,y,s,a,JSON.stringify(p),JSON.stringify(g),_,c,S,h,JSON.stringify(f)])}const Nle={x:{[Sn.Backward]:!1,[Sn.Forward]:!1},y:{[Sn.Backward]:!1,[Sn.Forward]:!1}};function Ple(e){let{delta:t,disabled:n}=e;const r=Db(t);return wf(i=>{if(n||!r||!i)return Nle;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Sn.Backward]:i.x[Sn.Backward]||s.x===-1,[Sn.Forward]:i.x[Sn.Forward]||s.x===1},y:{[Sn.Backward]:i.y[Sn.Backward]||s.y===-1,[Sn.Forward]:i.y[Sn.Forward]||s.y===1}}},[n,t,r])}function Ole(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return wf(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function Ile(e,t){return w.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var bh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(bh||(bh={}));var Ib;(function(e){e.Optimized="optimized"})(Ib||(Ib={}));const hT=new Map;function $le(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,a]=w.useState(null),{frequency:o,measure:l,strategy:c}=i,h=w.useRef(e),d=v(),f=yh(d),g=w.useCallback(function(m){m===void 0&&(m=[]),!f.current&&a(p=>p===null?m:p.concat(m.filter(x=>!p.includes(x))))},[f]),_=w.useRef(null),y=wf(m=>{if(d&&!n)return hT;if(!m||m===hT||h.current!==e||s!=null){const p=new Map;for(let x of e){if(!x)continue;if(s&&s.length>0&&!s.includes(x.id)&&x.rect.current){p.set(x.id,x.rect.current);continue}const b=x.node.current,S=b?new IC(l(b),b):null;x.rect.current=S,S&&p.set(x.id,S)}return p}return m},[e,s,n,d,l]);return w.useEffect(()=>{h.current=e},[e]),w.useEffect(()=>{d||g()},[n,d]),w.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),w.useEffect(()=>{d||typeof o!="number"||_.current!==null||(_.current=setTimeout(()=>{g(),_.current=null},o))},[o,d,g,...r]),{droppableRects:y,measureDroppableContainers:g,measuringScheduled:s!=null};function v(){switch(c){case bh.Always:return!1;case bh.BeforeDragging:return n;default:return!n}}}function CO(e,t){return wf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ble(e,t){return CO(e,t)}function Fle(e){let{callback:t,disabled:n}=e;const r=PC(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function S0(e){let{callback:t,disabled:n}=e;const r=PC(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function zle(e){return new IC(su(e),e)}function fT(e,t,n){t===void 0&&(t=zle);const[r,i]=w.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const h=t(e);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const a=Fle({callback(l){if(e)for(const c of l){const{type:h,target:d}=c;if(h==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),o=S0({callback:s});return Xi(()=>{s(),e?(o==null||o.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[e]),r}function Hle(e){const t=CO(e);return gO(e,t)}const pT=[];function Wle(e){const t=w.useRef(e),n=wf(r=>e?r&&r!==pT&&e&&t.current&&e.parentNode===t.current.parentNode?r:w0(e):pT,[e]);return w.useEffect(()=>{t.current=e},[e]),n}function Ule(e){const[t,n]=w.useState(null),r=w.useRef(e),i=w.useCallback(s=>{const a=cx(s.target);a&&n(o=>o?(o.set(a,Pb(a)),new Map(o)):null)},[]);return w.useEffect(()=>{const s=r.current;if(e!==s){a(s);const o=e.map(l=>{const c=cx(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,Pb(c)]):null}).filter(l=>l!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(s)};function a(o){o.forEach(l=>{const c=cx(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),w.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>nc(s,a),wi):wO(e):wi,[e,t])}function mT(e,t){t===void 0&&(t=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},t),w.useEffect(()=>{const r=e!==wi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xh(e,n.current):wi}function Vle(e){w.useEffect(()=>{if(!b0)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function qle(e,t){return w.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,t)},n},{}),[e,t])}function kO(e){return w.useMemo(()=>e?gle(e):null,[e])}const gT=[];function Gle(e,t){t===void 0&&(t=su);const[n]=e,r=kO(n?xr(n):null),[i,s]=w.useState(gT);function a(){s(()=>e.length?e.map(l=>_O(l)?r:new IC(t(l),l)):gT)}const o=S0({callback:a});return Xi(()=>{o==null||o.disconnect(),a(),e.forEach(l=>o==null?void 0:o.observe(l))},[e]),i}function Kle(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bf(t)?t:e}function Yle(e){let{measure:t}=e;const[n,r]=w.useState(null),i=w.useCallback(c=>{for(const{target:h}of c)if(bf(h)){r(d=>{const f=t(h);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),s=S0({callback:i}),a=w.useCallback(c=>{const h=Kle(c);s==null||s.disconnect(),h&&(s==null||s.observe(h)),r(h?t(h):null)},[t,s]),[o,l]=Rg(a);return w.useMemo(()=>({nodeRef:o,rect:n,setRef:l}),[n,o,l])}const Xle=[{sensor:FC,options:{}},{sensor:$C,options:{}}],Jle={current:{}},fm={draggable:{measure:lT},droppable:{measure:lT,strategy:bh.WhileDragging,frequency:Ib.Optimized},dragOverlay:{measure:su}};class $d extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Qle={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $d,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ag},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fm,measureDroppableContainers:Ag,windowRect:null,measuringScheduled:!1},Zle={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ag,draggableNodes:new Map,over:null,measureDroppableContainers:Ag},C0=w.createContext(Zle),EO=w.createContext(Qle);function ece(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $d}}}function tce(e,t){switch(t.type){case gn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case gn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case gn.DragEnd:case gn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case gn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new $d(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case gn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new $d(e.droppable.containers);return a.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case gn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new $d(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function nce(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext(C0),s=Db(r),a=Db(n==null?void 0:n.id);return w.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!OC(s)||document.activeElement===s.target)return;const o=i.get(a);if(!o)return;const{activatorNode:l,node:c}=o;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const h of[l.current,c.current]){if(!h)continue;const d=Kae(h);if(d){d.focus();break}}})}},[r,t,i,a,s]),null}function rce(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function ice(e){return w.useMemo(()=>({draggable:{...fm.draggable,...e==null?void 0:e.draggable},droppable:{...fm.droppable,...e==null?void 0:e.droppable},dragOverlay:{...fm.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function sce(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=w.useRef(!1),{x:a,y:o}=typeof i=="boolean"?{x:i,y:i}:i;Xi(()=>{if(!a&&!o||!t){s.current=!1;return}if(s.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const h=n(c),d=gO(h,r);if(a||(d.x=0),o||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=vO(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,o,r,n])}const TO=w.createContext({...wi,scaleX:1,scaleY:1});var Js;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Js||(Js={}));const oce=w.memo(function(t){var n,r,i,s;let{id:a,accessibility:o,autoScroll:l=!0,children:c,sensors:h=Xle,collisionDetection:d=cle,measuring:f,modifiers:g,..._}=t;const y=w.useReducer(tce,void 0,ece),[v,m]=y,[p,x]=ele(),[b,S]=w.useState(Js.Uninitialized),C=b===Js.Initialized,{draggable:{active:E,nodes:k,translate:T},droppable:{containers:R}}=v,M=E!=null?k.get(E):null,L=w.useRef({initial:null,translated:null}),D=w.useMemo(()=>{var nt;return E!=null?{id:E,data:(nt=M==null?void 0:M.data)!=null?nt:Jle,rect:L}:null},[E,M]),N=w.useRef(null),[P,I]=w.useState(null),[z,O]=w.useState(null),j=yh(_,Object.values(_)),A=Sf("DndDescribedBy",a),F=w.useMemo(()=>R.getEnabled(),[R]),H=ice(f),{droppableRects:B,measureDroppableContainers:G,measuringScheduled:Q}=$le(F,{dragging:C,dependencies:[T.x,T.y],config:H.droppable}),Y=Ole(k,E),W=w.useMemo(()=>z?Nb(z):null,[z]),$=rn(),V=Ble(Y,H.draggable.measure);sce({activeNode:E!=null?k.get(E):null,config:$.layoutShiftCompensation,initialRect:V,measure:H.draggable.measure});const U=fT(Y,H.draggable.measure,V),X=fT(Y?Y.parentElement:null),q=w.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=R.getNodeFor((n=q.current.over)==null?void 0:n.id),ne=Yle({measure:H.dragOverlay.measure}),le=(r=ne.nodeRef.current)!=null?r:Y,ve=C?(i=ne.rect)!=null?i:U:null,ae=!!(ne.nodeRef.current&&ne.rect),Ee=Hle(ae?null:U),Me=kO(le?xr(le):null),xe=Wle(C?re??Y:null),we=Gle(xe),se=rce(g,{transform:{x:T.x-Ee.x,y:T.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:z,active:D,activeNodeRect:U,containerNodeRect:X,draggingNodeRect:ve,over:q.current.over,overlayNodeRect:ne.rect,scrollableAncestors:xe,scrollableAncestorRects:we,windowRect:Me}),ee=W?nc(W,T):null,ie=Ule(xe),ce=mT(ie),K=mT(ie,[U]),te=nc(se,ce),oe=ve?hle(ve,se):null,he=D&&oe?d({active:D,collisionRect:oe,droppableRects:B,droppableContainers:F,pointerCoordinates:ee}):null,_e=mO(he,"id"),[ge,ye]=w.useState(null),ze=ae?se:nc(se,K),Oe=ule(ze,(s=ge==null?void 0:ge.rect)!=null?s:null,U),je=w.useRef(null),Le=w.useCallback((nt,mt)=>{let{sensor:Gt,options:sn}=mt;if(N.current==null)return;const Mt=k.get(N.current);if(!Mt)return;const Ot=nt.nativeEvent,It=new Gt({active:N.current,activeNode:Mt,event:Ot,options:sn,context:q,onAbort(_t){if(!k.get(_t))return;const{onDragAbort:Je}=j.current,Ge={id:_t};Je==null||Je(Ge),p({type:"onDragAbort",event:Ge})},onPending(_t,on,Je,Ge){if(!k.get(_t))return;const{onDragPending:gt}=j.current,en={id:_t,constraint:on,initialCoordinates:Je,offset:Ge};gt==null||gt(en),p({type:"onDragPending",event:en})},onStart(_t){const on=N.current;if(on==null)return;const Je=k.get(on);if(!Je)return;const{onDragStart:Ge}=j.current,He={activatorEvent:Ot,active:{id:on,data:Je.data,rect:L}};Er.unstable_batchedUpdates(()=>{Ge==null||Ge(He),S(Js.Initializing),m({type:gn.DragStart,initialCoordinates:_t,active:on}),p({type:"onDragStart",event:He}),I(je.current),O(Ot)})},onMove(_t){m({type:gn.DragMove,coordinates:_t})},onEnd:pn(gn.DragEnd),onCancel:pn(gn.DragCancel)});je.current=It;function pn(_t){return async function(){const{active:Je,collisions:Ge,over:He,scrollAdjustedTranslate:gt}=q.current;let en=null;if(Je&&gt){const{cancelDrop:tn}=j.current;en={activatorEvent:Ot,active:Je,collisions:Ge,delta:gt,over:He},_t===gn.DragEnd&&typeof tn=="function"&&await Promise.resolve(tn(en))&&(_t=gn.DragCancel)}N.current=null,Er.unstable_batchedUpdates(()=>{m({type:_t}),S(Js.Uninitialized),ye(null),I(null),O(null),je.current=null;const tn=_t===gn.DragEnd?"onDragEnd":"onDragCancel";if(en){const Rn=j.current[tn];Rn==null||Rn(en),p({type:tn,event:en})}})}}},[k]),pt=w.useCallback((nt,mt)=>(Gt,sn)=>{const Mt=Gt.nativeEvent,Ot=k.get(sn);if(N.current!==null||!Ot||Mt.dndKit||Mt.defaultPrevented)return;const It={active:Ot};nt(Gt,mt.options,It)===!0&&(Mt.dndKit={capturedBy:mt.sensor},N.current=sn,Le(Gt,mt))},[k,Le]),Te=Ile(h,pt);Vle(h),Xi(()=>{U&&b===Js.Initializing&&S(Js.Initialized)},[U,b]),w.useEffect(()=>{const{onDragMove:nt}=j.current,{active:mt,activatorEvent:Gt,collisions:sn,over:Mt}=q.current;if(!mt||!Gt)return;const Ot={active:mt,activatorEvent:Gt,collisions:sn,delta:{x:te.x,y:te.y},over:Mt};Er.unstable_batchedUpdates(()=>{nt==null||nt(Ot),p({type:"onDragMove",event:Ot})})},[te.x,te.y]),w.useEffect(()=>{const{active:nt,activatorEvent:mt,collisions:Gt,droppableContainers:sn,scrollAdjustedTranslate:Mt}=q.current;if(!nt||N.current==null||!mt||!Mt)return;const{onDragOver:Ot}=j.current,It=sn.get(_e),pn=It&&It.rect.current?{id:It.id,rect:It.rect.current,data:It.data,disabled:It.disabled}:null,_t={active:nt,activatorEvent:mt,collisions:Gt,delta:{x:Mt.x,y:Mt.y},over:pn};Er.unstable_batchedUpdates(()=>{ye(pn),Ot==null||Ot(_t),p({type:"onDragOver",event:_t})})},[_e]),Xi(()=>{q.current={activatorEvent:z,active:D,activeNode:Y,collisionRect:oe,collisions:he,droppableRects:B,draggableNodes:k,draggingNode:le,draggingNodeRect:ve,droppableContainers:R,over:ge,scrollableAncestors:xe,scrollAdjustedTranslate:te},L.current={initial:ve,translated:oe}},[D,Y,he,oe,k,le,ve,B,R,ge,xe,te]),Dle({...$,delta:T,draggingRect:oe,pointerCoordinates:ee,scrollableAncestors:xe,scrollableAncestorRects:we});const Ie=w.useMemo(()=>({active:D,activeNode:Y,activeNodeRect:U,activatorEvent:z,collisions:he,containerNodeRect:X,dragOverlay:ne,draggableNodes:k,droppableContainers:R,droppableRects:B,over:ge,measureDroppableContainers:G,scrollableAncestors:xe,scrollableAncestorRects:we,measuringConfiguration:H,measuringScheduled:Q,windowRect:Me}),[D,Y,U,z,he,X,ne,k,R,B,ge,G,xe,we,H,Q,Me]),Xe=w.useMemo(()=>({activatorEvent:z,activators:Te,active:D,activeNodeRect:U,ariaDescribedById:{draggable:A},dispatch:m,draggableNodes:k,over:ge,measureDroppableContainers:G}),[z,Te,D,U,m,A,k,ge,G]);return lt.createElement(hO.Provider,{value:x},lt.createElement(C0.Provider,{value:Xe},lt.createElement(EO.Provider,{value:Ie},lt.createElement(TO.Provider,{value:Oe},c)),lt.createElement(nce,{disabled:(o==null?void 0:o.restoreFocus)===!1})),lt.createElement(rle,{...o,hiddenTextDescribedById:A}));function rn(){const nt=(P==null?void 0:P.autoScrollEnabled)===!1,mt=typeof l=="object"?l.enabled===!1:l===!1,Gt=C&&!nt&&!mt;return typeof l=="object"?{...l,enabled:Gt}:{enabled:Gt}}}),ace=w.createContext(null),vT="button",lce="Draggable";function cce(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Sf(lce),{activators:a,activatorEvent:o,active:l,activeNodeRect:c,ariaDescribedById:h,draggableNodes:d,over:f}=w.useContext(C0),{role:g=vT,roleDescription:_="draggable",tabIndex:y=0}=i??{},v=(l==null?void 0:l.id)===t,m=w.useContext(v?TO:ace),[p,x]=Rg(),[b,S]=Rg(),C=qle(a,t),E=yh(n);Xi(()=>(d.set(t,{id:t,key:s,node:p,activatorNode:b,data:E}),()=>{const T=d.get(t);T&&T.key===s&&d.delete(t)}),[d,t]);const k=w.useMemo(()=>({role:g,tabIndex:y,"aria-disabled":r,"aria-pressed":v&&g===vT?!0:void 0,"aria-roledescription":_,"aria-describedby":h.draggable}),[r,g,y,v,_,h.draggable]);return{active:l,activatorEvent:o,activeNodeRect:c,attributes:k,isDragging:v,listeners:r?void 0:C,node:p,over:f,setNodeRef:x,setActivatorNodeRef:S,transform:m}}function uce(){return w.useContext(EO)}const dce="Droppable",hce={timeout:25};function fce(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Sf(dce),{active:a,dispatch:o,over:l,measureDroppableContainers:c}=w.useContext(C0),h=w.useRef({disabled:n}),d=w.useRef(!1),f=w.useRef(null),g=w.useRef(null),{disabled:_,updateMeasurementsFor:y,timeout:v}={...hce,...i},m=yh(y??r),p=w.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(m.current)?m.current:[m.current]),g.current=null},v)},[v]),x=S0({callback:p,disabled:_||!a}),b=w.useCallback((k,T)=>{x&&(T&&(x.unobserve(T),d.current=!1),k&&x.observe(k))},[x]),[S,C]=Rg(b),E=yh(t);return w.useEffect(()=>{!x||!S.current||(x.disconnect(),d.current=!1,x.observe(S.current))},[S,x]),w.useEffect(()=>(o({type:gn.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:f,data:E}}),()=>o({type:gn.UnregisterDroppable,key:s,id:r})),[r]),w.useEffect(()=>{n!==h.current.disabled&&(o({type:gn.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,o]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:C}}function zC(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function pce(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function Cp(e){return e!==null&&e>=0}function mce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function gce(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const MO=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=zC(t,r,n),a=t[i],o=s[i];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},kp={scaleX:1,scaleY:1},vce=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:s,overIndex:a}=e;const o=(t=s[n])!=null?t:r;if(!o)return null;if(i===n){const c=s[a];return c?{x:0,y:n<a?c.top+c.height-(o.top+o.height):c.top-o.top,...kp}:null}const l=yce(s,i,n);return i>n&&i<=a?{x:0,y:-o.height-l,...kp}:i<n&&i>=a?{x:0,y:o.height+l,...kp}:{x:0,y:0,...kp}};function yce(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return r?n<t?i?r.top-(i.top+i.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const RO="Sortable",AO=lt.createContext({activeIndex:-1,containerId:RO,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:MO,disabled:{draggable:!1,droppable:!1}});function xce(e){let{children:t,id:n,items:r,strategy:i=MO,disabled:s=!1}=e;const{active:a,dragOverlay:o,droppableRects:l,over:c,measureDroppableContainers:h}=uce(),d=Sf(RO,n),f=o.rect!==null,g=w.useMemo(()=>r.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),_=a!=null,y=a?g.indexOf(a.id):-1,v=c?g.indexOf(c.id):-1,m=w.useRef(g),p=!mce(g,m.current),x=v!==-1&&y===-1||p,b=gce(s);Xi(()=>{p&&_&&h(g)},[p,g,_,h]),w.useEffect(()=>{m.current=g},[g]);const S=w.useMemo(()=>({activeIndex:y,containerId:d,disabled:b,disableTransforms:x,items:g,overIndex:v,useDragOverlay:f,sortedRects:pce(g,l),strategy:i}),[y,d,b.draggable,b.droppable,x,g,v,l,f,i]);return lt.createElement(AO.Provider,{value:S},t)}const _ce=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return zC(n,r,i).indexOf(t)},bce=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:s,newIndex:a,previousItems:o,previousContainerId:l,transition:c}=e;return!c||!r||o!==s&&i===a?!1:n?!0:a!==i&&t===l},wce={duration:200,easing:"ease"},jO="transform",Sce=_h.Transition.toString({property:jO,duration:0,easing:"linear"}),Cce={roleDescription:"sortable"};function kce(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,a]=w.useState(null),o=w.useRef(n);return Xi(()=>{if(!t&&n!==o.current&&r.current){const l=i.current;if(l){const c=su(r.current,{ignoreTransform:!0}),h={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(h.x||h.y)&&a(h)}}n!==o.current&&(o.current=n)},[t,n,r,i]),w.useEffect(()=>{s&&a(null)},[s]),s}function Ece(e){let{animateLayoutChanges:t=bce,attributes:n,disabled:r,data:i,getNewIndex:s=_ce,id:a,strategy:o,resizeObserverConfig:l,transition:c=wce}=e;const{items:h,containerId:d,activeIndex:f,disabled:g,disableTransforms:_,sortedRects:y,overIndex:v,useDragOverlay:m,strategy:p}=w.useContext(AO),x=Tce(r,g),b=h.indexOf(a),S=w.useMemo(()=>({sortable:{containerId:d,index:b,items:h},...i}),[d,i,b,h]),C=w.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:E,node:k,isOver:T,setNodeRef:R}=fce({id:a,data:S,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:M,activatorEvent:L,activeNodeRect:D,attributes:N,setNodeRef:P,listeners:I,isDragging:z,over:O,setActivatorNodeRef:j,transform:A}=cce({id:a,data:S,attributes:{...Cce,...n},disabled:x.draggable}),F=Uae(R,P),H=!!M,B=H&&!_&&Cp(f)&&Cp(v),G=!m&&z,Q=G&&B?A:null,W=B?Q??(o??p)({rects:y,activeNodeRect:D,activeIndex:f,overIndex:v,index:b}):null,$=Cp(f)&&Cp(v)?s({id:a,items:h,activeIndex:f,overIndex:v}):b,V=M==null?void 0:M.id,U=w.useRef({activeId:V,items:h,newIndex:$,containerId:d}),X=h!==U.current.items,q=t({active:M,containerId:d,isDragging:z,isSorting:H,id:a,index:b,items:h,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:c,wasDragging:U.current.activeId!=null}),re=kce({disabled:!q,index:b,node:k,rect:E});return w.useEffect(()=>{H&&U.current.newIndex!==$&&(U.current.newIndex=$),d!==U.current.containerId&&(U.current.containerId=d),h!==U.current.items&&(U.current.items=h)},[H,$,d,h]),w.useEffect(()=>{if(V===U.current.activeId)return;if(V&&!U.current.activeId){U.current.activeId=V;return}const le=setTimeout(()=>{U.current.activeId=V},50);return()=>clearTimeout(le)},[V]),{active:M,activeIndex:f,attributes:N,data:S,rect:E,index:b,newIndex:$,items:h,isOver:T,isSorting:H,isDragging:z,listeners:I,node:k,overIndex:v,over:O,setNodeRef:F,setActivatorNodeRef:j,setDroppableNodeRef:R,setDraggableNodeRef:P,transform:re??W,transition:ne()};function ne(){if(re||X&&U.current.newIndex===b)return Sce;if(!(G&&!OC(L)||!c)&&(H||q))return _h.Transition.toString({...c,property:jO})}}function Tce(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Lg(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Mce=[it.Down,it.Right,it.Up,it.Left],Rce=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:a,scrollableAncestors:o}}=t;if(Mce.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const f=i.get(d.id);if(f)switch(e.code){case it.Down:r.top<f.top&&l.push(d);break;case it.Up:r.top>f.top&&l.push(d);break;case it.Left:r.left>f.left&&l.push(d);break;case it.Right:r.left<f.left&&l.push(d);break}});const c=ale({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let h=mO(c,"id");if(h===(a==null?void 0:a.id)&&c.length>1&&(h=c[1].id),h!=null){const d=s.get(n.id),f=s.get(h),g=f?i.get(f.id):null,_=f==null?void 0:f.node.current;if(_&&g&&d&&f){const v=w0(_).some((C,E)=>o[E]!==C),m=LO(d,f),p=Ace(d,f),x=v||!m?{x:0,y:0}:{x:p?r.width-g.width:0,y:p?r.height-g.height:0},b={x:g.left,y:g.top};return x.x&&x.y?b:xh(b,x)}}}};function LO(e,t){return!Lg(e)||!Lg(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Ace(e,t){return!Lg(e)||!Lg(t)||!LO(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const DO=new Set,vr=new WeakMap,Sc=new WeakMap,Ra=new WeakMap,$b=new WeakMap,jce=new WeakMap,Cc=new WeakMap,Dg=new WeakMap,pd=new WeakSet;let Ao,HC=0,WC=0;const ys="__aa_tgt",wh="__aa_del",Ng="__aa_new",Lce=e=>{const t=$ce(e);t&&t.forEach(n=>Bce(n))},Dce=e=>{e.forEach(t=>{t.target===Ao&&Pce(),vr.has(t.target)&&Ja(t.target)})};function Nce(e){const t=$b.get(e);t==null||t.disconnect();let n=vr.get(e),r=0;const i=5;n||(n=kc(e),vr.set(e,n));const{offsetWidth:s,offsetHeight:a}=Ao,l=[n.top-i,s-(n.left+i+n.width),a-(n.top+i+n.height),n.left-i].map(h=>`${-1*Math.floor(h)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&Ja(e)},{root:Ao,threshold:1,rootMargin:l});c.observe(e),$b.set(e,c)}function Ja(e){clearTimeout(Dg.get(e));const t=k0(e),n=Sh(t)?500:t.duration;Dg.set(e,setTimeout(async()=>{const r=Ra.get(e);try{await(r==null?void 0:r.finished),vr.set(e,kc(e)),Nce(e)}catch{}},n))}function Pce(){clearTimeout(Dg.get(Ao)),Dg.set(Ao,setTimeout(()=>{DO.forEach(e=>IO(e,t=>NO(()=>Ja(t))))},100))}function Oce(e){setTimeout(()=>{jce.set(e,setInterval(()=>NO(Ja.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function NO(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Bb,Fl;const Ice=typeof window<"u"&&"ResizeObserver"in window;Ice&&(Ao=document.documentElement,Bb=new MutationObserver(Lce),Fl=new ResizeObserver(Dce),window.addEventListener("scroll",()=>{WC=window.scrollY,HC=window.scrollX}),Fl.observe(Ao));function $ce(e){return e.reduce((r,i)=>[...r,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,i)=>{if(r===!1)return!1;if(i.target instanceof Element){if(hx(i.target),!r.has(i.target)){r.add(i.target);for(let s=0;s<i.target.children.length;s++){const a=i.target.children.item(s);if(a){if(wh in a)return!1;hx(i.target,a),r.add(a)}}}if(i.removedNodes.length)for(let s=0;s<i.removedNodes.length;s++){const a=i.removedNodes[s];if(wh in a)return!1;a instanceof Element&&(r.add(a),hx(i.target,a),Sc.set(a,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function hx(e,t){!t&&!(ys in e)?Object.defineProperty(e,ys,{value:e}):t&&!(ys in t)&&Object.defineProperty(t,ys,{value:e})}function Bce(e){var t;const n=e.isConnected,r=vr.has(e);n&&Sc.has(e)&&Sc.delete(e),Ra.has(e)&&((t=Ra.get(e))===null||t===void 0||t.cancel()),Ng in e?yT(e):r&&n?zce(e):r&&!n?Hce(e):yT(e)}function Li(e){return Number(e.replace(/[^0-9.\-]/g,""))}function Fce(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function kc(e){const t=e.getBoundingClientRect(),{x:n,y:r}=Fce(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function PO(e,t,n){let r=t.width,i=t.height,s=n.width,a=n.height;const o=getComputedStyle(e);if(o.getPropertyValue("box-sizing")==="content-box"){const c=Li(o.paddingTop)+Li(o.paddingBottom)+Li(o.borderTopWidth)+Li(o.borderBottomWidth),h=Li(o.paddingLeft)+Li(o.paddingRight)+Li(o.borderRightWidth)+Li(o.borderLeftWidth);r-=h,s-=h,i-=c,a-=c}return[r,s,i,a].map(Math.round)}function k0(e){return ys in e&&Cc.has(e[ys])?Cc.get(e[ys]):{duration:250,easing:"ease-in-out"}}function OO(e){if(ys in e)return e[ys]}function UC(e){const t=OO(e);return t?pd.has(t):!1}function IO(e,...t){t.forEach(n=>n(e,Cc.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(i=>i(r,Cc.has(r)))}}function VC(e){return Array.isArray(e)?e:[e]}function Sh(e){return typeof e=="function"}function zce(e){const t=vr.get(e),n=kc(e);if(!UC(e))return vr.set(e,n);let r;if(!t)return;const i=k0(e);if(typeof i!="function"){const s=t.left-n.left,a=t.top-n.top,[o,l,c,h]=PO(e,t,n),d={transform:`translate(${s}px, ${a}px)`},f={transform:"translate(0, 0)"};o!==l&&(d.width=`${o}px`,f.width=`${l}px`),c!==h&&(d.height=`${c}px`,f.height=`${h}px`),r=e.animate([d,f],{duration:i.duration,easing:i.easing})}else{const[s]=VC(i(e,"remain",t,n));r=new Animation(s),r.play()}Ra.set(e,r),vr.set(e,n),r.addEventListener("finish",Ja.bind(null,e))}function yT(e){Ng in e&&delete e[Ng];const t=kc(e);vr.set(e,t);const n=k0(e);if(!UC(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[i]=VC(n(e,"add",t));r=new Animation(i),r.play()}Ra.set(e,r),r.addEventListener("finish",Ja.bind(null,e))}function xT(e,t){var n;e.remove(),vr.delete(e),Sc.delete(e),Ra.delete(e),(n=$b.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(wh in e&&delete e[wh],Object.defineProperty(e,Ng,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function Hce(e){var t;if(!Sc.has(e)||!vr.has(e))return;const[n,r]=Sc.get(e);Object.defineProperty(e,wh,{value:!0,configurable:!0});const i=window.scrollX,s=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=OO(e))===null||t===void 0||t.appendChild(e),!UC(e))return xT(e);const[a,o,l,c]=Uce(e),h=k0(e),d=vr.get(e);(i!==HC||s!==WC)&&Wce(e,i,s,h);let f,g={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Sh(h))Object.assign(e.style,g),f=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:h.duration,easing:"ease-out"});else{const[_,y]=VC(h(e,"remove",d));(y==null?void 0:y.styleReset)!==!1&&(g=(y==null?void 0:y.styleReset)||g,Object.assign(e.style,g)),f=new Animation(_),f.play()}Ra.set(e,f),f.addEventListener("finish",xT.bind(null,e,g))}function Wce(e,t,n,r){const i=HC-t,s=WC-n,a=document.documentElement.style.scrollBehavior;if(getComputedStyle(Ao).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+s),!e.parentElement)return;const l=e.parentElement;let c=l.clientHeight,h=l.clientWidth;const d=performance.now();function f(){requestAnimationFrame(()=>{if(!Sh(r)){const g=c-l.clientHeight,_=h-l.clientWidth;d+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-_,top:window.scrollY-g}),c=l.clientHeight,h=l.clientWidth,f()):document.documentElement.style.scrollBehavior=a}})}f()}function Uce(e){const t=vr.get(e),[n,,r]=PO(e,t,kc(e));let i=e.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const s=getComputedStyle(i),a=vr.get(i)||kc(i),o=Math.round(t.top-a.top)-Li(s.borderTopWidth),l=Math.round(t.left-a.left)-Li(s.borderLeftWidth);return[o,l,n,r]}function Vce(e,t={}){return Bb&&Fl&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Sh(t)&&!t.disrespectUserMotionPreference||(pd.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),IO(e,Ja,Oce,i=>Fl==null?void 0:Fl.observe(i)),Sh(t)?Cc.set(e,t):Cc.set(e,{duration:250,easing:"ease-in-out",...t}),Bb.observe(e,{childList:!0}),DO.add(e))),Object.freeze({parent:e,enable:()=>{pd.add(e)},disable:()=>{pd.delete(e)},isEnabled:()=>pd.has(e)})}function E0(e){const[t,n]=w.useState(),r=w.useMemo(()=>e,[]),i=w.useCallback(a=>{a instanceof HTMLElement?n(Vce(a,r)):n(void 0)},[r]),s=w.useCallback(a=>{t&&(a?t.enable():t.disable())},[t]);return[i,s]}function qce({id:e,disabled:t,className:n,children:r}){const{attributes:i,listeners:s,setNodeRef:a,transform:o,transition:l}=Ece({id:e,disabled:t});i.role="listitem";const c={transform:_h.Transform.toString(o&&{...o,scaleY:1}),transition:l};return u.jsxs("li",{ref:a,style:c,...i,className:J("bg-card rounded-lg border px-2 py-3 flex gap-3 relative aria-pressed:z-50 aria-pressed:opacity-85 aria-pressed:shadow-xl",n),children:[u.jsx("div",{...s,title:"Drag to reorder",className:J("text-muted-foreground my-auto",t?"cursor-not-allowed opacity-50":"cursor-grab hover:text-primary hover:scale-110"),children:u.jsx(QK,{className:"size-6"})}),r]})}function Gce({onDragEnd:e,className:t,children:n,ids:r}){const[i,s]=E0(),a=ile(sT(FC),sT($C,{coordinateGetter:Rce})),o=l=>{e(l),setTimeout(()=>{s(!0)},1)};return u.jsx(oce,{sensors:a,collisionDetection:ole,onDragStart:()=>s(!1),onDragCancel:()=>s(!0),onDragEnd:o,children:u.jsx(xce,{items:r,strategy:vce,children:u.jsx("ol",{ref:i,className:t,children:n})})})}var $O="abcdefghijklmnopqrstuvwxyz",BO="ABCDEFGHIJKLMNOPQRSTUVWXYZ",FO="0123456789",Kce="346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz",Yce="6789BCDFGHJKLMNPQRTWbcdfghjkmnpqrtwz";const Xce=FO,Jce=$O,Qce=BO;var Zce=Xce+Jce+Qce,eue={lowercase:$O,uppercase:BO,numbers:FO,nolookalikes:Kce,nolookalikesSafe:Yce,alphanumeric:Zce};let tue=e=>crypto.getRandomValues(new Uint8Array(e)),nue=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,i=-~(1.6*r*t/e.length);return(s=t)=>{let a="";for(;;){let o=n(i),l=i|0;for(;l--;)if(a+=e[o[l]&r]||"",a.length>=s)return a}}},rue=(e,t=21)=>nue(e,t|0,tue);function iue({changelogData:e}){const[t,n]=w.useState(!1),r=w.useMemo(()=>{if(!(e!=null&&e.length))return null;const o=e[e.length-1],l=new Date(o.ts),c=bc(l,"2-digit","2-digit"),h=wc(l,"long"),d=vh(l)?c:h;return{author:o.author,dateTime:d}},[e]),i=w.useMemo(()=>e?[...e].reverse():null,[e]),s=()=>{n(!0)},a=Array.isArray(e)?"No changes yet":"loading...";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex xs:flex-col max-xs:items-center max-xs:gap-2 max-xs:w-full px-2 py-1 rounded-lg text-muted-foreground group relative",children:[i!=null&&i.length?u.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-[inherit] bg-card opacity-0 border group-hover:opacity-100 transition-opacity text-primary group-active:bg-primary group-active:text-primary-foreground group-active:border-none select-none cursor-pointer",onClick:s,children:"View Changelog"}):null,u.jsxs("div",{className:"tracking-wider leading-3 font-semibold",children:[u.jsx(gY,{className:"max-xs:hidden size-4 inline-block align-text-bottom"})," Last Updated",u.jsx("span",{className:"xs:hidden",children:":"})]}),u.jsxs("div",{className:"text-xs",children:[u.jsx(AK,{className:"size-4 inline-block align-text-bottom"})," ",(r==null?void 0:r.dateTime)??a]})]}),u.jsx(Xa,{open:t,onOpenChange:n,children:u.jsxs(Wo,{className:"max-sm:p-4 max-w-xl",children:[u.jsx(Uo,{children:u.jsx(Vo,{children:"Recent Changes"})}),u.jsx("div",{className:"pr-3 max-h-[80vh] overflow-auto space-y-3",style:{scrollbarWidth:"thin"},children:i==null?void 0:i.map((o,l)=>u.jsx(sue,{entry:o},l))})]})})]})}function sue({entry:e}){return u.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-md border odd:bg-card/75",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsxs("div",{className:"font-semibold text-accent",children:[u.jsx(RY,{className:"size-5 mr-2 inline-block align-text-bottom opacity-65"}),e.author]}),u.jsx("div",{className:"text-sm text-muted-foreground",children:vs(e.ts,"short","short")})]}),u.jsx("div",{className:"flex gap-1 flex-wrap text-sm",children:e.keys.length?e.keys.map((t,n)=>u.jsxs("span",{children:[u.jsx("div",{className:"inline px-1 py-0.5 font-mono tracking-wide rounded bg-secondary/50",children:t},t),n<e.keys.length-1&&","]})):u.jsx("div",{className:"italic",children:"No changes"})})]})}function zO(e){const t=w.useMemo(()=>e.parentName&&e.parentLink?u.jsxs(u.Fragment,{children:[u.jsx(xi,{href:e.parentLink,className:"hover:text-secondary-foreground hover:underline",children:e.parentName}),u.jsx(cS,{className:"opacity-75"}),u.jsx("li",{className:"text-secondary-foreground",children:e.title})]}):u.jsx("li",{className:"text-secondary-foreground",children:e.title}),[e]);return u.jsx("header",{className:"border-b mb-4",children:u.jsxs("div",{className:"xbg-blue-700 max-xs:pb-2 xs:min-h-16 flex max-xs:flex-col gap-2 xs:gap-4 max-xs:items-start justify-between items-center px-4 py-2",children:[u.jsxs("ol",{className:"xbg-green-500 flex flex-wrap items-center gap-1 sm:gap-2.5 text-2xl text-muted-foreground leading-none",children:[u.jsx("span",{className:"opacity-75",children:e.icon}),t]}),e.children]})})}const oue=rue(eue.alphanumeric,21);function aue(){var E,k;const[e,t]=w.useState(!1),[n,r]=w.useState(),i=ef(),{hasPerm:s}=rr(),[a,o]=w.useState(!1),[l,c]=w.useState(null),[h,d]=w.useState(!1),f=wt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),g=wt({method:"POST",path:"/settings/banTemplates",throwGenericErrors:!0}),_=Kc("/settings/banTemplates",async()=>{const T=await f({});if(!T)throw new Error("No data returned");return T},{isPaused:()=>a||!!l||e}),y=async T=>{o(!0),c(null),d(!1);try{const R=await _.mutate(T,!1);if(!await g({data:R}))throw new Error("No data returned");d(!0)}catch(R){R instanceof gb||R instanceof Error?c(R.message):c(JSON.stringify(R))}finally{o(!1)}};w.useEffect(()=>{if(!h)return;const T=setTimeout(()=>{d(!1)},5e3);return()=>clearTimeout(T)},[h]);const v=T=>{const{active:R,over:M}=T;M&&R.id!==M.id&&y(L=>{const D=L.findIndex(P=>P.id===R.id),N=L.findIndex(P=>P.id===M.id);return zC(L,D,N)})},m=({id:T,reason:R,duration:M})=>{y(T?L=>L.map(D=>D.id===T?{id:T,reason:R,duration:M}:D):L=>[...L,{id:oue(21),reason:R,duration:M}]),t(!1),r(void 0)},p=T=>{if(!T||!_.data)return;const R=_.data.find(M=>M.id===T);R&&i({title:"Remove Template",actionLabel:"Remove",confirmBtnVariant:"destructive",message:u.jsxs(u.Fragment,{children:["Are you sure you want to remove this ban template? ",u.jsx("br",{}),u.jsx("blockquote",{className:"opacity-70 italic border-l-4 pl-2",children:R.reason})]}),onConfirm:()=>{console.log("Remove confirmed",T),y(M=>M.filter(L=>L.id!==T))}})},x=T=>{!T||!_.data||(console.log("Edit item",T),r(_.data.find(R=>R.id===T)),t(!0))},b=()=>{r(void 0),t(!0)};let S;if(_.error){const T=()=>_.mutate(),R=((E=_==null?void 0:_.error)==null?void 0:E.message)??"unknown error";S=u.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error loading: ",R]}),u.jsx("br",{}),u.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else if(a)S=u.jsx("span",{className:"text-success-inlinex animate-pulse",children:"Saving..."});else if(l){const T=()=>{_.data&&y(()=>_.data)},R=l??"unknown error";S=u.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error saving: ",R]}),u.jsx("br",{}),u.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else h?S=u.jsx("span",{className:"text-success-inline",children:"Saved."}):(_.isLoading||_.isValidating)&&(S=u.jsx("span",{className:"text-muted-foreground",children:"Loading..."}));const C=s("settings.write");return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto",children:[u.jsxs("p",{className:"px-2 md:px-0",children:["Here you can configure ban reasons and durations that will appear as dropdown options when banning a player. ",u.jsx("br",{}),"This is useful for common reasons that happen frequently, like violation of your server rules. ",u.jsx("br",{}),C?u.jsxs("span",{className:"text-muted-foreground italic",children:["TIP: You can also drag and drop to reorder the list. ",u.jsx("br",{})]}):u.jsxs("span",{className:"text-warning-inline",children:["You need the ",u.jsx(Ue,{className:"text-warning-inline",children:"Settings: Change"})," permission to edit these reasons."]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap justify-between text-muted-foreground px-2 md:px-0",children:[u.jsxs("span",{className:"shrink-0",children:["Configured reasons: ",((k=_.data)==null?void 0:k.length)??0]}),S]}),!_.data&&!l&&u.jsxs("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:[u.jsx(Zt,{className:"inline animate-spin h-8"}),"Loading..."]}),_.data&&u.jsxs(Gce,{className:"space-y-2 border p-2 xs:rounded-lg",ids:_.data.map(T=>T.id),onDragEnd:v,children:[_.data.length?_.data.map(T=>u.jsx(qce,{id:T.id,disabled:!C,children:u.jsx(Hae,{onEdit:x,onRemove:p,disabled:!C,...T})},T.id)):u.jsx("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:"No reasons configured yet."}),u.jsx(Wae,{onClick:b,disabled:!C})]})]})]}),u.jsx(zae,{reasonData:n,onSave:m,isDialogOpen:e,setIsDialogOpen:t},n==null?void 0:n.id)]})}function lue(){return u.jsxs("div",{className:"w-full mb-10",children:[u.jsx(zO,{icon:u.jsx(fS,{}),title:"Ban Templates",parentName:"Settings",parentLink:"/settings"}),u.jsx("div",{className:"px-0 xs:px-3 md:px-0 flex flex-row gap-2 w-full",children:u.jsx(aue,{})})]})}const Bu=150;function _T({pageName:e}){const[t,n]=w.useState(!0),[r,i]=w.useState(""),[s,a]=w.useState(!1),o=Bv(),l=wt({method:"GET",path:`/systemLog/${e}`,throwGenericErrors:!0}),c=w.useRef(null),h=w.useRef(null),d=w.useMemo(()=>new ED.Terminal(bN),[]),f=w.useMemo(()=>new jD.FitAddon,[]),g=w.useMemo(()=>new DD.SearchAddon,[]),_=(S,C)=>{Xc(C)},y=w.useMemo(()=>new PD.WebLinksAddon(_),[]),v=Un(Bu,S=>{window.postMessage({type:"liveConsoleSearchHotkey",action:S})},{noTrailing:!0}),m=()=>{if(!h.current||!d.element||!f){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const S=f.proposeDimensions();S?d.resize(S.cols,S.rows):console.log("refitTerminal: no proposed dimensions")};yi("resize",nS(100,m)),w.useEffect(()=>{if(h.current&&c.current&&!d.element){console.log("xterm init"),h.current.innerHTML="",d.loadAddon(f),d.loadAddon(g),d.loadAddon(y),d.loadAddon(new RD.CanvasAddon),d.loadAddon(new _N(c.current,h.current)),d.open(h.current),d.write("\x1B[?25l"),m();const S=Un(Bu,()=>{d.scrollLines(Math.min(1,2-d.rows))},{noTrailing:!0}),C=Un(Bu,()=>{d.scrollLines(Math.max(1,d.rows-2))},{noTrailing:!0}),E=Un(Bu,()=>{d.scrollToTop()},{noTrailing:!0}),k=Un(Bu,()=>{d.scrollToBottom()},{noTrailing:!0});d.attachCustomKeyEventHandler(T=>T.code==="F5"||T.code==="Escape"||T.code==="KeyF"&&(T.ctrlKey||T.metaKey)||T.code==="F3"?!1:T.code==="KeyC"&&(T.ctrlKey||T.metaKey)?(document.execCommand("copy"),d.clearSelection(),!1):T.code==="PageUp"?(S(),!1):T.code==="PageDown"?(C(),!1):T.code==="Home"?(E(),!1):T.code==="End"?(k(),!1):!aS(T)),l({success:(T,R)=>{n(!1),p(T.data),d.writeln(""),d.writeln("\x1B[33m[END OF LOG - REFRESH THE PAGE TO LOAD MORE]\x1B")},error:(T,R)=>{n(!1),i(T)}})}},[d]),yi("keydown",S=>{S.code==="F5"?t&&(o(),S.preventDefault()):S.code==="Escape"?(g.clearDecorations(),a(!1)):S.code==="KeyF"&&(S.ctrlKey||S.metaKey)?(s?v("focus"):a(!0),S.preventDefault()):S.code==="F3"&&(v(S.shiftKey?"previous":"next"),S.preventDefault())});const p=S=>{const C=S.split(/\r?\n/);C.length&&!C[C.length-1]&&C.pop();for(const E of C)d.writeln(E)};let x="Console Log",b="Output of txAdmin to it's parent terminal, including usually hidden debug messages.";return e==="action"&&(x="Action Log",b="Log of all actions taken by txAdmin or any admin."),u.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.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:[u.jsx("polyline",{points:"4 17 10 11 4 5"}),u.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),u.jsxs("p",{className:"font-mono text-sm",children:[x," - ",u.jsx("span",{className:"text-muted-foreground",children:b})]})]})}),u.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[t&&!r?u.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:u.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[u.jsx(Zt,{className:"w-16 h-16 animate-spin"}),u.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Loading..."})]})}):null,r&&u.jsxs("div",{className:"absolute inset-0 z-20 bg-black/60 flex flex-col gap-4 items-center justify-center",children:[u.jsxs("h2",{className:"text-2xl tracking-wider font-light text-muted-foreground select-none",children:["Error fetching ",x,":"]}),u.jsx("p",{className:"mx-8 max-w-screen-md text-destructive-inline font-mono",children:r})]}),u.jsx("div",{ref:h,className:"absolute top-1 left-2 right-0 bottom-0"}),u.jsx(xN,{show:s,setShow:a,searchAddon:g}),u.jsx("button",{ref:c,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{d.scrollToBottom()},children:u.jsx($D,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]})]})}const Ec=w.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:J("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 placeholder:opacity-50",e),ref:n,...t}));Ec.displayName="Textarea";const cue=IP,HO=w.forwardRef(({children:e},t)=>u.jsx(m0,{ref:t,asChild:!0,children:e}));HO.displayName=m0.displayName;const WO=w.forwardRef(({className:e,...t},n)=>u.jsx(y0,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(uS,{className:"h-4 w-4"})}));WO.displayName=y0.displayName;const UO=w.forwardRef(({className:e,...t},n)=>u.jsx(x0,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Ua,{className:"h-4 w-4"})}));UO.displayName=x0.displayName;const VO=w.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>u.jsx($P,{children:u.jsxs(g0,{ref:i,className:J("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:[u.jsx(WO,{}),u.jsx(BP,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(UO,{})]})}));VO.displayName=g0.displayName;const Fb=w.forwardRef(({className:e,children:t,...n},r)=>u.jsx(v0,{ref:r,className:J("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:u.jsx(zP,{children:t})}));Fb.displayName=v0.displayName;const bT=150,wT="!add-new",uue=["permanent","2 hours","8 hours","1 day","2 days","1 week","2 weeks"],qO=w.forwardRef(function({banTemplates:t,disabled:n,onNavigateAway:r},i){const s=w.useRef(null),a=w.useRef(null),o=$o()[1],[l,c]=w.useState("2 days"),[h,d]=w.useState("days"),f=_S();w.useImperativeHandle(i,()=>({getData:()=>{var v,m;return{reason:(v=s.current)==null?void 0:v.value.trim(),duration:l==="custom"?`${(m=a.current)==null?void 0:m.value} ${h}`:l}},clearData:()=>{!s.current||!a.current||(s.current.value="",a.current.value="",c("2 days"),d("days"))},focusReason:()=>{var v;(v=s.current)==null||v.focus()}}),[s,a,l,h]);const g=v=>{if(v===wT)o("/settings/ban-templates"),r==null||r();else{if(!t)return;const m=t.find(x=>x.id===v);if(!m)return;const p=Xm(m.duration);uue.includes(p)?c(p):typeof m.duration=="object"&&(c("custom"),a.current.value=m.duration.value.toString(),d(m.duration.unit)),s.current.value=m.reason,setTimeout(()=>{s.current.focus()},50)}},_=w.useMemo(()=>{if(t)return t.map((v,m)=>{const p=gG(v.duration),x=v.reason.length>bT?v.reason.slice(0,bT-3)+"...":v.reason;return u.jsxs(Fb,{value:v.id,className:"focus:bg-secondary focus:text-secondary-foreground",children:[u.jsx("span",{className:"inline-block pr-1 font-mono opacity-75 min-w-[4ch]",children:p})," ",x]},m)})},[t]);let y;return Array.isArray(t)?t.length?y=u.jsxs(u.Fragment,{children:[_,u.jsxs(Fb,{value:wT,className:"font-bold text-warning-inline",children:["Add Ban Template",u.jsx(ka,{className:"inline mr-1 h-4"})]})]}):y=u.jsxs("div",{className:"text-warning-inline text-center p-4",children:["You do not have any template configured. ",u.jsx("br",{}),u.jsxs(xi,{href:"/settings/ban-templates",className:"cursor-pointer underline hover:text-accent",onClick:()=>{f()},children:["Add Ban Template",u.jsx(ka,{className:"inline mr-1 h-4"})]})]}):y=u.jsx("div",{className:"text-secondary-foreground text-center p-4",children:u.jsx(Zt,{className:"inline animate-spin size-6"})}),u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(_n,{htmlFor:"banReason",children:"Reason"}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(yt,{id:"banReason",ref:s,placeholder:"The reason for the ban, rule violated, etc.",className:"w-full",disabled:n,autoFocus:!0}),u.jsxs(cue,{onValueChange:g,disabled:n,children:[u.jsx(HO,{className:"tracking-wide",children:u.jsx("button",{className:J("size-10 inline-flex justify-center items-center rounded-md shrink-0","ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","border bg-black/20 shadow-sm","hover:bg-primary hover:text-primary-foreground hover:border-primary","disabled:opacity-50 disabled:cursor-not-allowed"),children:u.jsx(HK,{className:"size-5"})})}),u.jsx(VO,{className:"tracking-wide w-[calc(100vw-1rem)] sm:max-w-screen-sm",align:"end",children:y})]})]})]}),u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(_n,{htmlFor:"durationSelect",children:"Duration"}),u.jsxs("div",{className:"space-y-1",children:[u.jsxs(Pn,{onValueChange:c,value:l,disabled:n,children:[u.jsx(kn,{id:"durationSelect",className:"tracking-wide",children:u.jsx(On,{placeholder:"Select Duration"})}),u.jsxs(En,{className:"tracking-wide",children:[u.jsx(be,{value:"custom",className:"font-bold",children:"Custom (set below)"}),u.jsx(be,{value:"2 hours",children:"2 HOURS"}),u.jsx(be,{value:"8 hours",children:"8 HOURS"}),u.jsx(be,{value:"1 day",children:"1 DAY"}),u.jsx(be,{value:"2 days",children:"2 DAYS"}),u.jsx(be,{value:"1 week",children:"1 WEEK"}),u.jsx(be,{value:"2 weeks",children:"2 WEEKS"}),u.jsx(be,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),u.jsxs("div",{className:"flex flex-row gap-2",children:[u.jsx(yt,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:l!=="custom"||n,ref:a}),u.jsxs(Pn,{onValueChange:d,value:h,children:[u.jsx(kn,{className:"tracking-wide",id:"durationUnits",disabled:l!=="custom"||n,children:u.jsx(On,{})}),u.jsxs(En,{className:"tracking-wide",children:[u.jsx(be,{value:"hours",children:"HOURS"}),u.jsx(be,{value:"days",children:"DAYS"}),u.jsx(be,{value:"weeks",children:"WEEKS"}),u.jsx(be,{value:"months",children:"MONTHS"})]})]})]})]})]})]})});function due(){const e=w.useRef(null),t=w.useRef(null),[n,r]=w.useState(!1),{hasPerm:i}=rr(),s=wt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),a=wt({method:"POST",path:"/history/addLegacyBan",throwGenericErrors:!0}),o=()=>{if(!e.current||!t.current)return;const{reason:h,duration:d}=t.current.getData();if(!h||h.length<3){We.warning("The reason must be at least 3 characters long."),t.current.focusReason();return}const f=e.current.value;if(!f){We.warning("You must enter at least one identifier."),e.current.focus();return}const g=f.toLowerCase().split(/[,;\s\n]+/g).map(_=>_.trim()).filter(Boolean);if(!g.length){We.warning("You must enter at least one valid identifier."),e.current.focus();return}r(!0),a({data:{identifiers:g,reason:h,duration:d},toastLoadingMessage:"Banning identifiers...",genericHandler:{successMsg:"Identifiers banned."},success:_=>{r(!1),e.current.value="",e.current.focus()},error:_=>{r(!1),e.current.focus()}})},l=Kc("/settings/banTemplates",async()=>{const h=await s({});if(!h)throw new Error("No data returned");return h}),c=i("players.ban");return u.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto px-2 md:px-0",children:[u.jsxs("div",{className:"px-2 md:px-0",children:[u.jsx("h1",{className:"text-3xl mb-2",children:"Ban Identifiers"}),u.jsxs("p",{children:["Here you can ban specific player identifiers (like ",u.jsx(Ue,{children:"license"})," and ",u.jsx(Ue,{children:"discord"}),") without having to search for a registered player.",u.jsx("br",{}),"Bans without a single ",u.jsx(Ue,{children:"license"})," identifier are considered ",u.jsx("em",{children:"Legacy Bans"})," and should be avoided if possible. ",u.jsx("br",{}),c?null:u.jsxs("span",{className:"text-warning-inline",children:["You need the ",u.jsx(Ue,{className:"text-warning-inline",children:"Player: Ban"})," permission to use this feature."]})]})]}),u.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 border bg-card p-4 rounded-lg",children:[u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(_n,{htmlFor:"banIdentifiers",children:"Identifiers"}),u.jsx(Ec,{ref:e,className:"h-full",disabled:n||!c,placeholder:"discord:xxxx, fivem:xxxx, license:xxxx, steam:xxxx, etc..."})]}),u.jsx(qO,{ref:t,banTemplates:l.data,disabled:n||!c})]}),u.jsxs("div",{className:"flex place-content-center gap-4",children:[u.jsx(Ae,{size:"sm",variant:"outline",disabled:n||!c,onClick:()=>{var h;(h=t.current)==null||h.clearData()},children:"Clear"}),u.jsx(Ae,{size:"sm",variant:"destructive",disabled:n||!c,onClick:o,children:n?u.jsxs("span",{className:"flex items-center leading-relaxed",children:[u.jsx(Zt,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})]})]})}var GO={exports:{}},hue="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",fue=hue,pue=fue;function KO(){}function YO(){}YO.resetWarningCache=KO;var mue=function(){function e(r,i,s,a,o,l){if(l!==pue){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:YO,resetWarningCache:KO};return n.PropTypes=n,n};GO.exports=mue();var gue=GO.exports;const Z=Tn(gue);var qC=kf(),Ve=e=>Cf(e,qC),GC=kf();Ve.write=e=>Cf(e,GC);var T0=kf();Ve.onStart=e=>Cf(e,T0);var KC=kf();Ve.onFrame=e=>Cf(e,KC);var YC=kf();Ve.onFinish=e=>Cf(e,YC);var rc=[];Ve.setTimeout=(e,t)=>{const n=Ve.now()+t,r=()=>{const s=rc.findIndex(a=>a.cancel==r);~s&&rc.splice(s,1),ao-=~s?1:0},i={time:n,handler:e,cancel:r};return rc.splice(XO(n),0,i),ao+=1,JO(),i};var XO=e=>~(~rc.findIndex(t=>t.time>e)||~rc.length);Ve.cancel=e=>{T0.delete(e),KC.delete(e),YC.delete(e),qC.delete(e),GC.delete(e)};Ve.sync=e=>{zb=!0,Ve.batchedUpdates(e),zb=!1};Ve.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,Ve.onStart(n)}return r.handler=e,r.cancel=()=>{T0.delete(n),t=null},r};var XC=typeof window<"u"?window.requestAnimationFrame:()=>{};Ve.use=e=>XC=e;Ve.now=typeof performance<"u"?()=>performance.now():Date.now;Ve.batchedUpdates=e=>e();Ve.catch=console.error;Ve.frameLoop="always";Ve.advance=()=>{Ve.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ZO()};var oo=-1,ao=0,zb=!1;function Cf(e,t){zb?(t.delete(e),e(0)):(t.add(e),JO())}function JO(){oo<0&&(oo=0,Ve.frameLoop!=="demand"&&XC(QO))}function vue(){oo=-1}function QO(){~oo&&(XC(QO),Ve.batchedUpdates(ZO))}function ZO(){const e=oo;oo=Ve.now();const t=XO(oo);if(t&&(eI(rc.splice(0,t),n=>n.handler()),ao-=t),!ao){vue();return}T0.flush(),qC.flush(e?Math.min(64,oo-e):16.667),KC.flush(),GC.flush(),YC.flush()}function kf(){let e=new Set,t=e;return{add(n){ao+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return ao-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,ao-=t.size,eI(t,r=>r(n)&&e.add(r)),ao+=e.size,t=e)}}}function eI(e,t){e.forEach(n=>{try{t(n)}catch(r){Ve.catch(r)}})}var yue=Object.defineProperty,xue=(e,t)=>{for(var n in t)yue(e,n,{get:t[n],enumerable:!0})},Si={};xue(Si,{assign:()=>bue,colors:()=>_o,createStringInterpolator:()=>QC,skipAnimation:()=>nI,to:()=>tI,willAdvance:()=>ZC});function Hb(){}var _ue=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),de={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function ds(e,t){if(de.arr(e)){if(!de.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var Be=(e,t)=>e.forEach(t);function Ji(e,t,n){if(de.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var Zn=e=>de.und(e)?[]:de.arr(e)?e:[e];function Bd(e,t){if(e.size){const n=Array.from(e);e.clear(),Be(n,t)}}var md=(e,...t)=>Bd(e,n=>n(...t)),JC=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),QC,tI,_o=null,nI=!1,ZC=Hb,bue=e=>{e.to&&(tI=e.to),e.now&&(Ve.now=e.now),e.colors!==void 0&&(_o=e.colors),e.skipAnimation!=null&&(nI=e.skipAnimation),e.createStringInterpolator&&(QC=e.createStringInterpolator),e.requestAnimationFrame&&Ve.use(e.requestAnimationFrame),e.batchedUpdates&&(Ve.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ZC=e.willAdvance),e.frameLoop&&(Ve.frameLoop=e.frameLoop)},Fd=new Set,Wr=[],fx=[],Pg=0,M0={get idle(){return!Fd.size&&!Wr.length},start(e){Pg>e.priority?(Fd.add(e),Ve.onStart(wue)):(rI(e),Ve(Wb))},advance:Wb,sort(e){if(Pg)Ve.onFrame(()=>M0.sort(e));else{const t=Wr.indexOf(e);~t&&(Wr.splice(t,1),iI(e))}},clear(){Wr=[],Fd.clear()}};function wue(){Fd.forEach(rI),Fd.clear(),Ve(Wb)}function rI(e){Wr.includes(e)||iI(e)}function iI(e){Wr.splice(Sue(Wr,t=>t.priority>e.priority),0,e)}function Wb(e){const t=fx;for(let n=0;n<Wr.length;n++){const r=Wr[n];Pg=r.priority,r.idle||(ZC(r),r.advance(e),r.idle||t.push(r))}return Pg=0,fx=Wr,fx.length=0,Wr=t,Wr.length>0}function Sue(e,t){const n=e.findIndex(t);return n<0?e.length:n}var Cue=(e,t,n)=>Math.min(Math.max(n,e),t),kue={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},fi="[-+]?\\d*\\.?\\d+",Og=fi+"%";function R0(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Eue=new RegExp("rgb"+R0(fi,fi,fi)),Tue=new RegExp("rgba"+R0(fi,fi,fi,fi)),Mue=new RegExp("hsl"+R0(fi,Og,Og)),Rue=new RegExp("hsla"+R0(fi,Og,Og,fi)),Aue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,jue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Lue=/^#([0-9a-fA-F]{6})$/,Due=/^#([0-9a-fA-F]{8})$/;function Nue(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Lue.exec(e))?parseInt(t[1]+"ff",16)>>>0:_o&&_o[e]!==void 0?_o[e]:(t=Eue.exec(e))?(wl(t[1])<<24|wl(t[2])<<16|wl(t[3])<<8|255)>>>0:(t=Tue.exec(e))?(wl(t[1])<<24|wl(t[2])<<16|wl(t[3])<<8|kT(t[4]))>>>0:(t=Aue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Due.exec(e))?parseInt(t[1],16)>>>0:(t=jue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Mue.exec(e))?(ST(CT(t[1]),Ep(t[2]),Ep(t[3]))|255)>>>0:(t=Rue.exec(e))?(ST(CT(t[1]),Ep(t[2]),Ep(t[3]))|kT(t[4]))>>>0:null}function px(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ST(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=px(i,r,e+1/3),a=px(i,r,e),o=px(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function wl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function CT(e){return(parseFloat(e)%360+360)%360/360}function kT(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ep(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function ET(e){let t=Nue(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,i=(t&65280)>>>8,s=(t&255)/255;return`rgba(${n}, ${r}, ${i}, ${s})`}var Ch=(e,t,n)=>{if(de.fun(e))return e;if(de.arr(e))return Ch({range:e,output:t,extrapolate:n});if(de.str(e.output[0]))return QC(e);const r=e,i=r.output,s=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",o=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(c=>c);return c=>{const h=Oue(c,s);return Pue(c,s[h],s[h+1],i[h],i[h+1],l,a,o,r.map)}};function Pue(e,t,n,r,i,s,a,o,l){let c=l?l(e):e;if(c<t){if(a==="identity")return c;a==="clamp"&&(c=t)}if(c>n){if(o==="identity")return c;o==="clamp"&&(c=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?c=-c:n===1/0?c=c-t:c=(c-t)/(n-t),c=s(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function Oue(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Iue=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,i=t==="end"?Math.floor(r):Math.ceil(r);return Cue(0,1,i/e)},Ig=1.70158,Tp=Ig*1.525,TT=Ig+1,MT=2*Math.PI/3,RT=2*Math.PI/4.5,Mp=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,$ue={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>TT*e*e*e-Ig*e*e,easeOutBack:e=>1+TT*Math.pow(e-1,3)+Ig*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((Tp+1)*2*e-Tp)/2:(Math.pow(2*e-2,2)*((Tp+1)*(e*2-2)+Tp)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*MT),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*MT)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*RT))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*RT)/2+1,easeInBounce:e=>1-Mp(1-e),easeOutBounce:Mp,easeInOutBounce:e=>e<.5?(1-Mp(1-2*e))/2:(1+Mp(2*e-1))/2,steps:Iue},kh=Symbol.for("FluidValue.get"),Tc=Symbol.for("FluidValue.observers"),zr=e=>!!(e&&e[kh]),or=e=>e&&e[kh]?e[kh]():e,AT=e=>e[Tc]||null;function Bue(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Eh(e,t){const n=e[Tc];n&&n.forEach(r=>{Bue(r,t)})}var sI=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Fue(this,e)}},Fue=(e,t)=>oI(e,kh,t);function ou(e,t){if(e[kh]){let n=e[Tc];n||oI(e,Tc,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Th(e,t){const n=e[Tc];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Tc]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var oI=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),pm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,zue=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,jT=new RegExp(`(${pm.source})(%|[a-z]+)`,"i"),Hue=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,A0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,aI=e=>{const[t,n]=Wue(e);if(!t||JC())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(n);return i||e}else{if(n&&A0.test(n))return aI(n);if(n)return n}return e},Wue=e=>{const t=A0.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},mx,Uue=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,lI=e=>{mx||(mx=_o?new RegExp(`(${Object.keys(_o).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>or(s).replace(A0,aI).replace(zue,ET).replace(mx,ET)),n=t.map(s=>s.match(pm).map(Number)),i=n[0].map((s,a)=>n.map(o=>{if(!(a in o))throw Error('The arity of each "output" value must be equal');return o[a]})).map(s=>Ch({...e,output:s}));return s=>{var l;const a=!jT.test(t[0])&&((l=t.find(c=>jT.test(c)))==null?void 0:l.replace(pm,""));let o=0;return t[0].replace(pm,()=>`${i[o++](s)}${a||""}`).replace(Hue,Uue)}},ek="react-spring: ",cI=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${ek}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},Vue=cI(console.warn);function que(){Vue(`${ek}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Gue=cI(console.warn);function Kue(){Gue(`${ek}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function j0(e){return de.str(e)&&(e[0]=="#"||/\d/.test(e)||!JC()&&A0.test(e)||e in(_o||{}))}var la=JC()?w.useEffect:w.useLayoutEffect,Yue=()=>{const e=w.useRef(!1);return la(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function tk(){const e=w.useState()[1],t=Yue();return()=>{t.current&&e(Math.random())}}function Xue(e,t){const[n]=w.useState(()=>({inputs:t,result:e()})),r=w.useRef(),i=r.current;let s=i;return s?s.inputs&&Jue(t,s.inputs)||(s={inputs:t,result:e()}):s=n,w.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function Jue(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var nk=e=>w.useEffect(e,Que),Que=[];function Ub(e){const t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Mh=Symbol.for("Animated:node"),Zue=e=>!!e&&e[Mh]===e,Di=e=>e&&e[Mh],rk=(e,t)=>_ue(e,Mh,t),L0=e=>e&&e[Mh]&&e[Mh].getPayload(),uI=class{constructor(){rk(this,this)}getPayload(){return this.payload||[]}},Ef=class extends uI{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,de.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Ef(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return de.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,de.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Rh=class extends Ef{constructor(e){super(0),this._string=null,this._toString=Ch({output:[e,e]})}static create(e){return new Rh(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(de.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Ch({output:[this.getValue(),e]})),this._value=0,super.reset()}},$g={dependencies:null},D0=class extends uI{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ji(this.source,(n,r)=>{Zue(n)?t[r]=n.getValue(e):zr(n)?t[r]=or(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Be(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Ji(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){$g.dependencies&&zr(e)&&$g.dependencies.add(e);const t=L0(e);t&&Be(t,n=>this.add(n))}},dI=class extends D0{constructor(e){super(e)}static create(e){return new dI(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(ede)),!0)}};function ede(e){return(j0(e)?Rh:Ef).create(e)}function Vb(e){const t=Di(e);return t?t.constructor:de.arr(e)?dI:j0(e)?Rh:Ef}var LT=(e,t)=>{const n=!de.fun(e)||e.prototype&&e.prototype.isReactComponent;return w.forwardRef((r,i)=>{const s=w.useRef(null),a=n&&w.useCallback(_=>{s.current=rde(i,_)},[i]),[o,l]=nde(r,t),c=tk(),h=()=>{const _=s.current;if(n&&!_)return;(_?t.applyAnimatedValues(_,o.getValue(!0)):!1)===!1&&c()},d=new tde(h,l),f=w.useRef();la(()=>(f.current=d,Be(l,_=>ou(_,d)),()=>{f.current&&(Be(f.current.deps,_=>Th(_,f.current)),Ve.cancel(f.current.update))})),w.useEffect(h,[]),nk(()=>()=>{const _=f.current;Be(_.deps,y=>Th(y,_))});const g=t.getComponentProps(o.getValue());return w.createElement(e,{...g,ref:a})})},tde=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&Ve.write(this.update)}};function nde(e,t){const n=new Set;return $g.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new D0(e),$g.dependencies=null,[e,n]}function rde(e,t){return e&&(de.fun(e)?e(t):e.current=t),t}var DT=Symbol.for("AnimatedComponent"),ide=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new D0(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=a=>{const o=NT(a)||"Anonymous";return de.str(a)?a=s[a]||(s[a]=LT(a,i)):a=a[DT]||(a[DT]=LT(a,i)),a.displayName=`Animated(${o})`,a};return Ji(e,(a,o)=>{de.arr(e)&&(o=NT(a)),s[o]=s(a)}),{animated:s}},NT=e=>de.str(e)?e:e&&de.str(e.displayName)?e.displayName:de.fun(e)&&e.name||null;function ar(e,...t){return de.fun(e)?e(...t):e}var zd=(e,t)=>e===!0||!!(t&&e&&(de.fun(e)?e(t):Zn(e).includes(t))),hI=(e,t)=>de.obj(e)?t&&e[t]:e,fI=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,sde=e=>e,N0=(e,t=sde)=>{let n=ode;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const i of n){const s=t(e[i],i);de.und(s)||(r[i]=s)}return r},ode=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ade={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function lde(e){const t={};let n=0;if(Ji(e,(r,i)=>{ade[i]||(t[i]=r,n++)}),n)return t}function ik(e){const t=lde(e);if(t){const n={to:t};return Ji(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function Ah(e){return e=or(e),de.arr(e)?e.map(Ah):j0(e)?Si.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function pI(e){for(const t in e)return!0;return!1}function qb(e){return de.fun(e)||de.arr(e)&&de.obj(e[0])}function Gb(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function mI(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var sk={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},Kb={...sk.default,mass:1,damping:1,easing:$ue.linear,clamp:!1},cde=class{constructor(){this.velocity=0,Object.assign(this,Kb)}};function ude(e,t,n){n&&(n={...n},PT(n,t),t={...n,...t}),PT(e,t),Object.assign(e,t);for(const a in Kb)e[a]==null&&(e[a]=Kb[a]);let{frequency:r,damping:i}=e;const{mass:s}=e;return de.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*s,e.friction=4*Math.PI*i*s/r),e}function PT(e,t){if(!de.und(t.decay))e.duration=void 0;else{const n=!de.und(t.tension)||!de.und(t.friction);(n||!de.und(t.frequency)||!de.und(t.damping)||!de.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var OT=[],dde=class{constructor(){this.changed=!1,this.values=OT,this.toValues=null,this.fromValues=OT,this.config=new cde,this.immediate=!1}};function gI(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((a,o)=>{let l,c,h=zd(n.cancel??(r==null?void 0:r.cancel),t);if(h)g();else{de.und(n.pause)||(i.paused=zd(n.pause,t));let _=r==null?void 0:r.pause;_!==!0&&(_=i.paused||zd(_,t)),l=ar(n.delay||0,t),_?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(c),c.cancel(),l=c.time-Ve.now()}function f(){l>0&&!Si.skipAnimation?(i.delayed=!0,c=Ve.setTimeout(g,l),i.pauseQueue.add(d),i.timeouts.add(c)):g()}function g(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(h=!0);try{s.start({...n,callId:e,cancel:h},a)}catch(_){o(_)}}})}var ok=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?ic(e.get()):t.every(n=>n.noop)?vI(e.get()):ui(e.get(),t.every(n=>n.finished)),vI=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ui=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ic=e=>({value:e,cancelled:!0,finished:!1});function yI(e,t,n,r){const{callId:i,parentId:s,onRest:a}=t,{asyncTo:o,promise:l}=n;return!s&&e===o&&!t.reset?l:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const c=N0(t,(v,m)=>m==="onRest"?void 0:v);let h,d;const f=new Promise((v,m)=>(h=v,d=m)),g=v=>{const m=i<=(n.cancelId||0)&&ic(r)||i!==n.asyncId&&ui(r,!1);if(m)throw v.result=m,d(v),v},_=(v,m)=>{const p=new IT,x=new $T;return(async()=>{if(Si.skipAnimation)throw jh(n),x.result=ui(r,!1),d(x),x;g(p);const b=de.obj(v)?{...v}:{...m,to:v};b.parentId=i,Ji(c,(C,E)=>{de.und(b[E])&&(b[E]=C)});const S=await r.start(b);return g(p),n.paused&&await new Promise(C=>{n.resumeQueue.add(C)}),S})()};let y;if(Si.skipAnimation)return jh(n),ui(r,!1);try{let v;de.arr(e)?v=(async m=>{for(const p of m)await _(p)})(e):v=Promise.resolve(e(_,r.stop.bind(r))),await Promise.all([v.then(h),f]),y=ui(r.get(),!0,!1)}catch(v){if(v instanceof IT)y=v.result;else if(v instanceof $T)y=v.result;else throw v}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?o:void 0,n.promise=s?l:void 0)}return de.fun(a)&&Ve.batchedUpdates(()=>{a(y,r,r.item)}),y})()}function jh(e,t){Bd(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var IT=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},$T=class extends Error{constructor(){super("SkipAnimationSignal")}},Yb=e=>e instanceof ak,hde=1,ak=class extends sI{constructor(){super(...arguments),this.id=hde++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Di(this);return e&&e.getValue()}to(...e){return Si.to(this,e)}interpolate(...e){return que(),Si.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Eh(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||M0.sort(this),Eh(this,{type:"priority",parent:this,priority:e})}},Aa=Symbol.for("SpringPhase"),xI=1,Xb=2,Jb=4,gx=e=>(e[Aa]&xI)>0,Gs=e=>(e[Aa]&Xb)>0,Fu=e=>(e[Aa]&Jb)>0,BT=(e,t)=>t?e[Aa]|=Xb|xI:e[Aa]&=~Xb,FT=(e,t)=>t?e[Aa]|=Jb:e[Aa]&=~Jb,fde=class extends ak{constructor(e,t){if(super(),this.animation=new dde,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!de.und(e)||!de.und(t)){const n=de.obj(e)?{...e}:{...t,from:e};de.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Gs(this)||this._state.asyncTo)||Fu(this)}get goal(){return or(this.animation.to)}get velocity(){const e=Di(this);return e instanceof Ef?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return gx(this)}get isAnimating(){return Gs(this)}get isPaused(){return Fu(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:i}=r;const{config:s}=r,a=L0(r.to);!a&&zr(r.to)&&(i=Zn(or(r.to))),r.values.forEach((c,h)=>{if(c.done)return;const d=c.constructor==Rh?1:a?a[h].lastPosition:i[h];let f=r.immediate,g=d;if(!f){if(g=c.lastPosition,s.tension<=0){c.done=!0;return}let _=c.elapsedTime+=e;const y=r.fromValues[h],v=c.v0!=null?c.v0:c.v0=de.arr(s.velocity)?s.velocity[h]:s.velocity;let m;const p=s.precision||(y==d?.005:Math.min(1,Math.abs(d-y)*.001));if(de.und(s.duration))if(s.decay){const x=s.decay===!0?.998:s.decay,b=Math.exp(-(1-x)*_);g=y+v/(1-x)*(1-b),f=Math.abs(c.lastPosition-g)<=p,m=v*b}else{m=c.lastVelocity==null?v:c.lastVelocity;const x=s.restVelocity||p/10,b=s.clamp?0:s.bounce,S=!de.und(b),C=y==d?c.v0>0:y<d;let E,k=!1;const T=1,R=Math.ceil(e/T);for(let M=0;M<R&&(E=Math.abs(m)>x,!(!E&&(f=Math.abs(d-g)<=p,f)));++M){S&&(k=g==d||g>d==C,k&&(m=-m*b,g=d));const L=-s.tension*1e-6*(g-d),D=-s.friction*.001*m,N=(L+D)/s.mass;m=m+N*T,g=g+m*T}}else{let x=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,_=c.elapsedTime+=e)),x=(s.progress||0)+_/this._memoizedDuration,x=x>1?1:x<0?0:x,c.durationProgress=x),g=y+s.easing(x)*(d-y),m=(g-c.lastPosition)/e,f=x==1}c.lastVelocity=m,Number.isNaN(g)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[h].done&&(f=!1),f?c.done=!0:t=!1,c.setValue(g,s.round)&&(n=!0)});const o=Di(this),l=o.getValue();if(t){const c=or(r.to);(l!==c||n)&&!s.decay?(o.setValue(c),this._onChange(c)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return Ve.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Gs(this)){const{to:e,config:t}=this.animation;Ve.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return de.und(e)?(n=this.queue||[],this.queue=[]):n=[de.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>ok(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),jh(this._state,e&&this._lastCallId),Ve.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=de.obj(n)?n[t]:n,(n==null||qb(n))&&(n=void 0),r=de.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return gx(this)||(e.reverse&&([n,r]=[r,n]),r=or(r),de.und(r)?Di(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,N0(e,(a,o)=>/^on/.test(o)?hI(a,n):a)),HT(this,e,"onProps"),Hu(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return gI(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{Fu(this)||(FT(this,!0),md(s.pauseQueue),Hu(this,"onPause",ui(this,zu(this,this.animation.to)),this))},resume:()=>{Fu(this)&&(FT(this,!1),Gs(this)&&this._resume(),md(s.resumeQueue),Hu(this,"onResume",ui(this,zu(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const o=_I(e);if(o)return this._update(o,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ic(this));const r=!de.und(e.to),i=!de.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(ic(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:h=l,from:d=c}=e;i&&!r&&(!t.default||de.und(h))&&(h=d),t.reverse&&([h,d]=[d,h]);const f=!ds(d,c);f&&(o.from=d),d=or(d);const g=!ds(h,l);g&&this._focus(h);const _=qb(t.to),{config:y}=o,{decay:v,velocity:m}=y;(r||i)&&(y.velocity=0),t.config&&!_&&ude(y,ar(t.config,s),t.config!==a.config?ar(a.config,s):void 0);let p=Di(this);if(!p||de.und(h))return n(ui(this,!0));const x=de.und(t.reset)?i&&!t.default:!de.und(d)&&zd(t.reset,s),b=x?d:this.get(),S=Ah(h),C=de.num(S)||de.arr(S)||j0(S),E=!_&&(!C||zd(a.immediate||t.immediate,s));if(g){const M=Vb(h);if(M!==p.constructor)if(E)p=this._set(S);else throw Error(`Cannot animate between ${p.constructor.name} and ${M.name}, as the "to" prop suggests`)}const k=p.constructor;let T=zr(h),R=!1;if(!T){const M=x||!gx(this)&&f;(g||M)&&(R=ds(Ah(b),S),T=!R),(!ds(o.immediate,E)&&!E||!ds(y.decay,v)||!ds(y.velocity,m))&&(T=!0)}if(R&&Gs(this)&&(o.changed&&!x?T=!0:T||this._stop(l)),!_&&((T||zr(l))&&(o.values=p.getPayload(),o.toValues=zr(h)?null:k==Rh?[1]:Zn(S)),o.immediate!=E&&(o.immediate=E,!E&&!x&&this._set(l)),T)){const{onRest:M}=o;Be(mde,D=>HT(this,t,D));const L=ui(this,zu(this,l));md(this._pendingCalls,L),this._pendingCalls.add(n),o.changed&&Ve.batchedUpdates(()=>{var D;o.changed=!x,M==null||M(L,this),x?ar(a.onRest,L):(D=o.onStart)==null||D.call(o,L,this)})}x&&this._set(b),_?n(yI(t.to,t,this._state,this)):T?this._start():Gs(this)&&!g?this._pendingCalls.add(n):n(vI(b))}_focus(e){const t=this.animation;e!==t.to&&(AT(this)&&this._detach(),t.to=e,AT(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;zr(t)&&(ou(t,this),Yb(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;zr(e)&&Th(e,this)}_set(e,t=!0){const n=or(e);if(!de.und(n)){const r=Di(this);if(!r||!ds(n,r.getValue())){const i=Vb(n);!r||r.constructor!=i?rk(this,i.create(n)):r.setValue(n),r&&Ve.batchedUpdates(()=>{this._onChange(n,t)})}}return Di(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Hu(this,"onStart",ui(this,zu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ar(this.animation.onChange,e,this)),ar(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Di(this).reset(or(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),Gs(this)||(BT(this,!0),Fu(this)||this._resume())}_resume(){Si.skipAnimation?this.finish():M0.start(this)}_stop(e,t){if(Gs(this)){BT(this,!1);const n=this.animation;Be(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Eh(this,{type:"idle",parent:this});const r=t?ic(this.get()):ui(this.get(),zu(this,e??n.to));md(this._pendingCalls,r),n.changed&&(n.changed=!1,Hu(this,"onRest",r,this))}}};function zu(e,t){const n=Ah(t),r=Ah(e.get());return ds(r,n)}function _I(e,t=e.loop,n=e.to){const r=ar(t);if(r){const i=r!==!0&&ik(r),s=(i||e).reverse,a=!i||i.reset;return Lh({...e,loop:t,default:!1,pause:void 0,to:!s||qb(n)?n:void 0,from:a?e.from:void 0,reset:a,...i})}}function Lh(e){const{to:t,from:n}=e=ik(e),r=new Set;return de.obj(t)&&zT(t,r),de.obj(n)&&zT(n,r),e.keys=r.size?Array.from(r):null,e}function pde(e){const t=Lh(e);return de.und(t.default)&&(t.default=N0(t)),t}function zT(e,t){Ji(e,(n,r)=>n!=null&&t.add(r))}var mde=["onStart","onRest","onChange","onPause","onResume"];function HT(e,t,n){e.animation[n]=t[n]!==fI(t,n)?hI(t[n],e.key):void 0}function Hu(e,t,...n){var r,i,s,a;(i=(r=e.animation)[t])==null||i.call(r,...n),(a=(s=e.defaultProps)[t])==null||a.call(s,...n)}var gde=["onStart","onChange","onRest"],vde=1,bI=class{constructor(e,t){this.id=vde++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];de.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Lh(e)),this}start(e){let{queue:t}=this;return e?t=Zn(e).map(Lh):this.queue=[],this._flush?this._flush(this,t):(EI(this,t),Qb(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Be(Zn(t),r=>n[r].stop(!!e))}else jh(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(de.und(e))this.start({pause:!0});else{const t=this.springs;Be(Zn(e),n=>t[n].pause())}return this}resume(e){if(de.und(e))this.start({pause:!1});else{const t=this.springs;Be(Zn(e),n=>t[n].resume())}return this}each(e){Ji(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,Bd(e,([o,l])=>{l.value=this.get(),o(l,this,this._item)}));const s=!r&&this._started,a=i||s&&n.size?this.get():null;i&&t.size&&Bd(t,([o,l])=>{l.value=a,o(l,this,this._item)}),s&&(this._started=!1,Bd(n,([o,l])=>{l.value=a,o(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;Ve.onFrame(this._onFrame)}};function Qb(e,t){return Promise.all(t.map(n=>wI(e,n))).then(n=>ok(e,n))}async function wI(e,t,n){const{keys:r,to:i,from:s,loop:a,onRest:o,onResolve:l}=t,c=de.obj(t.default)&&t.default;a&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const h=de.arr(i)||de.fun(i)?i:void 0;h?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Be(gde,y=>{const v=t[y];if(de.fun(v)){const m=e._events[y];t[y]=({finished:p,cancelled:x})=>{const b=m.get(v);b?(p||(b.finished=!1),x&&(b.cancelled=!0)):m.set(v,{value:null,finished:p||!1,cancelled:x||!1})},c&&(c[y]=t[y])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,md(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const f=(r||Object.keys(e.springs)).map(y=>e.springs[y].start(t)),g=t.cancel===!0||fI(t,"cancel")===!0;(h||g&&d.asyncId)&&f.push(gI(++e._lastAsyncId,{props:t,state:d,actions:{pause:Hb,resume:Hb,start(y,v){g?(jh(d,e._lastAsyncId),v(ic(e))):(y.onRest=o,v(yI(h,y,d,e)))}}})),d.paused&&await new Promise(y=>{d.resumeQueue.add(y)});const _=ok(e,await Promise.all(f));if(a&&_.finished&&!(n&&_.noop)){const y=_I(t,a,i);if(y)return EI(e,[y]),wI(e,y,!0)}return l&&Ve.batchedUpdates(()=>l(_,e,e.item)),_}function Zb(e,t){const n={...e.springs};return t&&Be(Zn(t),r=>{de.und(r.keys)&&(r=Lh(r)),de.obj(r.to)||(r={...r,to:void 0}),kI(n,r,i=>CI(i))}),SI(e,n),n}function SI(e,t){Ji(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,ou(n,e))})}function CI(e,t){const n=new fde;return n.key=e,t&&ou(n,t),n}function kI(e,t,n){t.keys&&Be(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function EI(e,t){Be(t,n=>{kI(e.springs,n,r=>CI(r,e))})}var Tf=({children:e,...t})=>{const n=w.useContext(Bg),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=Xue(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=Bg;return w.createElement(s,{value:t},e)},Bg=yde(Tf,{});Tf.Provider=Bg.Provider;Tf.Consumer=Bg.Consumer;function yde(e,t){return Object.assign(e,w.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var TI=()=>{const e=[],t=function(r){Kue();const i=[];return Be(e,(s,a)=>{if(de.und(r))i.push(s.start());else{const o=n(r,s,a);o&&i.push(s.start(o))}}),i};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const i=e.indexOf(r);~i&&e.splice(i,1)},t.pause=function(){return Be(e,r=>r.pause(...arguments)),this},t.resume=function(){return Be(e,r=>r.resume(...arguments)),this},t.set=function(r){Be(e,(i,s)=>{const a=de.fun(r)?r(s,i):r;a&&i.set(a)})},t.start=function(r){const i=[];return Be(e,(s,a)=>{if(de.und(r))i.push(s.start());else{const o=this._getProps(r,s,a);o&&i.push(s.start(o))}}),i},t.stop=function(){return Be(e,r=>r.stop(...arguments)),this},t.update=function(r){return Be(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return de.fun(r)?r(s,i):r};return t._getProps=n,t};function xde(e,t,n){const r=de.fun(t)&&t;r&&!n&&(n=[]);const i=w.useMemo(()=>r||arguments.length==3?TI():void 0,[]),s=w.useRef(0),a=tk(),o=w.useMemo(()=>({ctrls:[],queue:[],flush(m,p){const x=Zb(m,p);return s.current>0&&!o.queue.length&&!Object.keys(x).some(S=>!m.springs[S])?Qb(m,p):new Promise(S=>{SI(m,x),o.queue.push(()=>{S(Qb(m,p))}),a()})}}),[]),l=w.useRef([...o.ctrls]),c=[],h=Ub(e)||0;w.useMemo(()=>{Be(l.current.slice(e,h),m=>{Gb(m,i),m.stop(!0)}),l.current.length=e,d(h,e)},[e]),w.useMemo(()=>{d(0,Math.min(h,e))},n);function d(m,p){for(let x=m;x<p;x++){const b=l.current[x]||(l.current[x]=new bI(null,o.flush)),S=r?r(x,b):t[x];S&&(c[x]=pde(S))}}const f=l.current.map((m,p)=>Zb(m,c[p])),g=w.useContext(Tf),_=Ub(g),y=g!==_&&pI(g);la(()=>{s.current++,o.ctrls=l.current;const{queue:m}=o;m.length&&(o.queue=[],Be(m,p=>p())),Be(l.current,(p,x)=>{i==null||i.add(p),y&&p.start({default:g});const b=c[x];b&&(mI(p,b.ref),p.ref?p.queue.push(b):p.start(b))})}),nk(()=>()=>{Be(o.ctrls,m=>m.stop(!0))});const v=f.map(m=>({...m}));return i?[v,i]:v}function Bs(e,t){const n=de.fun(e),[[r],i]=xde(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,i]:r}function Qa(e,t,n){const r=de.fun(t)&&t,{reset:i,sort:s,trail:a=0,expires:o=!0,exitBeforeEnter:l=!1,onDestroyed:c,ref:h,config:d}=r?r():t,f=w.useMemo(()=>r||arguments.length==3?TI():void 0,[]),g=Zn(e),_=[],y=w.useRef(null),v=i?null:y.current;la(()=>{y.current=_}),nk(()=>(Be(_,N=>{f==null||f.add(N.ctrl),N.ctrl.ref=f}),()=>{Be(y.current,N=>{N.expired&&clearTimeout(N.expirationId),Gb(N.ctrl,f),N.ctrl.stop(!0)})}));const m=bde(g,r?r():t,v),p=i&&y.current||[];la(()=>Be(p,({ctrl:N,item:P,key:I})=>{Gb(N,f),ar(c,P,I)}));const x=[];if(v&&Be(v,(N,P)=>{N.expired?(clearTimeout(N.expirationId),p.push(N)):(P=x[P]=m.indexOf(N.key),~P&&(_[P]=N))}),Be(g,(N,P)=>{_[P]||(_[P]={key:m[P],item:N,phase:"mount",ctrl:new bI},_[P].ctrl.item=N)}),x.length){let N=-1;const{leave:P}=r?r():t;Be(x,(I,z)=>{const O=v[z];~I?(N=_.indexOf(O),_[N]={...O,item:g[I]}):P&&_.splice(++N,0,O)})}de.fun(s)&&_.sort((N,P)=>s(N.item,P.item));let b=-a;const S=tk(),C=N0(t),E=new Map,k=w.useRef(new Map),T=w.useRef(!1);Be(_,(N,P)=>{const I=N.key,z=N.phase,O=r?r():t;let j,A;const F=ar(O.delay||0,I);if(z=="mount")j=O.enter,A="enter";else{const Q=m.indexOf(I)<0;if(z!="leave")if(Q)j=O.leave,A="leave";else if(j=O.update)A="update";else return;else if(!Q)j=O.enter,A="enter";else return}if(j=ar(j,N.item,P),j=de.obj(j)?ik(j):{to:j},!j.config){const Q=d||C.config;j.config=ar(Q,N.item,P,A)}b+=a;const H={...C,delay:F+b,ref:h,immediate:O.immediate,reset:!1,...j};if(A=="enter"&&de.und(H.from)){const Q=r?r():t,Y=de.und(Q.initial)||v?Q.from:Q.initial;H.from=ar(Y,N.item,P)}const{onResolve:B}=H;H.onResolve=Q=>{ar(B,Q);const Y=y.current,W=Y.find($=>$.key===I);if(W&&!(Q.cancelled&&W.phase!="update")&&W.ctrl.idle){const $=Y.every(V=>V.ctrl.idle);if(W.phase=="leave"){const V=ar(o,W.item);if(V!==!1){const U=V===!0?0:V;if(W.expired=!0,!$&&U>0){U<=2147483647&&(W.expirationId=setTimeout(S,U));return}}}$&&Y.some(V=>V.expired)&&(k.current.delete(W),l&&(T.current=!0),S())}};const G=Zb(N.ctrl,H);A==="leave"&&l?k.current.set(N,{phase:A,springs:G,payload:H}):E.set(N,{phase:A,springs:G,payload:H})});const R=w.useContext(Tf),M=Ub(R),L=R!==M&&pI(R);la(()=>{L&&Be(_,N=>{N.ctrl.start({default:R})})},[R]),Be(E,(N,P)=>{if(k.current.size){const I=_.findIndex(z=>z.key===P.key);_.splice(I,1)}}),la(()=>{Be(k.current.size?k.current:E,({phase:N,payload:P},I)=>{const{ctrl:z}=I;I.phase=N,f==null||f.add(z),L&&N=="enter"&&z.start({default:R}),P&&(mI(z,P.ref),(z.ref||f)&&!T.current?z.update(P):(z.start(P),T.current&&(T.current=!1)))})},i?void 0:n);const D=N=>w.createElement(w.Fragment,null,_.map((P,I)=>{const{springs:z}=E.get(P)||P.ctrl,O=N({...z},P.item,P,I);return O&&O.type?w.createElement(O.type,{...O.props,key:de.str(P.key)||de.num(P.key)?P.key:P.ctrl.id,ref:O.ref}):O}));return f?[D,f]:D}var _de=1;function bde(e,{key:t,keys:n=t},r){if(n===null){const i=new Set;return e.map(s=>{const a=r&&r.find(o=>o.item===s&&o.phase!=="leave"&&!i.has(o));return a?(i.add(a),a.key):_de++})}return de.und(n)?e:de.fun(n)?e.map(n):Zn(n)}var MI=class extends ak{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ch(...t);const n=this._get(),r=Vb(n);rk(this,r.create(n))}advance(e){const t=this._get(),n=this.get();ds(t,n)||(Di(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&WT(this._active)&&vx(this)}_get(){const e=de.arr(this.source)?this.source.map(or):Zn(or(this.source));return this.calc(...e)}_start(){this.idle&&!WT(this._active)&&(this.idle=!1,Be(L0(this),e=>{e.done=!1}),Si.skipAnimation?(Ve.batchedUpdates(()=>this.advance()),vx(this)):M0.start(this))}_attach(){let e=1;Be(Zn(this.source),t=>{zr(t)&&ou(t,this),Yb(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Be(Zn(this.source),e=>{zr(e)&&Th(e,this)}),this._active.clear(),vx(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=Zn(this.source).reduce((t,n)=>Math.max(t,(Yb(n)?n.priority:0)+1),0))}};function wde(e){return e.idle!==!1}function WT(e){return!e.size||Array.from(e).every(wde)}function vx(e){e.idle||(e.idle=!0,Be(L0(e),t=>{t.done=!0}),Eh(e,{type:"idle",parent:e}))}var jo=(e,...t)=>new MI(e,t);Si.assign({createStringInterpolator:lI,to:(e,t)=>new MI(e,t)});var RI=/^--/;function Sde(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!RI.test(e)&&!(Hd.hasOwnProperty(e)&&Hd[e])?t+"px":(""+t).trim()}var UT={};function Cde(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:i,children:s,scrollTop:a,scrollLeft:o,viewBox:l,...c}=t,h=Object.values(c),d=Object.keys(c).map(f=>n||e.hasAttribute(f)?f:UT[f]||(UT[f]=f.replace(/([A-Z])/g,g=>"-"+g.toLowerCase())));s!==void 0&&(e.textContent=s);for(const f in i)if(i.hasOwnProperty(f)){const g=Sde(f,i[f]);RI.test(f)?e.style.setProperty(f,g):e.style[f]=g}d.forEach((f,g)=>{e.setAttribute(f,h[g])}),r!==void 0&&(e.className=r),a!==void 0&&(e.scrollTop=a),o!==void 0&&(e.scrollLeft=o),l!==void 0&&e.setAttribute("viewBox",l)}var Hd={animationIterationCount:!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,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},kde=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Ede=["Webkit","Ms","Moz","O"];Hd=Object.keys(Hd).reduce((e,t)=>(Ede.forEach(n=>e[kde(n,t)]=e[t]),e),Hd);var Tde=/^(matrix|translate|scale|rotate|skew)/,Mde=/^(translate)/,Rde=/^(rotate|skew)/,yx=(e,t)=>de.num(e)&&e!==0?e+t:e,mm=(e,t)=>de.arr(e)?e.every(n=>mm(n,t)):de.num(e)?e===t:parseFloat(e)===t,Ade=class extends D0{constructor({x:e,y:t,z:n,...r}){const i=[],s=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),s.push(a=>[`translate3d(${a.map(o=>yx(o,"px")).join(",")})`,mm(a,0)])),Ji(r,(a,o)=>{if(o==="transform")i.push([a||""]),s.push(l=>[l,l===""]);else if(Tde.test(o)){if(delete r[o],de.und(a))return;const l=Mde.test(o)?"px":Rde.test(o)?"deg":"";i.push(Zn(a)),s.push(o==="rotate3d"?([c,h,d,f])=>[`rotate3d(${c},${h},${d},${yx(f,l)})`,mm(f,0)]:c=>[`${o}(${c.map(h=>yx(h,l)).join(",")})`,mm(c,o.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new jde(i,s)),super(r)}},jde=class extends sI{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Be(this.inputs,(n,r)=>{const i=or(n[0]),[s,a]=this.transforms[r](de.arr(i)?i:n.map(or));e+=" "+s,t=t&&a}),t?"none":e}observerAdded(e){e==1&&Be(this.inputs,t=>Be(t,n=>zr(n)&&ou(n,this)))}observerRemoved(e){e==0&&Be(this.inputs,t=>Be(t,n=>zr(n)&&Th(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Eh(this,e)}},Lde=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Si.assign({batchedUpdates:Er.unstable_batchedUpdates,createStringInterpolator:lI,colors:kue});var Dde=ide(Lde,{applyAnimatedValues:Cde,createAnimatedStyle:e=>new Ade(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),St=Dde.animated;function ja(){return ja=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},ja.apply(this,arguments)}var Nde={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0},VT=function(e,t){return"translate("+e+"px, "+t+"px)"},AI=w.memo(function(e){var t,n=e.position,r=e.anchor,i=e.children,s=Vt(),a=br(),o=a.animate,l=a.config,c=H$(),h=c[0],d=c[1],f=w.useRef(!1),g=void 0,_=!1,y=d.width>0&&d.height>0,v=Math.round(n[0]),m=Math.round(n[1]);y&&(r==="top"?(v-=d.width/2,m-=d.height+14):r==="right"?(v+=14,m-=d.height/2):r==="bottom"?(v-=d.width/2,m+=14):r==="left"?(v-=d.width+14,m-=d.height/2):r==="center"&&(v-=d.width/2,m-=d.height/2),g={transform:VT(v,m)},f.current||(_=!0),f.current=[v,m]);var p=Bs({to:g,config:l,immediate:!o||_}),x=ja({},Nde,s.tooltip.wrapper,{transform:(t=p.transform)!=null?t:VT(v,m),opacity:p.transform?1:0});return u.jsx(St.div,{ref:h,style:x,children:i})});AI.displayName="TooltipWrapper";var Pde=w.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return u.jsx("span",{style:ja({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),jI=w.memo(function(e){var t,n=e.id,r=e.value,i=e.format,s=e.enableChip,a=s!==void 0&&s,o=e.color,l=e.renderContent,c=Vt(),h=N1(i);if(typeof l=="function")t=l();else{var d=r;h!==void 0&&d!==void 0&&(d=h(d)),t=u.jsxs("div",{style:c.tooltip.basic,children:[a&&u.jsx(Pde,{color:o,style:c.tooltip.chip}),d!==void 0?u.jsxs("span",{children:[n,": ",u.jsx("strong",{children:""+d})]}):n]})}return u.jsx("div",{style:c.tooltip.container,children:t})}),Ode={width:"100%",borderCollapse:"collapse"},Ide=w.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,s=e.renderContent,a=Vt();return i.length?(t=typeof s=="function"?s():u.jsxs("div",{children:[n&&n,u.jsx("table",{style:ja({},Ode,a.tooltip.table),children:u.jsx("tbody",{children:i.map(function(o,l){return u.jsx("tr",{children:o.map(function(c,h){return u.jsx("td",{style:a.tooltip.tableCell,children:c},h)})},l)})})})]}),u.jsx("div",{style:a.tooltip.container,children:t})):null});Ide.displayName="TableTooltip";var ew=w.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,s=Vt(),a=br(),o=a.animate,l=a.config,c=w.useMemo(function(){return ja({},s.crosshair.line,{pointerEvents:"none"})},[s.crosshair.line]),h=Bs({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!o});return u.jsx(St.line,ja({},h,{fill:"none",style:c}))});ew.displayName="CrosshairLine";var $de=w.memo(function(e){var t,n,r=e.width,i=e.height,s=e.type,a=e.x,o=e.y;return s==="cross"?(t={x0:a,x1:a,y0:0,y1:i},n={x0:0,x1:r,y0:o,y1:o}):s==="top-left"?(t={x0:a,x1:a,y0:0,y1:o},n={x0:0,x1:a,y0:o,y1:o}):s==="top"?t={x0:a,x1:a,y0:0,y1:o}:s==="top-right"?(t={x0:a,x1:a,y0:0,y1:o},n={x0:a,x1:r,y0:o,y1:o}):s==="right"?n={x0:a,x1:r,y0:o,y1:o}:s==="bottom-right"?(t={x0:a,x1:a,y0:o,y1:i},n={x0:a,x1:r,y0:o,y1:o}):s==="bottom"?t={x0:a,x1:a,y0:o,y1:i}:s==="bottom-left"?(t={x0:a,x1:a,y0:o,y1:i},n={x0:0,x1:a,y0:o,y1:o}):s==="left"?n={x0:0,x1:a,y0:o,y1:o}:s==="x"?t={x0:a,x1:a,y0:0,y1:i}:s==="y"&&(n={x0:0,x1:r,y0:o,y1:o}),u.jsxs(u.Fragment,{children:[t&&u.jsx(ew,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&u.jsx(ew,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});$de.displayName="Crosshair";var LI=w.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),tw={isVisible:!1,position:[null,null],content:null,anchor:null},DI=w.createContext(tw),Bde=function(e){var t=w.useState(tw),n=t[0],r=t[1],i=w.useCallback(function(o,l,c){var h=l[0],d=l[1];c===void 0&&(c="top"),r({isVisible:!0,position:[h,d],anchor:c,content:o})},[r]),s=w.useCallback(function(o,l,c){c===void 0&&(c="top");var h=e.current.getBoundingClientRect(),d=e.current.offsetWidth,f=d===h.width?1:d/h.width,g="touches"in l?l.touches[0]:l,_=g.clientX,y=g.clientY,v=(_-h.left)*f,m=(y-h.top)*f;c!=="left"&&c!=="right"||(c=v<h.width/2?"right":"left"),r({isVisible:!0,position:[v,m],anchor:c,content:o})},[e,r]),a=w.useCallback(function(){r(tw)},[r]);return{actions:w.useMemo(function(){return{showTooltipAt:i,showTooltipFromEvent:s,hideTooltip:a}},[i,s,a]),state:n}},lk=function(){var e=w.useContext(LI);if(e===void 0)throw new Error("useTooltip must be used within a TooltipProvider");return e},Fde=function(){var e=w.useContext(DI);if(e===void 0)throw new Error("useTooltipState must be used within a TooltipProvider");return e},zde=function(e){return e.isVisible},Hde=function(){var e=Fde();return zde(e)?u.jsx(AI,{position:e.position,anchor:e.anchor,children:e.content}):null},Wde=function(e){var t=e.container,n=e.children,r=Bde(t),i=r.actions,s=r.state;return u.jsx(LI.Provider,{value:i,children:u.jsx(DI.Provider,{value:s,children:n})})};function Ude(){this.__data__=[],this.size=0}var Vde=Ude;function qde(e,t){return e===t||e!==e&&t!==t}var Mf=qde,Gde=Mf;function Kde(e,t){for(var n=e.length;n--;)if(Gde(e[n][0],t))return n;return-1}var P0=Kde,Yde=P0,Xde=Array.prototype,Jde=Xde.splice;function Qde(e){var t=this.__data__,n=Yde(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Jde.call(t,n,1),--this.size,!0}var Zde=Qde,ehe=P0;function the(e){var t=this.__data__,n=ehe(t,e);return n<0?void 0:t[n][1]}var nhe=the,rhe=P0;function ihe(e){return rhe(this.__data__,e)>-1}var she=ihe,ohe=P0;function ahe(e,t){var n=this.__data__,r=ohe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var lhe=ahe,che=Vde,uhe=Zde,dhe=nhe,hhe=she,fhe=lhe;function au(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}au.prototype.clear=che;au.prototype.delete=uhe;au.prototype.get=dhe;au.prototype.has=hhe;au.prototype.set=fhe;var O0=au,phe=O0;function mhe(){this.__data__=new phe,this.size=0}var ghe=mhe;function vhe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var yhe=vhe;function xhe(e){return this.__data__.get(e)}var _he=xhe;function bhe(e){return this.__data__.has(e)}var whe=bhe,She=typeof $i=="object"&&$i&&$i.Object===Object&&$i,NI=She,Che=NI,khe=typeof self=="object"&&self&&self.Object===Object&&self,Ehe=Che||khe||Function("return this")(),ns=Ehe,The=ns,Mhe=The.Symbol,lu=Mhe,qT=lu,PI=Object.prototype,Rhe=PI.hasOwnProperty,Ahe=PI.toString,Wu=qT?qT.toStringTag:void 0;function jhe(e){var t=Rhe.call(e,Wu),n=e[Wu];try{e[Wu]=void 0;var r=!0}catch{}var i=Ahe.call(e);return r&&(t?e[Wu]=n:delete e[Wu]),i}var Lhe=jhe,Dhe=Object.prototype,Nhe=Dhe.toString;function Phe(e){return Nhe.call(e)}var Ohe=Phe,GT=lu,Ihe=Lhe,$he=Ohe,Bhe="[object Null]",Fhe="[object Undefined]",KT=GT?GT.toStringTag:void 0;function zhe(e){return e==null?e===void 0?Fhe:Bhe:KT&&KT in Object(e)?Ihe(e):$he(e)}var qo=zhe;function Hhe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var rs=Hhe,Whe=qo,Uhe=rs,Vhe="[object AsyncFunction]",qhe="[object Function]",Ghe="[object GeneratorFunction]",Khe="[object Proxy]";function Yhe(e){if(!Uhe(e))return!1;var t=Whe(e);return t==qhe||t==Ghe||t==Vhe||t==Khe}var I0=Yhe;const OI=Tn(I0);var Xhe=ns,Jhe=Xhe["__core-js_shared__"],Qhe=Jhe,xx=Qhe,YT=function(){var e=/[^.]+$/.exec(xx&&xx.keys&&xx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Zhe(e){return!!YT&&YT in e}var efe=Zhe,tfe=Function.prototype,nfe=tfe.toString;function rfe(e){if(e!=null){try{return nfe.call(e)}catch{}try{return e+""}catch{}}return""}var II=rfe,ife=I0,sfe=efe,ofe=rs,afe=II,lfe=/[\\^$.*+?()[\]{}|]/g,cfe=/^\[object .+?Constructor\]$/,ufe=Function.prototype,dfe=Object.prototype,hfe=ufe.toString,ffe=dfe.hasOwnProperty,pfe=RegExp("^"+hfe.call(ffe).replace(lfe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mfe(e){if(!ofe(e)||sfe(e))return!1;var t=ife(e)?pfe:cfe;return t.test(afe(e))}var gfe=mfe;function vfe(e,t){return e==null?void 0:e[t]}var yfe=vfe,xfe=gfe,_fe=yfe;function bfe(e,t){var n=_fe(e,t);return xfe(n)?n:void 0}var Za=bfe,wfe=Za,Sfe=ns,Cfe=wfe(Sfe,"Map"),ck=Cfe,kfe=Za,Efe=kfe(Object,"create"),$0=Efe,XT=$0;function Tfe(){this.__data__=XT?XT(null):{},this.size=0}var Mfe=Tfe;function Rfe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Afe=Rfe,jfe=$0,Lfe="__lodash_hash_undefined__",Dfe=Object.prototype,Nfe=Dfe.hasOwnProperty;function Pfe(e){var t=this.__data__;if(jfe){var n=t[e];return n===Lfe?void 0:n}return Nfe.call(t,e)?t[e]:void 0}var Ofe=Pfe,Ife=$0,$fe=Object.prototype,Bfe=$fe.hasOwnProperty;function Ffe(e){var t=this.__data__;return Ife?t[e]!==void 0:Bfe.call(t,e)}var zfe=Ffe,Hfe=$0,Wfe="__lodash_hash_undefined__";function Ufe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Hfe&&t===void 0?Wfe:t,this}var Vfe=Ufe,qfe=Mfe,Gfe=Afe,Kfe=Ofe,Yfe=zfe,Xfe=Vfe;function cu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}cu.prototype.clear=qfe;cu.prototype.delete=Gfe;cu.prototype.get=Kfe;cu.prototype.has=Yfe;cu.prototype.set=Xfe;var Jfe=cu,JT=Jfe,Qfe=O0,Zfe=ck;function epe(){this.size=0,this.__data__={hash:new JT,map:new(Zfe||Qfe),string:new JT}}var tpe=epe;function npe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var rpe=npe,ipe=rpe;function spe(e,t){var n=e.__data__;return ipe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var B0=spe,ope=B0;function ape(e){var t=ope(this,e).delete(e);return this.size-=t?1:0,t}var lpe=ape,cpe=B0;function upe(e){return cpe(this,e).get(e)}var dpe=upe,hpe=B0;function fpe(e){return hpe(this,e).has(e)}var ppe=fpe,mpe=B0;function gpe(e,t){var n=mpe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var vpe=gpe,ype=tpe,xpe=lpe,_pe=dpe,bpe=ppe,wpe=vpe;function uu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}uu.prototype.clear=ype;uu.prototype.delete=xpe;uu.prototype.get=_pe;uu.prototype.has=bpe;uu.prototype.set=wpe;var uk=uu,Spe=O0,Cpe=ck,kpe=uk,Epe=200;function Tpe(e,t){var n=this.__data__;if(n instanceof Spe){var r=n.__data__;if(!Cpe||r.length<Epe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new kpe(r)}return n.set(e,t),this.size=n.size,this}var Mpe=Tpe,Rpe=O0,Ape=ghe,jpe=yhe,Lpe=_he,Dpe=whe,Npe=Mpe;function du(e){var t=this.__data__=new Rpe(e);this.size=t.size}du.prototype.clear=Ape;du.prototype.delete=jpe;du.prototype.get=Lpe;du.prototype.has=Dpe;du.prototype.set=Npe;var F0=du,Ppe=Za,Ope=function(){try{var e=Ppe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),$I=Ope,QT=$I;function Ipe(e,t,n){t=="__proto__"&&QT?QT(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var dk=Ipe,$pe=dk,Bpe=Mf;function Fpe(e,t,n){(n!==void 0&&!Bpe(e[t],n)||n===void 0&&!(t in e))&&$pe(e,t,n)}var BI=Fpe;function zpe(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[e?o:++i];if(n(s[l],l,s)===!1)break}return t}}var Hpe=zpe,Wpe=Hpe,Upe=Wpe(),FI=Upe,Fg={exports:{}};Fg.exports;(function(e,t){var n=ns,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s?n.Buffer:void 0,o=a?a.allocUnsafe:void 0;function l(c,h){if(h)return c.slice();var d=c.length,f=o?o(d):new c.constructor(d);return c.copy(f),f}e.exports=l})(Fg,Fg.exports);var zI=Fg.exports,Vpe=ns,qpe=Vpe.Uint8Array,HI=qpe,ZT=HI;function Gpe(e){var t=new e.constructor(e.byteLength);return new ZT(t).set(new ZT(e)),t}var hk=Gpe,Kpe=hk;function Ype(e,t){var n=t?Kpe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var WI=Ype;function Xpe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var UI=Xpe,Jpe=rs,eM=Object.create,Qpe=function(){function e(){}return function(t){if(!Jpe(t))return{};if(eM)return eM(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Zpe=Qpe;function eme(e,t){return function(n){return e(t(n))}}var VI=eme,tme=VI,nme=tme(Object.getPrototypeOf,Object),fk=nme,rme=Object.prototype;function ime(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||rme;return e===n}var pk=ime,sme=Zpe,ome=fk,ame=pk;function lme(e){return typeof e.constructor=="function"&&!ame(e)?sme(ome(e)):{}}var qI=lme;function cme(e){return e!=null&&typeof e=="object"}var ki=cme,ume=qo,dme=ki,hme="[object Arguments]";function fme(e){return dme(e)&&ume(e)==hme}var pme=fme,tM=pme,mme=ki,GI=Object.prototype,gme=GI.hasOwnProperty,vme=GI.propertyIsEnumerable,yme=tM(function(){return arguments}())?tM:function(e){return mme(e)&&gme.call(e,"callee")&&!vme.call(e,"callee")},z0=yme,xme=Array.isArray,_r=xme,_me=9007199254740991;function bme(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=_me}var mk=bme,wme=I0,Sme=mk;function Cme(e){return e!=null&&Sme(e.length)&&!wme(e)}var hu=Cme,kme=hu,Eme=ki;function Tme(e){return Eme(e)&&kme(e)}var KI=Tme,zg={exports:{}};function Mme(){return!1}var Rme=Mme;zg.exports;(function(e,t){var n=ns,r=Rme,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?n.Buffer:void 0,l=o?o.isBuffer:void 0,c=l||r;e.exports=c})(zg,zg.exports);var H0=zg.exports,Ame=qo,jme=fk,Lme=ki,Dme="[object Object]",Nme=Function.prototype,Pme=Object.prototype,YI=Nme.toString,Ome=Pme.hasOwnProperty,Ime=YI.call(Object);function $me(e){if(!Lme(e)||Ame(e)!=Dme)return!1;var t=jme(e);if(t===null)return!0;var n=Ome.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&YI.call(n)==Ime}var gk=$me;const vk=Tn(gk);var Bme=qo,Fme=mk,zme=ki,Hme="[object Arguments]",Wme="[object Array]",Ume="[object Boolean]",Vme="[object Date]",qme="[object Error]",Gme="[object Function]",Kme="[object Map]",Yme="[object Number]",Xme="[object Object]",Jme="[object RegExp]",Qme="[object Set]",Zme="[object String]",ege="[object WeakMap]",tge="[object ArrayBuffer]",nge="[object DataView]",rge="[object Float32Array]",ige="[object Float64Array]",sge="[object Int8Array]",oge="[object Int16Array]",age="[object Int32Array]",lge="[object Uint8Array]",cge="[object Uint8ClampedArray]",uge="[object Uint16Array]",dge="[object Uint32Array]",zt={};zt[rge]=zt[ige]=zt[sge]=zt[oge]=zt[age]=zt[lge]=zt[cge]=zt[uge]=zt[dge]=!0;zt[Hme]=zt[Wme]=zt[tge]=zt[Ume]=zt[nge]=zt[Vme]=zt[qme]=zt[Gme]=zt[Kme]=zt[Yme]=zt[Xme]=zt[Jme]=zt[Qme]=zt[Zme]=zt[ege]=!1;function hge(e){return zme(e)&&Fme(e.length)&&!!zt[Bme(e)]}var fge=hge;function pge(e){return function(t){return e(t)}}var Rf=pge,Hg={exports:{}};Hg.exports;(function(e,t){var n=NI,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s&&n.process,o=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o})(Hg,Hg.exports);var W0=Hg.exports,mge=fge,gge=Rf,nM=W0,rM=nM&&nM.isTypedArray,vge=rM?gge(rM):mge,yk=vge;function yge(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var XI=yge,xge=dk,_ge=Mf,bge=Object.prototype,wge=bge.hasOwnProperty;function Sge(e,t,n){var r=e[t];(!(wge.call(e,t)&&_ge(r,n))||n===void 0&&!(t in e))&&xge(e,t,n)}var xk=Sge,Cge=xk,kge=dk;function Ege(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=r?r(n[o],e[o],o,n,e):void 0;l===void 0&&(l=e[o]),i?kge(n,o,l):Cge(n,o,l)}return n}var fu=Ege;function Tge(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Mge=Tge,Rge=9007199254740991,Age=/^(?:0|[1-9]\d*)$/;function jge(e,t){var n=typeof e;return t=t??Rge,!!t&&(n=="number"||n!="symbol"&&Age.test(e))&&e>-1&&e%1==0&&e<t}var U0=jge,Lge=Mge,Dge=z0,Nge=_r,Pge=H0,Oge=U0,Ige=yk,$ge=Object.prototype,Bge=$ge.hasOwnProperty;function Fge(e,t){var n=Nge(e),r=!n&&Dge(e),i=!n&&!r&&Pge(e),s=!n&&!r&&!i&&Ige(e),a=n||r||i||s,o=a?Lge(e.length,String):[],l=o.length;for(var c in e)(t||Bge.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Oge(c,l)))&&o.push(c);return o}var JI=Fge;function zge(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Hge=zge,Wge=rs,Uge=pk,Vge=Hge,qge=Object.prototype,Gge=qge.hasOwnProperty;function Kge(e){if(!Wge(e))return Vge(e);var t=Uge(e),n=[];for(var r in e)r=="constructor"&&(t||!Gge.call(e,r))||n.push(r);return n}var Yge=Kge,Xge=JI,Jge=Yge,Qge=hu;function Zge(e){return Qge(e)?Xge(e,!0):Jge(e)}var Af=Zge,eve=fu,tve=Af;function nve(e){return eve(e,tve(e))}var rve=nve,iM=BI,ive=zI,sve=WI,ove=UI,ave=qI,sM=z0,oM=_r,lve=KI,cve=H0,uve=I0,dve=rs,hve=gk,fve=yk,aM=XI,pve=rve;function mve(e,t,n,r,i,s,a){var o=aM(e,n),l=aM(t,n),c=a.get(l);if(c){iM(e,n,c);return}var h=s?s(o,l,n+"",e,t,a):void 0,d=h===void 0;if(d){var f=oM(l),g=!f&&cve(l),_=!f&&!g&&fve(l);h=l,f||g||_?oM(o)?h=o:lve(o)?h=ove(o):g?(d=!1,h=ive(l,!0)):_?(d=!1,h=sve(l,!0)):h=[]:hve(l)||sM(l)?(h=o,sM(o)?h=pve(o):(!dve(o)||uve(o))&&(h=ave(l))):d=!1}d&&(a.set(l,h),i(h,l,r,s,a),a.delete(l)),iM(e,n,h)}var gve=mve,vve=F0,yve=BI,xve=FI,_ve=gve,bve=rs,wve=Af,Sve=XI;function QI(e,t,n,r,i){e!==t&&xve(t,function(s,a){if(i||(i=new vve),bve(s))_ve(e,t,a,n,QI,r,i);else{var o=r?r(Sve(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),yve(e,a,o)}},wve)}var Cve=QI;function kve(e){return e}var V0=kve;function Eve(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Tve=Eve,Mve=Tve,lM=Math.max;function Rve(e,t,n){return t=lM(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=lM(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),Mve(e,this,o)}}var ZI=Rve;function Ave(e){return function(){return e}}var jve=Ave,Lve=jve,cM=$I,Dve=V0,Nve=cM?function(e,t){return cM(e,"toString",{configurable:!0,enumerable:!1,value:Lve(t),writable:!0})}:Dve,Pve=Nve,Ove=800,Ive=16,$ve=Date.now;function Bve(e){var t=0,n=0;return function(){var r=$ve(),i=Ive-(r-n);if(n=r,i>0){if(++t>=Ove)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Fve=Bve,zve=Pve,Hve=Fve,Wve=Hve(zve),e9=Wve,Uve=V0,Vve=ZI,qve=e9;function Gve(e,t){return qve(Vve(e,t,Uve),e+"")}var _k=Gve,Kve=Mf,Yve=hu,Xve=U0,Jve=rs;function Qve(e,t,n){if(!Jve(n))return!1;var r=typeof t;return(r=="number"?Yve(n)&&Xve(t,n.length):r=="string"&&t in n)?Kve(n[t],e):!1}var t9=Qve,Zve=_k,e0e=t9;function t0e(e){return Zve(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&e0e(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var n0e=t0e,r0e=Cve,i0e=n0e,s0e=i0e(function(e,t,n){r0e(e,t,n)}),o0e=s0e;const a0e=Tn(o0e);var l0e=qo,c0e=ki,u0e="[object Symbol]";function d0e(e){return typeof e=="symbol"||c0e(e)&&l0e(e)==u0e}var q0=d0e,h0e=_r,f0e=q0,p0e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m0e=/^\w*$/;function g0e(e,t){if(h0e(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||f0e(e)?!0:m0e.test(e)||!p0e.test(e)||t!=null&&e in Object(t)}var bk=g0e,n9=uk,v0e="Expected a function";function wk(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(v0e);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(wk.Cache||n9),n}wk.Cache=n9;var y0e=wk,x0e=y0e,_0e=500;function b0e(e){var t=x0e(e,function(r){return n.size===_0e&&n.clear(),r}),n=t.cache;return t}var w0e=b0e,S0e=w0e,C0e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,k0e=/\\(\\)?/g,E0e=S0e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(C0e,function(n,r,i,s){t.push(i?s.replace(k0e,"$1"):r||n)}),t}),T0e=E0e;function M0e(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var G0=M0e,uM=lu,R0e=G0,A0e=_r,j0e=q0,L0e=1/0,dM=uM?uM.prototype:void 0,hM=dM?dM.toString:void 0;function r9(e){if(typeof e=="string")return e;if(A0e(e))return R0e(e,r9)+"";if(j0e(e))return hM?hM.call(e):"";var t=e+"";return t=="0"&&1/e==-L0e?"-0":t}var D0e=r9,N0e=D0e;function P0e(e){return e==null?"":N0e(e)}var O0e=P0e,I0e=_r,$0e=bk,B0e=T0e,F0e=O0e;function z0e(e,t){return I0e(e)?e:$0e(e,t)?[e]:B0e(F0e(e))}var pu=z0e,H0e=q0,W0e=1/0;function U0e(e){if(typeof e=="string"||H0e(e))return e;var t=e+"";return t=="0"&&1/e==-W0e?"-0":t}var mu=U0e,V0e=pu,q0e=mu;function G0e(e,t){t=V0e(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[q0e(t[n++])];return n&&n==r?e:void 0}var jf=G0e,K0e=jf;function Y0e(e,t,n){var r=e==null?void 0:K0e(e,t);return r===void 0?n:r}var i9=Y0e;const Ds=Tn(i9);var X0e=xk,J0e=pu,Q0e=U0,fM=rs,Z0e=mu;function e1e(e,t,n,r){if(!fM(e))return e;t=J0e(t,e);for(var i=-1,s=t.length,a=s-1,o=e;o!=null&&++i<s;){var l=Z0e(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var h=o[l];c=r?r(h,l,o):void 0,c===void 0&&(c=fM(h)?h:Q0e(t[i+1])?[]:{})}X0e(o,l,c),o=o[l]}return e}var s9=e1e,t1e=s9;function n1e(e,t,n){return e==null?e:t1e(e,t,n)}var r1e=n1e;const gd=Tn(r1e);function K0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Sk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function gu(){}var La=.7,Mc=1/La,sc="\\s*([+-]?\\d+)\\s*",Dh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",i1e=/^#([0-9a-f]{3,8})$/,s1e=new RegExp(`^rgb\\(${sc},${sc},${sc}\\)$`),o1e=new RegExp(`^rgb\\(${qi},${qi},${qi}\\)$`),a1e=new RegExp(`^rgba\\(${sc},${sc},${sc},${Dh}\\)$`),l1e=new RegExp(`^rgba\\(${qi},${qi},${qi},${Dh}\\)$`),c1e=new RegExp(`^hsl\\(${Dh},${qi},${qi}\\)$`),u1e=new RegExp(`^hsla\\(${Dh},${qi},${qi},${Dh}\\)$`),pM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};K0(gu,Ns,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mM,formatHex:mM,formatHex8:d1e,formatHsl:h1e,formatRgb:gM,toString:gM});function mM(){return this.rgb().formatHex()}function d1e(){return this.rgb().formatHex8()}function h1e(){return a9(this).formatHsl()}function gM(){return this.rgb().formatRgb()}function Ns(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=i1e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vM(t):n===3?new Vn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Rp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Rp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=s1e.exec(e))?new Vn(t[1],t[2],t[3],1):(t=o1e.exec(e))?new Vn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=a1e.exec(e))?Rp(t[1],t[2],t[3],t[4]):(t=l1e.exec(e))?Rp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=c1e.exec(e))?_M(t[1],t[2]/100,t[3]/100,1):(t=u1e.exec(e))?_M(t[1],t[2]/100,t[3]/100,t[4]):pM.hasOwnProperty(e)?vM(pM[e]):e==="transparent"?new Vn(NaN,NaN,NaN,0):null}function vM(e){return new Vn(e>>16&255,e>>8&255,e&255,1)}function Rp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vn(e,t,n,r)}function o9(e){return e instanceof gu||(e=Ns(e)),e?(e=e.rgb(),new Vn(e.r,e.g,e.b,e.opacity)):new Vn}function Rc(e,t,n,r){return arguments.length===1?o9(e):new Vn(e,t,n,r??1)}function Vn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}K0(Vn,Rc,Sk(gu,{brighter(e){return e=e==null?Mc:Math.pow(Mc,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?La:Math.pow(La,e),new Vn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vn(ga(this.r),ga(this.g),ga(this.b),Wg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yM,formatHex:yM,formatHex8:f1e,formatRgb:xM,toString:xM}));function yM(){return`#${ca(this.r)}${ca(this.g)}${ca(this.b)}`}function f1e(){return`#${ca(this.r)}${ca(this.g)}${ca(this.b)}${ca((isNaN(this.opacity)?1:this.opacity)*255)}`}function xM(){const e=Wg(this.opacity);return`${e===1?"rgb(":"rgba("}${ga(this.r)}, ${ga(this.g)}, ${ga(this.b)}${e===1?")":`, ${e})`}`}function Wg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ga(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ca(e){return e=ga(e),(e<16?"0":"")+e.toString(16)}function _M(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hi(e,t,n,r)}function a9(e){if(e instanceof hi)return new hi(e.h,e.s,e.l,e.opacity);if(e instanceof gu||(e=Ns(e)),!e)return new hi;if(e instanceof hi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new hi(a,o,l,e.opacity)}function p1e(e,t,n,r){return arguments.length===1?a9(e):new hi(e,t,n,r??1)}function hi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}K0(hi,p1e,Sk(gu,{brighter(e){return e=e==null?Mc:Math.pow(Mc,e),new hi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?La:Math.pow(La,e),new hi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Vn(_x(e>=240?e-240:e+120,i,r),_x(e,i,r),_x(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new hi(bM(this.h),Ap(this.s),Ap(this.l),Wg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wg(this.opacity);return`${e===1?"hsl(":"hsla("}${bM(this.h)}, ${Ap(this.s)*100}%, ${Ap(this.l)*100}%${e===1?")":`, ${e})`}`}}));function bM(e){return e=(e||0)%360,e<0?e+360:e}function Ap(e){return Math.max(0,Math.min(1,e||0))}function _x(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const m1e=Math.PI/180,g1e=180/Math.PI;var l9=-.14861,Ck=1.78277,kk=-.29227,Y0=-.90649,Nh=1.97294,wM=Nh*Y0,SM=Nh*Ck,CM=Ck*kk-Y0*l9;function v1e(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);e instanceof Vn||(e=o9(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(CM*r+wM*t-SM*n)/(CM+wM-SM),s=r-i,a=(Nh*(n-i)-kk*s)/Y0,o=Math.sqrt(a*a+s*s)/(Nh*i*(1-i)),l=o?Math.atan2(a,s)*g1e-120:NaN;return new va(l<0?l+360:l,o,i,e.opacity)}function Qi(e,t,n,r){return arguments.length===1?v1e(e):new va(e,t,n,r??1)}function va(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}K0(va,Qi,Sk(gu,{brighter(e){return e=e==null?Mc:Math.pow(Mc,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?La:Math.pow(La,e),new va(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*m1e,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Vn(255*(t+n*(l9*r+Ck*i)),255*(t+n*(kk*r+Y0*i)),255*(t+n*(Nh*r)),this.opacity)}}));function y1e(e,t,n,r,i){var s=e*e,a=s*e;return((1-3*e+3*s-a)*t+(4-6*s+3*a)*n+(1+3*e+3*s-3*a)*r+a*i)/6}function x1e(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],s=e[r+1],a=r>0?e[r-1]:2*i-s,o=r<t-1?e[r+2]:2*s-i;return y1e((n-r/t)*t,a,i,s,o)}}const X0=e=>()=>e;function c9(e,t){return function(n){return e+n*t}}function _1e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function b1e(e,t){var n=t-e;return n?c9(e,n>180||n<-180?n-360*Math.round(n/360):n):X0(isNaN(e)?t:e)}function w1e(e){return(e=+e)==1?oc:function(t,n){return n-t?_1e(t,n,e):X0(isNaN(t)?n:t)}}function oc(e,t){var n=t-e;return n?c9(e,n):X0(isNaN(e)?t:e)}const Ug=function e(t){var n=w1e(t);function r(i,s){var a=n((i=Rc(i)).r,(s=Rc(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=oc(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=l(h),i.opacity=c(h),i+""}}return r.gamma=e,r}(1);function S1e(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),s=new Array(n),a,o;for(a=0;a<n;++a)o=Rc(t[a]),r[a]=o.r||0,i[a]=o.g||0,s[a]=o.b||0;return r=e(r),i=e(i),s=e(s),o.opacity=1,function(l){return o.r=r(l),o.g=i(l),o.b=s(l),o+""}}}var C1e=S1e(x1e);function k1e(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function E1e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function T1e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=J0(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function M1e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function di(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function R1e(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=J0(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var nw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bx=new RegExp(nw.source,"g");function A1e(e){return function(){return e}}function j1e(e){return function(t){return e(t)+""}}function Ek(e,t){var n=nw.lastIndex=bx.lastIndex=0,r,i,s,a=-1,o=[],l=[];for(e=e+"",t=t+"";(r=nw.exec(e))&&(i=bx.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:di(r,i)})),n=bx.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?l[0]?j1e(l[0].x):A1e(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)o[(d=l[h]).i]=d.x(c);return o.join("")})}function J0(e,t){var n=typeof t,r;return t==null||n==="boolean"?X0(t):(n==="number"?di:n==="string"?(r=Ns(t))?(t=r,Ug):Ek:t instanceof Ns?Ug:t instanceof Date?M1e:E1e(t)?k1e:Array.isArray(t)?T1e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?R1e:di)(e,t)}function u9(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var kM=180/Math.PI,rw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function d9(e,t,n,r,i,s){var a,o,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,l/=o),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*kM,skewX:Math.atan(l)*kM,scaleX:a,scaleY:o}}var jp;function L1e(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rw:d9(t.a,t.b,t.c,t.d,t.e,t.f)}function D1e(e){return e==null||(jp||(jp=document.createElementNS("http://www.w3.org/2000/svg","g")),jp.setAttribute("transform",e),!(e=jp.transform.baseVal.consolidate()))?rw:(e=e.matrix,d9(e.a,e.b,e.c,e.d,e.e,e.f))}function h9(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,h,d,f,g,_){if(c!==d||h!==f){var y=g.push("translate(",null,t,null,n);_.push({i:y-4,x:di(c,d)},{i:y-2,x:di(h,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function a(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:di(c,h)})):h&&d.push(i(d)+"rotate("+h+r)}function o(c,h,d,f){c!==h?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:di(c,h)}):h&&d.push(i(d)+"skewX("+h+r)}function l(c,h,d,f,g,_){if(c!==d||h!==f){var y=g.push(i(g)+"scale(",null,",",null,")");_.push({i:y-4,x:di(c,d)},{i:y-2,x:di(h,f)})}else(d!==1||f!==1)&&g.push(i(g)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),o(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(g){for(var _=-1,y=f.length,v;++_<y;)d[(v=f[_]).i]=v.x(g);return d.join("")}}}var N1e=h9(L1e,"px, ","px)","deg)"),P1e=h9(D1e,", ",")",")"),O1e=1e-12;function EM(e){return((e=Math.exp(e))+1/e)/2}function I1e(e){return((e=Math.exp(e))-1/e)/2}function $1e(e){return((e=Math.exp(2*e))-1)/(e+1)}const B1e=function e(t,n,r){function i(s,a){var o=s[0],l=s[1],c=s[2],h=a[0],d=a[1],f=a[2],g=h-o,_=d-l,y=g*g+_*_,v,m;if(y<O1e)m=Math.log(f/c)/t,v=function(E){return[o+E*g,l+E*_,c*Math.exp(t*E*m)]};else{var p=Math.sqrt(y),x=(f*f-c*c+r*y)/(2*c*n*p),b=(f*f-c*c-r*y)/(2*f*n*p),S=Math.log(Math.sqrt(x*x+1)-x),C=Math.log(Math.sqrt(b*b+1)-b);m=(C-S)/t,v=function(E){var k=E*m,T=EM(S),R=c/(n*p)*(T*$1e(t*k+S)-I1e(S));return[o+R*g,l+R*_,c*T/EM(t*k+S)]}}return v.duration=m*1e3*t/Math.SQRT2,v}return i.rho=function(s){var a=Math.max(.001,+s),o=a*a,l=o*o;return e(a,o,l)},i}(Math.SQRT2,2,4);function f9(e){return function t(n){n=+n;function r(i,s){var a=e((i=Qi(i)).h,(s=Qi(s)).h),o=oc(i.s,s.s),l=oc(i.l,s.l),c=oc(i.opacity,s.opacity);return function(h){return i.h=a(h),i.s=o(h),i.l=l(Math.pow(h,n)),i.opacity=c(h),i+""}}return r.gamma=t,r}(1)}f9(b1e);var Tk=f9(oc),F1e=qo,z1e=_r,H1e=ki,W1e="[object String]";function U1e(e){return typeof e=="string"||!z1e(e)&&H1e(e)&&F1e(e)==W1e}var V1e=U1e;const q1e=Tn(V1e);function G1e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var p9=G1e;const Re=Tn(p9);function ac(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function K1e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Lf(e){let t,n,r;e.length!==2?(t=ac,n=(o,l)=>ac(e(o),l),r=(o,l)=>e(o)-l):(t=e===ac||e===K1e?e:Y1e,n=e,r=e);function i(o,l,c=0,h=o.length){if(c<h){if(t(l,l)!==0)return h;do{const d=c+h>>>1;n(o[d],l)<0?c=d+1:h=d}while(c<h)}return c}function s(o,l,c=0,h=o.length){if(c<h){if(t(l,l)!==0)return h;do{const d=c+h>>>1;n(o[d],l)<=0?c=d+1:h=d}while(c<h)}return c}function a(o,l,c=0,h=o.length){const d=i(o,l,c,h-1);return d>c&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function Y1e(){return 0}function X1e(e){return e===null?NaN:+e}function*J1e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Q1e=Lf(ac),Z1e=Q1e.right;Lf(X1e).center;class TM extends Map{constructor(t,n=nye){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(MM(this,t))}has(t){return super.has(MM(this,t))}set(t,n){return super.set(eye(this,t),n)}delete(t){return super.delete(tye(this,t))}}function MM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function eye({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function tye({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function nye(e){return e!==null&&typeof e=="object"?e.valueOf():e}function rye(e=ac){if(e===ac)return m9;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function m9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const iye=Math.sqrt(50),sye=Math.sqrt(10),oye=Math.sqrt(2);function Vg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=iye?10:s>=sye?5:s>=oye?2:1;let o,l,c;return i<0?(c=Math.pow(10,-i)/a,o=Math.round(e*c),l=Math.round(t*c),o/c<e&&++o,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*c<e&&++o,l*c>t&&--l),l<o&&.5<=n&&n<2?Vg(e,t,n*2):[o,l,c]}function iw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?Vg(t,e,n):Vg(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c<o;++c)l[c]=(s-c)/-a;else for(let c=0;c<o;++c)l[c]=(s-c)*a;else if(a<0)for(let c=0;c<o;++c)l[c]=(i+c)/-a;else for(let c=0;c<o;++c)l[c]=(i+c)*a;return l}function sw(e,t,n){return t=+t,e=+e,n=+n,Vg(e,t,n)[2]}function ow(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?sw(t,e,n):sw(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Qs(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function RM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function g9(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?m9:rye(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,h=Math.log(l),d=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*d*(l-d)/l)*(c-l/2<0?-1:1),g=Math.max(n,Math.floor(t-c*d/l+f)),_=Math.min(r,Math.floor(t+(l-c)*d/l+f));g9(e,t,g,_,i)}const s=e[t];let a=n,o=r;for(Uu(e,n,t),i(e[r],s)>0&&Uu(e,n,r);a<o;){for(Uu(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Uu(e,n,o):(++o,Uu(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Uu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function aye(e,t,n){if(e=Float64Array.from(J1e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return RM(e);if(t>=1)return Qs(e);var r,i=(r-1)*t,s=Math.floor(i),a=Qs(g9(e,s).subarray(0,s+1)),o=RM(e.subarray(s+1));return a+(o-a)*(i-s)}}function Mk(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function el(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function lye(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const AM=Symbol("implicit");function ua(){var e=new TM,t=[],n=[],r=AM;function i(s){let a=e.get(s);if(a===void 0){if(r!==AM)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new TM;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return ua(t,n).unknown(r)},el.apply(i,arguments),i}function Q0(){var e=ua().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,l=0,c=0,h=.5;delete e.unknown;function d(){var f=t().length,g=i<r,_=g?i:r,y=g?r:i;s=(y-_)/Math.max(1,f-l+c*2),o&&(s=Math.floor(s)),_+=(y-_-s*(f-l))*h,a=s*(1-l),o&&(_=Math.round(_),a=Math.round(a));var v=Mk(f).map(function(m){return _+s*m});return n(g?v.reverse():v)}return e.domain=function(f){return arguments.length?(t(f),d()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,o=!0,d()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(f){return arguments.length?(o=!!f,d()):o},e.padding=function(f){return arguments.length?(l=Math.min(1,c=+f),d()):l},e.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),d()):l},e.paddingOuter=function(f){return arguments.length?(c=+f,d()):c},e.align=function(f){return arguments.length?(h=Math.max(0,Math.min(1,f)),d()):h},e.copy=function(){return Q0(t(),[r,i]).round(o).paddingInner(l).paddingOuter(c).align(h)},el.apply(d(),arguments)}function v9(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return v9(t())},e}function cye(){return v9(Q0.apply(null,arguments).paddingInner(1))}function uye(e){return function(){return e}}function dye(e){return+e}var jM=[0,1];function lo(e){return e}function aw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:uye(isNaN(t)?NaN:.5)}function hye(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function fye(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=aw(i,r),s=n(a,s)):(r=aw(r,i),s=n(s,a)),function(o){return s(r(o))}}function pye(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=aw(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var l=Z1e(e,o,1,r)-1;return s[l](i[l](o))}}function Z0(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rk(){var e=jM,t=jM,n=J0,r,i,s,a=lo,o,l,c;function h(){var f=Math.min(e.length,t.length);return a!==lo&&(a=hye(e[0],e[f-1])),o=f>2?pye:fye,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?s:(l||(l=o(e.map(r),t,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=o(t,e.map(r),di)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,dye),h()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),h()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),n=u9,h()},d.clamp=function(f){return arguments.length?(a=f?!0:lo,h()):a!==lo},d.interpolate=function(f){return arguments.length?(n=f,h()):n},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,g){return r=f,i=g,h()}}function y9(){return Rk()(lo,lo)}function mye(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function qg(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ac(e){return e=qg(Math.abs(e)),e?e[1]:NaN}function gye(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(n.substring(i-=o,i+o)),!((l+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function vye(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var yye=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ph(e){if(!(t=yye.exec(e)))throw new Error("invalid format: "+e);var t;return new Ak({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ph.prototype=Ak.prototype;function Ak(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ak.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function xye(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var x9;function _ye(e,t){var n=qg(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(x9=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+qg(e,Math.max(0,t+s-1))[0]}function LM(e,t){var n=qg(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const DM={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:mye,e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return LM(e*100,t)},r:LM,s:_ye,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function NM(e){return e}var PM=Array.prototype.map,OM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function bye(e){var t=e.grouping===void 0||e.thousands===void 0?NM:gye(PM.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?NM:vye(PM.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"-":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d){d=Ph(d);var f=d.fill,g=d.align,_=d.sign,y=d.symbol,v=d.zero,m=d.width,p=d.comma,x=d.precision,b=d.trim,S=d.type;S==="n"?(p=!0,S="g"):DM[S]||(x===void 0&&(x=12),b=!0,S="g"),(v||f==="0"&&g==="=")&&(v=!0,f="0",g="=");var C=y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=y==="$"?r:/[%p]/.test(S)?a:"",k=DM[S],T=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(M){var L=C,D=E,N,P,I;if(S==="c")D=k(M)+D,M="";else{M=+M;var z=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),x),b&&(M=xye(M)),z&&+M==0&&_!=="+"&&(z=!1),L=(z?_==="("?_:o:_==="-"||_==="("?"":_)+L,D=(S==="s"?OM[8+x9/3]:"")+D+(z&&_==="("?")":""),T){for(N=-1,P=M.length;++N<P;)if(I=M.charCodeAt(N),48>I||I>57){D=(I===46?i+M.slice(N+1):M.slice(N))+D,M=M.slice(0,N);break}}}p&&!v&&(M=t(M,1/0));var O=L.length+M.length+D.length,j=O<m?new Array(m-O+1).join(f):"";switch(p&&v&&(M=t(j+M,j.length?m-D.length:1/0),j=""),g){case"<":M=L+M+D+j;break;case"=":M=L+j+M+D;break;case"^":M=j.slice(0,O=j.length>>1)+L+M+D+j.slice(O);break;default:M=j+L+M+D;break}return s(M)}return R.toString=function(){return d+""},R}function h(d,f){var g=c((d=Ph(d),d.type="f",d)),_=Math.max(-8,Math.min(8,Math.floor(Ac(f)/3)))*3,y=Math.pow(10,-_),v=OM[8+_/3];return function(m){return g(y*m)+v}}return{format:c,formatPrefix:h}}var Lp,Df,_9;wye({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function wye(e){return Lp=bye(e),Df=Lp.format,_9=Lp.formatPrefix,Lp}function Sye(e){return Math.max(0,-Ac(Math.abs(e)))}function Cye(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ac(t)/3)))*3-Ac(Math.abs(e)))}function kye(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ac(t)-Ac(e))+1}function Eye(e,t,n,r){var i=ow(e,t,n),s;switch(r=Ph(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Cye(i,a))&&(r.precision=s),_9(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=kye(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Sye(i))&&(r.precision=s-(r.type==="%")*2);break}}return Df(r)}function jk(e){var t=e.domain;return e.ticks=function(n){var r=t();return iw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Eye(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],l,c,h=10;for(o<a&&(c=a,a=o,o=c,c=i,i=s,s=c);h-- >0;){if(c=sw(a,o,n),c===l)return r[i]=a,r[s]=o,t(r);if(c>0)a=Math.floor(a/c)*c,o=Math.ceil(o/c)*c;else if(c<0)a=Math.ceil(a*c)/c,o=Math.floor(o*c)/c;else break;l=c}return e},e}function co(){var e=y9();return e.copy=function(){return Z0(e,co())},el.apply(e,arguments),jk(e)}function b9(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function IM(e){return Math.log(e)}function $M(e){return Math.exp(e)}function Tye(e){return-Math.log(-e)}function Mye(e){return-Math.exp(-e)}function Rye(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Aye(e){return e===10?Rye:e===Math.E?Math.exp:t=>Math.pow(e,t)}function jye(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function BM(e){return(t,n)=>-e(-t,n)}function Lye(e){const t=e(IM,$M),n=t.domain;let r=10,i,s;function a(){return i=jye(r),s=Aye(r),n()[0]<0?(i=BM(i),s=BM(s),e(Tye,Mye)):e(IM,$M),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const l=n();let c=l[0],h=l[l.length-1];const d=h<c;d&&([c,h]=[h,c]);let f=i(c),g=i(h),_,y;const v=o==null?10:+o;let m=[];if(!(r%1)&&g-f<v){if(f=Math.floor(f),g=Math.ceil(g),c>0){for(;f<=g;++f)for(_=1;_<r;++_)if(y=f<0?_/s(-f):_*s(f),!(y<c)){if(y>h)break;m.push(y)}}else for(;f<=g;++f)for(_=r-1;_>=1;--_)if(y=f>0?_/s(-f):_*s(f),!(y<c)){if(y>h)break;m.push(y)}m.length*2<v&&(m=iw(c,h,v))}else m=iw(f,g,Math.min(g-f,v)).map(s);return d?m.reverse():m},t.tickFormat=(o,l)=>{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ph(l)).precision==null&&(l.trim=!0),l=Df(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return h=>{let d=h/s(Math.round(i(h)));return d*r<r-.5&&(d*=r),d<=c?l(h):""}},t.nice=()=>n(b9(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function w9(){const e=Lye(Rk()).domain([1,10]);return e.copy=()=>Z0(e,w9()).base(e.base()),el.apply(e,arguments),e}function FM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Dye(e){var t=1,n=e(FM(t),zM(t));return n.constant=function(r){return arguments.length?e(FM(t=+r),zM(t)):t},jk(n)}function S9(){var e=Dye(Rk());return e.copy=function(){return Z0(e,S9()).constant(e.constant())},el.apply(e,arguments)}const wx=new Date,Sx=new Date;function bn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const l=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=s=>bn(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(wx.setTime(+s),Sx.setTime(+a),e(wx),e(Sx),Math.floor(n(wx,Sx))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Gg=bn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Gg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?bn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Gg);Gg.range;const xs=1e3,Vr=xs*60,_s=Vr*60,Ps=_s*24,Lk=Ps*7,HM=Ps*30,Cx=Ps*365,da=bn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*xs)},(e,t)=>(t-e)/xs,e=>e.getUTCSeconds());da.range;const Dk=bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xs)},(e,t)=>{e.setTime(+e+t*Vr)},(e,t)=>(t-e)/Vr,e=>e.getMinutes());Dk.range;const Nk=bn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Vr)},(e,t)=>(t-e)/Vr,e=>e.getUTCMinutes());Nk.range;const Pk=bn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xs-e.getMinutes()*Vr)},(e,t)=>{e.setTime(+e+t*_s)},(e,t)=>(t-e)/_s,e=>e.getHours());Pk.range;const Ok=bn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*_s)},(e,t)=>(t-e)/_s,e=>e.getUTCHours());Ok.range;const Ik=bn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Vr)/Ps,e=>e.getDate()-1);Ik.range;const C9=bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ps,e=>e.getUTCDate()-1);C9.range;const k9=bn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ps,e=>Math.floor(e/Ps));k9.range;function tl(e){return bn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Vr)/Lk)}const $k=tl(0),Nye=tl(1),Pye=tl(2),Oye=tl(3),Iye=tl(4),$ye=tl(5),Bye=tl(6);$k.range;Nye.range;Pye.range;Oye.range;Iye.range;$ye.range;Bye.range;function nl(e){return bn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Lk)}const Bk=nl(0),Fye=nl(1),zye=nl(2),Hye=nl(3),Wye=nl(4),Uye=nl(5),Vye=nl(6);Bk.range;Fye.range;zye.range;Hye.range;Wye.range;Uye.range;Vye.range;const Fk=bn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Fk.range;const zk=bn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());zk.range;const e1=bn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());e1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:bn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});e1.range;const t1=bn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());t1.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:bn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});t1.range;function E9(e,t,n,r,i,s){const a=[[da,1,xs],[da,5,5*xs],[da,15,15*xs],[da,30,30*xs],[s,1,Vr],[s,5,5*Vr],[s,15,15*Vr],[s,30,30*Vr],[i,1,_s],[i,3,3*_s],[i,6,6*_s],[i,12,12*_s],[r,1,Ps],[r,2,2*Ps],[n,1,Lk],[t,1,HM],[t,3,3*HM],[e,1,Cx]];function o(c,h,d){const f=h<c;f&&([c,h]=[h,c]);const g=d&&typeof d.range=="function"?d:l(c,h,d),_=g?g.range(c,+h+1):[];return f?_.reverse():_}function l(c,h,d){const f=Math.abs(h-c)/d,g=Lf(([,,v])=>v).right(a,f);if(g===a.length)return e.every(ow(c/Cx,h/Cx,d));if(g===0)return Gg.every(Math.max(ow(c,h,d),1));const[_,y]=a[f/a[g-1][2]<a[g][2]/f?g-1:g];return _.every(y)}return[o,l]}const[qye,Gye]=E9(t1,zk,Bk,k9,Ok,Nk),[Kye,Yye]=E9(e1,Fk,$k,Ik,Pk,Dk);var kx=new Date,Ex=new Date;function hn(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=function(s){return e(s=new Date(+s)),s},i.ceil=function(s){return e(s=new Date(s-1)),t(s,1),e(s),s},i.round=function(s){var a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=function(s,a){return t(s=new Date(+s),a==null?1:Math.floor(a)),s},i.range=function(s,a,o){var l=[],c;if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c<s&&s<a);return l},i.filter=function(s){return hn(function(a){if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},function(a,o){if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););})},n&&(i.count=function(s,a){return kx.setTime(+s),Ex.setTime(+a),e(kx),e(Ex),Math.floor(n(kx,Ex))},i.every=function(s){return s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?function(a){return r(a)%s===0}:function(a){return i.count(0,a)%s===0}):i}),i}var Oh=hn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});Oh.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?hn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):Oh};Oh.range;var Kg=1e3,Da=6e4,Yg=36e5,T9=864e5,M9=6048e5,lw=hn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*Kg)},function(e,t){return(t-e)/Kg},function(e){return e.getUTCSeconds()});lw.range;var R9=hn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Kg)},function(e,t){e.setTime(+e+t*Da)},function(e,t){return(t-e)/Da},function(e){return e.getMinutes()});R9.range;var A9=hn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Kg-e.getMinutes()*Da)},function(e,t){e.setTime(+e+t*Yg)},function(e,t){return(t-e)/Yg},function(e){return e.getHours()});A9.range;var Hk=hn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Da)/T9},function(e){return e.getDate()-1});Hk.range;function rl(e){return hn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Da)/M9})}var Xg=rl(0),Ih=rl(1),j9=rl(2),L9=rl(3),Na=rl(4),D9=rl(5),N9=rl(6);Xg.range;Ih.range;j9.range;L9.range;Na.range;D9.range;N9.range;var P9=hn(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});P9.range;var Lo=hn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Lo.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:hn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};Lo.range;var O9=hn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*Da)},function(e,t){return(t-e)/Da},function(e){return e.getUTCMinutes()});O9.range;var I9=hn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Yg)},function(e,t){return(t-e)/Yg},function(e){return e.getUTCHours()});I9.range;var Wk=hn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/T9},function(e){return e.getUTCDate()-1});Wk.range;function il(e){return hn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/M9})}var Jg=il(0),$h=il(1),$9=il(2),B9=il(3),Pa=il(4),F9=il(5),z9=il(6);Jg.range;$h.range;$9.range;B9.range;Pa.range;F9.range;z9.range;var H9=hn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});H9.range;var Do=hn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});Do.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:hn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};Do.range;function Tx(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Mx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Vu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Xye(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,l=e.shortMonths,c=qu(i),h=Gu(i),d=qu(s),f=Gu(s),g=qu(a),_=Gu(a),y=qu(o),v=Gu(o),m=qu(l),p=Gu(l),x={a:z,A:O,b:j,B:A,c:null,d:KM,e:KM,f:xxe,g:Rxe,G:jxe,H:gxe,I:vxe,j:yxe,L:W9,m:_xe,M:bxe,p:F,q:H,Q:JM,s:QM,S:wxe,u:Sxe,U:Cxe,V:kxe,w:Exe,W:Txe,x:null,X:null,y:Mxe,Y:Axe,Z:Lxe,"%":XM},b={a:B,A:G,b:Q,B:Y,c:null,d:YM,e:YM,f:Oxe,g:qxe,G:Kxe,H:Dxe,I:Nxe,j:Pxe,L:V9,m:Ixe,M:$xe,p:W,q:$,Q:JM,s:QM,S:Bxe,u:Fxe,U:zxe,V:Hxe,w:Wxe,W:Uxe,x:null,X:null,y:Vxe,Y:Gxe,Z:Yxe,"%":XM},S={a:R,A:M,b:L,B:D,c:N,d:qM,e:qM,f:hxe,g:VM,G:UM,H:GM,I:GM,j:lxe,L:dxe,m:axe,M:cxe,p:T,q:oxe,Q:pxe,s:mxe,S:uxe,u:txe,U:nxe,V:rxe,w:exe,W:ixe,x:P,X:I,y:VM,Y:UM,Z:sxe,"%":fxe};x.x=C(n,x),x.X=C(r,x),x.c=C(t,x),b.x=C(n,b),b.X=C(r,b),b.c=C(t,b);function C(V,U){return function(X){var q=[],re=-1,ne=0,le=V.length,ve,ae,Ee;for(X instanceof Date||(X=new Date(+X));++re<le;)V.charCodeAt(re)===37&&(q.push(V.slice(ne,re)),(ae=WM[ve=V.charAt(++re)])!=null?ve=V.charAt(++re):ae=ve==="e"?" ":"0",(Ee=U[ve])&&(ve=Ee(X,ae)),q.push(ve),ne=re+1);return q.push(V.slice(ne,re)),q.join("")}}function E(V,U){return function(X){var q=Vu(1900,void 0,1),re=k(q,V,X+="",0),ne,le;if(re!=X.length)return null;if("Q"in q)return new Date(q.Q);if("s"in q)return new Date(q.s*1e3+("L"in q?q.L:0));if(U&&!("Z"in q)&&(q.Z=0),"p"in q&&(q.H=q.H%12+q.p*12),q.m===void 0&&(q.m="q"in q?q.q:0),"V"in q){if(q.V<1||q.V>53)return null;"w"in q||(q.w=1),"Z"in q?(ne=Mx(Vu(q.y,0,1)),le=ne.getUTCDay(),ne=le>4||le===0?$h.ceil(ne):$h(ne),ne=Wk.offset(ne,(q.V-1)*7),q.y=ne.getUTCFullYear(),q.m=ne.getUTCMonth(),q.d=ne.getUTCDate()+(q.w+6)%7):(ne=Tx(Vu(q.y,0,1)),le=ne.getDay(),ne=le>4||le===0?Ih.ceil(ne):Ih(ne),ne=Hk.offset(ne,(q.V-1)*7),q.y=ne.getFullYear(),q.m=ne.getMonth(),q.d=ne.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),le="Z"in q?Mx(Vu(q.y,0,1)).getUTCDay():Tx(Vu(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(le+5)%7:q.w+q.U*7-(le+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,Mx(q)):Tx(q)}}function k(V,U,X,q){for(var re=0,ne=U.length,le=X.length,ve,ae;re<ne;){if(q>=le)return-1;if(ve=U.charCodeAt(re++),ve===37){if(ve=U.charAt(re++),ae=S[ve in WM?U.charAt(re++):ve],!ae||(q=ae(V,X,q))<0)return-1}else if(ve!=X.charCodeAt(q++))return-1}return q}function T(V,U,X){var q=c.exec(U.slice(X));return q?(V.p=h.get(q[0].toLowerCase()),X+q[0].length):-1}function R(V,U,X){var q=g.exec(U.slice(X));return q?(V.w=_.get(q[0].toLowerCase()),X+q[0].length):-1}function M(V,U,X){var q=d.exec(U.slice(X));return q?(V.w=f.get(q[0].toLowerCase()),X+q[0].length):-1}function L(V,U,X){var q=m.exec(U.slice(X));return q?(V.m=p.get(q[0].toLowerCase()),X+q[0].length):-1}function D(V,U,X){var q=y.exec(U.slice(X));return q?(V.m=v.get(q[0].toLowerCase()),X+q[0].length):-1}function N(V,U,X){return k(V,t,U,X)}function P(V,U,X){return k(V,n,U,X)}function I(V,U,X){return k(V,r,U,X)}function z(V){return a[V.getDay()]}function O(V){return s[V.getDay()]}function j(V){return l[V.getMonth()]}function A(V){return o[V.getMonth()]}function F(V){return i[+(V.getHours()>=12)]}function H(V){return 1+~~(V.getMonth()/3)}function B(V){return a[V.getUTCDay()]}function G(V){return s[V.getUTCDay()]}function Q(V){return l[V.getUTCMonth()]}function Y(V){return o[V.getUTCMonth()]}function W(V){return i[+(V.getUTCHours()>=12)]}function $(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var U=C(V+="",x);return U.toString=function(){return V},U},parse:function(V){var U=E(V+="",!1);return U.toString=function(){return V},U},utcFormat:function(V){var U=C(V+="",b);return U.toString=function(){return V},U},utcParse:function(V){var U=E(V+="",!0);return U.toString=function(){return V},U}}}var WM={"-":"",_:" ",0:"0"},Mn=/^\s*\d+/,Jye=/^%/,Qye=/[\\^$*+?|[\]().{}]/g;function ft(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function Zye(e){return e.replace(Qye,"\\$&")}function qu(e){return new RegExp("^(?:"+e.map(Zye).join("|")+")","i")}function Gu(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function exe(e,t,n){var r=Mn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function txe(e,t,n){var r=Mn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function nxe(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function rxe(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function ixe(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function UM(e,t,n){var r=Mn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function VM(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function sxe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function oxe(e,t,n){var r=Mn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function axe(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function qM(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function lxe(e,t,n){var r=Mn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function GM(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function cxe(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function uxe(e,t,n){var r=Mn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function dxe(e,t,n){var r=Mn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function hxe(e,t,n){var r=Mn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fxe(e,t,n){var r=Jye.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function pxe(e,t,n){var r=Mn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function mxe(e,t,n){var r=Mn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function KM(e,t){return ft(e.getDate(),t,2)}function gxe(e,t){return ft(e.getHours(),t,2)}function vxe(e,t){return ft(e.getHours()%12||12,t,2)}function yxe(e,t){return ft(1+Hk.count(Lo(e),e),t,3)}function W9(e,t){return ft(e.getMilliseconds(),t,3)}function xxe(e,t){return W9(e,t)+"000"}function _xe(e,t){return ft(e.getMonth()+1,t,2)}function bxe(e,t){return ft(e.getMinutes(),t,2)}function wxe(e,t){return ft(e.getSeconds(),t,2)}function Sxe(e){var t=e.getDay();return t===0?7:t}function Cxe(e,t){return ft(Xg.count(Lo(e)-1,e),t,2)}function U9(e){var t=e.getDay();return t>=4||t===0?Na(e):Na.ceil(e)}function kxe(e,t){return e=U9(e),ft(Na.count(Lo(e),e)+(Lo(e).getDay()===4),t,2)}function Exe(e){return e.getDay()}function Txe(e,t){return ft(Ih.count(Lo(e)-1,e),t,2)}function Mxe(e,t){return ft(e.getFullYear()%100,t,2)}function Rxe(e,t){return e=U9(e),ft(e.getFullYear()%100,t,2)}function Axe(e,t){return ft(e.getFullYear()%1e4,t,4)}function jxe(e,t){var n=e.getDay();return e=n>=4||n===0?Na(e):Na.ceil(e),ft(e.getFullYear()%1e4,t,4)}function Lxe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ft(t/60|0,"0",2)+ft(t%60,"0",2)}function YM(e,t){return ft(e.getUTCDate(),t,2)}function Dxe(e,t){return ft(e.getUTCHours(),t,2)}function Nxe(e,t){return ft(e.getUTCHours()%12||12,t,2)}function Pxe(e,t){return ft(1+Wk.count(Do(e),e),t,3)}function V9(e,t){return ft(e.getUTCMilliseconds(),t,3)}function Oxe(e,t){return V9(e,t)+"000"}function Ixe(e,t){return ft(e.getUTCMonth()+1,t,2)}function $xe(e,t){return ft(e.getUTCMinutes(),t,2)}function Bxe(e,t){return ft(e.getUTCSeconds(),t,2)}function Fxe(e){var t=e.getUTCDay();return t===0?7:t}function zxe(e,t){return ft(Jg.count(Do(e)-1,e),t,2)}function q9(e){var t=e.getUTCDay();return t>=4||t===0?Pa(e):Pa.ceil(e)}function Hxe(e,t){return e=q9(e),ft(Pa.count(Do(e),e)+(Do(e).getUTCDay()===4),t,2)}function Wxe(e){return e.getUTCDay()}function Uxe(e,t){return ft($h.count(Do(e)-1,e),t,2)}function Vxe(e,t){return ft(e.getUTCFullYear()%100,t,2)}function qxe(e,t){return e=q9(e),ft(e.getUTCFullYear()%100,t,2)}function Gxe(e,t){return ft(e.getUTCFullYear()%1e4,t,4)}function Kxe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Pa(e):Pa.ceil(e),ft(e.getUTCFullYear()%1e4,t,4)}function Yxe(){return"+0000"}function XM(){return"%"}function JM(e){return+e}function QM(e){return Math.floor(+e/1e3)}var Sl,n1,G9,K9,Y9;Xxe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Xxe(e){return Sl=Xye(e),n1=Sl.format,G9=Sl.parse,K9=Sl.utcFormat,Y9=Sl.utcParse,Sl}function Jxe(e){return new Date(e)}function Qxe(e){return e instanceof Date?+e:+new Date(+e)}function Uk(e,t,n,r,i,s,a,o,l,c){var h=y9(),d=h.invert,f=h.domain,g=c(".%L"),_=c(":%S"),y=c("%I:%M"),v=c("%I %p"),m=c("%a %d"),p=c("%b %d"),x=c("%B"),b=c("%Y");function S(C){return(l(C)<C?g:o(C)<C?_:a(C)<C?y:s(C)<C?v:r(C)<C?i(C)<C?m:p:n(C)<C?x:b)(C)}return h.invert=function(C){return new Date(d(C))},h.domain=function(C){return arguments.length?f(Array.from(C,Qxe)):f().map(Jxe)},h.ticks=function(C){var E=f();return e(E[0],E[E.length-1],C??10)},h.tickFormat=function(C,E){return E==null?S:c(E)},h.nice=function(C){var E=f();return(!C||typeof C.range!="function")&&(C=t(E[0],E[E.length-1],C??10)),C?f(b9(E,C)):h},h.copy=function(){return Z0(h,Uk(e,t,n,r,i,s,a,o,l,c))},h}function Vk(){return el.apply(Uk(Kye,Yye,e1,Fk,$k,Ik,Pk,Dk,da,n1).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Zxe(){return el.apply(Uk(qye,Gye,t1,zk,Bk,C9,Ok,Nk,da,K9).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function e_e(){var e=0,t=1,n,r,i,s,a=lo,o=!1,l;function c(d){return d==null||isNaN(d=+d)?l:a(i===0?.5:(d=(s(d)-n)*i,o?Math.max(0,Math.min(1,d)):d))}c.domain=function(d){return arguments.length?([e,t]=d,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(d){return arguments.length?(o=!!d,c):o},c.interpolator=function(d){return arguments.length?(a=d,c):a};function h(d){return function(f){var g,_;return arguments.length?([g,_]=f,a=d(g,_),c):[a(0),a(1)]}}return c.range=h(J0),c.rangeRound=h(u9),c.unknown=function(d){return arguments.length?(l=d,c):l},function(d){return s=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),c}}function t_e(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function X9(){var e=jk(e_e()(lo));return e.copy=function(){return t_e(e,X9())},lye.apply(e,arguments)}function Ye(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}const J9=Ye("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Q9=Ye("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Z9=Ye("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),e$=Ye("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),t$=Ye("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),n$=Ye("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),r$=Ye("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),i$=Ye("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),qk=Ye("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),n_e=Ye("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),Tt=e=>C1e(e[e.length-1]);var r1=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Ye);const r_e=Tt(r1);var i1=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Ye);const i_e=Tt(i1);var s1=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Ye);const s_e=Tt(s1);var o1=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Ye);const o_e=Tt(o1);var a1=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Ye);const a_e=Tt(a1);var l1=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Ye);const l_e=Tt(l1);var c1=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Ye);const c_e=Tt(c1);var u1=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Ye);const s$=Tt(u1);var d1=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Ye);const u_e=Tt(d1);var h1=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Ye);const d_e=Tt(h1);var f1=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Ye);const h_e=Tt(f1);var p1=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Ye);const f_e=Tt(p1);var m1=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Ye);const p_e=Tt(m1);var g1=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Ye);const m_e=Tt(g1);var v1=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Ye);const g_e=Tt(v1);var y1=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Ye);const v_e=Tt(y1);var x1=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Ye);const y_e=Tt(x1);var _1=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Ye);const x_e=Tt(_1);var b1=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Ye);const o$=Tt(b1);var w1=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Ye);const __e=Tt(w1);var S1=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Ye);const a$=Tt(S1);var C1=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Ye);const b_e=Tt(C1);var k1=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Ye);const w_e=Tt(k1);var E1=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Ye);const S_e=Tt(E1);var T1=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Ye);const C_e=Tt(T1);var M1=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Ye);const k_e=Tt(M1);var R1=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Ye);const E_e=Tt(R1);function T_e(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const M_e=Tk(Qi(300,.5,0),Qi(-240,.5,1));var R_e=Tk(Qi(-100,.75,.35),Qi(80,1.5,.8)),l$=Tk(Qi(260,.75,.35),Qi(80,1.5,.8)),Dp=Qi();function A_e(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Dp.h=360*e-100,Dp.s=1.5-1.5*t,Dp.l=.8-.9*t,Dp+""}var Np=Rc(),j_e=Math.PI/3,L_e=Math.PI*2/3;function D_e(e){var t;return e=(.5-e)*Math.PI,Np.r=255*(t=Math.sin(e))*t,Np.g=255*(t=Math.sin(e+j_e))*t,Np.b=255*(t=Math.sin(e+L_e))*t,Np+""}function N_e(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function A1(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const c$=A1(Ye("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var P_e=A1(Ye("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),O_e=A1(Ye("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),I_e=A1(Ye("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),$_e="__lodash_hash_undefined__";function B_e(e){return this.__data__.set(e,$_e),this}var F_e=B_e;function z_e(e){return this.__data__.has(e)}var H_e=z_e,W_e=uk,U_e=F_e,V_e=H_e;function Qg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new W_e;++t<n;)this.add(e[t])}Qg.prototype.add=Qg.prototype.push=U_e;Qg.prototype.has=V_e;var Gk=Qg;function q_e(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var G_e=q_e;function K_e(e){return e!==e}var Y_e=K_e;function X_e(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var J_e=X_e,Q_e=G_e,Z_e=Y_e,ebe=J_e;function tbe(e,t,n){return t===t?ebe(e,t,n):Q_e(e,Z_e,n)}var nbe=tbe,rbe=nbe;function ibe(e,t){var n=e==null?0:e.length;return!!n&&rbe(e,t,0)>-1}var u$=ibe;function sbe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var d$=sbe;function obe(e,t){return e.has(t)}var Kk=obe,abe=Gk,lbe=u$,cbe=d$,ube=G0,dbe=Rf,hbe=Kk,fbe=200;function pbe(e,t,n,r){var i=-1,s=lbe,a=!0,o=e.length,l=[],c=t.length;if(!o)return l;n&&(t=ube(t,dbe(n))),r?(s=cbe,a=!1):t.length>=fbe&&(s=hbe,a=!1,t=new abe(t));e:for(;++i<o;){var h=e[i],d=n==null?h:n(h);if(h=r||h!==0?h:0,a&&d===d){for(var f=c;f--;)if(t[f]===d)continue e;l.push(h)}else s(t,d,r)||l.push(h)}return l}var mbe=pbe,gbe=mbe,vbe=_k,ybe=KI,xbe=vbe(function(e,t){return ybe(e)?gbe(e,t):[]}),_be=xbe;const h$=Tn(_be);function Wt(e){return function(){return e}}const ZM=Math.abs,Fn=Math.atan2,Yo=Math.cos,bbe=Math.max,Rx=Math.min,Ri=Math.sin,zl=Math.sqrt,zn=1e-12,Bh=Math.PI,Zg=Bh/2,gm=2*Bh;function wbe(e){return e>1?0:e<-1?Bh:Math.acos(e)}function eR(e){return e>=1?Zg:e<=-1?-Zg:Math.asin(e)}const cw=Math.PI,uw=2*cw,Zo=1e-6,Sbe=uw-Zo;function f$(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Cbe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return f$;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class kbe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?f$:Cbe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,l=r-t,c=i-n,h=a-t,d=o-n,f=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Zo)if(!(Math.abs(d*l-c*h)>Zo)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-a,_=i-o,y=l*l+c*c,v=g*g+_*_,m=Math.sqrt(y),p=Math.sqrt(f),x=s*Math.tan((cw-Math.acos((y+f-v)/(2*m*p)))/2),b=x/p,S=x/m;Math.abs(b-1)>Zo&&this._append`L${t+b*h},${n+b*d}`,this._append`A${s},${s},0,0,${+(d*g>h*_)},${this._x1=t+S*l},${this._y1=n+S*c}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),l=r*Math.sin(i),c=t+o,h=n+l,d=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Zo||Math.abs(this._y1-h)>Zo)&&this._append`L${c},${h}`,r&&(f<0&&(f=f%uw+uw),f>Sbe?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=h}`:f>Zo&&this._append`A${r},${r},0,${+(f>=cw)},${d},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function p$(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new kbe(t)}function Ebe(e){return e.innerRadius}function Tbe(e){return e.outerRadius}function Mbe(e){return e.startAngle}function Rbe(e){return e.endAngle}function Abe(e){return e&&e.padAngle}function jbe(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,h=a-i,d=o-s,f=d*l-h*c;if(!(f*f<zn))return f=(h*(t-s)-d*(e-i))/f,[e+f*l,t+f*c]}function Pp(e,t,n,r,i,s,a){var o=e-n,l=t-r,c=(a?s:-s)/zl(o*o+l*l),h=c*l,d=-c*o,f=e+h,g=t+d,_=n+h,y=r+d,v=(f+_)/2,m=(g+y)/2,p=_-f,x=y-g,b=p*p+x*x,S=i-s,C=f*y-_*g,E=(x<0?-1:1)*zl(bbe(0,S*S*b-C*C)),k=(C*x-p*E)/b,T=(-C*p-x*E)/b,R=(C*x+p*E)/b,M=(-C*p+x*E)/b,L=k-v,D=T-m,N=R-v,P=M-m;return L*L+D*D>N*N+P*P&&(k=R,T=M),{cx:k,cy:T,x01:-h,y01:-d,x11:k*(i/S-1),y11:T*(i/S-1)}}function Lbe(){var e=Ebe,t=Tbe,n=Wt(0),r=null,i=Mbe,s=Rbe,a=Abe,o=null,l=p$(c);function c(){var h,d,f=+e.apply(this,arguments),g=+t.apply(this,arguments),_=i.apply(this,arguments)-Zg,y=s.apply(this,arguments)-Zg,v=ZM(y-_),m=y>_;if(o||(o=h=l()),g<f&&(d=g,g=f,f=d),!(g>zn))o.moveTo(0,0);else if(v>gm-zn)o.moveTo(g*Yo(_),g*Ri(_)),o.arc(0,0,g,_,y,!m),f>zn&&(o.moveTo(f*Yo(y),f*Ri(y)),o.arc(0,0,f,y,_,m));else{var p=_,x=y,b=_,S=y,C=v,E=v,k=a.apply(this,arguments)/2,T=k>zn&&(r?+r.apply(this,arguments):zl(f*f+g*g)),R=Rx(ZM(g-f)/2,+n.apply(this,arguments)),M=R,L=R,D,N;if(T>zn){var P=eR(T/f*Ri(k)),I=eR(T/g*Ri(k));(C-=P*2)>zn?(P*=m?1:-1,b+=P,S-=P):(C=0,b=S=(_+y)/2),(E-=I*2)>zn?(I*=m?1:-1,p+=I,x-=I):(E=0,p=x=(_+y)/2)}var z=g*Yo(p),O=g*Ri(p),j=f*Yo(S),A=f*Ri(S);if(R>zn){var F=g*Yo(x),H=g*Ri(x),B=f*Yo(b),G=f*Ri(b),Q;if(v<Bh)if(Q=jbe(z,O,B,G,F,H,j,A)){var Y=z-Q[0],W=O-Q[1],$=F-Q[0],V=H-Q[1],U=1/Ri(wbe((Y*$+W*V)/(zl(Y*Y+W*W)*zl($*$+V*V)))/2),X=zl(Q[0]*Q[0]+Q[1]*Q[1]);M=Rx(R,(f-X)/(U-1)),L=Rx(R,(g-X)/(U+1))}else M=L=0}E>zn?L>zn?(D=Pp(B,G,z,O,g,L,m),N=Pp(F,H,j,A,g,L,m),o.moveTo(D.cx+D.x01,D.cy+D.y01),L<R?o.arc(D.cx,D.cy,L,Fn(D.y01,D.x01),Fn(N.y01,N.x01),!m):(o.arc(D.cx,D.cy,L,Fn(D.y01,D.x01),Fn(D.y11,D.x11),!m),o.arc(0,0,g,Fn(D.cy+D.y11,D.cx+D.x11),Fn(N.cy+N.y11,N.cx+N.x11),!m),o.arc(N.cx,N.cy,L,Fn(N.y11,N.x11),Fn(N.y01,N.x01),!m))):(o.moveTo(z,O),o.arc(0,0,g,p,x,!m)):o.moveTo(z,O),!(f>zn)||!(C>zn)?o.lineTo(j,A):M>zn?(D=Pp(j,A,F,H,f,-M,m),N=Pp(z,O,B,G,f,-M,m),o.lineTo(D.cx+D.x01,D.cy+D.y01),M<R?o.arc(D.cx,D.cy,M,Fn(D.y01,D.x01),Fn(N.y01,N.x01),!m):(o.arc(D.cx,D.cy,M,Fn(D.y01,D.x01),Fn(D.y11,D.x11),!m),o.arc(0,0,f,Fn(D.cy+D.y11,D.cx+D.x11),Fn(N.cy+N.y11,N.cx+N.x11),m),o.arc(N.cx,N.cy,M,Fn(N.y11,N.x11),Fn(N.y01,N.x01),!m))):o.arc(0,0,f,S,b,m)}if(o.closePath(),h)return o=null,h+""||null}return c.centroid=function(){var h=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-Bh/2;return[Yo(d)*h,Ri(d)*h]},c.innerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Wt(+h),c):e},c.outerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Wt(+h),c):t},c.cornerRadius=function(h){return arguments.length?(n=typeof h=="function"?h:Wt(+h),c):n},c.padRadius=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Wt(+h),c):r},c.startAngle=function(h){return arguments.length?(i=typeof h=="function"?h:Wt(+h),c):i},c.endAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Wt(+h),c):s},c.padAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Wt(+h),c):a},c.context=function(h){return arguments.length?(o=h??null,c):o},c}function Yk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function m$(e){this._context=e}m$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function g$(e){return new m$(e)}function Dbe(e){return e[0]}function Nbe(e){return e[1]}function v$(e,t){var n=Wt(!0),r=null,i=g$,s=null,a=p$(o);e=typeof e=="function"?e:e===void 0?Dbe:Wt(e),t=typeof t=="function"?t:t===void 0?Nbe:Wt(t);function o(l){var c,h=(l=Yk(l)).length,d,f=!1,g;for(r==null&&(s=i(g=a())),c=0;c<=h;++c)!(c<h&&n(d=l[c],c,l))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+e(d,c,l),+t(d,c,l));if(g)return s=null,g+""||null}return o.x=function(l){return arguments.length?(e=typeof l=="function"?l:Wt(+l),o):e},o.y=function(l){return arguments.length?(t=typeof l=="function"?l:Wt(+l),o):t},o.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Wt(!!l),o):n},o.curve=function(l){return arguments.length?(i=l,r!=null&&(s=i(r)),o):i},o.context=function(l){return arguments.length?(l==null?r=s=null:s=i(r=l),o):r},o}function Pbe(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Obe(e){return e}function Ibe(){var e=Obe,t=Pbe,n=null,r=Wt(0),i=Wt(gm),s=Wt(0);function a(o){var l,c=(o=Yk(o)).length,h,d,f=0,g=new Array(c),_=new Array(c),y=+r.apply(this,arguments),v=Math.min(gm,Math.max(-gm,i.apply(this,arguments)-y)),m,p=Math.min(Math.abs(v)/c,s.apply(this,arguments)),x=p*(v<0?-1:1),b;for(l=0;l<c;++l)(b=_[g[l]=l]=+e(o[l],l,o))>0&&(f+=b);for(t!=null?g.sort(function(S,C){return t(_[S],_[C])}):n!=null&&g.sort(function(S,C){return n(o[S],o[C])}),l=0,d=f?(v-c*x)/f:0;l<c;++l,y=m)h=g[l],b=_[h],m=y+(b>0?b*d:0)+x,_[h]={data:o[h],index:l,value:b,startAngle:y,endAngle:m,padAngle:p};return _}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:Wt(+o),a):e},a.sortValues=function(o){return arguments.length?(t=o,n=null,a):t},a.sort=function(o){return arguments.length?(n=o,t=null,a):n},a.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:Wt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Wt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Wt(+o),a):s},a}function No(){}function ev(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function j1(e){this._context=e}j1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ev(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ev(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $be(e){return new j1(e)}function y$(e){this._context=e}y$.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ev(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bbe(e){return new y$(e)}function x$(e){this._context=e}x$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:ev(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fbe(e){return new x$(e)}function _$(e,t){this._basis=new j1(e),this._beta=t}_$.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],s=e[n]-r,a=t[n]-i,o=-1,l;++o<=n;)l=o/n,this._basis.point(this._beta*e[o]+(1-this._beta)*(r+l*s),this._beta*t[o]+(1-this._beta)*(i+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const zbe=function e(t){function n(r){return t===1?new j1(r):new _$(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function tv(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Xk(e,t){this._context=e,this._k=(1-t)/6}Xk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:tv(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:tv(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Hbe=function e(t){function n(r){return new Xk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Jk(e,t){this._context=e,this._k=(1-t)/6}Jk.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:tv(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Wbe=function e(t){function n(r){return new Jk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Qk(e,t){this._context=e,this._k=(1-t)/6}Qk.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:tv(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ube=function e(t){function n(r){return new Qk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Zk(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>zn){var o=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*o-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*o-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>zn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/h}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function b$(e,t){this._context=e,this._alpha=t}b$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Zk(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Vbe=function e(t){function n(r){return t?new b$(r,t):new Xk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function w$(e,t){this._context=e,this._alpha=t}w$.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Zk(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const qbe=function e(t){function n(r){return t?new w$(r,t):new Jk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function S$(e,t){this._context=e,this._alpha=t}S$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Zk(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Gbe=function e(t){function n(r){return t?new S$(r,t):new Qk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function C$(e){this._context=e}C$.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Kbe(e){return new C$(e)}function tR(e){return e<0?-1:1}function nR(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(tR(s)+tR(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function rR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Ax(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function nv(e){this._context=e}nv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ax(this,this._t0,rR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ax(this,rR(this,n=nR(this,e,t)),n);break;default:Ax(this,this._t0,n=nR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function k$(e){this._context=new E$(e)}(k$.prototype=Object.create(nv.prototype)).point=function(e,t){nv.prototype.point.call(this,t,e)};function E$(e){this._context=e}E$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function Ybe(e){return new nv(e)}function Xbe(e){return new k$(e)}function T$(e){this._context=e}T$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=iR(e),i=iR(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function iR(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function Jbe(e){return new T$(e)}function L1(e,t){this._context=e,this._t=t}L1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Qbe(e){return new L1(e,.5)}function Zbe(e){return new L1(e,0)}function ewe(e){return new L1(e,1)}function sR(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function oR(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function twe(e,t){return e[t]}function nwe(e){const t=[];return t.key=e,t}function rwe(){var e=Wt([]),t=oR,n=sR,r=twe;function i(s){var a=Array.from(e.apply(this,arguments),nwe),o,l=a.length,c=-1,h;for(const d of s)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(d,a[o].key,c,s)]).data=d;for(o=0,h=Yk(t(a));o<l;++o)a[h[o]].index=o;return n(a,h),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Wt(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Wt(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?oR:typeof s=="function"?s:Wt(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??sR,i):n},i}function iwe(e,t){if((l=e.length)>0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r<c;++r)for(a=o=0,n=0;n<l;++n)(s=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}var swe=jf,owe=s9,awe=pu;function lwe(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var a=t[r],o=swe(e,a);n(o,a)&&owe(s,awe(a,e),o)}return s}var cwe=lwe;function uwe(e,t){return e!=null&&t in Object(e)}var dwe=uwe,hwe=pu,fwe=z0,pwe=_r,mwe=U0,gwe=mk,vwe=mu;function ywe(e,t,n){t=hwe(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=vwe(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&gwe(i)&&mwe(a,i)&&(pwe(e)||fwe(e)))}var xwe=ywe,_we=dwe,bwe=xwe;function wwe(e,t){return e!=null&&bwe(e,t,_we)}var M$=wwe,Swe=cwe,Cwe=M$;function kwe(e,t){return Swe(e,t,function(n,r){return Cwe(e,r)})}var Ewe=kwe;function Twe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var e5=Twe,aR=lu,Mwe=z0,Rwe=_r,lR=aR?aR.isConcatSpreadable:void 0;function Awe(e){return Rwe(e)||Mwe(e)||!!(lR&&e&&e[lR])}var jwe=Awe,Lwe=e5,Dwe=jwe;function R$(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=Dwe),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?R$(o,t-1,n,r,i):Lwe(i,o):r||(i[i.length]=o)}return i}var A$=R$,Nwe=A$;function Pwe(e){var t=e==null?0:e.length;return t?Nwe(e,1):[]}var Owe=Pwe,Iwe=Owe,$we=ZI,Bwe=e9;function Fwe(e){return Bwe($we(e,void 0,Iwe),e+"")}var j$=Fwe,zwe=Ewe,Hwe=j$,Wwe=Hwe(function(e,t){return e==null?{}:zwe(e,t)}),Uwe=Wwe;const Vwe=Tn(Uwe);function qwe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Gwe=qwe,Kwe=Gk,Ywe=Gwe,Xwe=Kk,Jwe=1,Qwe=2;function Zwe(e,t,n,r,i,s){var a=n&Jwe,o=e.length,l=t.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,f=!0,g=n&Qwe?new Kwe:void 0;for(s.set(e,t),s.set(t,e);++d<o;){var _=e[d],y=t[d];if(r)var v=a?r(y,_,d,t,e,s):r(_,y,d,e,t,s);if(v!==void 0){if(v)continue;f=!1;break}if(g){if(!Ywe(t,function(m,p){if(!Xwe(g,p)&&(_===m||i(_,m,n,r,s)))return g.push(p)})){f=!1;break}}else if(!(_===y||i(_,y,n,r,s))){f=!1;break}}return s.delete(e),s.delete(t),f}var L$=Zwe;function e2e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var t2e=e2e;function n2e(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var t5=n2e,cR=lu,uR=HI,r2e=Mf,i2e=L$,s2e=t2e,o2e=t5,a2e=1,l2e=2,c2e="[object Boolean]",u2e="[object Date]",d2e="[object Error]",h2e="[object Map]",f2e="[object Number]",p2e="[object RegExp]",m2e="[object Set]",g2e="[object String]",v2e="[object Symbol]",y2e="[object ArrayBuffer]",x2e="[object DataView]",dR=cR?cR.prototype:void 0,jx=dR?dR.valueOf:void 0;function _2e(e,t,n,r,i,s,a){switch(n){case x2e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y2e:return!(e.byteLength!=t.byteLength||!s(new uR(e),new uR(t)));case c2e:case u2e:case f2e:return r2e(+e,+t);case d2e:return e.name==t.name&&e.message==t.message;case p2e:case g2e:return e==t+"";case h2e:var o=s2e;case m2e:var l=r&a2e;if(o||(o=o2e),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=l2e,a.set(e,t);var h=i2e(o(e),o(t),r,i,s,a);return a.delete(e),h;case v2e:if(jx)return jx.call(e)==jx.call(t)}return!1}var b2e=_2e,w2e=e5,S2e=_r;function C2e(e,t,n){var r=t(e);return S2e(e)?r:w2e(r,n(e))}var D$=C2e;function k2e(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}var N$=k2e;function E2e(){return[]}var P$=E2e,T2e=N$,M2e=P$,R2e=Object.prototype,A2e=R2e.propertyIsEnumerable,hR=Object.getOwnPropertySymbols,j2e=hR?function(e){return e==null?[]:(e=Object(e),T2e(hR(e),function(t){return A2e.call(e,t)}))}:M2e,n5=j2e,L2e=VI,D2e=L2e(Object.keys,Object),N2e=D2e,P2e=pk,O2e=N2e,I2e=Object.prototype,$2e=I2e.hasOwnProperty;function B2e(e){if(!P2e(e))return O2e(e);var t=[];for(var n in Object(e))$2e.call(e,n)&&n!="constructor"&&t.push(n);return t}var F2e=B2e,z2e=JI,H2e=F2e,W2e=hu;function U2e(e){return W2e(e)?z2e(e):H2e(e)}var Nf=U2e,V2e=D$,q2e=n5,G2e=Nf;function K2e(e){return V2e(e,G2e,q2e)}var O$=K2e,fR=O$,Y2e=1,X2e=Object.prototype,J2e=X2e.hasOwnProperty;function Q2e(e,t,n,r,i,s){var a=n&Y2e,o=fR(e),l=o.length,c=fR(t),h=c.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var f=o[d];if(!(a?f in t:J2e.call(t,f)))return!1}var g=s.get(e),_=s.get(t);if(g&&_)return g==t&&_==e;var y=!0;s.set(e,t),s.set(t,e);for(var v=a;++d<l;){f=o[d];var m=e[f],p=t[f];if(r)var x=a?r(p,m,f,t,e,s):r(m,p,f,e,t,s);if(!(x===void 0?m===p||i(m,p,n,r,s):x)){y=!1;break}v||(v=f=="constructor")}if(y&&!v){var b=e.constructor,S=t.constructor;b!=S&&"constructor"in e&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(y=!1)}return s.delete(e),s.delete(t),y}var Z2e=Q2e,eSe=Za,tSe=ns,nSe=eSe(tSe,"DataView"),rSe=nSe,iSe=Za,sSe=ns,oSe=iSe(sSe,"Promise"),aSe=oSe,lSe=Za,cSe=ns,uSe=lSe(cSe,"Set"),I$=uSe,dSe=Za,hSe=ns,fSe=dSe(hSe,"WeakMap"),pSe=fSe,dw=rSe,hw=ck,fw=aSe,pw=I$,mw=pSe,$$=qo,vu=II,pR="[object Map]",mSe="[object Object]",mR="[object Promise]",gR="[object Set]",vR="[object WeakMap]",yR="[object DataView]",gSe=vu(dw),vSe=vu(hw),ySe=vu(fw),xSe=vu(pw),_Se=vu(mw),ea=$$;(dw&&ea(new dw(new ArrayBuffer(1)))!=yR||hw&&ea(new hw)!=pR||fw&&ea(fw.resolve())!=mR||pw&&ea(new pw)!=gR||mw&&ea(new mw)!=vR)&&(ea=function(e){var t=$$(e),n=t==mSe?e.constructor:void 0,r=n?vu(n):"";if(r)switch(r){case gSe:return yR;case vSe:return pR;case ySe:return mR;case xSe:return gR;case _Se:return vR}return t});var D1=ea,Lx=F0,bSe=L$,wSe=b2e,SSe=Z2e,xR=D1,_R=_r,bR=H0,CSe=yk,kSe=1,wR="[object Arguments]",SR="[object Array]",Op="[object Object]",ESe=Object.prototype,CR=ESe.hasOwnProperty;function TSe(e,t,n,r,i,s){var a=_R(e),o=_R(t),l=a?SR:xR(e),c=o?SR:xR(t);l=l==wR?Op:l,c=c==wR?Op:c;var h=l==Op,d=c==Op,f=l==c;if(f&&bR(e)){if(!bR(t))return!1;a=!0,h=!1}if(f&&!h)return s||(s=new Lx),a||CSe(e)?bSe(e,t,n,r,i,s):wSe(e,t,l,n,r,i,s);if(!(n&kSe)){var g=h&&CR.call(e,"__wrapped__"),_=d&&CR.call(t,"__wrapped__");if(g||_){var y=g?e.value():e,v=_?t.value():t;return s||(s=new Lx),i(y,v,n,r,s)}}return f?(s||(s=new Lx),SSe(e,t,n,r,i,s)):!1}var MSe=TSe,RSe=MSe,kR=ki;function B$(e,t,n,r,i){return e===t?!0:e==null||t==null||!kR(e)&&!kR(t)?e!==e&&t!==t:RSe(e,t,n,r,B$,i)}var r5=B$,ASe=r5;function jSe(e,t){return ASe(e,t)}var LSe=jSe;const DSe=Tn(LSe);var NSe={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"transparent",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}};function gi(){return gi=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},gi.apply(this,arguments)}function i5(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var PSe=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],OSe=function(e,t){return gi({},t,e)},ISe=function(e,t){var n=a0e({},e,t);return PSe.forEach(function(r){gd(n,r,OSe(Ds(n,r),n.text))}),n},F$=w.createContext(),z$=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,s=i===void 0?"default":i,a=w.useMemo(function(){var o=q1e(s)?sk[s]:s;return{animate:r,config:o}},[r,s]);return u.jsx(F$.Provider,{value:a,children:t})},ER={animate:Z.bool,motionConfig:Z.oneOfType([Z.oneOf(Object.keys(sk)),Z.shape({mass:Z.number,tension:Z.number,friction:Z.number,clamp:Z.bool,precision:Z.number,velocity:Z.number,duration:Z.number,easing:Z.func})])};z$.propTypes={children:Z.node.isRequired,animate:ER.animate,config:ER.motionConfig};var br=function(){return w.useContext(F$)},$Se=function(e){var t=br(),n=t.animate,r=t.config,i=function(o){var l=w.useRef();return w.useEffect(function(){l.current=o},[o]),l.current}(e),s=w.useMemo(function(){return Ek(i,e)},[i,e]),a=Bs({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return jo(a,s)},BSe={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:Re(r1),PRGn:Re(i1),PiYG:Re(s1),PuOr:Re(o1),RdBu:Re(a1),RdGy:Re(l1),RdYlBu:Re(c1),RdYlGn:Re(u1),spectral:Re(d1),blues:Re(C1),greens:Re(k1),greys:Re(E1),oranges:Re(R1),purples:Re(T1),reds:Re(M1),BuGn:Re(h1),BuPu:Re(f1),GnBu:Re(p1),OrRd:Re(m1),PuBuGn:Re(g1),PuBu:Re(v1),PuRd:Re(y1),RdPu:Re(x1),YlGnBu:Re(_1),YlGn:Re(b1),YlOrBr:Re(w1),YlOrRd:Re(S1)},FSe=Object.keys(BSe);Re(r1),Re(i1),Re(s1),Re(o1),Re(a1),Re(l1),Re(c1),Re(u1),Re(d1),Re(C1),Re(k1),Re(E1),Re(R1),Re(T1),Re(M1),Re(h1),Re(f1),Re(p1),Re(m1),Re(g1),Re(v1),Re(y1),Re(x1),Re(_1),Re(b1),Re(w1),Re(S1);Z.oneOfType([Z.oneOf(FSe),Z.func,Z.arrayOf(Z.string)]);var zSe={basis:$be,basisClosed:Bbe,basisOpen:Fbe,bundle:zbe,cardinal:Hbe,cardinalClosed:Wbe,cardinalOpen:Ube,catmullRom:Vbe,catmullRomClosed:qbe,catmullRomOpen:Gbe,linear:g$,linearClosed:Kbe,monotoneX:Ybe,monotoneY:Xbe,natural:Jbe,step:Qbe,stepAfter:ewe,stepBefore:Zbe},s5=Object.keys(zSe);s5.filter(function(e){return e.endsWith("Closed")});h$(s5,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");h$(s5,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");Z.shape({top:Z.number,right:Z.number,bottom:Z.number,left:Z.number}).isRequired;var HSe=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];Z.oneOf(HSe);ua(qk);var WSe={top:0,right:0,bottom:0,left:0},o5=function(e,t,n){return n===void 0&&(n={}),w.useMemo(function(){var r=gi({},WSe,n);return{margin:r,innerWidth:e-r.left-r.right,innerHeight:t-r.top-r.bottom,outerWidth:e,outerHeight:t}},[e,t,n.top,n.right,n.bottom,n.left])},H$=function(){var e=w.useRef(null),t=w.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=w.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(s){var a=s[0];return r(a.contentRect)})})[0];return w.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},USe=function(e){return w.useMemo(function(){return ISe(NSe,e)},[e])},VSe=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?n1(e.slice("5")):Df(e):function(t){return""+t}},N1=function(e){return w.useMemo(function(){return VSe(e)},[e])},W$=w.createContext(),qSe={},U$=function(e){var t=e.theme,n=t===void 0?qSe:t,r=e.children,i=USe(n);return u.jsx(W$.Provider,{value:i,children:r})};U$.propTypes={children:Z.node.isRequired,theme:Z.object};var Vt=function(){return w.useContext(W$)},GSe=["outlineWidth","outlineColor","outlineOpacity"],a5=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,i5(e,GSe)},V$=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?w.cloneElement(r,{},t):t};V$.propTypes={children:Z.node.isRequired,condition:Z.bool.isRequired,wrapper:Z.element.isRequired};var KSe={position:"relative"},P1=function(e){var t=e.children,n=e.theme,r=e.renderWrapper,i=r===void 0||r,s=e.isInteractive,a=s===void 0||s,o=e.animate,l=e.motionConfig,c=w.useRef(null);return u.jsx(U$,{theme:n,children:u.jsx(z$,{animate:o,config:l,children:u.jsx(Wde,{container:c,children:u.jsxs(V$,{condition:i,wrapper:u.jsx("div",{style:KSe,ref:c}),children:[t,a&&u.jsx(Hde,{})]})})})})};P1.propTypes={children:Z.element.isRequired,isInteractive:Z.bool,renderWrapper:Z.bool,theme:Z.object,animate:Z.bool,motionConfig:Z.string};Z.func.isRequired,Z.bool,Z.bool,Z.object.isRequired,Z.bool.isRequired,Z.string;var q$=function(e){var t=e.children,n=H$(),r=n[0],i=n[1],s=i.width>0&&i.height>0;return u.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:s&&t({width:i.width,height:i.height})})};q$.propTypes={children:Z.func.isRequired};var YSe=["id","colors"],G$=function(e){var t=e.id,n=e.colors,r=i5(e,YSe);return u.jsx("linearGradient",gi({id:t,x1:0,x2:0,y1:0,y2:1},r,{children:n.map(function(i){var s=i.offset,a=i.color,o=i.opacity;return u.jsx("stop",{offset:s+"%",stopColor:a,stopOpacity:o!==void 0?o:1},s)})}))};G$.propTypes={id:Z.string.isRequired,colors:Z.arrayOf(Z.shape({offset:Z.number.isRequired,color:Z.string.isRequired,opacity:Z.number})).isRequired,gradientTransform:Z.string};var K$={linearGradient:G$},Ku={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},gw=w.memo(function(e){var t=e.id,n=e.background,r=n===void 0?Ku.background:n,i=e.color,s=i===void 0?Ku.color:i,a=e.size,o=a===void 0?Ku.size:a,l=e.padding,c=l===void 0?Ku.padding:l,h=e.stagger,d=h===void 0?Ku.stagger:h,f=o+c,g=o/2,_=c/2;return d===!0&&(f=2*o+2*c),u.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[u.jsx("rect",{width:f,height:f,fill:r}),u.jsx("circle",{cx:_+g,cy:_+g,r:g,fill:s}),d&&u.jsx("circle",{cx:1.5*c+o+g,cy:1.5*c+o+g,r:g,fill:s})]})});gw.displayName="PatternDots",gw.propTypes={id:Z.string.isRequired,color:Z.string.isRequired,background:Z.string.isRequired,size:Z.number.isRequired,padding:Z.number.isRequired,stagger:Z.bool.isRequired};var Kr=function(e){return e*Math.PI/180},O1=function(e){return 180*e/Math.PI},XSe=function(e){return e.startAngle+(e.endAngle-e.startAngle)/2},ya=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},JSe=function(e){var t=e%360;return t<0&&(t+=360),t},QSe={svg:{align:{left:"start",center:"middle",right:"end",start:"start",middle:"middle",end:"end"},baseline:{top:"text-before-edge",center:"central",bottom:"alphabetic"}},canvas:{align:{left:"left",center:"center",right:"right",start:"left",middle:"center",end:"right"},baseline:{top:"top",center:"middle",bottom:"bottom"}}},Yu={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},vw=w.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?Yu.spacing:n,i=e.rotation,s=i===void 0?Yu.rotation:i,a=e.background,o=a===void 0?Yu.background:a,l=e.color,c=l===void 0?Yu.color:l,h=e.lineWidth,d=h===void 0?Yu.lineWidth:h,f=Math.round(s)%360,g=Math.abs(r);f>180?f-=360:f>90?f-=180:f<-180?f+=360:f<-90&&(f+=180);var _,y=g,v=g;return f===0?_=`
                M 0 0 L `+y+` 0
                M 0 `+v+" L "+y+" "+v+`
            `:f===90?_=`
                M 0 0 L 0 `+v+`
                M `+y+" 0 L "+y+" "+v+`
            `:(y=Math.abs(g/Math.sin(Kr(f))),v=g/Math.sin(Kr(90-f)),_=f>0?`
                    M 0 `+-v+" L "+2*y+" "+v+`
                    M `+-y+" "+-v+" L "+y+" "+v+`
                    M `+-y+" 0 L "+y+" "+2*v+`
                `:`
                    M `+-y+" "+v+" L "+y+" "+-v+`
                    M `+-y+" "+2*v+" L "+2*y+" "+-v+`
                    M 0 `+2*v+" L "+2*y+` 0
                `),u.jsxs("pattern",{id:t,width:y,height:v,patternUnits:"userSpaceOnUse",children:[u.jsx("rect",{width:y,height:v,fill:o,stroke:"rgba(255, 0, 0, 0.1)",strokeWidth:0}),u.jsx("path",{d:_,strokeWidth:d,stroke:c,strokeLinecap:"square"})]})});vw.displayName="PatternLines",vw.propTypes={id:Z.string.isRequired,spacing:Z.number.isRequired,rotation:Z.number.isRequired,background:Z.string.isRequired,color:Z.string.isRequired,lineWidth:Z.number.isRequired};var Xu={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},yw=w.memo(function(e){var t=e.id,n=e.color,r=n===void 0?Xu.color:n,i=e.background,s=i===void 0?Xu.background:i,a=e.size,o=a===void 0?Xu.size:a,l=e.padding,c=l===void 0?Xu.padding:l,h=e.stagger,d=h===void 0?Xu.stagger:h,f=o+c,g=c/2;return d===!0&&(f=2*o+2*c),u.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[u.jsx("rect",{width:f,height:f,fill:s}),u.jsx("rect",{x:g,y:g,width:o,height:o,fill:r}),d&&u.jsx("rect",{x:1.5*c+o,y:1.5*c+o,width:o,height:o,fill:r})]})});yw.displayName="PatternSquares",yw.propTypes={id:Z.string.isRequired,color:Z.string.isRequired,background:Z.string.isRequired,size:Z.number.isRequired,padding:Z.number.isRequired,stagger:Z.bool.isRequired};var Y$={patternDots:gw,patternLines:vw,patternSquares:yw},ZSe=["type"],xw=gi({},K$,Y$),X$=function(e){var t=e.defs;return!t||t.length<1?null:u.jsx("defs",{"aria-hidden":!0,children:t.map(function(n){var r=n.type,i=i5(n,ZSe);return xw[r]?w.createElement(xw[r],gi({key:i.id},i)):null})})};X$.propTypes={defs:Z.arrayOf(Z.shape({type:Z.oneOf(Object.keys(xw)).isRequired,id:Z.string.isRequired}))};var eCe=w.memo(X$),l5=function(e){var t=e.width,n=e.height,r=e.margin,i=e.defs,s=e.children,a=e.role,o=e.ariaLabel,l=e.ariaLabelledBy,c=e.ariaDescribedBy,h=e.isFocusable,d=Vt();return u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,role:a,"aria-label":o,"aria-labelledby":l,"aria-describedby":c,focusable:h,tabIndex:h?0:void 0,children:[u.jsx(eCe,{defs:i}),u.jsx("rect",{width:t,height:n,fill:d.background}),u.jsx("g",{transform:"translate("+r.left+","+r.top+")",children:s})]})};l5.propTypes={width:Z.number.isRequired,height:Z.number.isRequired,margin:Z.shape({top:Z.number.isRequired,left:Z.number.isRequired}).isRequired,defs:Z.array,children:Z.oneOfType([Z.arrayOf(Z.node),Z.node]).isRequired,role:Z.string,isFocusable:Z.bool,ariaLabel:Z.string,ariaLabelledBy:Z.string,ariaDescribedBy:Z.string};var J$=function(e){var t=e.size,n=e.color,r=e.borderWidth,i=e.borderColor;return u.jsx("circle",{r:t/2,fill:n,stroke:i,strokeWidth:r,style:{pointerEvents:"none"}})};J$.propTypes={size:Z.number.isRequired,color:Z.string.isRequired,borderWidth:Z.number.isRequired,borderColor:Z.string.isRequired};var tCe=w.memo(J$),Q$=function(e){var t=e.x,n=e.y,r=e.symbol,i=r===void 0?tCe:r,s=e.size,a=e.datum,o=e.color,l=e.borderWidth,c=e.borderColor,h=e.label,d=e.labelTextAnchor,f=d===void 0?"middle":d,g=e.labelYOffset,_=g===void 0?-12:g,y=Vt(),v=br(),m=v.animate,p=v.config,x=Bs({transform:"translate("+t+", "+n+")",config:p,immediate:!m});return u.jsxs(St.g,{transform:x.transform,style:{pointerEvents:"none"},children:[w.createElement(i,{size:s,color:o,datum:a,borderWidth:l,borderColor:c}),h&&u.jsx("text",{textAnchor:f,y:_,style:a5(y.dots.text),children:h})]})};Q$.propTypes={x:Z.number.isRequired,y:Z.number.isRequired,datum:Z.object.isRequired,size:Z.number.isRequired,color:Z.string.isRequired,borderWidth:Z.number.isRequired,borderColor:Z.string.isRequired,symbol:Z.oneOfType([Z.func,Z.object]),label:Z.oneOfType([Z.string,Z.number]),labelTextAnchor:Z.oneOf(["start","middle","end"]),labelYOffset:Z.number};w.memo(Q$);var Z$=function(e){var t=e.width,n=e.height,r=e.axis,i=e.scale,s=e.value,a=e.lineStyle,o=e.textStyle,l=e.legend,c=e.legendPosition,h=c===void 0?"top-right":c,d=e.legendOffsetX,f=d===void 0?14:d,g=e.legendOffsetY,_=g===void 0?14:g,y=e.legendOrientation,v=y===void 0?"horizontal":y,m=Vt(),p=0,x=0,b=0,S=0;r==="y"?(b=i(s),x=t):(p=i(s),S=n);var C=null;if(l){var E=function(k){var T=k.axis,R=k.width,M=k.height,L=k.position,D=k.offsetX,N=k.offsetY,P=k.orientation,I=0,z=0,O=P==="vertical"?-90:0,j="start";if(T==="x")switch(L){case"top-left":I=-D,z=N,j="end";break;case"top":z=-N,j=P==="horizontal"?"middle":"start";break;case"top-right":I=D,z=N,j=P==="horizontal"?"start":"end";break;case"right":I=D,z=M/2,j=P==="horizontal"?"start":"middle";break;case"bottom-right":I=D,z=M-N,j="start";break;case"bottom":z=M+N,j=P==="horizontal"?"middle":"end";break;case"bottom-left":z=M-N,I=-D,j=P==="horizontal"?"end":"start";break;case"left":I=-D,z=M/2,j=P==="horizontal"?"end":"middle"}else switch(L){case"top-left":I=D,z=-N,j="start";break;case"top":I=R/2,z=-N,j=P==="horizontal"?"middle":"start";break;case"top-right":I=R-D,z=-N,j=P==="horizontal"?"end":"start";break;case"right":I=R+D,j=P==="horizontal"?"start":"middle";break;case"bottom-right":I=R-D,z=N,j="end";break;case"bottom":I=R/2,z=N,j=P==="horizontal"?"middle":"end";break;case"bottom-left":I=D,z=N,j=P==="horizontal"?"start":"end";break;case"left":I=-D,j=P==="horizontal"?"end":"middle"}return{x:I,y:z,rotation:O,textAnchor:j}}({axis:r,width:t,height:n,position:h,offsetX:f,offsetY:_,orientation:v});C=u.jsx("text",{transform:"translate("+E.x+", "+E.y+") rotate("+E.rotation+")",textAnchor:E.textAnchor,dominantBaseline:"central",style:o,children:l})}return u.jsxs("g",{transform:"translate("+p+", "+b+")",children:[u.jsx("line",{x1:0,x2:x,y1:0,y2:S,stroke:m.markers.lineColor,strokeWidth:m.markers.lineStrokeWidth,style:a}),C]})};Z$.propTypes={width:Z.number.isRequired,height:Z.number.isRequired,axis:Z.oneOf(["x","y"]).isRequired,scale:Z.func.isRequired,value:Z.oneOfType([Z.number,Z.string,Z.instanceOf(Date)]).isRequired,lineStyle:Z.object,textStyle:Z.object,legend:Z.string,legendPosition:Z.oneOf(["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"]),legendOffsetX:Z.number.isRequired,legendOffsetY:Z.number.isRequired,legendOrientation:Z.oneOf(["horizontal","vertical"]).isRequired};var nCe=w.memo(Z$),eB=function(e){var t=e.markers,n=e.width,r=e.height,i=e.xScale,s=e.yScale;return t&&t.length!==0?t.map(function(a,o){return u.jsx(nCe,gi({},a,{width:n,height:r,scale:a.axis==="y"?s:i}),o)}):null};eB.propTypes={width:Z.number.isRequired,height:Z.number.isRequired,xScale:Z.func.isRequired,yScale:Z.func.isRequired,markers:Z.arrayOf(Z.shape({axis:Z.oneOf(["x","y"]).isRequired,value:Z.oneOfType([Z.number,Z.string,Z.instanceOf(Date)]).isRequired,lineStyle:Z.object,textStyle:Z.object}))};var rCe=w.memo(eB),tB=function(e){return OI(e)?e:function(t){return Ds(t,e)}},xa=function(e){return w.useMemo(function(){return tB(e)},[e])},iCe=function(e,t,n,r,i,s){return e<=i&&i<=e+n&&t<=s&&s<=t+r},Dx=function(e,t){var n,r="touches"in t?t.touches[0]:t,i=r.clientX,s=r.clientY,a=e.getBoundingClientRect(),o=(n=e.getBBox!==void 0?e.getBBox():{width:e.offsetWidth||0,height:e.offsetHeight||0}).width===a.width?1:n.width/a.width;return[(i-a.left)*o,(s-a.top)*o]},sCe=Object.keys(K$),oCe=Object.keys(Y$),aCe=function(e,t,n){if(e==="*")return!0;if(OI(e))return e(t);if(vk(e)){var r=n?Ds(t,n):t;return DSe(Vwe(r,Object.keys(e)),e)}return!1},nB=function(e,t,n,r){var i=r===void 0?{}:r,s=i.dataKey,a=i.colorKey,o=a===void 0?"color":a,l=i.targetKey,c=l===void 0?"fill":l,h=[],d={};return e.length&&t.length&&(h=[].concat(e),t.forEach(function(f){for(var g=function(){var y=n[_],v=y.id,m=y.match;if(aCe(m,f,s)){var p=e.find(function(R){return R.id===v});if(p){if(oCe.includes(p.type))if(p.background==="inherit"||p.color==="inherit"){var x=Ds(f,o),b=p.background,S=p.color,C=v;p.background==="inherit"&&(C=C+".bg."+x,b=x),p.color==="inherit"&&(C=C+".fg."+x,S=x),gd(f,c,"url(#"+C+")"),d[C]||(h.push(gi({},p,{id:C,background:b,color:S})),d[C]=1)}else gd(f,c,"url(#"+v+")");else if(sCe.includes(p.type))if(p.colors.map(function(R){return R.color}).includes("inherit")){var E=Ds(f,o),k=v,T=gi({},p,{colors:p.colors.map(function(R,M){return R.color!=="inherit"?R:(k=k+"."+M+"."+E,gi({},R,{color:R.color==="inherit"?E:R.color}))})});T.id=k,gd(f,c,"url(#"+k+")"),d[k]||(h.push(T),d[k]=1)}else gd(f,c,"url(#"+v+")")}return"break"}},_=0;_<n.length&&g()!=="break";_++);})),h};function lCe(){}var cCe=lCe,Nx=I$,uCe=cCe,dCe=t5,hCe=1/0,fCe=Nx&&1/dCe(new Nx([,-0]))[1]==hCe?function(e){return new Nx(e)}:uCe,pCe=fCe,mCe=Gk,gCe=u$,vCe=d$,yCe=Kk,xCe=pCe,_Ce=t5,bCe=200;function wCe(e,t,n){var r=-1,i=gCe,s=e.length,a=!0,o=[],l=o;if(n)a=!1,i=vCe;else if(s>=bCe){var c=t?null:xCe(e);if(c)return _Ce(c);a=!1,i=yCe,l=new mCe}else l=t?[]:o;e:for(;++r<s;){var h=e[r],d=t?t(h):h;if(h=n||h!==0?h:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),o.push(h)}else i(l,d,n)||(l!==o&&l.push(d),o.push(h))}return o}var SCe=wCe,CCe=F0,kCe=r5,ECe=1,TCe=2;function MCe(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var l=o[0],c=e[l],h=o[1];if(a&&o[2]){if(c===void 0&&!(l in e))return!1}else{var d=new CCe;if(r)var f=r(c,h,l,e,t,d);if(!(f===void 0?kCe(h,c,ECe|TCe,r,d):f))return!1}}return!0}var RCe=MCe,ACe=rs;function jCe(e){return e===e&&!ACe(e)}var rB=jCe,LCe=rB,DCe=Nf;function NCe(e){for(var t=DCe(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,LCe(i)]}return t}var PCe=NCe;function OCe(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var iB=OCe,ICe=RCe,$Ce=PCe,BCe=iB;function FCe(e){var t=$Ce(e);return t.length==1&&t[0][2]?BCe(t[0][0],t[0][1]):function(n){return n===e||ICe(n,e,t)}}var zCe=FCe,HCe=r5,WCe=i9,UCe=M$,VCe=bk,qCe=rB,GCe=iB,KCe=mu,YCe=1,XCe=2;function JCe(e,t){return VCe(e)&&qCe(t)?GCe(KCe(e),t):function(n){var r=WCe(n,e);return r===void 0&&r===t?UCe(n,e):HCe(t,r,YCe|XCe)}}var QCe=JCe;function ZCe(e){return function(t){return t==null?void 0:t[e]}}var eke=ZCe,tke=jf;function nke(e){return function(t){return tke(t,e)}}var rke=nke,ike=eke,ske=rke,oke=bk,ake=mu;function lke(e){return oke(e)?ike(ake(e)):ske(e)}var cke=lke,uke=zCe,dke=QCe,hke=V0,fke=_r,pke=cke;function mke(e){return typeof e=="function"?e:e==null?hke:typeof e=="object"?fke(e)?dke(e[0],e[1]):uke(e):pke(e)}var c5=mke,gke=c5,vke=SCe;function yke(e,t){return e&&e.length?vke(e,gke(t)):[]}var xke=yke;const TR=Tn(xke);var _ke=FI,bke=Nf;function wke(e,t){return e&&_ke(e,t,bke)}var Ske=wke,Cke=hu;function kke(e,t){return function(n,r){if(n==null)return n;if(!Cke(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var Eke=kke,Tke=Ske,Mke=Eke,Rke=Mke(Tke),sB=Rke,Ake=sB,jke=hu;function Lke(e,t){var n=-1,r=jke(e)?Array(e.length):[];return Ake(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var Dke=Lke;function Nke(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Pke=Nke,MR=q0;function Oke(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=MR(e),a=t!==void 0,o=t===null,l=t===t,c=MR(t);if(!o&&!c&&!s&&e>t||s&&a&&l&&!o&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&e<t||c&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!l)return-1}return 0}var Ike=Oke,$ke=Ike;function Bke(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var l=$ke(i[r],s[r]);if(l){if(r>=o)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var Fke=Bke,Px=G0,zke=jf,Hke=c5,Wke=Dke,Uke=Pke,Vke=Rf,qke=Fke,Gke=V0,Kke=_r;function Yke(e,t,n){t.length?t=Px(t,function(s){return Kke(s)?function(a){return zke(a,s.length===1?s[0]:s)}:s}):t=[Gke];var r=-1;t=Px(t,Vke(Hke));var i=Wke(e,function(s,a,o){var l=Px(t,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return Uke(i,function(s,a){return qke(s,a,n)})}var Xke=Yke,Jke=A$,Qke=Xke,Zke=_k,RR=t9;Zke(function(e,t){if(e==null)return[];var n=t.length;return n>1&&RR(e,t[0],t[1])?t=[]:n>2&&RR(t[0],t[1],t[2])&&(t=[t[0]]),Qke(e,Jke(t,1),[])});var AR=W0;AR&&AR.isDate;var Cl=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],e5e={millisecond:[],second:Cl.slice(0,1),minute:Cl.slice(0,2),hour:Cl.slice(0,3),day:Cl.slice(0,4),month:Cl.slice(0,5),year:Cl.slice(0,6)},t5e=function(e){return function(t){return e5e[e].forEach(function(n){n(t)}),t}},n5e=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,s=e.useUTC,a=s===void 0||s,o=t5e(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return o(l);var c=a?Y9(n):G9(n);return o(c(l))}},r5e=function(e,t,n,r){var i,s,a,o,l=e.min,c=l===void 0?0:l,h=e.max,d=h===void 0?"auto":h,f=e.stacked,g=f!==void 0&&f,_=e.reverse,y=_!==void 0&&_,v=e.clamp,m=v!==void 0&&v,p=e.nice,x=p!==void 0&&p;c==="auto"?i=g===!0?(s=t.minStacked)!=null?s:0:t.min:i=c,d==="auto"?a=g===!0?(o=t.maxStacked)!=null?o:0:t.max:a=d;var b=co().rangeRound(r==="x"?[0,n]:[n,0]).domain(y?[a,i]:[i,a]).clamp(m);return x===!0?b.nice():typeof x=="number"&&b.nice(x),i5e(b,g)},i5e=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},s5e=function(e,t,n){var r=cye().range([0,n]).domain(t.all);return r.type="point",r},o5e=function(e,t,n,r){var i=e.round,s=i===void 0||i,a=Q0().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(s);return a5e(a)},a5e=function(e){var t=e;return t.type="band",t},l5e=function(e,t,n){var r,i,s=e.format,a=s===void 0?"native":s,o=e.precision,l=o===void 0?"millisecond":o,c=e.min,h=c===void 0?"auto":c,d=e.max,f=d===void 0?"auto":d,g=e.useUTC,_=g===void 0||g,y=e.nice,v=y!==void 0&&y,m=n5e({format:a,precision:l,useUTC:_});r=h==="auto"?m(t.min):a!=="native"?m(h):h,i=f==="auto"?m(t.max):a!=="native"?m(f):f;var p=_?Zxe():Vk();p.range([0,n]),r&&i&&p.domain([r,i]),v===!0?p.nice():typeof v!="object"&&typeof v!="number"||p.nice(v);var x=p;return x.type="time",x.useUTC=_,x},c5e=function(e,t,n,r){var i,s=e.base,a=s===void 0?10:s,o=e.min,l=o===void 0?"auto":o,c=e.max,h=c===void 0?"auto":c;if(t.all.some(function(y){return y===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,g=!1;if(t.all.filter(function(y){return y!=null}).forEach(function(y){g||(i===void 0?i=Math.sign(y):Math.sign(y)!==i&&(g=!0))}),g)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=l==="auto"?t.min:l,f=h==="auto"?t.max:h;var _=w9().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(a).nice();return _.type="log",_},u5e=function(e,t,n,r){var i,s,a=e.constant,o=a===void 0?1:a,l=e.min,c=l===void 0?"auto":l,h=e.max,d=h===void 0?"auto":h,f=e.reverse,g=f!==void 0&&f;i=c==="auto"?t.min:c,s=d==="auto"?t.max:d;var _=S9().constant(o).rangeRound(r==="x"?[0,n]:[n,0]).nice();g===!0?_.domain([s,i]):_.domain([i,s]);var y=_;return y.type="symlog",y};function u5(e,t,n,r){switch(e.type){case"linear":return r5e(e,t,n,r);case"point":return s5e(e,t,n);case"band":return o5e(e,t,n,r);case"time":return l5e(e,t,n);case"log":return c5e(e,t,n,r);case"symlog":return u5e(e,t,n,r);default:throw new Error("invalid scale spec")}}var oB=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},aB={millisecond:[Oh,Oh],second:[lw,lw],minute:[R9,O9],hour:[A9,I9],day:[hn(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),hn(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[Xg,Jg],sunday:[Xg,Jg],monday:[Ih,$h],tuesday:[j9,$9],wednesday:[L9,B9],thursday:[Na,Pa],friday:[D9,F9],saturday:[N9,z9],month:[P9,H9],year:[Lo,Do]},d5e=Object.keys(aB),h5e=new RegExp("^every\\s*(\\d+)?\\s*("+d5e.join("|")+")s?$","i"),lB=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(h5e);if(n){var r=n[1],i=n[2],s=aB[i][e.useUTC?1:0];if(i==="day"){var a,o,l=e.domain(),c=l[0],h=l[1],d=new Date(h);return d.setDate(d.getDate()+1),(a=(o=s.every(Number(r??1)))==null?void 0:o.range(c,d))!=null?a:[]}if(r===void 0)return e.ticks(s);var f=s.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(g=t)=="number"&&isFinite(g)&&Math.floor(g)===g)return e.ticks(t)}var g;return e.domain()};function Yr(){return Yr=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},Yr.apply(this,arguments)}var cB=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,s=e.tickValues,a=e.tickSize,o=e.tickPadding,l=e.tickRotation,c=e.truncateTickAt,h=e.engine,d=h===void 0?"svg":h,f=lB(r,s),g=QSe[d],_="bandwidth"in r?oB(r):r,y={lineX:0,lineY:0},v={textX:0,textY:0},m=typeof document=="object"&&document.dir==="rtl",p=g.align.center,x=g.baseline.center;return n==="x"?(t=function(b){var S;return{x:(S=_(b))!=null?S:0,y:0}},y.lineY=a*(i==="after"?1:-1),v.textY=(a+o)*(i==="after"?1:-1),x=i==="after"?g.baseline.top:g.baseline.bottom,l===0?p=g.align.center:i==="after"&&l<0||i==="before"&&l>0?(p=g.align[m?"left":"right"],x=g.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(p=g.align[m?"right":"left"],x=g.baseline.center)):(t=function(b){var S;return{x:0,y:(S=_(b))!=null?S:0}},y.lineX=a*(i==="after"?1:-1),v.textX=(a+o)*(i==="after"?1:-1),p=i==="after"?g.align.left:g.align.right),{ticks:f.map(function(b){var S=typeof b=="string"?function(C){var E=String(C).length;return c&&c>0&&E>c?""+String(C).slice(0,c).concat("..."):""+C}(b):b;return Yr({key:b instanceof Date?""+b.valueOf():""+b,value:S},t(b),y,v)}),textAlign:p,textBaseline:x}},uB=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=n1(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Df(e)},_w=function(e){var t,n=e.width,r=e.height,i=e.scale,s=e.axis,a=e.values,o=(t=a,(Array.isArray(t)?a:void 0)||lB(i,a)),l="bandwidth"in i?oB(i):i,c=s==="x"?o.map(function(h){var d,f;return{key:h instanceof Date?""+h.valueOf():""+h,x1:(d=l(h))!=null?d:0,x2:(f=l(h))!=null?f:0,y1:0,y2:r}}):o.map(function(h){var d,f;return{key:h instanceof Date?""+h.valueOf():""+h,x1:0,x2:n,y1:(d=l(h))!=null?d:0,y2:(f=l(h))!=null?f:0}});return c},f5e=w.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,s=e.lineY,a=e.onClick,o=e.textBaseline,l=e.textAnchor,c=e.animatedProps,h=Vt(),d=h.axis.ticks.line,f=h.axis.ticks.text,g=(t=r==null?void 0:r(n))!=null?t:n,_=w.useMemo(function(){var y={opacity:c.opacity};return a?{style:Yr({},y,{cursor:"pointer"}),onClick:function(v){return a(v,g)}}:{style:y}},[c.opacity,a,g]);return u.jsxs(St.g,Yr({transform:c.transform},_,{children:[u.jsx("line",{x1:0,x2:i,y1:0,y2:s,style:d}),f.outlineWidth>0&&u.jsx(St.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+g}),u.jsx(St.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:a5(f),children:""+g})]}))}),p5e=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,s=e.y,a=s===void 0?0:s,o=e.length,l=e.ticksPosition,c=e.tickValues,h=e.tickSize,d=h===void 0?5:h,f=e.tickPadding,g=f===void 0?5:f,_=e.tickRotation,y=_===void 0?0:_,v=e.format,m=e.renderTick,p=m===void 0?f5e:m,x=e.truncateTickAt,b=e.legend,S=e.legendPosition,C=S===void 0?"end":S,E=e.legendOffset,k=E===void 0?0:E,T=e.onClick,R=e.ariaHidden,M=Vt(),L=M.axis.legend.text,D=w.useMemo(function(){return uB(v,n)},[v,n]),N=cB({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:g,tickRotation:y,truncateTickAt:x}),P=N.ticks,I=N.textAlign,z=N.textBaseline,O=null;if(b!==void 0){var j,A=0,F=0,H=0;t==="y"?(H=-90,A=k,C==="start"?(j="start",F=o):C==="middle"?(j="middle",F=o/2):C==="end"&&(j="end")):(F=k,C==="start"?j="start":C==="middle"?(j="middle",A=o/2):C==="end"&&(j="end",A=o)),O=u.jsxs(u.Fragment,{children:[L.outlineWidth>0&&u.jsx("text",{transform:"translate("+A+", "+F+") rotate("+H+")",textAnchor:j,style:Yr({dominantBaseline:"central"},L),strokeWidth:2*L.outlineWidth,stroke:L.outlineColor,strokeLinejoin:"round",children:b}),u.jsx("text",{transform:"translate("+A+", "+F+") rotate("+H+")",textAnchor:j,style:Yr({dominantBaseline:"central"},L),children:b})]})}var B=br(),G=B.animate,Q=B.config,Y=Bs({transform:"translate("+i+","+a+")",lineX2:t==="x"?o:0,lineY2:t==="x"?0:o,config:Q,immediate:!G}),W=w.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+y+")"}},[y]),$=w.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+y+")"}},[y]),V=Qa(P,{keys:function(U){return U.key},initial:W,from:$,enter:W,update:W,leave:{opacity:0},config:Q,immediate:!G});return u.jsxs(St.g,{transform:Y.transform,"aria-hidden":R,children:[V(function(U,X,q,re){return w.createElement(p,Yr({tickIndex:re,format:D,rotate:y,textBaseline:z,textAnchor:I,truncateTickAt:x,animatedProps:U},X,T?{onClick:T}:{}))}),u.jsx(St.line,{style:M.axis.domain.line,x1:0,x2:Y.lineX2,y1:0,y2:Y.lineY2}),O]})},m5e=w.memo(p5e),dB=["top","right","bottom","left"],g5e=w.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,s={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return u.jsx(u.Fragment,{children:dB.map(function(a){var o=s[a];if(!o)return null;var l=a==="top"||a==="bottom";return u.jsx(m5e,Yr({},o,{axis:l?"x":"y",x:a==="right"?r:0,y:a==="bottom"?i:0,scale:l?t:n,length:l?r:i,ticksPosition:a==="top"||a==="left"?"before":"after",truncateTickAt:o.truncateTickAt}),a)})})}),v5e=w.memo(function(e){var t=e.animatedProps,n=Vt();return u.jsx(St.line,Yr({},t,n.grid.line))}),jR=w.memo(function(e){var t=e.lines,n=br(),r=n.animate,i=n.config,s=Qa(t,{keys:function(a){return a.key},initial:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},from:function(a){return{opacity:0,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},enter:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},update:function(a){return{opacity:1,x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2}},leave:{opacity:0},config:i,immediate:!r});return u.jsx("g",{children:s(function(a,o){return w.createElement(v5e,Yr({},o,{key:o.key,animatedProps:a}))})})}),y5e=w.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,s=e.xValues,a=e.yValues,o=w.useMemo(function(){return!!r&&_w({width:t,height:n,scale:r,axis:"x",values:s})},[r,s,t,n]),l=w.useMemo(function(){return!!i&&_w({width:t,height:n,scale:i,axis:"y",values:a})},[n,t,i,a]);return u.jsxs(u.Fragment,{children:[o&&u.jsx(jR,{lines:o}),l&&u.jsx(jR,{lines:l})]})}),x5e=function(e,t){var n,r=t.axis,i=t.scale,s=t.x,a=s===void 0?0:s,o=t.y,l=o===void 0?0:o,c=t.length,h=t.ticksPosition,d=t.tickValues,f=t.tickSize,g=f===void 0?5:f,_=t.tickPadding,y=_===void 0?5:_,v=t.tickRotation,m=v===void 0?0:v,p=t.format,x=t.legend,b=t.legendPosition,S=b===void 0?"end":b,C=t.legendOffset,E=C===void 0?0:C,k=t.theme,T=cB({axis:r,scale:i,ticksPosition:h,tickValues:d,tickSize:g,tickPadding:y,tickRotation:m,engine:"canvas"}),R=T.ticks,M=T.textAlign,L=T.textBaseline;e.save(),e.translate(a,l),e.textAlign=M,e.textBaseline=L;var D=k.axis.ticks.text;e.font=(D.fontWeight?D.fontWeight+" ":"")+D.fontSize+"px "+D.fontFamily,((n=k.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(k.axis.domain.line.strokeWidth),e.lineCap="square",k.axis.domain.line.stroke&&(e.strokeStyle=k.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?c:0,r==="x"?0:c),e.stroke());var N=typeof p=="function"?p:function(j){return""+j};if(R.forEach(function(j){var A;((A=k.axis.ticks.line.strokeWidth)!=null?A:0)>0&&(e.lineWidth=Number(k.axis.ticks.line.strokeWidth),e.lineCap="square",k.axis.ticks.line.stroke&&(e.strokeStyle=k.axis.ticks.line.stroke),e.beginPath(),e.moveTo(j.x,j.y),e.lineTo(j.x+j.lineX,j.y+j.lineY),e.stroke());var F=N(j.value);e.save(),e.translate(j.x+j.textX,j.y+j.textY),e.rotate(Kr(m)),D.outlineWidth>0&&(e.strokeStyle=D.outlineColor,e.lineWidth=2*D.outlineWidth,e.lineJoin="round",e.strokeText(""+F,0,0)),k.axis.ticks.text.fill&&(e.fillStyle=D.fill),e.fillText(""+F,0,0),e.restore()}),x!==void 0){var P=0,I=0,z=0,O="center";r==="y"?(z=-90,P=E,S==="start"?(O="start",I=c):S==="middle"?(O="center",I=c/2):S==="end"&&(O="end")):(I=E,S==="start"?O="start":S==="middle"?(O="center",P=c/2):S==="end"&&(O="end",P=c)),e.translate(P,I),e.rotate(Kr(z)),e.font=(k.axis.legend.text.fontWeight?k.axis.legend.text.fontWeight+" ":"")+k.axis.legend.text.fontSize+"px "+k.axis.legend.text.fontFamily,k.axis.legend.text.fill&&(e.fillStyle=k.axis.legend.text.fill),e.textAlign=O,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},_5e=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,s=t.height,a=t.top,o=t.right,l=t.bottom,c=t.left,h=t.theme,d={top:a,right:o,bottom:l,left:c};dB.forEach(function(f){var g=d[f];if(!g)return null;var _=f==="top"||f==="bottom",y=f==="top"||f==="left"?"before":"after",v=_?n:r,m=uB(g.format,v);x5e(e,Yr({},g,{axis:_?"x":"y",x:f==="right"?i:0,y:f==="bottom"?s:0,scale:v,format:m,length:_?i:s,ticksPosition:y,theme:h}))})},LR=function(e,t){var n=t.width,r=t.height,i=t.scale,s=t.axis,a=t.values;_w({width:n,height:r,scale:i,axis:s,values:a}).forEach(function(o){e.beginPath(),e.moveTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.stroke()})},b5e=sB;function w5e(e,t){var n=[];return b5e(e,function(r,i,s){t(r,i,s)&&n.push(r)}),n}var S5e=w5e,C5e=N$,k5e=S5e,E5e=c5,T5e=_r;function M5e(e,t){var n=T5e(e)?C5e:k5e;return n(e,E5e(t))}var R5e=M5e;const A5e=Tn(R5e);var j5e=qo,L5e=ki,D5e="[object Number]";function N5e(e){return typeof e=="number"||L5e(e)&&j5e(e)==D5e}var P5e=N5e;const DR=Tn(P5e);function O5e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var I5e=O5e,$5e=fu,B5e=Nf;function F5e(e,t){return e&&$5e(t,B5e(t),e)}var z5e=F5e,H5e=fu,W5e=Af;function U5e(e,t){return e&&H5e(t,W5e(t),e)}var V5e=U5e,q5e=fu,G5e=n5;function K5e(e,t){return q5e(e,G5e(e),t)}var Y5e=K5e,X5e=e5,J5e=fk,Q5e=n5,Z5e=P$,eEe=Object.getOwnPropertySymbols,tEe=eEe?function(e){for(var t=[];e;)X5e(t,Q5e(e)),e=J5e(e);return t}:Z5e,hB=tEe,nEe=fu,rEe=hB;function iEe(e,t){return nEe(e,rEe(e),t)}var sEe=iEe,oEe=D$,aEe=hB,lEe=Af;function cEe(e){return oEe(e,lEe,aEe)}var fB=cEe,uEe=Object.prototype,dEe=uEe.hasOwnProperty;function hEe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dEe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var fEe=hEe,pEe=hk;function mEe(e,t){var n=t?pEe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gEe=mEe,vEe=/\w*$/;function yEe(e){var t=new e.constructor(e.source,vEe.exec(e));return t.lastIndex=e.lastIndex,t}var xEe=yEe,NR=lu,PR=NR?NR.prototype:void 0,OR=PR?PR.valueOf:void 0;function _Ee(e){return OR?Object(OR.call(e)):{}}var bEe=_Ee,wEe=hk,SEe=gEe,CEe=xEe,kEe=bEe,EEe=WI,TEe="[object Boolean]",MEe="[object Date]",REe="[object Map]",AEe="[object Number]",jEe="[object RegExp]",LEe="[object Set]",DEe="[object String]",NEe="[object Symbol]",PEe="[object ArrayBuffer]",OEe="[object DataView]",IEe="[object Float32Array]",$Ee="[object Float64Array]",BEe="[object Int8Array]",FEe="[object Int16Array]",zEe="[object Int32Array]",HEe="[object Uint8Array]",WEe="[object Uint8ClampedArray]",UEe="[object Uint16Array]",VEe="[object Uint32Array]";function qEe(e,t,n){var r=e.constructor;switch(t){case PEe:return wEe(e);case TEe:case MEe:return new r(+e);case OEe:return SEe(e,n);case IEe:case $Ee:case BEe:case FEe:case zEe:case HEe:case WEe:case UEe:case VEe:return EEe(e,n);case REe:return new r;case AEe:case DEe:return new r(e);case jEe:return CEe(e);case LEe:return new r;case NEe:return kEe(e)}}var GEe=qEe,KEe=D1,YEe=ki,XEe="[object Map]";function JEe(e){return YEe(e)&&KEe(e)==XEe}var QEe=JEe,ZEe=QEe,e3e=Rf,IR=W0,$R=IR&&IR.isMap,t3e=$R?e3e($R):ZEe,n3e=t3e,r3e=D1,i3e=ki,s3e="[object Set]";function o3e(e){return i3e(e)&&r3e(e)==s3e}var a3e=o3e,l3e=a3e,c3e=Rf,BR=W0,FR=BR&&BR.isSet,u3e=FR?c3e(FR):l3e,d3e=u3e,h3e=F0,f3e=I5e,p3e=xk,m3e=z5e,g3e=V5e,v3e=zI,y3e=UI,x3e=Y5e,_3e=sEe,b3e=O$,w3e=fB,S3e=D1,C3e=fEe,k3e=GEe,E3e=qI,T3e=_r,M3e=H0,R3e=n3e,A3e=rs,j3e=d3e,L3e=Nf,D3e=Af,N3e=1,P3e=2,O3e=4,pB="[object Arguments]",I3e="[object Array]",$3e="[object Boolean]",B3e="[object Date]",F3e="[object Error]",mB="[object Function]",z3e="[object GeneratorFunction]",H3e="[object Map]",W3e="[object Number]",gB="[object Object]",U3e="[object RegExp]",V3e="[object Set]",q3e="[object String]",G3e="[object Symbol]",K3e="[object WeakMap]",Y3e="[object ArrayBuffer]",X3e="[object DataView]",J3e="[object Float32Array]",Q3e="[object Float64Array]",Z3e="[object Int8Array]",e4e="[object Int16Array]",t4e="[object Int32Array]",n4e="[object Uint8Array]",r4e="[object Uint8ClampedArray]",i4e="[object Uint16Array]",s4e="[object Uint32Array]",At={};At[pB]=At[I3e]=At[Y3e]=At[X3e]=At[$3e]=At[B3e]=At[J3e]=At[Q3e]=At[Z3e]=At[e4e]=At[t4e]=At[H3e]=At[W3e]=At[gB]=At[U3e]=At[V3e]=At[q3e]=At[G3e]=At[n4e]=At[r4e]=At[i4e]=At[s4e]=!0;At[F3e]=At[mB]=At[K3e]=!1;function vm(e,t,n,r,i,s){var a,o=t&N3e,l=t&P3e,c=t&O3e;if(n&&(a=i?n(e,r,i,s):n(e)),a!==void 0)return a;if(!A3e(e))return e;var h=T3e(e);if(h){if(a=C3e(e),!o)return y3e(e,a)}else{var d=S3e(e),f=d==mB||d==z3e;if(M3e(e))return v3e(e,o);if(d==gB||d==pB||f&&!i){if(a=l||f?{}:E3e(e),!o)return l?_3e(e,g3e(a,e)):x3e(e,m3e(a,e))}else{if(!At[d])return i?e:{};a=k3e(e,d,o)}}s||(s=new h3e);var g=s.get(e);if(g)return g;s.set(e,a),j3e(e)?e.forEach(function(v){a.add(vm(v,t,n,v,e,s))}):R3e(e)&&e.forEach(function(v,m){a.set(m,vm(v,t,n,m,e,s))});var _=c?l?w3e:b3e:l?D3e:L3e,y=h?void 0:_(e);return f3e(y||e,function(v,m){y&&(m=v,v=e[m]),p3e(a,m,vm(v,t,n,m,e,s))}),a}var o4e=vm;function a4e(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}var l4e=a4e,c4e=jf,u4e=l4e;function d4e(e,t){return t.length<2?e:c4e(e,u4e(t,0,-1))}var h4e=d4e,f4e=pu,p4e=p9,m4e=h4e,g4e=mu;function v4e(e,t){return t=f4e(t,e),e=m4e(e,t),e==null||delete e[g4e(p4e(t))]}var y4e=v4e,x4e=gk;function _4e(e){return x4e(e)?void 0:e}var b4e=_4e,w4e=G0,S4e=o4e,C4e=y4e,k4e=pu,E4e=fu,T4e=b4e,M4e=j$,R4e=fB,A4e=1,j4e=2,L4e=4,D4e=M4e(function(e,t){var n={};if(e==null)return n;var r=!1;t=w4e(t,function(s){return s=k4e(s,e),r||(r=s.length>1),s}),E4e(e,R4e(e),n),r&&(n=S4e(n,A4e|j4e|L4e,T4e));for(var i=t.length;i--;)C4e(n,t[i]);return n}),N4e=D4e;const vB=Tn(N4e);function Zi(){return Zi=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},Zi.apply(this,arguments)}var bw={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},P4e=function(e){var t=typeof e;return w.isValidElement(e)||t==="string"||t==="function"||t==="object"},O4e=function(e){var t=typeof e;return t==="string"||t==="function"},Fh=function(e){return e.type==="circle"},ww=function(e){return e.type==="dot"},zh=function(e){return e.type==="rect"},I4e=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(s,a){var o=a.offset||0;return[].concat(s,A5e(t,a.match).map(function(l){var c=r(l),h=i(l);return(Fh(a)||zh(a))&&(h.size=h.size+2*o,h.width=h.width+2*o,h.height=h.height+2*o),Zi({},vB(a,["match","offset"]),c,h,{size:a.size||h.size,datum:l})}))},[])},$4e=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return JSe(O1(i))},yB=function(e){var t,n,r=e.x,i=e.y,s=e.noteX,a=e.noteY,o=e.noteWidth,l=o===void 0?bw.noteWidth:o,c=e.noteTextOffset,h=c===void 0?bw.noteTextOffset:c;if(DR(s))t=r+s;else{if(s.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=s.abs}if(DR(a))n=i+a;else{if(a.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=a.abs}var d=r,f=i,g=$4e(r,i,t,n);if(Fh(e)){var _=ya(Kr(g),e.size/2);d+=_.x,f+=_.y}if(zh(e)){var y=Math.round((g+90)/45)%8;y===0&&(f-=e.height/2),y===1&&(d+=e.width/2,f-=e.height/2),y===2&&(d+=e.width/2),y===3&&(d+=e.width/2,f+=e.height/2),y===4&&(f+=e.height/2),y===5&&(d-=e.width/2,f+=e.height/2),y===6&&(d-=e.width/2),y===7&&(d-=e.width/2,f-=e.height/2)}var v=t,m=t;return(g+90)%360>180?(v-=l,m-=l):m+=l,{points:[[d,f],[t,n],[m,n]],text:[v,n-h],angle:g+90}},xB=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return w.useMemo(function(){return I4e({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},B4e=function(e){var t=e.annotations;return w.useMemo(function(){return t.map(function(n){return Zi({},n,{computed:yB(Zi({},n))})})},[t])},F4e=function(e){return w.useMemo(function(){return yB(e)},[e])},z4e=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=Vt(),a=br(),o=a.animate,l=a.config,c=Bs({x:n,y:r,config:l,immediate:!o});return typeof i=="function"?w.createElement(i,{x:n,y:r,datum:t}):u.jsxs(u.Fragment,{children:[s.annotations.text.outlineWidth>0&&u.jsx(St.text,{x:c.x,y:c.y,style:Zi({},s.annotations.text,{strokeLinejoin:"round",strokeWidth:2*s.annotations.text.outlineWidth,stroke:s.annotations.text.outlineColor}),children:i}),u.jsx(St.text,{x:c.x,y:c.y,style:vB(s.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},zR=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Vt(),s=w.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,h){return c+" L"+h[0]+","+h[1]},"M"+l[0]+","+l[1])},[t]),a=$Se(s);if(r&&i.annotations.link.outlineWidth<=0)return null;var o=Zi({},i.annotations.link);return r&&(o.strokeLinecap="square",o.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,o.stroke=i.annotations.link.outlineColor,o.opacity=i.annotations.link.outlineOpacity),u.jsx(St.path,{fill:"none",d:a,style:o})},H4e=function(e){var t=e.x,n=e.y,r=e.size,i=Vt(),s=br(),a=s.animate,o=s.config,l=Bs({x:t,y:n,radius:r/2,config:o,immediate:!a});return u.jsxs(u.Fragment,{children:[i.annotations.outline.outlineWidth>0&&u.jsx(St.circle,{cx:l.x,cy:l.y,r:l.radius,style:Zi({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),u.jsx(St.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},W4e=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?bw.dotSize:r,s=Vt(),a=br(),o=a.animate,l=a.config,c=Bs({x:t,y:n,radius:i/2,config:l,immediate:!o});return u.jsxs(u.Fragment,{children:[s.annotations.outline.outlineWidth>0&&u.jsx(St.circle,{cx:c.x,cy:c.y,r:c.radius,style:Zi({},s.annotations.outline,{fill:"none",strokeWidth:2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),u.jsx(St.circle,{cx:c.x,cy:c.y,r:c.radius,style:s.annotations.symbol})]})},U4e=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,s=e.borderRadius,a=s===void 0?6:s,o=Vt(),l=br(),c=l.animate,h=l.config,d=Bs({x:t-r/2,y:n-i/2,width:r,height:i,config:h,immediate:!c});return u.jsxs(u.Fragment,{children:[o.annotations.outline.outlineWidth>0&&u.jsx(St.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:Zi({},o.annotations.outline,{fill:"none",strokeWidth:o.annotations.outline.strokeWidth+2*o.annotations.outline.outlineWidth,stroke:o.annotations.outline.outlineColor,opacity:o.annotations.outline.outlineOpacity})}),u.jsx(St.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:o.annotations.outline})]})},V4e=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=F4e(e);if(!P4e(i))throw new Error("note should be a valid react element");return u.jsxs(u.Fragment,{children:[u.jsx(zR,{points:s.points,isOutline:!0}),Fh(e)&&u.jsx(H4e,{x:n,y:r,size:e.size}),ww(e)&&u.jsx(W4e,{x:n,y:r,size:e.size}),zh(e)&&u.jsx(U4e,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),u.jsx(zR,{points:s.points}),u.jsx(z4e,{datum:t,x:s.text[0],y:s.text[1],note:i})]})},HR=function(e,t){t.forEach(function(n,r){var i=n[0],s=n[1];r===0?e.moveTo(i,s):e.lineTo(i,s)})},q4e=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!O4e(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),HR(e,i.computed.points),e.stroke(),e.lineCap="butt"),Fh(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),ww(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),zh(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),HR(e,i.computed.points),e.stroke(),Fh(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),ww(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),zh(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};function rv(){return rv=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},rv.apply(this,arguments)}function WR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function G4e(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(i,s){if(i){if(typeof i=="string")return WR(i,s);var a=Object.prototype.toString.call(i).slice(8,-1);return a==="Object"&&i.constructor&&(a=i.constructor.name),a==="Map"||a==="Set"?Array.from(i):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?WR(i,s):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var _B={nivo:["#e8c1a0","#f47560","#f1e15b","#e8a838","#61cdbb","#97e3d5"],category10:J9,accent:Q9,dark2:Z9,paired:e$,pastel1:t$,pastel2:n$,set1:r$,set2:i$,set3:qk,tableau10:n_e},K4e=Object.keys(_B),bB={brown_blueGreen:r1,purpleRed_green:i1,pink_yellowGreen:s1,purple_orange:o1,red_blue:a1,red_grey:l1,red_yellow_blue:c1,red_yellow_green:u1,spectral:d1},Y4e=Object.keys(bB),X4e={brown_blueGreen:r_e,purpleRed_green:i_e,pink_yellowGreen:s_e,purple_orange:o_e,red_blue:a_e,red_grey:l_e,red_yellow_blue:c_e,red_yellow_green:s$,spectral:u_e},wB={blues:C1,greens:k1,greys:E1,oranges:R1,purples:T1,reds:M1,blue_green:h1,blue_purple:f1,green_blue:p1,orange_red:m1,purple_blue_green:g1,purple_blue:v1,purple_red:y1,red_purple:x1,yellow_green_blue:_1,yellow_green:b1,yellow_orange_brown:w1,yellow_orange_red:S1},J4e=Object.keys(wB),Q4e={blues:b_e,greens:w_e,greys:S_e,oranges:E_e,purples:C_e,reds:k_e,turbo:N_e,viridis:c$,inferno:O_e,magma:P_e,plasma:I_e,cividis:T_e,warm:R_e,cool:l$,cubehelixDefault:M_e,blue_green:d_e,blue_purple:h_e,green_blue:f_e,orange_red:p_e,purple_blue_green:m_e,purple_blue:g_e,purple_red:v_e,red_purple:y_e,yellow_green_blue:x_e,yellow_green:o$,yellow_orange_brown:__e,yellow_orange_red:a$},Ox=rv({},_B,bB,wB),Z4e=function(e){return K4e.includes(e)},eTe=function(e){return Y4e.includes(e)},tTe=function(e){return J4e.includes(e)},nTe={rainbow:A_e,sinebow:D_e};rv({},X4e,Q4e,nTe);var rTe=function(e,t){if(typeof e=="function")return e;if(vk(e)){if(function(l){return l.theme!==void 0}(e)){if(t===void 0)throw new Error("Unable to use color from theme as no theme was provided");var n=Ds(t,e.theme);if(n===void 0)throw new Error("Color from theme is undefined at path: '"+e.theme+"'");return function(){return n}}if(function(l){return l.from!==void 0}(e)){var r=function(l){return Ds(l,e.from)};if(Array.isArray(e.modifiers)){for(var i,s=[],a=function(){var l=i.value,c=l[0],h=l[1];if(c==="brighter")s.push(function(d){return d.brighter(h)});else if(c==="darker")s.push(function(d){return d.darker(h)});else{if(c!=="opacity")throw new Error("Invalid color modifier: '"+c+"', must be one of: 'brighter', 'darker', 'opacity'");s.push(function(d){return d.opacity=h,d})}},o=G4e(e.modifiers);!(i=o()).done;)a();return s.length===0?r:function(l){return s.reduce(function(c,h){return h(c)},Rc(r(l))).toString()}}return r}throw new Error("Invalid color spec, you should either specify 'theme' or 'from' when using a config object")}return function(){return e}},jc=function(e,t){return w.useMemo(function(){return rTe(e,t)},[e,t])};Z.oneOfType([Z.string,Z.func,Z.shape({theme:Z.string.isRequired}),Z.shape({from:Z.string.isRequired,modifiers:Z.arrayOf(Z.array)})]);var iTe=function(e,t){if(typeof e=="function")return e;var n=typeof t=="function"?t:function(d){return Ds(d,t)};if(Array.isArray(e)){var r=ua(e),i=function(d){return r(n(d))};return i.scale=r,i}if(vk(e)){if(function(d){return d.datum!==void 0}(e))return function(d){return Ds(d,e.datum)};if(function(d){return d.scheme!==void 0}(e)){if(Z4e(e.scheme)){var s=ua(Ox[e.scheme]),a=function(d){return s(n(d))};return a.scale=s,a}if(eTe(e.scheme)){if(e.size!==void 0&&(e.size<3||e.size>11))throw new Error("Invalid size '"+e.size+"' for diverging color scheme '"+e.scheme+"', must be between 3~11");var o=ua(Ox[e.scheme][e.size||11]),l=function(d){return o(n(d))};return l.scale=o,l}if(tTe(e.scheme)){if(e.size!==void 0&&(e.size<3||e.size>9))throw new Error("Invalid size '"+e.size+"' for sequential color scheme '"+e.scheme+"', must be between 3~9");var c=ua(Ox[e.scheme][e.size||9]),h=function(d){return c(n(d))};return h.scale=c,h}}throw new Error("Invalid colors, when using an object, you should either pass a 'datum' or a 'scheme' property")}return function(){return e}},SB=function(e,t){return w.useMemo(function(){return iTe(e,t)},[e,t])},sTe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return u.jsx("circle",{r:r/2,cx:t+r/2,cy:n+r/2,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})},oTe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return u.jsx("g",{transform:"translate("+t+","+n+")",children:u.jsx("path",{d:`
                    M`+r/2+` 0
                    L`+.8*r+" "+r/2+`
                    L`+r/2+" "+r+`
                    L`+.2*r+" "+r/2+`
                    L`+r/2+` 0
                `,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})},aTe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return u.jsx("rect",{x:t,y:n,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,width:r,height:r,style:{pointerEvents:"none"}})},lTe=function(e){var t=e.x,n=e.y,r=e.size,i=e.fill,s=e.opacity,a=s===void 0?1:s,o=e.borderWidth,l=o===void 0?0:o,c=e.borderColor;return u.jsx("g",{transform:"translate("+t+","+n+")",children:u.jsx("path",{d:`
                M`+r/2+` 0
                L`+r+" "+r+`
                L0 `+r+`
                L`+r/2+` 0
            `,fill:i,opacity:a,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})};function ha(){return ha=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},ha.apply(this,arguments)}var cTe={top:0,right:0,bottom:0,left:0},d5=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,s=e.itemCount,a=e.itemWidth,o=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var l=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:ha({},cTe,i),c=l.left+l.right,h=l.top+l.bottom,d=a+c,f=o+h,g=(s-1)*r;return n==="row"?d=a*s+g+c:n==="column"&&(f=o*s+g+h),{width:d,height:f,padding:l}},CB=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,s=e.containerHeight,a=e.width,o=e.height,l=n,c=r;switch(t){case"top":l+=(i-a)/2;break;case"top-right":l+=i-a;break;case"right":l+=i-a,c+=(s-o)/2;break;case"bottom-right":l+=i-a,c+=s-o;break;case"bottom":l+=(i-a)/2,c+=s-o;break;case"bottom-left":c+=s-o;break;case"left":c+=(s-o)/2;break;case"center":l+=(i-a)/2,c+=(s-o)/2}return{x:l,y:c}},kB=function(e){var t,n,r,i,s,a,o=e.direction,l=e.justify,c=e.symbolSize,h=e.symbolSpacing,d=e.width,f=e.height;switch(o){case"left-to-right":t=0,n=(f-c)/2,i=f/2,a="central",l?(r=d,s="end"):(r=c+h,s="start");break;case"right-to-left":t=d-c,n=(f-c)/2,i=f/2,a="central",l?(r=0,s="start"):(r=d-c-h,s="end");break;case"top-to-bottom":t=(d-c)/2,n=0,r=d/2,s="middle",l?(i=f,a="alphabetic"):(i=c+h,a="text-before-edge");break;case"bottom-to-top":t=(d-c)/2,n=f-c,r=d/2,s="middle",l?(i=0,a="text-before-edge"):(i=f-c-h,a="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:s,labelAlignment:a}},uTe={circle:sTe,diamond:oTe,square:aTe,triangle:lTe},dTe=function(e){var t,n,r,i,s,a,o,l,c,h,d,f=e.x,g=e.y,_=e.width,y=e.height,v=e.data,m=e.direction,p=m===void 0?"left-to-right":m,x=e.justify,b=x!==void 0&&x,S=e.textColor,C=e.background,E=C===void 0?"transparent":C,k=e.opacity,T=k===void 0?1:k,R=e.symbolShape,M=R===void 0?"square":R,L=e.symbolSize,D=L===void 0?16:L,N=e.symbolSpacing,P=N===void 0?8:N,I=e.symbolBorderWidth,z=I===void 0?0:I,O=e.symbolBorderColor,j=O===void 0?"transparent":O,A=e.onClick,F=e.onMouseEnter,H=e.onMouseLeave,B=e.toggleSerie,G=e.effects,Q=w.useState({}),Y=Q[0],W=Q[1],$=Vt(),V=w.useCallback(function(xe){if(G){var we=G.filter(function(se){return se.on==="hover"}).reduce(function(se,ee){return ha({},se,ee.style)},{});W(we)}F==null||F(v,xe)},[F,v,G]),U=w.useCallback(function(xe){if(G){var we=G.filter(function(se){return se.on!=="hover"}).reduce(function(se,ee){return ha({},se,ee.style)},{});W(we)}H==null||H(v,xe)},[H,v,G]),X=kB({direction:p,justify:b,symbolSize:(t=Y.symbolSize)!=null?t:D,symbolSpacing:P,width:_,height:y}),q=X.symbolX,re=X.symbolY,ne=X.labelX,le=X.labelY,ve=X.labelAnchor,ae=X.labelAlignment,Ee=[A,F,H,B].some(function(xe){return xe!==void 0}),Me=typeof M=="function"?M:uTe[M];return u.jsxs("g",{transform:"translate("+f+","+g+")",style:{opacity:(n=Y.itemOpacity)!=null?n:T},children:[u.jsx("rect",{width:_,height:y,fill:(r=Y.itemBackground)!=null?r:E,style:{cursor:Ee?"pointer":"auto"},onClick:function(xe){A==null||A(v,xe),B==null||B(v.id)},onMouseEnter:V,onMouseLeave:U}),w.createElement(Me,ha({id:v.id,x:q,y:re,size:(i=Y.symbolSize)!=null?i:D,fill:(s=(a=v.fill)!=null?a:v.color)!=null?s:"black",borderWidth:(o=Y.symbolBorderWidth)!=null?o:z,borderColor:(l=Y.symbolBorderColor)!=null?l:j},v.hidden?$.legends.hidden.symbol:void 0)),u.jsx("text",{textAnchor:ve,style:ha({},a5($.legends.text),{fill:(c=(h=(d=Y.itemTextColor)!=null?d:S)!=null?h:$.legends.text.fill)!=null?c:"black",dominantBaseline:ae,pointerEvents:"none",userSelect:"none"},v.hidden?$.legends.hidden.text:void 0),x:ne,y:le,children:v.label})]})},hTe=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,s=e.padding,a=s===void 0?0:s,o=e.justify,l=e.effects,c=e.itemWidth,h=e.itemHeight,d=e.itemDirection,f=d===void 0?"left-to-right":d,g=e.itemsSpacing,_=g===void 0?0:g,y=e.itemTextColor,v=e.itemBackground,m=v===void 0?"transparent":v,p=e.itemOpacity,x=p===void 0?1:p,b=e.symbolShape,S=e.symbolSize,C=e.symbolSpacing,E=e.symbolBorderWidth,k=e.symbolBorderColor,T=e.onClick,R=e.onMouseEnter,M=e.onMouseLeave,L=e.toggleSerie,D=d5({itemCount:t.length,itemWidth:c,itemHeight:h,itemsSpacing:_,direction:i,padding:a}).padding,N=i==="row"?c+_:0,P=i==="column"?h+_:0;return u.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(I,z){return u.jsx(dTe,{data:I,x:z*N+D.left,y:z*P+D.top,width:c,height:h,direction:f,justify:o,effects:l,textColor:y,background:m,opacity:x,symbolShape:b,symbolSize:S,symbolSpacing:C,symbolBorderWidth:E,symbolBorderColor:k,onClick:T,onMouseEnter:R,onMouseLeave:M,toggleSerie:L},z)})})},EB=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,s=i===void 0?0:i,a=e.translateY,o=a===void 0?0:a,l=e.anchor,c=e.direction,h=e.padding,d=h===void 0?0:h,f=e.justify,g=e.itemsSpacing,_=g===void 0?0:g,y=e.itemWidth,v=e.itemHeight,m=e.itemDirection,p=e.itemTextColor,x=e.itemBackground,b=e.itemOpacity,S=e.symbolShape,C=e.symbolSize,E=e.symbolSpacing,k=e.symbolBorderWidth,T=e.symbolBorderColor,R=e.onClick,M=e.onMouseEnter,L=e.onMouseLeave,D=e.toggleSerie,N=e.effects,P=d5({itemCount:t.length,itemsSpacing:_,itemWidth:y,itemHeight:v,direction:c,padding:d}),I=P.width,z=P.height,O=CB({anchor:l,translateX:s,translateY:o,containerWidth:n,containerHeight:r,width:I,height:z}),j=O.x,A=O.y;return u.jsx(hTe,{data:t,x:j,y:A,direction:c,padding:d,justify:f,effects:N,itemsSpacing:_,itemWidth:y,itemHeight:v,itemDirection:m,itemTextColor:p,itemBackground:x,itemOpacity:b,symbolShape:S,symbolSize:C,symbolSpacing:E,symbolBorderWidth:k,symbolBorderColor:T,onClick:R,onMouseEnter:M,onMouseLeave:L,toggleSerie:typeof D=="boolean"?void 0:D})},fTe={start:"left",middle:"center",end:"right"},pTe=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,s=t.translateX,a=s===void 0?0:s,o=t.translateY,l=o===void 0?0:o,c=t.anchor,h=t.direction,d=t.padding,f=d===void 0?0:d,g=t.justify,_=g!==void 0&&g,y=t.itemsSpacing,v=y===void 0?0:y,m=t.itemWidth,p=t.itemHeight,x=t.itemDirection,b=x===void 0?"left-to-right":x,S=t.itemTextColor,C=t.symbolSize,E=C===void 0?16:C,k=t.symbolSpacing,T=k===void 0?8:k,R=t.theme,M=d5({itemCount:n.length,itemWidth:m,itemHeight:p,itemsSpacing:v,direction:h,padding:f}),L=M.width,D=M.height,N=M.padding,P=CB({anchor:c,translateX:a,translateY:l,containerWidth:r,containerHeight:i,width:L,height:D}),I=P.x,z=P.y,O=h==="row"?m+v:0,j=h==="column"?p+v:0;e.save(),e.translate(I,z),e.font=R.legends.text.fontSize+"px "+(R.legends.text.fontFamily||"sans-serif"),n.forEach(function(A,F){var H,B,G=F*O+N.left,Q=F*j+N.top,Y=kB({direction:b,justify:_,symbolSize:E,symbolSpacing:T,width:m,height:p}),W=Y.symbolX,$=Y.symbolY,V=Y.labelX,U=Y.labelY,X=Y.labelAnchor,q=Y.labelAlignment;e.fillStyle=(H=A.color)!=null?H:"black",e.fillRect(G+W,Q+$,E,E),e.textAlign=fTe[X],q==="central"&&(e.textBaseline="middle"),e.fillStyle=(B=S??R.legends.text.fill)!=null?B:"black",e.fillText(String(A.label),G+V,Q+U)}),e.restore()};function bt(){return bt=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},bt.apply(this,arguments)}function yu(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var UR,mTe=function(e){var t=e.bars,n=e.annotations,r=xB({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var s=i.height,a=i.width;return{width:a,height:s,size:Math.max(a,s)}}});return u.jsx(u.Fragment,{children:r.map(function(i,s){return u.jsx(V4e,bt({},i),s)})})},gTe=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return u.jsx(u.Fragment,{children:r.map(function(s,a){var o,l=s[0],c=s[1];return u.jsx(EB,bt({},l,{containerWidth:t,containerHeight:n,data:(o=l.data)!=null?o:c,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),a)})})},vTe=["data"],yTe=function(e){var t,n=e.bar,r=n.data,i=yu(n,vTe),s=e.style,a=s.borderColor,o=s.color,l=s.height,c=s.labelColor,h=s.labelOpacity,d=s.labelX,f=s.labelY,g=s.transform,_=s.width,y=e.borderRadius,v=e.borderWidth,m=e.label,p=e.shouldRenderLabel,x=e.isInteractive,b=e.onClick,S=e.onMouseEnter,C=e.onMouseLeave,E=e.tooltip,k=e.isFocusable,T=e.ariaLabel,R=e.ariaLabelledBy,M=e.ariaDescribedBy,L=Vt(),D=lk(),N=D.showTooltipFromEvent,P=D.showTooltipAt,I=D.hideTooltip,z=w.useMemo(function(){return function(){return w.createElement(E,bt({},i,r))}},[E,i,r]),O=w.useCallback(function(G){b==null||b(bt({color:i.color},r),G)},[i,r,b]),j=w.useCallback(function(G){return N(z(),G)},[N,z]),A=w.useCallback(function(G){S==null||S(r,G),N(z(),G)},[r,S,N,z]),F=w.useCallback(function(G){C==null||C(r,G),I()},[r,I,C]),H=w.useCallback(function(){P(z(),[i.absX+i.width/2,i.absY])},[P,z,i]),B=w.useCallback(function(){I()},[I]);return u.jsxs(St.g,{transform:g,children:[u.jsx(St.rect,{width:jo(_,function(G){return Math.max(G,0)}),height:jo(l,function(G){return Math.max(G,0)}),rx:y,ry:y,fill:(t=r.fill)!=null?t:o,strokeWidth:v,stroke:a,focusable:k,tabIndex:k?0:void 0,"aria-label":T?T(r):void 0,"aria-labelledby":R?R(r):void 0,"aria-describedby":M?M(r):void 0,onMouseEnter:x?A:void 0,onMouseMove:x?j:void 0,onMouseLeave:x?F:void 0,onClick:x?O:void 0,onFocus:x&&k?H:void 0,onBlur:x&&k?B:void 0}),p&&u.jsx(St.text,{x:d,y:f,textAnchor:"middle",dominantBaseline:"central",fillOpacity:h,style:bt({},L.labels.text,{pointerEvents:"none",fill:c}),children:m})]})},xTe=["color","label"],_Te=function(e){var t=e.color,n=e.label,r=yu(e,xTe);return u.jsx(jI,{id:n,value:r.formattedValue,enableChip:!0,color:t})},kt={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:_Te,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},Ft=bt({},kt,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:yTe,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),jn=bt({},kt,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(UR=window.devicePixelRatio)!=null?UR:1}),TB=function(e,t,n,r,i,s){return u5(r,{all:e.map(t),min:0,max:0},i,s).padding(n)},MB=function(e,t){return e.map(function(n){return bt({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},I1=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},$1=function(e){return[e,Number(e)]},bTe=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],h5=function(e,t){return e>t},RB=function(e,t){return e<t},AB=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},wTe=function(e){return h5(e,0)?0:e},STe=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getColor,o=e.getIndex,l=e.getTooltipLabel,c=e.innerPadding,h=c===void 0?0:c,d=e.keys,f=e.xScale,g=e.yScale,_=e.margin,y=n?RB:h5,v=i.map(I1),m=[];return d.forEach(function(p,x){return AB(0,f.domain().length).forEach(function(b){var S,C,E,k=$1(i[b][p]),T=k[0],R=k[1],M=o(i[b]),L=((S=f(M))!=null?S:0)+t*x+h*x,D=y(C=R,0)?(E=g(C))!=null?E:0:r,N=function(I,z){var O;return y(I,0)?r-z:((O=g(I))!=null?O:0)-r}(R,D),P={id:p,value:T===null?T:R,formattedValue:s(R),hidden:!1,index:b,indexValue:M,data:v[b]};m.push({key:p+"."+P.indexValue,index:m.length,data:P,x:L,y:D,absX:_.left+L,absY:_.top+D,width:t,height:N,color:a(P),label:l(P)})})}),m},CTe=function(e,t,n,r){var i=e.data,s=e.formatValue,a=e.getIndex,o=e.getColor,l=e.getTooltipLabel,c=e.keys,h=e.innerPadding,d=h===void 0?0:h,f=e.xScale,g=e.yScale,_=e.margin,y=n?RB:h5,v=i.map(I1),m=[];return c.forEach(function(p,x){return AB(0,g.domain().length).forEach(function(b){var S,C,E,k=$1(i[b][p]),T=k[0],R=k[1],M=a(i[b]),L=y(C=R,0)?r:(E=f(C))!=null?E:0,D=((S=g(M))!=null?S:0)+t*x+d*x,N=function(I,z){var O;return y(I,0)?((O=f(I))!=null?O:0)-r:r-z}(R,L),P={id:p,value:T===null?T:R,formattedValue:s(R),hidden:!1,index:b,indexValue:M,data:v[b]};m.push({key:p+"."+P.indexValue,index:m.length,data:P,x:L,y:D,absX:_.left+L,absY:_.top+D,width:N,height:t,color:o(P),label:l(P)})})}),m},kTe=function(e){var t,n,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,c=e.padding,h=c===void 0?0:c,d=e.innerPadding,f=d===void 0?0:d,g=e.valueScale,_=e.indexScale,y=e.hiddenIds,v=y===void 0?[]:y,m=yu(e,bTe),p=m.keys.filter(function(A){return!v.includes(A)}),x=MB(m.data,p),b=r==="vertical"?["y","x",o]:["x","y",l],S=b[0],C=b[1],E=b[2],k=TB(x,m.getIndex,h,_,E,C),T=bt({max:s,min:i,reverse:a},g),R=T.min==="auto"?wTe:function(A){return A},M=x.reduce(function(A,F){return[].concat(A,p.map(function(H){return F[H]}))},[]).filter(Boolean),L=R(Math.min.apply(Math,M)),D=(n=Math.max.apply(Math,M),isFinite(n)?n:0),N=u5(T,{all:M,min:L,max:D},S==="x"?o:l,S),P=r==="vertical"?[k,N]:[N,k],I=P[0],z=P[1],O=(k.bandwidth()-f*(p.length-1))/p.length,j=[bt({},m,{data:x,keys:p,innerPadding:f,xScale:I,yScale:z}),O,T.reverse,(t=N(0))!=null?t:0];return{xScale:I,yScale:z,bars:O>0?r==="vertical"?STe.apply(void 0,j):CTe.apply(void 0,j):[]}},ETe=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],TTe=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},MTe=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,c=e.xScale,h=e.yScale,d=e.margin,f=[];return l.forEach(function(g){return c.domain().forEach(function(_,y){var v,m,p=g[y],x=(v=c(s(p.data)))!=null?v:0,b=((m=function(R){return h(R[n?0:1])}(p))!=null?m:0)+.5*o,S=function(R,M){var L;return((L=h(R[n?1:0]))!=null?L:0)-M}(p,b)-o,C=$1(p.data[g.key]),E=C[0],k=C[1],T={id:g.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:y,indexValue:_,data:I1(p.data)};f.push({key:g.key+"."+_,index:f.length,data:T,x,y:b,absX:d.left+x,absY:d.top+b,width:t,height:S,color:i(T),label:a(T)})})}),f},RTe=function(e,t,n){var r=e.formatValue,i=e.getColor,s=e.getIndex,a=e.getTooltipLabel,o=e.innerPadding,l=e.stackedData,c=e.xScale,h=e.yScale,d=e.margin,f=[];return l.forEach(function(g){return h.domain().forEach(function(_,y){var v,m,p=g[y],x=(v=h(s(p.data)))!=null?v:0,b=((m=function(R){return c(R[n?1:0])}(p))!=null?m:0)+.5*o,S=function(R,M){var L;return((L=c(R[n?0:1]))!=null?L:0)-M}(p,b)-o,C=$1(p.data[g.key]),E=C[0],k=C[1],T={id:g.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:y,indexValue:_,data:I1(p.data)};f.push({key:g.key+"."+_,index:f.length,data:T,x:b,y:x,absX:d.left+b,absY:d.top+x,width:S,height:t,color:i(T),label:a(T)})})}),f},ATe=function(e){var t,n=e.data,r=e.layout,i=e.minValue,s=e.maxValue,a=e.reverse,o=e.width,l=e.height,c=e.padding,h=c===void 0?0:c,d=e.valueScale,f=e.indexScale,g=e.hiddenIds,_=g===void 0?[]:g,y=yu(e,ETe),v=y.keys.filter(function(O){return!_.includes(O)}),m=rwe().keys(v).offset(iwe)(MB(n,v)),p=r==="vertical"?["y","x",o]:["x","y",l],x=p[0],b=p[1],S=p[2],C=TB(n,y.getIndex,h,f,S,b),E=bt({max:s,min:i,reverse:a},d),k=(t=TTe(m),d.type==="log"?t.filter(function(O){return O!==0}):t),T=Math.min.apply(Math,k),R=Math.max.apply(Math,k),M=u5(E,{all:k,min:T,max:R},x==="x"?o:l,x),L=r==="vertical"?[C,M]:[M,C],D=L[0],N=L[1],P=y.innerPadding>0?y.innerPadding:0,I=C.bandwidth(),z=[bt({},y,{innerPadding:P,stackedData:m,xScale:D,yScale:N}),I,E.reverse];return{xScale:D,yScale:N,bars:I>0?r==="vertical"?MTe.apply(void 0,z):RTe.apply(void 0,z):[]}},jTe=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,s=e.layout,a=e.legendLabel,o=e.reverse,l=tB(a??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(c,h,d){var f=TR(c.map(function(g){var _,y;return{id:(_=g.data.indexValue)!=null?_:"",label:d(g.data),hidden:g.data.hidden,color:(y=g.color)!=null?y:"#000"}}),function(g){return g.id});return h==="horizontal"&&f.reverse(),f}(t,s,l):function(c,h,d,f,g,_){var y=TR(c.map(function(v){var m;return{id:v.data.id,label:_(v.data),hidden:v.data.hidden,color:(m=v.color)!=null?m:"#000"}}),function(v){return v.id});return(h==="vertical"&&f==="stacked"&&d==="column"&&g!==!0||h==="horizontal"&&f==="stacked"&&g===!0)&&y.reverse(),y}(t,s,n,i,o,l)},VR=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},LTe=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},DTe=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},NTe=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},jB=function(e){var t=e.indexBy,n=t===void 0?kt.indexBy:t,r=e.keys,i=r===void 0?kt.keys:r,s=e.label,a=s===void 0?kt.label:s,o=e.tooltipLabel,l=o===void 0?kt.tooltipLabel:o,c=e.valueFormat,h=e.colors,d=h===void 0?kt.colors:h,f=e.colorBy,g=f===void 0?kt.colorBy:f,_=e.borderColor,y=_===void 0?kt.borderColor:_,v=e.labelTextColor,m=v===void 0?kt.labelTextColor:v,p=e.groupMode,x=p===void 0?kt.groupMode:p,b=e.layout,S=b===void 0?kt.layout:b,C=e.reverse,E=C===void 0?kt.reverse:C,k=e.data,T=e.minValue,R=T===void 0?kt.minValue:T,M=e.maxValue,L=M===void 0?kt.maxValue:M,D=e.margin,N=e.width,P=e.height,I=e.padding,z=I===void 0?kt.padding:I,O=e.innerPadding,j=O===void 0?kt.innerPadding:O,A=e.valueScale,F=A===void 0?kt.valueScale:A,H=e.indexScale,B=H===void 0?kt.indexScale:H,G=e.initialHiddenIds,Q=G===void 0?kt.initialHiddenIds:G,Y=e.enableLabel,W=Y===void 0?kt.enableLabel:Y,$=e.labelSkipWidth,V=$===void 0?kt.labelSkipWidth:$,U=e.labelSkipHeight,X=U===void 0?kt.labelSkipHeight:U,q=e.legends,re=q===void 0?kt.legends:q,ne=e.legendLabel,le=e.totalsOffset,ve=le===void 0?kt.totalsOffset:le,ae=w.useState(Q??[]),Ee=ae[0],Me=ae[1],xe=w.useCallback(function(Te){Me(function(Ie){return Ie.indexOf(Te)>-1?Ie.filter(function(Xe){return Xe!==Te}):[].concat(Ie,[Te])})},[]),we=xa(n),se=xa(a),ee=xa(l),ie=N1(c),ce=Vt(),K=SB(d,g),te=jc(y,ce),oe=jc(m,ce),he=(x==="grouped"?kTe:ATe)({layout:S,reverse:E,data:k,getIndex:we,keys:i,minValue:R,maxValue:L,width:N,height:P,getColor:K,padding:z,innerPadding:j,valueScale:F,indexScale:B,hiddenIds:Ee,formatValue:ie,getTooltipLabel:ee,margin:D}),_e=he.bars,ge=he.xScale,ye=he.yScale,ze=w.useMemo(function(){return _e.filter(function(Te){return Te.data.value!==null}).map(function(Te,Ie){return bt({},Te,{index:Ie})})},[_e]),Oe=w.useCallback(function(Te){var Ie=Te.width,Xe=Te.height;return!!W&&!(V>0&&Ie<V)&&!(X>0&&Xe<X)},[W,V,X]),je=w.useMemo(function(){return i.map(function(Te){var Ie=_e.find(function(Xe){return Xe.data.id===Te});return bt({},Ie,{data:bt({id:Te},Ie==null?void 0:Ie.data,{hidden:Ee.includes(Te)})})})},[Ee,i,_e]),Le=w.useMemo(function(){return re.map(function(Te){return[Te,jTe({bars:Te.dataFrom==="keys"?je:_e,direction:Te.direction,from:Te.dataFrom,groupMode:x,layout:S,legendLabel:ne,reverse:E})]})},[re,je,_e,x,S,ne,E]),pt=w.useMemo(function(){return function(Te,Ie,Xe,rn,nt,mt,Gt){rn===void 0&&(rn=kt.layout),nt===void 0&&(nt=kt.groupMode);var sn=[];if(Te.length===0)return sn;var Mt=new Map,Ot=Te[0].width,It=Te[0].height;if(nt==="stacked"){var pn=new Map;Te.forEach(function(Je){var Ge=Je.data,He=Ge.indexValue,gt=Ge.value;VR(Mt,He,Number(gt)),LTe(pn,He,Number(gt))}),pn.forEach(function(Je,Ge){var He,gt,en,tn=Mt.get(Ge)||0;rn==="vertical"?(He=Ie(Ge),gt=Xe(Je),en=Xe(Je/2)):(He=Ie(Je),gt=Xe(Ge),en=Ie(Je/2)),He+=rn==="vertical"?Ot/2:mt,gt+=rn==="vertical"?-mt:It/2,sn.push({key:"total_"+Ge,x:He,y:gt,value:tn,formattedValue:Gt(tn),animationOffset:en})})}else if(nt==="grouped"){var _t=new Map,on=new Map;Te.forEach(function(Je){var Ge=Je.data,He=Ge.indexValue,gt=Ge.value;VR(Mt,He,Number(gt)),DTe(_t,He,Number(gt)),NTe(on,He)}),_t.forEach(function(Je,Ge){var He,gt,en,tn=Mt.get(Ge)||0,Rn=on.get(Ge);rn==="vertical"?(He=Ie(Ge),gt=Xe(Je),en=Xe(Je/2)):(He=Ie(Je),gt=Xe(Ge),en=Ie(Je/2)),He+=rn==="vertical"?Rn*Ot/2:mt,gt+=rn==="vertical"?-mt:Rn*It/2,sn.push({key:"total_"+Ge,x:He,y:gt,value:tn,formattedValue:Gt(tn),animationOffset:en})})}return sn}(_e,ge,ye,S,x,ve,ie)},[_e,ge,ye,S,x,ve,ie]);return{bars:_e,barsWithValue:ze,xScale:ge,yScale:ye,getIndex:we,getLabel:se,getTooltipLabel:ee,formatValue:ie,getColor:K,getBorderColor:te,getLabelColor:oe,shouldRenderBarLabel:Oe,hiddenIds:Ee,toggleSerie:xe,legendsWithData:Le,barTotals:pt}},PTe=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,s=i===void 0?Ft.layout:i,a=Vt();return Qa(t,{keys:function(o){return o.key},from:function(o){return{x:s==="vertical"?o.x:o.animationOffset,y:s==="vertical"?o.animationOffset:o.y,labelOpacity:0}},enter:function(o){return{x:o.x,y:o.y,labelOpacity:1}},update:function(o){return{x:o.x,y:o.y,labelOpacity:1}},leave:function(o){return{x:s==="vertical"?o.x:o.animationOffset,y:s==="vertical"?o.animationOffset:o.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(o,l){return u.jsx(St.text,{x:o.x,y:o.y,fillOpacity:o.labelOpacity,style:bt({},a.labels.text,{pointerEvents:"none",fill:a.text.fill}),fontWeight:"bold",fontSize:a.labels.text.fontSize,fontFamily:a.labels.text.fontFamily,textAnchor:s==="vertical"?"middle":"start",alignmentBaseline:s==="vertical"?"alphabetic":"middle",children:l.formattedValue},l.key)})},OTe=["isInteractive","animate","motionConfig","theme","renderWrapper"],ITe=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,s=e.width,a=e.height,o=e.groupMode,l=e.layout,c=e.reverse,h=e.minValue,d=e.maxValue,f=e.valueScale,g=e.indexScale,_=e.padding,y=e.innerPadding,v=e.axisTop,m=e.axisRight,p=e.axisBottom,x=p===void 0?Ft.axisBottom:p,b=e.axisLeft,S=b===void 0?Ft.axisLeft:b,C=e.enableGridX,E=C===void 0?Ft.enableGridX:C,k=e.enableGridY,T=k===void 0?Ft.enableGridY:k,R=e.gridXValues,M=e.gridYValues,L=e.layers,D=L===void 0?Ft.layers:L,N=e.barComponent,P=N===void 0?Ft.barComponent:N,I=e.enableLabel,z=I===void 0?Ft.enableLabel:I,O=e.label,j=e.labelSkipWidth,A=j===void 0?Ft.labelSkipWidth:j,F=e.labelSkipHeight,H=F===void 0?Ft.labelSkipHeight:F,B=e.labelTextColor,G=e.markers,Q=G===void 0?Ft.markers:G,Y=e.colorBy,W=e.colors,$=e.defs,V=$===void 0?Ft.defs:$,U=e.fill,X=U===void 0?Ft.fill:U,q=e.borderRadius,re=q===void 0?Ft.borderRadius:q,ne=e.borderWidth,le=ne===void 0?Ft.borderWidth:ne,ve=e.borderColor,ae=e.annotations,Ee=ae===void 0?Ft.annotations:ae,Me=e.legendLabel,xe=e.tooltipLabel,we=e.valueFormat,se=e.isInteractive,ee=se===void 0?Ft.isInteractive:se,ie=e.tooltip,ce=ie===void 0?Ft.tooltip:ie,K=e.onClick,te=e.onMouseEnter,oe=e.onMouseLeave,he=e.legends,_e=e.role,ge=_e===void 0?Ft.role:_e,ye=e.ariaLabel,ze=e.ariaLabelledBy,Oe=e.ariaDescribedBy,je=e.isFocusable,Le=je===void 0?Ft.isFocusable:je,pt=e.barAriaLabel,Te=e.barAriaLabelledBy,Ie=e.barAriaDescribedBy,Xe=e.initialHiddenIds,rn=e.enableTotals,nt=rn===void 0?Ft.enableTotals:rn,mt=e.totalsOffset,Gt=mt===void 0?Ft.totalsOffset:mt,sn=br(),Mt=sn.animate,Ot=sn.config,It=o5(s,a,i),pn=It.outerWidth,_t=It.outerHeight,on=It.margin,Je=It.innerWidth,Ge=It.innerHeight,He=jB({indexBy:n,label:O,tooltipLabel:xe,valueFormat:we,colors:W,colorBy:Y,borderColor:ve,labelTextColor:B,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:h,maxValue:d,margin:on,width:Je,height:Ge,padding:_,innerPadding:y,valueScale:f,indexScale:g,enableLabel:z,labelSkipWidth:A,labelSkipHeight:H,legends:he,legendLabel:Me,initialHiddenIds:Xe,totalsOffset:Gt}),gt=He.bars,en=He.barsWithValue,tn=He.xScale,Rn=He.yScale,hl=He.getLabel,Ne=He.getTooltipLabel,Pe=He.getBorderColor,st=He.getLabelColor,Rt=He.shouldRenderBarLabel,ut=He.toggleSerie,Kt=He.legendsWithData,Ct=He.barTotals,Yt=Qa(en,{keys:function(ke){return ke.key},from:function(ke){return bt({borderColor:Pe(ke),color:ke.color,height:0,labelColor:st(ke),labelOpacity:0,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+(ke.y+ke.height)+")",width:ke.width},l==="vertical"?{}:{height:ke.height,transform:"translate("+ke.x+", "+ke.y+")",width:0})},enter:function(ke){return{borderColor:Pe(ke),color:ke.color,height:ke.height,labelColor:st(ke),labelOpacity:1,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+ke.y+")",width:ke.width}},update:function(ke){return{borderColor:Pe(ke),color:ke.color,height:ke.height,labelColor:st(ke),labelOpacity:1,labelX:ke.width/2,labelY:ke.height/2,transform:"translate("+ke.x+", "+ke.y+")",width:ke.width}},leave:function(ke){return bt({borderColor:Pe(ke),color:ke.color,height:0,labelColor:st(ke),labelOpacity:0,labelX:ke.width/2,labelY:0,transform:"translate("+ke.x+", "+(ke.y+ke.height)+")",width:ke.width},l==="vertical"?{}:{labelX:0,labelY:ke.height/2,height:ke.height,transform:"translate("+ke.x+", "+ke.y+")",width:0})},config:Ot,immediate:!Mt,initial:Mt?void 0:null}),Go=w.useMemo(function(){return{borderRadius:re,borderWidth:le,enableLabel:z,isInteractive:ee,labelSkipWidth:A,labelSkipHeight:H,onClick:K,onMouseEnter:te,onMouseLeave:oe,getTooltipLabel:Ne,tooltip:ce,isFocusable:Le,ariaLabel:pt,ariaLabelledBy:Te,ariaDescribedBy:Ie}},[re,le,z,Ne,ee,H,A,K,te,oe,ce,Le,pt,Te,Ie]),fl=nB(V,gt,X,{dataKey:"data",targetKey:"data.fill"}),Kn={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};D.includes("annotations")&&(Kn.annotations=u.jsx(mTe,{bars:gt,annotations:Ee},"annotations")),D.includes("axes")&&(Kn.axes=u.jsx(g5e,{xScale:tn,yScale:Rn,width:Je,height:Ge,top:v,right:m,bottom:x,left:S},"axes")),D.includes("bars")&&(Kn.bars=u.jsx(w.Fragment,{children:Yt(function(ke,os){return w.createElement(P,bt({},Go,{bar:os,style:ke,shouldRenderLabel:Rt(os),label:hl(os.data)}))})},"bars")),D.includes("grid")&&(Kn.grid=u.jsx(y5e,{width:Je,height:Ge,xScale:E?tn:null,yScale:T?Rn:null,xValues:R,yValues:M},"grid")),D.includes("legends")&&(Kn.legends=u.jsx(gTe,{width:Je,height:Ge,legends:Kt,toggleSerie:ut},"legends")),D.includes("markers")&&(Kn.markers=u.jsx(rCe,{markers:Q,width:Je,height:Ge,xScale:tn,yScale:Rn},"markers")),D.includes("totals")&&nt&&(Kn.totals=u.jsx(PTe,{data:Ct,springConfig:Ot,animate:Mt,layout:l},"totals"));var wu=w.useMemo(function(){return bt({},Go,{margin:on,width:s,height:a,innerWidth:Je,innerHeight:Ge,bars:gt,legendData:Kt,enableLabel:z,xScale:tn,yScale:Rn,tooltip:ce,getTooltipLabel:Ne,onClick:K,onMouseEnter:te,onMouseLeave:oe})},[Go,on,s,a,Je,Ge,gt,Kt,z,tn,Rn,ce,Ne,K,te,oe]);return u.jsx(l5,{width:pn,height:_t,margin:on,defs:fl,role:ge,ariaLabel:ye,ariaLabelledBy:ze,ariaDescribedBy:Oe,isFocusable:Le,children:D.map(function(ke,os){var An;return typeof ke=="function"?u.jsx(w.Fragment,{children:w.createElement(ke,wu)},os):(An=Kn==null?void 0:Kn[ke])!=null?An:null})})},$Te=function(e){var t=e.isInteractive,n=t===void 0?Ft.isInteractive:t,r=e.animate,i=r===void 0?Ft.animate:r,s=e.motionConfig,a=s===void 0?Ft.motionConfig:s,o=e.theme,l=e.renderWrapper,c=yu(e,OTe);return u.jsx(P1,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:u.jsx(ITe,bt({isInteractive:n},c))})},BTe=["isInteractive","renderWrapper","theme"],Ix=function(e,t,n,r){return e.find(function(i){return iCe(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},FTe=function(e){var t=e.data,n=e.indexBy,r=e.keys,i=e.margin,s=e.width,a=e.height,o=e.groupMode,l=e.layout,c=e.reverse,h=e.minValue,d=e.maxValue,f=e.valueScale,g=e.indexScale,_=e.padding,y=e.innerPadding,v=e.axisTop,m=e.axisRight,p=e.axisBottom,x=p===void 0?jn.axisBottom:p,b=e.axisLeft,S=b===void 0?jn.axisLeft:b,C=e.enableGridX,E=C===void 0?jn.enableGridX:C,k=e.enableGridY,T=k===void 0?jn.enableGridY:k,R=e.gridXValues,M=e.gridYValues,L=e.layers,D=L===void 0?jn.layers:L,N=e.renderBar,P=N===void 0?function(Ne,Pe){var st=Pe.bar,Rt=st.color,ut=st.height,Kt=st.width,Ct=st.x,Yt=st.y,Go=Pe.borderColor,fl=Pe.borderRadius,Kn=Pe.borderWidth,wu=Pe.label,ke=Pe.labelColor,os=Pe.shouldRenderLabel;if(Ne.fillStyle=Rt,Kn>0&&(Ne.strokeStyle=Go,Ne.lineWidth=Kn),Ne.beginPath(),fl>0){var An=Math.min(fl,ut);Ne.moveTo(Ct+An,Yt),Ne.lineTo(Ct+Kt-An,Yt),Ne.quadraticCurveTo(Ct+Kt,Yt,Ct+Kt,Yt+An),Ne.lineTo(Ct+Kt,Yt+ut-An),Ne.quadraticCurveTo(Ct+Kt,Yt+ut,Ct+Kt-An,Yt+ut),Ne.lineTo(Ct+An,Yt+ut),Ne.quadraticCurveTo(Ct,Yt+ut,Ct,Yt+ut-An),Ne.lineTo(Ct,Yt+An),Ne.quadraticCurveTo(Ct,Yt,Ct+An,Yt),Ne.closePath()}else Ne.rect(Ct,Yt,Kt,ut);Ne.fill(),Kn>0&&Ne.stroke(),os&&(Ne.textBaseline="middle",Ne.textAlign="center",Ne.fillStyle=ke,Ne.fillText(wu,Ct+Kt/2,Yt+ut/2))}:N,I=e.enableLabel,z=I===void 0?jn.enableLabel:I,O=e.label,j=e.labelSkipWidth,A=j===void 0?jn.labelSkipWidth:j,F=e.labelSkipHeight,H=F===void 0?jn.labelSkipHeight:F,B=e.labelTextColor,G=e.colorBy,Q=e.colors,Y=e.borderRadius,W=Y===void 0?jn.borderRadius:Y,$=e.borderWidth,V=$===void 0?jn.borderWidth:$,U=e.borderColor,X=e.annotations,q=X===void 0?jn.annotations:X,re=e.legendLabel,ne=e.tooltipLabel,le=e.valueFormat,ve=e.isInteractive,ae=ve===void 0?jn.isInteractive:ve,Ee=e.tooltip,Me=Ee===void 0?jn.tooltip:Ee,xe=e.onClick,we=e.onMouseEnter,se=e.onMouseLeave,ee=e.legends,ie=e.pixelRatio,ce=ie===void 0?jn.pixelRatio:ie,K=e.canvasRef,te=e.enableTotals,oe=te===void 0?jn.enableTotals:te,he=e.totalsOffset,_e=he===void 0?jn.totalsOffset:he,ge=w.useRef(null),ye=Vt(),ze=o5(s,a,i),Oe=ze.margin,je=ze.innerWidth,Le=ze.innerHeight,pt=ze.outerWidth,Te=ze.outerHeight,Ie=jB({indexBy:n,label:O,tooltipLabel:ne,valueFormat:le,colors:Q,colorBy:G,borderColor:U,labelTextColor:B,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:h,maxValue:d,margin:Oe,width:je,height:Le,padding:_,innerPadding:y,valueScale:f,indexScale:g,enableLabel:z,labelSkipWidth:A,labelSkipHeight:H,legends:ee,legendLabel:re,totalsOffset:_e}),Xe=Ie.bars,rn=Ie.barsWithValue,nt=Ie.xScale,mt=Ie.yScale,Gt=Ie.getLabel,sn=Ie.getTooltipLabel,Mt=Ie.getBorderColor,Ot=Ie.getLabelColor,It=Ie.shouldRenderBarLabel,pn=Ie.legendsWithData,_t=Ie.barTotals,on=lk(),Je=on.showTooltipFromEvent,Ge=on.hideTooltip,He=B4e({annotations:xB({data:Xe,annotations:q,getPosition:function(Ne){return{x:Ne.x,y:Ne.y}},getDimensions:function(Ne){var Pe=Ne.width,st=Ne.height;return{width:Pe,height:st,size:Math.max(Pe,st)}}})}),gt=w.useMemo(function(){return{borderRadius:W,borderWidth:V,isInteractive:ae,isFocusable:!1,labelSkipWidth:A,labelSkipHeight:H,margin:Oe,width:s,height:a,innerWidth:je,innerHeight:Le,bars:Xe,legendData:pn,enableLabel:z,xScale:nt,yScale:mt,tooltip:Me,getTooltipLabel:sn,onClick:xe,onMouseEnter:we,onMouseLeave:se}},[W,V,ae,A,H,Oe,s,a,je,Le,Xe,pn,z,nt,mt,Me,sn,xe,we,se]),en=N1(le);w.useEffect(function(){var Ne,Pe=(Ne=ge.current)==null?void 0:Ne.getContext("2d");ge.current&&Pe&&(ge.current.width=pt*ce,ge.current.height=Te*ce,Pe.scale(ce,ce),Pe.fillStyle=ye.background,Pe.fillRect(0,0,pt,Te),Pe.translate(Oe.left,Oe.top),D.forEach(function(st){st==="grid"?typeof ye.grid.line.strokeWidth=="number"&&ye.grid.line.strokeWidth>0&&(Pe.lineWidth=ye.grid.line.strokeWidth,Pe.strokeStyle=ye.grid.line.stroke,E&&LR(Pe,{width:je,height:Le,scale:nt,axis:"x",values:R}),T&&LR(Pe,{width:je,height:Le,scale:mt,axis:"y",values:M})):st==="axes"?_5e(Pe,{xScale:nt,yScale:mt,width:je,height:Le,top:v,right:m,bottom:x,left:S,theme:ye}):st==="bars"?rn.forEach(function(Rt){P(Pe,{bar:Rt,borderColor:Mt(Rt),borderRadius:W,borderWidth:V,label:Gt(Rt.data),labelColor:Ot(Rt),shouldRenderLabel:It(Rt)})}):st==="legends"?pn.forEach(function(Rt){var ut=Rt[0],Kt=Rt[1];pTe(Pe,bt({},ut,{data:Kt,containerWidth:je,containerHeight:Le,theme:ye}))}):st==="annotations"?q4e(Pe,{annotations:He,theme:ye}):st==="totals"&&oe?function(Rt,ut,Kt,Ct){Ct===void 0&&(Ct=jn.layout),Rt.fillStyle=Kt.text.fill,Rt.font="bold "+Kt.labels.text.fontSize+"px "+Kt.labels.text.fontFamily,Rt.textBaseline=Ct==="vertical"?"alphabetic":"middle",Rt.textAlign=Ct==="vertical"?"center":"start",ut.forEach(function(Yt){Rt.fillText(Yt.formattedValue,Yt.x,Yt.y)})}(Pe,_t,ye,l):typeof st=="function"&&st(Pe,gt)}),Pe.save())},[x,S,m,v,rn,W,V,He,E,T,Mt,Gt,Ot,R,M,o,a,Le,je,gt,D,l,pn,Oe.left,Oe.top,Te,pt,ce,P,nt,mt,c,It,ye,s,_t,oe,en]);var tn=w.useCallback(function(Ne){if(Xe&&ge.current){var Pe=Dx(ge.current,Ne),st=Pe[0],Rt=Pe[1],ut=Ix(Xe,Oe,st,Rt);ut!==void 0?(Je(w.createElement(Me,bt({},ut.data,{color:ut.color,label:ut.label,value:Number(ut.data.value)})),Ne),Ne.type==="mouseenter"&&(we==null||we(ut.data,Ne))):Ge()}},[Ge,Oe,we,Xe,Je,Me]),Rn=w.useCallback(function(Ne){if(Xe&&ge.current){Ge();var Pe=Dx(ge.current,Ne),st=Pe[0],Rt=Pe[1],ut=Ix(Xe,Oe,st,Rt);ut&&(se==null||se(ut.data,Ne))}},[Ge,Oe,se,Xe]),hl=w.useCallback(function(Ne){if(Xe&&ge.current){var Pe=Dx(ge.current,Ne),st=Pe[0],Rt=Pe[1],ut=Ix(Xe,Oe,st,Rt);ut!==void 0&&(xe==null||xe(bt({},ut.data,{color:ut.color}),Ne))}},[Oe,xe,Xe]);return u.jsx("canvas",{ref:function(Ne){ge.current=Ne,K&&"current"in K&&(K.current=Ne)},width:pt*ce,height:Te*ce,style:{width:pt,height:Te,cursor:ae?"auto":"normal"},onMouseEnter:ae?tn:void 0,onMouseMove:ae?tn:void 0,onMouseLeave:ae?Rn:void 0,onClick:ae?hl:void 0})},zTe=w.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,s=yu(e,BTe);return u.jsx(P1,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:u.jsx(FTe,bt({},s,{canvasRef:t}))})});w.forwardRef(function(e,t){return u.jsx(q$,{children:function(n){var r=n.width,i=n.height;return u.jsx(zTe,bt({width:r,height:i},e,{ref:t}))}})});const Wd=window.document.documentElement,LB=window.txConsts.customThemes.map(e=>e.name),HTe=window.txConsts.customThemes.map(e=>`theme-${e.name}`),f5=["dark","light"],DB=LB.find(e=>Wd.classList.contains(`theme-${e}`))??f5.find(e=>Wd.classList.contains(e))??window.txConsts.defaultTheme,NB=e=>{document.cookie=`txAdmin-theme=${e};path=/;SameSite=Lax;max-age=31536000;`},PB=e=>{if(f5.includes(e))return{isInvalid:!1,isDefault:!0,isDarkScheme:e==="dark",lightDarkClass:e,customClass:void 0};if(LB.includes(e)){const t=window.txConsts.customThemes.find(n=>n.name===e);if(t){const n=t.isDark;return{isInvalid:!1,isDefault:!1,isDarkScheme:n,lightDarkClass:n?"dark":"light",customClass:`theme-${e}`}}}return console.warn(`Could not find theme'${e}', defaulting to dark.`),{isInvalid:!0,isDefault:!1,isDarkScheme:!0,lightDarkClass:"dark",customClass:void 0}},p5=Qe(DB),OB=Qe(e=>{const t=e(p5);return PB(t).isDarkScheme});NB(DB);const Sw=(e,t)=>{var l,c;const{isInvalid:n,isDefault:r,isDarkScheme:i,lightDarkClass:s,customClass:a}=PB(t);if(n)throw new Error(`invalid theme ${t}`);Wd.classList.remove(...f5,...HTe),Wd.classList.add(s),a&&Wd.classList.add(a);const o=(c=(l=document.getElementById("legacyPageIframe"))==null?void 0:l.contentDocument)==null?void 0:c.body;o&&(i?o.classList.add("theme--dark"):o.classList.remove("theme--dark")),NB(t),console.log(`Changed theme from '${e}' to '${t}'.`)},IB=()=>{const[e,t]=mr(p5);return{theme:e,setTheme:r=>{r!==e&&(Sw(e,r),t(r))}}},WTe=()=>{const e=tt(p5);return()=>e(t=>t==="dark"?(Sw(t,"light"),"light"):t==="light"?(Sw(t,"dark"),"dark"):(console.log("invalid theme",t),t))},B1=()=>et(OB),UTe=e=>{const t=et(OB);if(typeof e=="string")return e.replace(/{theme}/g,t?"dark":"light")};var $B=typeof global=="object"&&global&&global.Object===Object&&global,VTe=typeof self=="object"&&self&&self.Object===Object&&self,is=$B||VTe||Function("return this")(),Lc=is.Symbol,BB=Object.prototype,qTe=BB.hasOwnProperty,GTe=BB.toString,Ju=Lc?Lc.toStringTag:void 0;function KTe(e){var t=qTe.call(e,Ju),n=e[Ju];try{e[Ju]=void 0;var r=!0}catch{}var i=GTe.call(e);return r&&(t?e[Ju]=n:delete e[Ju]),i}var YTe=Object.prototype,XTe=YTe.toString;function JTe(e){return XTe.call(e)}var QTe="[object Null]",ZTe="[object Undefined]",qR=Lc?Lc.toStringTag:void 0;function Pf(e){return e==null?e===void 0?ZTe:QTe:qR&&qR in Object(e)?KTe(e):JTe(e)}function Of(e){return e!=null&&typeof e=="object"}var m5=Array.isArray;function F1(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var eMe="[object AsyncFunction]",tMe="[object Function]",nMe="[object GeneratorFunction]",rMe="[object Proxy]";function FB(e){if(!F1(e))return!1;var t=Pf(e);return t==tMe||t==nMe||t==eMe||t==rMe}var $x=is["__core-js_shared__"],GR=function(){var e=/[^.]+$/.exec($x&&$x.keys&&$x.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function iMe(e){return!!GR&&GR in e}var sMe=Function.prototype,oMe=sMe.toString;function sl(e){if(e!=null){try{return oMe.call(e)}catch{}try{return e+""}catch{}}return""}var aMe=/[\\^$.*+?()[\]{}|]/g,lMe=/^\[object .+?Constructor\]$/,cMe=Function.prototype,uMe=Object.prototype,dMe=cMe.toString,hMe=uMe.hasOwnProperty,fMe=RegExp("^"+dMe.call(hMe).replace(aMe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function pMe(e){if(!F1(e)||iMe(e))return!1;var t=FB(e)?fMe:lMe;return t.test(sl(e))}function mMe(e,t){return e==null?void 0:e[t]}function ol(e,t){var n=mMe(e,t);return pMe(n)?n:void 0}var Cw=ol(is,"WeakMap"),KR=Object.create,gMe=function(){function e(){}return function(t){if(!F1(t))return{};if(KR)return KR(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),YR=function(){try{var e=ol(Object,"defineProperty");return e({},"",{}),e}catch{}}();function vMe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var yMe=9007199254740991,xMe=/^(?:0|[1-9]\d*)$/;function _Me(e,t){var n=typeof e;return t=t??yMe,!!t&&(n=="number"||n!="symbol"&&xMe.test(e))&&e>-1&&e%1==0&&e<t}function bMe(e,t,n){t=="__proto__"&&YR?YR(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function zB(e,t){return e===t||e!==e&&t!==t}var wMe=Object.prototype,SMe=wMe.hasOwnProperty;function CMe(e,t,n){var r=e[t];(!(SMe.call(e,t)&&zB(r,n))||n===void 0&&!(t in e))&&bMe(e,t,n)}var kMe=9007199254740991;function HB(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kMe}function EMe(e){return e!=null&&HB(e.length)&&!FB(e)}var TMe=Object.prototype;function WB(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||TMe;return e===n}function MMe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var RMe="[object Arguments]";function XR(e){return Of(e)&&Pf(e)==RMe}var UB=Object.prototype,AMe=UB.hasOwnProperty,jMe=UB.propertyIsEnumerable,LMe=XR(function(){return arguments}())?XR:function(e){return Of(e)&&AMe.call(e,"callee")&&!jMe.call(e,"callee")};function DMe(){return!1}var VB=typeof exports=="object"&&exports&&!exports.nodeType&&exports,JR=VB&&typeof module=="object"&&module&&!module.nodeType&&module,NMe=JR&&JR.exports===VB,QR=NMe?is.Buffer:void 0,PMe=QR?QR.isBuffer:void 0,qB=PMe||DMe,OMe="[object Arguments]",IMe="[object Array]",$Me="[object Boolean]",BMe="[object Date]",FMe="[object Error]",zMe="[object Function]",HMe="[object Map]",WMe="[object Number]",UMe="[object Object]",VMe="[object RegExp]",qMe="[object Set]",GMe="[object String]",KMe="[object WeakMap]",YMe="[object ArrayBuffer]",XMe="[object DataView]",JMe="[object Float32Array]",QMe="[object Float64Array]",ZMe="[object Int8Array]",eRe="[object Int16Array]",tRe="[object Int32Array]",nRe="[object Uint8Array]",rRe="[object Uint8ClampedArray]",iRe="[object Uint16Array]",sRe="[object Uint32Array]",Ht={};Ht[JMe]=Ht[QMe]=Ht[ZMe]=Ht[eRe]=Ht[tRe]=Ht[nRe]=Ht[rRe]=Ht[iRe]=Ht[sRe]=!0;Ht[OMe]=Ht[IMe]=Ht[YMe]=Ht[$Me]=Ht[XMe]=Ht[BMe]=Ht[FMe]=Ht[zMe]=Ht[HMe]=Ht[WMe]=Ht[UMe]=Ht[VMe]=Ht[qMe]=Ht[GMe]=Ht[KMe]=!1;function oRe(e){return Of(e)&&HB(e.length)&&!!Ht[Pf(e)]}function g5(e){return function(t){return e(t)}}var GB=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ud=GB&&typeof module=="object"&&module&&!module.nodeType&&module,aRe=Ud&&Ud.exports===GB,Bx=aRe&&$B.process,Dc=function(){try{var e=Ud&&Ud.require&&Ud.require("util").types;return e||Bx&&Bx.binding&&Bx.binding("util")}catch{}}(),ZR=Dc&&Dc.isTypedArray,lRe=ZR?g5(ZR):oRe,cRe=Object.prototype,uRe=cRe.hasOwnProperty;function dRe(e,t){var n=m5(e),r=!n&&LMe(e),i=!n&&!r&&qB(e),s=!n&&!r&&!i&&lRe(e),a=n||r||i||s,o=a?MMe(e.length,String):[],l=o.length;for(var c in e)uRe.call(e,c)&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||_Me(c,l)))&&o.push(c);return o}function KB(e,t){return function(n){return e(t(n))}}var hRe=KB(Object.keys,Object),fRe=Object.prototype,pRe=fRe.hasOwnProperty;function mRe(e){if(!WB(e))return hRe(e);var t=[];for(var n in Object(e))pRe.call(e,n)&&n!="constructor"&&t.push(n);return t}function gRe(e){return EMe(e)?dRe(e):mRe(e)}var Hh=ol(Object,"create");function vRe(){this.__data__=Hh?Hh(null):{},this.size=0}function yRe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xRe="__lodash_hash_undefined__",_Re=Object.prototype,bRe=_Re.hasOwnProperty;function wRe(e){var t=this.__data__;if(Hh){var n=t[e];return n===xRe?void 0:n}return bRe.call(t,e)?t[e]:void 0}var SRe=Object.prototype,CRe=SRe.hasOwnProperty;function kRe(e){var t=this.__data__;return Hh?t[e]!==void 0:CRe.call(t,e)}var ERe="__lodash_hash_undefined__";function TRe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Hh&&t===void 0?ERe:t,this}function Oa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Oa.prototype.clear=vRe;Oa.prototype.delete=yRe;Oa.prototype.get=wRe;Oa.prototype.has=kRe;Oa.prototype.set=TRe;function MRe(){this.__data__=[],this.size=0}function z1(e,t){for(var n=e.length;n--;)if(zB(e[n][0],t))return n;return-1}var RRe=Array.prototype,ARe=RRe.splice;function jRe(e){var t=this.__data__,n=z1(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ARe.call(t,n,1),--this.size,!0}function LRe(e){var t=this.__data__,n=z1(t,e);return n<0?void 0:t[n][1]}function DRe(e){return z1(this.__data__,e)>-1}function NRe(e,t){var n=this.__data__,r=z1(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Fs(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fs.prototype.clear=MRe;Fs.prototype.delete=jRe;Fs.prototype.get=LRe;Fs.prototype.has=DRe;Fs.prototype.set=NRe;var Wh=ol(is,"Map");function PRe(){this.size=0,this.__data__={hash:new Oa,map:new(Wh||Fs),string:new Oa}}function ORe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function H1(e,t){var n=e.__data__;return ORe(t)?n[typeof t=="string"?"string":"hash"]:n.map}function IRe(e){var t=H1(this,e).delete(e);return this.size-=t?1:0,t}function $Re(e){return H1(this,e).get(e)}function BRe(e){return H1(this,e).has(e)}function FRe(e,t){var n=H1(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function xu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}xu.prototype.clear=PRe;xu.prototype.delete=IRe;xu.prototype.get=$Re;xu.prototype.has=BRe;xu.prototype.set=FRe;function zRe(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var HRe=KB(Object.getPrototypeOf,Object);function WRe(){this.__data__=new Fs,this.size=0}function URe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function VRe(e){return this.__data__.get(e)}function qRe(e){return this.__data__.has(e)}var GRe=200;function KRe(e,t){var n=this.__data__;if(n instanceof Fs){var r=n.__data__;if(!Wh||r.length<GRe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new xu(r)}return n.set(e,t),this.size=n.size,this}function _u(e){var t=this.__data__=new Fs(e);this.size=t.size}_u.prototype.clear=WRe;_u.prototype.delete=URe;_u.prototype.get=VRe;_u.prototype.has=qRe;_u.prototype.set=KRe;var YB=typeof exports=="object"&&exports&&!exports.nodeType&&exports,eA=YB&&typeof module=="object"&&module&&!module.nodeType&&module,YRe=eA&&eA.exports===YB,tA=YRe?is.Buffer:void 0;tA&&tA.allocUnsafe;function XRe(e,t){return e.slice()}function JRe(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}function QRe(){return[]}var ZRe=Object.prototype,eAe=ZRe.propertyIsEnumerable,nA=Object.getOwnPropertySymbols,tAe=nA?function(e){return e==null?[]:(e=Object(e),JRe(nA(e),function(t){return eAe.call(e,t)}))}:QRe;function nAe(e,t,n){var r=t(e);return m5(e)?r:zRe(r,n(e))}function rAe(e){return nAe(e,gRe,tAe)}var kw=ol(is,"DataView"),Ew=ol(is,"Promise"),Tw=ol(is,"Set"),rA="[object Map]",iAe="[object Object]",iA="[object Promise]",sA="[object Set]",oA="[object WeakMap]",aA="[object DataView]",sAe=sl(kw),oAe=sl(Wh),aAe=sl(Ew),lAe=sl(Tw),cAe=sl(Cw),fs=Pf;(kw&&fs(new kw(new ArrayBuffer(1)))!=aA||Wh&&fs(new Wh)!=rA||Ew&&fs(Ew.resolve())!=iA||Tw&&fs(new Tw)!=sA||Cw&&fs(new Cw)!=oA)&&(fs=function(e){var t=Pf(e),n=t==iAe?e.constructor:void 0,r=n?sl(n):"";if(r)switch(r){case sAe:return aA;case oAe:return rA;case aAe:return iA;case lAe:return sA;case cAe:return oA}return t});var uAe=Object.prototype,dAe=uAe.hasOwnProperty;function hAe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dAe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var lA=is.Uint8Array;function v5(e){var t=new e.constructor(e.byteLength);return new lA(t).set(new lA(e)),t}function fAe(e,t){var n=v5(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var pAe=/\w*$/;function mAe(e){var t=new e.constructor(e.source,pAe.exec(e));return t.lastIndex=e.lastIndex,t}var cA=Lc?Lc.prototype:void 0,uA=cA?cA.valueOf:void 0;function gAe(e){return uA?Object(uA.call(e)):{}}function vAe(e,t){var n=v5(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}var yAe="[object Boolean]",xAe="[object Date]",_Ae="[object Map]",bAe="[object Number]",wAe="[object RegExp]",SAe="[object Set]",CAe="[object String]",kAe="[object Symbol]",EAe="[object ArrayBuffer]",TAe="[object DataView]",MAe="[object Float32Array]",RAe="[object Float64Array]",AAe="[object Int8Array]",jAe="[object Int16Array]",LAe="[object Int32Array]",DAe="[object Uint8Array]",NAe="[object Uint8ClampedArray]",PAe="[object Uint16Array]",OAe="[object Uint32Array]";function IAe(e,t,n){var r=e.constructor;switch(t){case EAe:return v5(e);case yAe:case xAe:return new r(+e);case TAe:return fAe(e);case MAe:case RAe:case AAe:case jAe:case LAe:case DAe:case NAe:case PAe:case OAe:return vAe(e);case _Ae:return new r;case bAe:case CAe:return new r(e);case wAe:return mAe(e);case SAe:return new r;case kAe:return gAe(e)}}function $Ae(e){return typeof e.constructor=="function"&&!WB(e)?gMe(HRe(e)):{}}var BAe="[object Map]";function FAe(e){return Of(e)&&fs(e)==BAe}var dA=Dc&&Dc.isMap,zAe=dA?g5(dA):FAe,HAe="[object Set]";function WAe(e){return Of(e)&&fs(e)==HAe}var hA=Dc&&Dc.isSet,UAe=hA?g5(hA):WAe,XB="[object Arguments]",VAe="[object Array]",qAe="[object Boolean]",GAe="[object Date]",KAe="[object Error]",JB="[object Function]",YAe="[object GeneratorFunction]",XAe="[object Map]",JAe="[object Number]",QB="[object Object]",QAe="[object RegExp]",ZAe="[object Set]",eje="[object String]",tje="[object Symbol]",nje="[object WeakMap]",rje="[object ArrayBuffer]",ije="[object DataView]",sje="[object Float32Array]",oje="[object Float64Array]",aje="[object Int8Array]",lje="[object Int16Array]",cje="[object Int32Array]",uje="[object Uint8Array]",dje="[object Uint8ClampedArray]",hje="[object Uint16Array]",fje="[object Uint32Array]",jt={};jt[XB]=jt[VAe]=jt[rje]=jt[ije]=jt[qAe]=jt[GAe]=jt[sje]=jt[oje]=jt[aje]=jt[lje]=jt[cje]=jt[XAe]=jt[JAe]=jt[QB]=jt[QAe]=jt[ZAe]=jt[eje]=jt[tje]=jt[uje]=jt[dje]=jt[hje]=jt[fje]=!0;jt[KAe]=jt[JB]=jt[nje]=!1;function ym(e,t,n,r,i,s){var a;if(a!==void 0)return a;if(!F1(e))return e;var o=m5(e);if(o)a=hAe(e);else{var l=fs(e),c=l==JB||l==YAe;if(qB(e))return XRe(e);if(l==QB||l==XB||c&&!i)a=c?{}:$Ae(e);else{if(!jt[l])return i?e:{};a=IAe(e,l)}}s||(s=new _u);var h=s.get(e);if(h)return h;s.set(e,a),UAe(e)?e.forEach(function(g){a.add(ym(g,t,n,g,e,s))}):zAe(e)&&e.forEach(function(g,_){a.set(_,ym(g,t,n,_,e,s))});var d=rAe,f=o?void 0:d(e);return vMe(f||e,function(g,_){f&&(_=g,g=e[_]),CMe(a,_,ym(g,t,n,_,e,s))}),a}var pje=1,mje=4;function ta(e){return ym(e,pje|mje)}function gje(e){return e}var Fx=1,xm=2,Mw=3,vd=4,fA=1e-6;function vje(e){return"translate("+e+",0)"}function yje(e){return"translate(0,"+e+")"}function xje(e){return t=>+e(t)}function _je(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function bje(){return!this.__axis}function y5(e,t){var n=[],r=null,i=null,s=6,a=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===Fx||e===vd?-1:1,h=e===vd||e===xm?"x":"y",d=e===Fx||e===Mw?vje:yje;function f(g){var _=r??(t.ticks?t.ticks.apply(t,n):t.domain()),y=i??(t.tickFormat?t.tickFormat.apply(t,n):gje),v=Math.max(s,0)+o,m=t.range(),p=+m[0]+l,x=+m[m.length-1]+l,b=(t.bandwidth?_je:xje)(t.copy(),l),S=g.selection?g.selection():g,C=S.selectAll(".domain").data([null]),E=S.selectAll(".tick").data(_,t).order(),k=E.exit(),T=E.enter().append("g").attr("class","tick"),R=E.select("line"),M=E.select("text");C=C.merge(C.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),R=R.merge(T.append("line").attr("stroke","currentColor").attr(h+"2",c*s)),M=M.merge(T.append("text").attr("fill","currentColor").attr(h,c*v).attr("dy",e===Fx?"0em":e===Mw?"0.71em":"0.32em")),g!==S&&(C=C.transition(g),E=E.transition(g),R=R.transition(g),M=M.transition(g),k=k.transition(g).attr("opacity",fA).attr("transform",function(L){return isFinite(L=b(L))?d(L+l):this.getAttribute("transform")}),T.attr("opacity",fA).attr("transform",function(L){var D=this.parentNode.__axis;return d((D&&isFinite(D=D(L))?D:b(L))+l)})),k.remove(),C.attr("d",e===vd||e===xm?a?"M"+c*a+","+p+"H"+l+"V"+x+"H"+c*a:"M"+l+","+p+"V"+x:a?"M"+p+","+c*a+"V"+l+"H"+x+"V"+c*a:"M"+p+","+l+"H"+x),E.attr("opacity",1).attr("transform",function(L){return d(b(L)+l)}),R.attr(h+"2",c*s),M.attr(h,c*v).text(y),S.filter(bje).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===xm?"start":e===vd?"end":"middle"),S.each(function(){this.__axis=b})}return f.scale=function(g){return arguments.length?(t=g,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(g){return arguments.length?(n=g==null?[]:Array.from(g),f):n.slice()},f.tickValues=function(g){return arguments.length?(r=g==null?null:Array.from(g),f):r&&r.slice()},f.tickFormat=function(g){return arguments.length?(i=g,f):i},f.tickSize=function(g){return arguments.length?(s=a=+g,f):s},f.tickSizeInner=function(g){return arguments.length?(s=+g,f):s},f.tickSizeOuter=function(g){return arguments.length?(a=+g,f):a},f.tickPadding=function(g){return arguments.length?(o=+g,f):o},f.offset=function(g){return arguments.length?(l=+g,f):l},f}function wje(e){return y5(xm,e)}function ZB(e){return y5(Mw,e)}function eF(e){return y5(vd,e)}var Sje={value:()=>{}};function x5(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _m(n)}function _m(e){this._=e}function Cje(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_m.prototype=x5.prototype={constructor:_m,on:function(e,t){var n=this._,r=Cje(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=kje(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=pA(n[i],e.name,t);else if(t==null)for(i in n)n[i]=pA(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _m(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function kje(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function pA(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Sje,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Rw="http://www.w3.org/1999/xhtml";const mA={svg:"http://www.w3.org/2000/svg",xhtml:Rw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function W1(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mA.hasOwnProperty(t)?{space:mA[t],local:e}:e}function Eje(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Rw&&t.documentElement.namespaceURI===Rw?t.createElement(e):t.createElementNS(n,e)}}function Tje(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tF(e){var t=W1(e);return(t.local?Tje:Eje)(t)}function Mje(){}function _5(e){return e==null?Mje:function(){return this.querySelector(e)}}function Rje(e){typeof e!="function"&&(e=_5(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=new Array(a),l,c,h=0;h<a;++h)(l=s[h])&&(c=e.call(l,l.__data__,h,s))&&("__data__"in l&&(c.__data__=l.__data__),o[h]=c);return new Lr(r,this._parents)}function Aje(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jje(){return[]}function nF(e){return e==null?jje:function(){return this.querySelectorAll(e)}}function Lje(e){return function(){return Aje(e.apply(this,arguments))}}function Dje(e){typeof e=="function"?e=Lje(e):e=nF(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&(r.push(e.call(l,l.__data__,c,a)),i.push(l));return new Lr(r,i)}function rF(e){return function(){return this.matches(e)}}function iF(e){return function(t){return t.matches(e)}}var Nje=Array.prototype.find;function Pje(e){return function(){return Nje.call(this.children,e)}}function Oje(){return this.firstElementChild}function Ije(e){return this.select(e==null?Oje:Pje(typeof e=="function"?e:iF(e)))}var $je=Array.prototype.filter;function Bje(){return Array.from(this.children)}function Fje(e){return function(){return $je.call(this.children,e)}}function zje(e){return this.selectAll(e==null?Bje:Fje(typeof e=="function"?e:iF(e)))}function Hje(e){typeof e!="function"&&(e=rF(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Lr(r,this._parents)}function sF(e){return new Array(e.length)}function Wje(){return new Lr(this._enter||this._groups.map(sF),this._parents)}function iv(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}iv.prototype={constructor:iv,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Uje(e){return function(){return e}}function Vje(e,t,n,r,i,s){for(var a=0,o,l=t.length,c=s.length;a<c;++a)(o=t[a])?(o.__data__=s[a],r[a]=o):n[a]=new iv(e,s[a]);for(;a<l;++a)(o=t[a])&&(i[a]=o)}function qje(e,t,n,r,i,s,a){var o,l,c=new Map,h=t.length,d=s.length,f=new Array(h),g;for(o=0;o<h;++o)(l=t[o])&&(f[o]=g=a.call(l,l.__data__,o,t)+"",c.has(g)?i[o]=l:c.set(g,l));for(o=0;o<d;++o)g=a.call(e,s[o],o,s)+"",(l=c.get(g))?(r[o]=l,l.__data__=s[o],c.delete(g)):n[o]=new iv(e,s[o]);for(o=0;o<h;++o)(l=t[o])&&c.get(f[o])===l&&(i[o]=l)}function Gje(e){return e.__data__}function Kje(e,t){if(!arguments.length)return Array.from(this,Gje);var n=t?qje:Vje,r=this._parents,i=this._groups;typeof e!="function"&&(e=Uje(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),c=0;c<s;++c){var h=r[c],d=i[c],f=d.length,g=Yje(e.call(h,h&&h.__data__,c,r)),_=g.length,y=o[c]=new Array(_),v=a[c]=new Array(_),m=l[c]=new Array(f);n(h,d,y,v,m,g,t);for(var p=0,x=0,b,S;p<_;++p)if(b=y[p]){for(p>=x&&(x=p+1);!(S=v[x])&&++x<_;);b._next=S||null}}return a=new Lr(a,r),a._enter=o,a._exit=l,a}function Yje(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xje(){return new Lr(this._exit||this._groups.map(sF),this._parents)}function Jje(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Qje(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var c=n[l],h=r[l],d=c.length,f=o[l]=new Array(d),g,_=0;_<d;++_)(g=c[_]||h[_])&&(f[_]=g);for(;l<i;++l)o[l]=n[l];return new Lr(o,this._parents)}function Zje(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function e6e(e){e||(e=t6e);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],o=a.length,l=i[s]=new Array(o),c,h=0;h<o;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new Lr(i,this._parents).order()}function t6e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function n6e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function r6e(){return Array.from(this)}function i6e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}function s6e(){let e=0;for(const t of this)++e;return e}function o6e(){return!this.node()}function a6e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,o;s<a;++s)(o=i[s])&&e.call(o,o.__data__,s,i);return this}function l6e(e){return function(){this.removeAttribute(e)}}function c6e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function u6e(e,t){return function(){this.setAttribute(e,t)}}function d6e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function h6e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function f6e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function p6e(e,t){var n=W1(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?c6e:l6e:typeof t=="function"?n.local?f6e:h6e:n.local?d6e:u6e)(n,t))}function oF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function m6e(e){return function(){this.style.removeProperty(e)}}function g6e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function v6e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function y6e(e,t,n){return arguments.length>1?this.each((t==null?m6e:typeof t=="function"?v6e:g6e)(e,t,n??"")):Nc(this.node(),e)}function Nc(e,t){return e.style.getPropertyValue(t)||oF(e).getComputedStyle(e,null).getPropertyValue(t)}function x6e(e){return function(){delete this[e]}}function _6e(e,t){return function(){this[e]=t}}function b6e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function w6e(e,t){return arguments.length>1?this.each((t==null?x6e:typeof t=="function"?b6e:_6e)(e,t)):this.node()[e]}function aF(e){return e.trim().split(/^|\s+/)}function b5(e){return e.classList||new lF(e)}function lF(e){this._node=e,this._names=aF(e.getAttribute("class")||"")}lF.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function cF(e,t){for(var n=b5(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function uF(e,t){for(var n=b5(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function S6e(e){return function(){cF(this,e)}}function C6e(e){return function(){uF(this,e)}}function k6e(e,t){return function(){(t.apply(this,arguments)?cF:uF)(this,e)}}function E6e(e,t){var n=aF(e+"");if(arguments.length<2){for(var r=b5(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?k6e:t?S6e:C6e)(n,t))}function T6e(){this.textContent=""}function M6e(e){return function(){this.textContent=e}}function R6e(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function A6e(e){return arguments.length?this.each(e==null?T6e:(typeof e=="function"?R6e:M6e)(e)):this.node().textContent}function j6e(){this.innerHTML=""}function L6e(e){return function(){this.innerHTML=e}}function D6e(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function N6e(e){return arguments.length?this.each(e==null?j6e:(typeof e=="function"?D6e:L6e)(e)):this.node().innerHTML}function P6e(){this.nextSibling&&this.parentNode.appendChild(this)}function O6e(){return this.each(P6e)}function I6e(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $6e(){return this.each(I6e)}function B6e(e){var t=typeof e=="function"?e:tF(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function F6e(){return null}function z6e(e,t){var n=typeof e=="function"?e:tF(e),r=t==null?F6e:typeof t=="function"?t:_5(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function H6e(){var e=this.parentNode;e&&e.removeChild(this)}function W6e(){return this.each(H6e)}function U6e(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function V6e(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function q6e(e){return this.select(e?V6e:U6e)}function G6e(e){return arguments.length?this.property("__data__",e):this.node().__data__}function K6e(e){return function(t){e.call(this,t,this.__data__)}}function Y6e(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function X6e(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function J6e(e,t,n){return function(){var r=this.__on,i,s=K6e(t);if(r){for(var a=0,o=r.length;a<o;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Q6e(e,t,n){var r=Y6e(e+""),i,s=r.length,a;if(arguments.length<2){var o=this.node().__on;if(o){for(var l=0,c=o.length,h;l<c;++l)for(i=0,h=o[l];i<s;++i)if((a=r[i]).type===h.type&&a.name===h.name)return h.value}return}for(o=t?J6e:X6e,i=0;i<s;++i)this.each(o(r[i],t,n));return this}function dF(e,t,n){var r=oF(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Z6e(e,t){return function(){return dF(this,e,t)}}function eLe(e,t){return function(){return dF(this,e,t.apply(this,arguments))}}function tLe(e,t){return this.each((typeof t=="function"?eLe:Z6e)(e,t))}function*nLe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}var hF=[null];function Lr(e,t){this._groups=e,this._parents=t}function If(){return new Lr([[document.documentElement]],hF)}function rLe(){return this}Lr.prototype=If.prototype={constructor:Lr,select:Rje,selectAll:Dje,selectChild:Ije,selectChildren:zje,filter:Hje,data:Kje,enter:Wje,exit:Xje,join:Jje,merge:Qje,selection:rLe,order:Zje,sort:e6e,call:n6e,nodes:r6e,node:i6e,size:s6e,empty:o6e,each:a6e,attr:p6e,style:y6e,property:w6e,classed:E6e,text:A6e,html:N6e,raise:O6e,lower:$6e,append:B6e,insert:z6e,remove:W6e,clone:q6e,datum:G6e,on:Q6e,dispatch:tLe,[Symbol.iterator]:nLe};function Qn(e){return typeof e=="string"?new Lr([[document.querySelector(e)]],[document.documentElement]):new Lr([[e]],hF)}function iLe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function li(e,t){if(e=iLe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Aw={capture:!0,passive:!1};function jw(e){e.preventDefault(),e.stopImmediatePropagation()}function sLe(e){var t=e.document.documentElement,n=Qn(e).on("dragstart.drag",jw,Aw);"onselectstart"in t?n.on("selectstart.drag",jw,Aw):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function oLe(e,t){var n=e.document.documentElement,r=Qn(e).on("dragstart.drag",null);t&&(r.on("click.drag",jw,Aw),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Pc=0,yd=0,Qu=0,fF=1e3,sv,xd,ov=0,Ia=0,U1=0,Uh=typeof performance=="object"&&performance.now?performance:Date,pF=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function w5(){return Ia||(pF(aLe),Ia=Uh.now()+U1)}function aLe(){Ia=0}function av(){this._call=this._time=this._next=null}av.prototype=mF.prototype={constructor:av,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?w5():+n)+(t==null?0:+t),!this._next&&xd!==this&&(xd?xd._next=this:sv=this,xd=this),this._call=e,this._time=n,Lw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Lw())}};function mF(e,t,n){var r=new av;return r.restart(e,t,n),r}function lLe(){w5(),++Pc;for(var e=sv,t;e;)(t=Ia-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Pc}function gA(){Ia=(ov=Uh.now())+U1,Pc=yd=0;try{lLe()}finally{Pc=0,uLe(),Ia=0}}function cLe(){var e=Uh.now(),t=e-ov;t>fF&&(U1-=t,ov=e)}function uLe(){for(var e,t=sv,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:sv=n);xd=e,Lw(r)}function Lw(e){if(!Pc){yd&&(yd=clearTimeout(yd));var t=e-Ia;t>24?(e<1/0&&(yd=setTimeout(gA,e-Uh.now()-U1)),Qu&&(Qu=clearInterval(Qu))):(Qu||(ov=Uh.now(),Qu=setInterval(cLe,fF)),Pc=1,pF(gA))}}function vA(e,t,n){var r=new av;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var dLe=x5("start","end","cancel","interrupt"),hLe=[],gF=0,yA=1,Dw=2,bm=3,xA=4,Nw=5,wm=6;function V1(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;fLe(e,n,{name:t,index:r,group:i,on:dLe,tween:hLe,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:gF})}function S5(e,t){var n=Ei(e,t);if(n.state>gF)throw new Error("too late; already scheduled");return n}function ss(e,t){var n=Ei(e,t);if(n.state>bm)throw new Error("too late; already running");return n}function Ei(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function fLe(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=mF(s,0,n.time);function s(c){n.state=yA,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var h,d,f,g;if(n.state!==yA)return l();for(h in r)if(g=r[h],g.name===n.name){if(g.state===bm)return vA(a);g.state===xA?(g.state=wm,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[h]):+h<t&&(g.state=wm,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[h])}if(vA(function(){n.state===bm&&(n.state=xA,n.timer.restart(o,n.delay,n.time),o(c))}),n.state=Dw,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Dw){for(n.state=bm,i=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(g=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=g);i.length=d+1}}function o(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Nw,1),d=-1,f=i.length;++d<f;)i[d].call(e,h);n.state===Nw&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=wm,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Sm(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Dw&&r.state<Nw,r.state=wm,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}function pLe(e){return this.each(function(){Sm(this,e)})}function mLe(e,t){var n,r;return function(){var i=ss(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,o=r.length;a<o;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function gLe(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=ss(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var o={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=o;break}l===c&&i.push(o)}s.tween=i}}function vLe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ei(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?mLe:gLe)(n,e,t))}function C5(e,t,n){var r=e._id;return e.each(function(){var i=ss(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ei(i,r).value[t]}}function vF(e,t){var n;return(typeof t=="number"?di:t instanceof Ns?Ug:(n=Ns(t))?(t=n,Ug):Ek)(e,t)}function yLe(e){return function(){this.removeAttribute(e)}}function xLe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _Le(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}function bLe(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}function wLe(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function SLe(e,t,n){var r,i,s;return function(){var a,o=n(this),l;return o==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=o+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o)))}}function CLe(e,t){var n=W1(e),r=n==="transform"?P1e:vF;return this.attrTween(e,typeof t=="function"?(n.local?SLe:wLe)(n,r,C5(this,"attr."+e,t)):t==null?(n.local?xLe:yLe)(n):(n.local?bLe:_Le)(n,r,t))}function kLe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ELe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TLe(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ELe(e,s)),n}return i._value=t,i}function MLe(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&kLe(e,s)),n}return i._value=t,i}function RLe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=W1(e);return this.tween(n,(r.local?TLe:MLe)(r,t))}function ALe(e,t){return function(){S5(this,e).delay=+t.apply(this,arguments)}}function jLe(e,t){return t=+t,function(){S5(this,e).delay=t}}function LLe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ALe:jLe)(t,e)):Ei(this.node(),t).delay}function DLe(e,t){return function(){ss(this,e).duration=+t.apply(this,arguments)}}function NLe(e,t){return t=+t,function(){ss(this,e).duration=t}}function PLe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?DLe:NLe)(t,e)):Ei(this.node(),t).duration}function OLe(e,t){if(typeof t!="function")throw new Error;return function(){ss(this,e).ease=t}}function ILe(e){var t=this._id;return arguments.length?this.each(OLe(t,e)):Ei(this.node(),t).ease}function $Le(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ss(this,e).ease=n}}function BLe(e){if(typeof e!="function")throw new Error;return this.each($Le(this._id,e))}function FLe(e){typeof e!="function"&&(e=rF(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,o=r[i]=[],l,c=0;c<a;++c)(l=s[c])&&e.call(l,l.__data__,c,s)&&o.push(l);return new Os(r,this._parents,this._name,this._id)}function zLe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),o=0;o<s;++o)for(var l=t[o],c=n[o],h=l.length,d=a[o]=new Array(h),f,g=0;g<h;++g)(f=l[g]||c[g])&&(d[g]=f);for(;o<r;++o)a[o]=t[o];return new Os(a,this._parents,this._name,this._id)}function HLe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function WLe(e,t,n){var r,i,s=HLe(t)?S5:ss;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function ULe(e,t){var n=this._id;return arguments.length<2?Ei(this.node(),n).on.on(e):this.each(WLe(n,e,t))}function VLe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function qLe(){return this.on("end.remove",VLe(this._id))}function GLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_5(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var o=r[a],l=o.length,c=s[a]=new Array(l),h,d,f=0;f<l;++f)(h=o[f])&&(d=e.call(h,h.__data__,f,o))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,V1(c[f],t,n,f,c,Ei(h,n)));return new Os(s,this._parents,t,n)}function KLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nF(e));for(var r=this._groups,i=r.length,s=[],a=[],o=0;o<i;++o)for(var l=r[o],c=l.length,h,d=0;d<c;++d)if(h=l[d]){for(var f=e.call(h,h.__data__,d,l),g,_=Ei(h,n),y=0,v=f.length;y<v;++y)(g=f[y])&&V1(g,t,n,y,f,_);s.push(f),a.push(h)}return new Os(s,a,t,n)}var YLe=If.prototype.constructor;function XLe(){return new YLe(this._groups,this._parents)}function JLe(e,t){var n,r,i;return function(){var s=Nc(this,e),a=(this.style.removeProperty(e),Nc(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}function yF(e){return function(){this.style.removeProperty(e)}}function QLe(e,t,n){var r,i=n+"",s;return function(){var a=Nc(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}function ZLe(e,t,n){var r,i,s;return function(){var a=Nc(this,e),o=n(this),l=o+"";return o==null&&(l=o=(this.style.removeProperty(e),Nc(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,o))}}function eDe(e,t){var n,r,i,s="style."+t,a="end."+s,o;return function(){var l=ss(this,e),c=l.on,h=l.value[s]==null?o||(o=yF(t)):void 0;(c!==n||i!==h)&&(r=(n=c).copy()).on(a,i=h),l.on=r}}function tDe(e,t,n){var r=(e+="")=="transform"?N1e:vF;return t==null?this.styleTween(e,JLe(e,r)).on("end.style."+e,yF(e)):typeof t=="function"?this.styleTween(e,ZLe(e,r,C5(this,"style."+e,t))).each(eDe(this._id,e)):this.styleTween(e,QLe(e,r,t),n).on("end.style."+e,null)}function nDe(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function rDe(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&nDe(e,a,n)),r}return s._value=t,s}function iDe(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,rDe(e,t,n??""))}function sDe(e){return function(){this.textContent=e}}function oDe(e){return function(){var t=e(this);this.textContent=t??""}}function aDe(e){return this.tween("text",typeof e=="function"?oDe(C5(this,"text",e)):sDe(e==null?"":e+""))}function lDe(e){return function(t){this.textContent=e.call(this,t)}}function cDe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&lDe(i)),t}return r._value=e,r}function uDe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,cDe(e))}function dDe(){for(var e=this._name,t=this._id,n=xF(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)if(l=a[c]){var h=Ei(l,t);V1(l,e,n,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Os(r,this._parents,e,n)}function hDe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var o={value:a},l={value:function(){--i===0&&s()}};n.each(function(){var c=ss(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(o),t._.interrupt.push(o),t._.end.push(l)),c.on=t}),i===0&&s()})}var fDe=0;function Os(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function xF(){return++fDe}var cs=If.prototype;Os.prototype={constructor:Os,select:GLe,selectAll:KLe,selectChild:cs.selectChild,selectChildren:cs.selectChildren,filter:FLe,merge:zLe,selection:XLe,transition:dDe,call:cs.call,nodes:cs.nodes,node:cs.node,size:cs.size,empty:cs.empty,each:cs.each,on:ULe,attr:CLe,attrTween:RLe,style:tDe,styleTween:iDe,text:aDe,textTween:uDe,remove:qLe,tween:vLe,delay:LLe,duration:PLe,ease:ILe,easeVarying:BLe,end:hDe,[Symbol.iterator]:cs[Symbol.iterator]};function pDe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mDe={time:null,delay:0,duration:250,ease:pDe};function gDe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function vDe(e){var t,n;e instanceof Os?(t=e._id,e=e._name):(t=xF(),(n=mDe).time=w5(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],o=a.length,l,c=0;c<o;++c)(l=a[c])&&V1(l,e,t,c,a,n||gDe(l,t));return new Os(r,this._parents,e,t)}If.prototype.interrupt=pLe;If.prototype.transition=vDe;const Ip=e=>()=>e;function yDe(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function bs(e,t,n){this.k=e,this.x=t,this.y=n}bs.prototype={constructor:bs,scale:function(e){return e===1?this:new bs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new bs(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var _F=new bs(1,0,0);bs.prototype;function zx(e){e.stopImmediatePropagation()}function Zu(e){e.preventDefault(),e.stopImmediatePropagation()}function xDe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function _De(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function _A(){return this.__zoom||_F}function bDe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wDe(){return navigator.maxTouchPoints||"ontouchstart"in this}function SDe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function CDe(){var e=xDe,t=_De,n=SDe,r=bDe,i=wDe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=B1e,c=x5("start","zoom","end"),h,d,f,g=500,_=150,y=0,v=10;function m(N){N.property("__zoom",_A).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(N,P,I,z){var O=N.selection?N.selection():N;O.property("__zoom",_A),N!==O?S(N,P,I,z):O.interrupt().each(function(){C(this,arguments).event(z).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},m.scaleBy=function(N,P,I,z){m.scaleTo(N,function(){var O=this.__zoom.k,j=typeof P=="function"?P.apply(this,arguments):P;return O*j},I,z)},m.scaleTo=function(N,P,I,z){m.transform(N,function(){var O=t.apply(this,arguments),j=this.__zoom,A=I==null?b(O):typeof I=="function"?I.apply(this,arguments):I,F=j.invert(A),H=typeof P=="function"?P.apply(this,arguments):P;return n(x(p(j,H),A,F),O,a)},I,z)},m.translateBy=function(N,P,I,z){m.transform(N,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),a)},null,z)},m.translateTo=function(N,P,I,z,O){m.transform(N,function(){var j=t.apply(this,arguments),A=this.__zoom,F=z==null?b(j):typeof z=="function"?z.apply(this,arguments):z;return n(_F.translate(F[0],F[1]).scale(A.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof I=="function"?-I.apply(this,arguments):-I),j,a)},z,O)};function p(N,P){return P=Math.max(s[0],Math.min(s[1],P)),P===N.k?N:new bs(P,N.x,N.y)}function x(N,P,I){var z=P[0]-I[0]*N.k,O=P[1]-I[1]*N.k;return z===N.x&&O===N.y?N:new bs(N.k,z,O)}function b(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function S(N,P,I,z){N.on("start.zoom",function(){C(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(z).end()}).tween("zoom",function(){var O=this,j=arguments,A=C(O,j).event(z),F=t.apply(O,j),H=I==null?b(F):typeof I=="function"?I.apply(O,j):I,B=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),G=O.__zoom,Q=typeof P=="function"?P.apply(O,j):P,Y=l(G.invert(H).concat(B/G.k),Q.invert(H).concat(B/Q.k));return function(W){if(W===1)W=Q;else{var $=Y(W),V=B/$[2];W=new bs(V,H[0]-$[0]*V,H[1]-$[1]*V)}A.zoom(null,W)}})}function C(N,P,I){return!I&&N.__zooming||new E(N,P)}function E(N,P){this.that=N,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,P),this.taps=0}E.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,P){return this.mouse&&N!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var P=Qn(this.that).datum();c.call(N,this.that,new yDe(N,{sourceEvent:this.sourceEvent,target:m,type:N,transform:this.that.__zoom,dispatch:c}),P)}};function k(N,...P){if(!e.apply(this,arguments))return;var I=C(this,P).event(N),z=this.__zoom,O=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),j=li(N);if(I.wheel)(I.mouse[0][0]!==j[0]||I.mouse[0][1]!==j[1])&&(I.mouse[1]=z.invert(I.mouse[0]=j)),clearTimeout(I.wheel);else{if(z.k===O)return;I.mouse=[j,z.invert(j)],Sm(this),I.start()}Zu(N),I.wheel=setTimeout(A,_),I.zoom("mouse",n(x(p(z,O),I.mouse[0],I.mouse[1]),I.extent,a));function A(){I.wheel=null,I.end()}}function T(N,...P){if(f||!e.apply(this,arguments))return;var I=N.currentTarget,z=C(this,P,!0).event(N),O=Qn(N.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",B,!0),j=li(N,I),A=N.clientX,F=N.clientY;sLe(N.view),zx(N),z.mouse=[j,this.__zoom.invert(j)],Sm(this),z.start();function H(G){if(Zu(G),!z.moved){var Q=G.clientX-A,Y=G.clientY-F;z.moved=Q*Q+Y*Y>y}z.event(G).zoom("mouse",n(x(z.that.__zoom,z.mouse[0]=li(G,I),z.mouse[1]),z.extent,a))}function B(G){O.on("mousemove.zoom mouseup.zoom",null),oLe(G.view,z.moved),Zu(G),z.event(G).end()}}function R(N,...P){if(e.apply(this,arguments)){var I=this.__zoom,z=li(N.changedTouches?N.changedTouches[0]:N,this),O=I.invert(z),j=I.k*(N.shiftKey?.5:2),A=n(x(p(I,j),z,O),t.apply(this,P),a);Zu(N),o>0?Qn(this).transition().duration(o).call(S,A,z,N):Qn(this).call(m.transform,A,z,N)}}function M(N,...P){if(e.apply(this,arguments)){var I=N.touches,z=I.length,O=C(this,P,N.changedTouches.length===z).event(N),j,A,F,H;for(zx(N),A=0;A<z;++A)F=I[A],H=li(F,this),H=[H,this.__zoom.invert(H),F.identifier],O.touch0?!O.touch1&&O.touch0[2]!==H[2]&&(O.touch1=H,O.taps=0):(O.touch0=H,j=!0,O.taps=1+!!h);h&&(h=clearTimeout(h)),j&&(O.taps<2&&(d=H[0],h=setTimeout(function(){h=null},g)),Sm(this),O.start())}}function L(N,...P){if(this.__zooming){var I=C(this,P).event(N),z=N.changedTouches,O=z.length,j,A,F,H;for(Zu(N),j=0;j<O;++j)A=z[j],F=li(A,this),I.touch0&&I.touch0[2]===A.identifier?I.touch0[0]=F:I.touch1&&I.touch1[2]===A.identifier&&(I.touch1[0]=F);if(A=I.that.__zoom,I.touch1){var B=I.touch0[0],G=I.touch0[1],Q=I.touch1[0],Y=I.touch1[1],W=(W=Q[0]-B[0])*W+(W=Q[1]-B[1])*W,$=($=Y[0]-G[0])*$+($=Y[1]-G[1])*$;A=p(A,Math.sqrt(W/$)),F=[(B[0]+Q[0])/2,(B[1]+Q[1])/2],H=[(G[0]+Y[0])/2,(G[1]+Y[1])/2]}else if(I.touch0)F=I.touch0[0],H=I.touch0[1];else return;I.zoom("touch",n(x(A,F,H),I.extent,a))}}function D(N,...P){if(this.__zooming){var I=C(this,P).event(N),z=N.changedTouches,O=z.length,j,A;for(zx(N),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),j=0;j<O;++j)A=z[j],I.touch0&&I.touch0[2]===A.identifier?delete I.touch0:I.touch1&&I.touch1[2]===A.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(A=li(A,this),Math.hypot(d[0]-A[0],d[1]-A[1])<v)){var F=Qn(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:Ip(+N),m):r},m.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Ip(!!N),m):e},m.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:Ip(!!N),m):i},m.extent=function(N){return arguments.length?(t=typeof N=="function"?N:Ip([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),m):t},m.scaleExtent=function(N){return arguments.length?(s[0]=+N[0],s[1]=+N[1],m):[s[0],s[1]]},m.translateExtent=function(N){return arguments.length?(a[0][0]=+N[0][0],a[1][0]=+N[1][0],a[0][1]=+N[0][1],a[1][1]=+N[1][1],m):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},m.constrain=function(N){return arguments.length?(n=N,m):n},m.duration=function(N){return arguments.length?(o=+N,m):o},m.interpolate=function(N){return arguments.length?(l=N,m):l},m.on=function(){var N=c.on.apply(c,arguments);return N===c?m:N},m.clickDistance=function(N){return arguments.length?(y=(N=+N)*N,m):Math.sqrt(y)},m.tapDistance=function(N){return arguments.length?(v=+N,m):v},m}const kDe=(e,t)=>{let n;for(const r of e)if(r==="+Inf"){if(n!==void 0&&n<t)return;break}else typeof r!="string"&&r<=t&&(n=r);return typeof n=="number"?n:void 0},Cm=e=>e==="+Inf"?"+Inf":typeof e=="string"?"???":e<0?"<0 ms":e===0?"0 ms":e<.001?"<1 ms":e>=.001&&e<1?`${(e*1e3).toFixed(0)} ms`:e<10?`${e.toFixed(2)} s`:e<100?`${e.toFixed(1)} s`:`${e.toFixed(0)} s`,bF=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n-1]??0;if(typeof r!="number")throw new Error(`Invalid prev value: ${r}`);if(e.length>=2&&n===e.length-1){t.push(r*1.25);break}const i=e[n];if(typeof i!="number")throw new Error(`Invalid current value: ${i}`);t.push((r+i)/2)}return t},wF=(e,t)=>{if(e.length!==t.length)throw new Error("Invalid bucket count");let n=0;const r=[];for(let i=0;i<t.length;i++){const a=(typeof e[i]=="number"?e[i]:0)*t[i];r.push(a),n+=a}return r.map(i=>i/n)},EDe=60*1e3,TDe=15*60*1e3,kl={bootDuration:void 0,closeReason:void 0,log:[]},MDe=(e,t)=>{var a,o;let n,r,i=[],s=ta(kl);for(const l of e){s===void 0&&(s=ta(kl));const c=(a=s==null?void 0:s.log)==null?void 0:a.length;if(l.type==="svBoot")c&&(i.push(s),s=ta(kl)),s.bootTime=new Date(l.ts),s.bootDuration=l.duration;else if(l.type==="svClose")c&&(s.closeTime=new Date(l.ts),s.closeReason=l.reason,i.push(s),s=ta(kl));else if(l.type==="data"){const h=l.ts-TDe,d=c?s.log.at(-1):void 0;let f=l.ts-EDe;if(d){const y=d.end.getTime();y>=h?f=y:(i.push(s),s=ta(kl))}else if(s.bootTime){const y=s.bootTime.getTime();y>=h?f=y:s=ta(kl)}const g=new Date(f),_=new Date(l.ts);n||(n=g),r=_,s.log.push({start:g,end:_,players:l.players,fxsMemory:l.fxsMemory,nodeMemory:l.nodeMemory,weightedPerf:t(l.perf)})}}return(o=s==null?void 0:s.log)!=null&&o.length&&i.push(s),i=i.filter(l=>l.log.length),n&&r&&i.length?{dataStart:n,dataEnd:r,lifespans:i}:void 0},RDe=(e,t,n)=>{const r=t*60*60*1e3,i=n-r;let s=0;const a=[];for(const o of e)if(!(!o.log.length||o.log.at(-1).end.getTime()<i))for(const c of o.log)a.push(c.players),!(c.end.getTime()<i)&&(c.start.getTime()<i?s+=c.end.getTime()-i:s+=c.end.getTime()-c.start.getTime());return{uptimePct:n?Math.min(100,s/r*100):void 0,medianPlayerCount:aye(a,.5)??0}};function ADe({delay:e,onDebouncedResize:t,children:n}){const r=w.useRef(null),i=w.useRef(null),s=w.useRef(null),a=w.useRef({width:0,height:0});e===void 0&&(e=250);const o=()=>{if(!r.current||!r.current.parentNode)return;const c={width:r.current.clientWidth,height:r.current.clientHeight};a.current=c,t(c),s.current.style.visibility="visible",i.current.style.visibility="hidden"},l=w.useCallback(nS(e,o,{atBegin:!1}),[r]);return w.useEffect(()=>{if(!r.current)return;const c=new ResizeObserver(()=>{const h=r.current.clientHeight,d=r.current.clientWidth;h===0||d===0||a.current.width===d&&a.current.height===h||(a.current.width===0||a.current.height===0?o():(l(),s.current.style.visibility="hidden",i.current.style.visibility="visible"))});return c.observe(r.current),o(),()=>c.disconnect()},[r]),u.jsxs("div",{ref:r,style:{height:"100%",width:"100%",position:"relative"},children:[u.jsx("div",{ref:i,className:"absolute inset-0 flex items-center justify-center",children:u.jsx(Zt,{className:"animate-spin size-16 text-muted-foreground"})}),u.jsx("div",{className:"absolute inset-0",ref:s,children:n})]})}const Vh=w.memo(ADe),jDe={svMain:1e3/20/1e3,svNetwork:1e3/40/1e3,svSync:1e3/40/1e3},LDe=w.memo(({data:e,minTickIntervalMarker:t,width:n,height:r})=>{const i=B1(),s=a=>{var h;const o=((h=e.find((d,f)=>f===a.index-1))==null?void 0:h.bucket)??0,l=a.data.bucket,c=(a.value*100).toFixed()+"%";return u.jsxs("div",{className:"p-3 text-gray-900 bg-white rounded-md shadow-md",children:[u.jsxs("div",{children:["Tick duration: ",u.jsx("strong",{children:Cm(o)})," ~ ",u.jsx("strong",{children:Cm(l)})]}),u.jsxs("div",{children:["Time spent: ",u.jsxs("strong",{children:["~",c]})]}),u.jsxs("div",{children:["Tick count: ",a.data.count]})]})};return t=void 0,!n||!r?null:u.jsx($Te,{height:r,width:n,data:e,theme:{tooltip:{wrapper:{zIndex:1e4}},text:{fontSize:"12px",fontWeight:600,fill:"inherit"},grid:{line:{strokeDasharray:"8 6",stroke:"#3F4146",strokeOpacity:i?1:.25,strokeWidth:1}}},indexBy:"bucket",margin:{top:0,right:25,bottom:40,left:60},layout:"horizontal",valueFormat:".1%",colors:{datum:"data.color"},colorBy:"indexValue",borderWidth:.5,borderColor:i?void 0:{from:"color",modifiers:[["darker",1]]},axisBottom:{format:".0%",legend:"percent of total time",legendPosition:"middle",legendOffset:32},axisLeft:{format:Cm},enableGridX:!0,enableGridY:!1,labelSkipWidth:25,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},tooltip:s,markers:t?[{axis:"y",value:t,lineStyle:{stroke:"black",opacity:.5,strokeWidth:4,strokeDasharray:"6 2",strokeDashoffset:1},legend:"good",legendPosition:"bottom-right",legendOffsetX:10,legendOffsetY:12,legendOrientation:"horizontal",textStyle:{fontSize:"16px",opacity:.5}},{axis:"y",value:t,lineStyle:{stroke:"white",opacity:.55,strokeWidth:2,strokeDasharray:"4 4"},legend:"bad",legendPosition:"top-right",legendOffsetX:10,legendOffsetY:12,legendOrientation:"horizontal",textStyle:{fontSize:"16px",opacity:.5}}]:void 0})});function DDe(){const[e,t]=w.useState({width:0,height:0}),[n,r]=w.useState("svMain"),i=et(Ov),s=et(Iv),a=sS(),o=w.useMemo(()=>{if(!i||a().isExpired)return null;if(!i.perfBoundaries||!i.perfBucketCounts)return"incomplete";const d=s?s.threadName:n??"svMain",{perfBoundaries:f,perfBucketCounts:g}=i,_=jDe[d],y=kDe(f,_),v=f.findIndex(S=>S===y);let m;v?m=S=>{const C=v+1;return S<=v?o$(1.1-S/C):a$(.25+(S-C)/(f.length-C))}:m=S=>s$(1-(S+1)/f.length);const p=g[d];let x;if(s)x=s.snap.weightedPerf;else{const S=bF(f);x=wF(p,S)}const b=[];for(let S=0;S<f.length;S++)b.push({bucket:f[S],count:s?0:p[S],value:x[S],color:m(S+1)});return{threadName:d,data:b,minTickIntervalMarker:y,perfBoundaries:f}},[i,s,n]),l=w.useMemo(()=>{const d=a();if(!i||d.isExpired||!i.perfBoundaries||!i.perfBucketCounts)return null;if(s){const f=bc(s.snap.end,"2-digit","2-digit"),g=wc(s.snap.end,"short"),_=vh(s.snap.end)?f:`${f} - ${g}`;return u.jsxs(u.Fragment,{children:["(",u.jsx("span",{className:"text-xs text-warning-inline font-mono",children:_}),")"]})}else return d.isStale?"(minutes ago)":"(last minute)"},[i,s]);let c,h=null;return typeof o=="object"&&o!==null?(c=o.threadName,h=u.jsx(LDe,{...o,width:e.width,height:e.height})):typeof o=="string"?h=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:u.jsxs("p",{className:"max-w-80",children:["Data not yet available. ",u.jsx("br",{}),"The thread performance chart will appear soon after the server is online."]})}):h=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:u.jsx(Zt,{className:"animate-spin size-16 text-muted-foreground"})}),u.jsxs("div",{className:"py-2 md:rounded-xl border bg-card shadow-sm flex flex-col col-span-3 fill-primary h-[20rem] max-h-[20rem]",children:[u.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:[c??n," performance ",l]}),u.jsxs("div",{className:"flex gap-4",children:[u.jsxs(Pn,{defaultValue:n,onValueChange:r,disabled:!!s,children:[u.jsx(kn,{className:J("w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",!!s&&"hidden"),children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:"svMain",className:"cursor-pointer",children:"svMain"}),u.jsx(be,{value:"svSync",className:"cursor-pointer",children:"svSync"}),u.jsx(be,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),u.jsx("div",{className:"hidden xs:block",children:u.jsx(LK,{})})]})]}),u.jsx(Vh,{onDebouncedResize:t,children:h})]})}function Dt(){return Dt=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},Dt.apply(this,arguments)}var NDe={pointerEvents:"none"},PDe=function(e){var t=e.label,n=e.style,r=Vt();return u.jsx(St.g,{transform:n.transform,opacity:n.progress,style:NDe,children:u.jsx(St.text,{textAnchor:"middle",dominantBaseline:"central",style:Dt({},r.labels.text,{fill:n.textColor}),children:t})})},SF=function(e){var t=e%(2*Math.PI);return t<0&&(t+=2*Math.PI),t},ODe=function(e,t){return e.filter(function(n){return Math.abs(O1(n.arc.endAngle-n.arc.startAngle))>=t})},IDe={startAngle:{enter:function(e){return Dt({},e,{endAngle:e.startAngle})},update:function(e){return e},leave:function(e){return Dt({},e,{startAngle:e.endAngle})}},middleAngle:{enter:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return Dt({},e,{startAngle:t,endAngle:t})},update:function(e){return e},leave:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return Dt({},e,{startAngle:t,endAngle:t})}},endAngle:{enter:function(e){return Dt({},e,{startAngle:e.endAngle})},update:function(e){return e},leave:function(e){return Dt({},e,{endAngle:e.startAngle})}},innerRadius:{enter:function(e){return Dt({},e,{outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return Dt({},e,{innerRadius:e.outerRadius})}},centerRadius:{enter:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return Dt({},e,{innerRadius:t,outerRadius:t})},update:function(e){return e},leave:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return Dt({},e,{innerRadius:t,outerRadius:t})}},outerRadius:{enter:function(e){return Dt({},e,{innerRadius:e.outerRadius})},update:function(e){return e},leave:function(e){return Dt({},e,{outerRadius:e.innerRadius})}},pushIn:{enter:function(e){return Dt({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return Dt({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})}},pushOut:{enter:function(e){return Dt({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})},update:function(e){return e},leave:function(e){return Dt({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})}}},CF=function(e,t){return w.useMemo(function(){var n=IDe[e];return{enter:function(r){return Dt({progress:0},n.enter(r.arc),t?t.enter(r):{})},update:function(r){return Dt({progress:1},n.update(r.arc),t?t.update(r):{})},leave:function(r){return Dt({progress:0},n.leave(r.arc),t?t.leave(r):{})}}},[e,t])},$De=function(e,t){var n=XSe(e)-Math.PI/2,r=e.innerRadius+(e.outerRadius-e.innerRadius)*t;return ya(n,r)},BDe=function(e){return function(t,n,r,i){return jo([t,n,r,i],function(s,a,o,l){var c=$De({startAngle:s,endAngle:a,innerRadius:o,outerRadius:l},e);return"translate("+c.x+","+c.y+")"})}},FDe=function(e,t,n,r){t===void 0&&(t=.5),n===void 0&&(n="innerRadius");var i=br(),s=i.animate,a=i.config,o=CF(n,r);return{transition:Qa(e,{keys:function(l){return l.id},initial:o.update,from:o.enter,enter:o.update,update:o.update,leave:o.leave,config:a,immediate:!s}),interpolate:BDe(t)}},zDe=function(e){var t=e.center,n=e.data,r=e.transitionMode,i=e.label,s=e.radiusOffset,a=e.skipAngle,o=e.textColor,l=e.component,c=l===void 0?PDe:l,h=xa(i),d=Vt(),f=jc(o,d),g=w.useMemo(function(){return n.filter(function(p){return Math.abs(O1(p.arc.endAngle-p.arc.startAngle))>=a})},[n,a]),_=FDe(g,s,r),y=_.transition,v=_.interpolate,m=c;return u.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:y(function(p,x){return w.createElement(m,{key:x.id,datum:x,label:h(x),style:Dt({},p,{transform:v(p.startAngle,p.endAngle,p.innerRadius,p.outerRadius),textColor:f(x)})})})})},HDe=function(e){var t=e.label,n=e.style,r=Vt();return u.jsxs(St.g,{opacity:n.opacity,children:[u.jsx(St.path,{fill:"none",stroke:n.linkColor,strokeWidth:n.thickness,d:n.path}),u.jsx(St.text,{transform:n.textPosition,textAnchor:n.textAnchor,dominantBaseline:"central",style:Dt({},r.labels.text,{fill:n.textColor}),children:t})]})},WDe=function(e){var t=SF(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2);return t<Math.PI/2||t>1.5*Math.PI?"start":"end"},kF=function(e,t,n,r){var i,s,a=SF(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2),o=ya(a,e.outerRadius+t),l=ya(a,e.outerRadius+t+n);return a<Math.PI/2||a>1.5*Math.PI?(i="after",s={x:l.x+r,y:l.y}):(i="before",s={x:l.x-r,y:l.y}),{side:i,points:[o,l,s]}},UDe=v$().x(function(e){return e.x}).y(function(e){return e.y}),VDe=function(e,t,n,r,i,s,a){return jo([e,t,n,r,i,s,a],function(o,l,c,h,d,f,g){var _=kF({startAngle:o,endAngle:l,innerRadius:c,outerRadius:h},d,f,g).points;return UDe(_)})},qDe=function(e,t,n,r){return jo([e,t,n,r],function(i,s,a,o){return WDe({startAngle:i,endAngle:s,innerRadius:a,outerRadius:o})})},GDe=function(e,t,n,r,i,s,a,o){return jo([e,t,n,r,i,s,a,o],function(l,c,h,d,f,g,_,y){var v=kF({startAngle:l,endAngle:c,innerRadius:h,outerRadius:d},f,g,_),m=v.points,p=v.side,x=m[2];return p==="before"?x.x-=y:x.x+=y,"translate("+x.x+","+x.y+")"})},KDe=function(e){var t=e.data,n=e.offset,r=n===void 0?0:n,i=e.diagonalLength,s=e.straightLength,a=e.skipAngle,o=a===void 0?0:a,l=e.textOffset,c=e.linkColor,h=e.textColor,d=br(),f=d.animate,g=d.config,_=Vt(),y=jc(c,_),v=jc(h,_),m=function(x,b){return w.useMemo(function(){return ODe(x,b)},[x,b])}(t,o),p=function(x){var b=x.offset,S=x.diagonalLength,C=x.straightLength,E=x.textOffset,k=x.getLinkColor,T=x.getTextColor;return w.useMemo(function(){return{enter:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(R),textColor:T(R),opacity:0}},update:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:S,straightLength:C,textOffset:E,linkColor:k(R),textColor:T(R),opacity:1}},leave:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(R),textColor:T(R),opacity:0}}}},[S,C,E,k,T,b])}({offset:r,diagonalLength:i,straightLength:s,textOffset:l,getLinkColor:y,getTextColor:v});return{transition:Qa(m,{keys:function(x){return x.id},initial:p.update,from:p.enter,enter:p.update,update:p.update,leave:p.leave,config:g,immediate:!f}),interpolateLink:VDe,interpolateTextAnchor:qDe,interpolateTextPosition:GDe}},YDe=function(e){var t=e.center,n=e.data,r=e.label,i=e.skipAngle,s=e.offset,a=e.diagonalLength,o=e.straightLength,l=e.strokeWidth,c=e.textOffset,h=e.textColor,d=e.linkColor,f=e.component,g=f===void 0?HDe:f,_=xa(r),y=KDe({data:n,skipAngle:i,offset:s,diagonalLength:a,straightLength:o,textOffset:c,linkColor:d,textColor:h}),v=y.transition,m=y.interpolateLink,p=y.interpolateTextAnchor,x=y.interpolateTextPosition,b=g;return u.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(S,C){return w.createElement(b,{key:C.id,datum:C,label:_(C),style:Dt({},S,{thickness:l,path:m(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius,S.offset,S.diagonalLength,S.straightLength),textAnchor:p(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius),textPosition:x(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius,S.offset,S.diagonalLength,S.straightLength,S.textOffset)})})})})},XDe=function(e){var t=e.datum,n=e.style,r=e.onClick,i=e.onMouseEnter,s=e.onMouseMove,a=e.onMouseLeave,o=w.useCallback(function(d){return r==null?void 0:r(t,d)},[r,t]),l=w.useCallback(function(d){return i==null?void 0:i(t,d)},[i,t]),c=w.useCallback(function(d){return s==null?void 0:s(t,d)},[s,t]),h=w.useCallback(function(d){return a==null?void 0:a(t,d)},[a,t]);return u.jsx(St.path,{d:n.path,opacity:n.opacity,fill:t.fill||n.color,stroke:n.borderColor,strokeWidth:n.borderWidth,onClick:r?o:void 0,onMouseEnter:i?l:void 0,onMouseMove:s?c:void 0,onMouseLeave:a?h:void 0})},JDe=function(e,t,n,r,i){return jo([e,t,n,r],function(s,a,o,l){return i({startAngle:s,endAngle:a,innerRadius:Math.max(0,o),outerRadius:Math.max(0,l)})})},QDe=function(e,t,n){t===void 0&&(t="innerRadius");var r=br(),i=r.animate,s=r.config,a=CF(t,n);return{transition:Qa(e,{keys:function(o){return o.id},initial:a.update,from:a.enter,enter:a.update,update:a.update,leave:a.leave,config:s,immediate:!i}),interpolate:JDe}},ZDe=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,s=e.borderColor,a=e.onClick,o=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,h=e.transitionMode,d=e.component,f=d===void 0?XDe:d,g=Vt(),_=jc(s,g),y=QDe(n,h,{enter:function(x){return{opacity:0,color:x.color,borderColor:_(x)}},update:function(x){return{opacity:1,color:x.color,borderColor:_(x)}},leave:function(x){return{opacity:0,color:x.color,borderColor:_(x)}}}),v=y.transition,m=y.interpolate,p=f;return u.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(x,b){return w.createElement(p,{key:b.id,datum:b,style:Dt({},x,{borderWidth:i,path:m(x.startAngle,x.endAngle,x.innerRadius,x.outerRadius,r)}),onClick:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c})})})},e8e=function(e,t,n,r,i,s){s===void 0&&(s=!0);var a=[],o=ya(Kr(r),n);a.push([o.x,o.y]);var l=ya(Kr(i),n);a.push([l.x,l.y]);for(var c=Math.round(Math.min(r,i));c<=Math.round(Math.max(r,i));c++)if(c%90==0){var h=ya(Kr(c),n);a.push([h.x,h.y])}a=a.map(function(v){var m=v[0],p=v[1];return[e+m,t+p]}),s&&a.push([e,t]);var d=a.map(function(v){return v[0]}),f=a.map(function(v){return v[1]}),g=Math.min.apply(Math,d),_=Math.max.apply(Math,d),y=Math.min.apply(Math,f);return{points:a,x:g,y,width:_-g,height:Math.max.apply(Math,f)-y}},t8e=function(e){var t=e===void 0?{}:e,n=t.cornerRadius,r=n===void 0?0:n,i=t.padAngle,s=i===void 0?0:i;return w.useMemo(function(){return Lbe().innerRadius(function(a){return a.innerRadius}).outerRadius(function(a){return a.outerRadius}).cornerRadius(r).padAngle(s)},[r,s])};function $a(){return $a=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},$a.apply(this,arguments)}function EF(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var bA,n8e=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,s=e.toggleSerie;return u.jsx(u.Fragment,{children:r.map(function(a,o){var l;return u.jsx(EB,$a({},a,{containerWidth:t,containerHeight:n,data:(l=a.data)!=null?l:i,toggleSerie:a.toggleSerie?s:void 0}),o)})})},De={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return u.jsx(jI,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(bA=window.devicePixelRatio)!=null?bA:1},r8e=["points"],i8e=function(e){var t=e.data,n=e.id,r=n===void 0?De.id:n,i=e.value,s=i===void 0?De.value:i,a=e.valueFormat,o=e.colors,l=o===void 0?De.colors:o,c=xa(r),h=xa(s),d=N1(a),f=SB(l,"id");return w.useMemo(function(){return t.map(function(g){var _,y=c(g),v=h(g),m={id:y,label:(_=g.label)!=null?_:y,hidden:!1,value:v,formattedValue:d(v),data:g};return $a({},m,{color:f(m)})})},[t,c,h,d,f])},s8e=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,s=e.outerRadius,a=e.padAngle,o=e.sortByValue,l=e.activeId,c=e.activeInnerRadiusOffset,h=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,g=w.useMemo(function(){var m=Ibe().value(function(p){return p.value}).startAngle(Kr(n)).endAngle(Kr(r)).padAngle(Kr(a));return o||m.sortValues(null),m},[n,r,a,o]),_=w.useMemo(function(){var m=t.filter(function(p){return!d.includes(p.id)});return{dataWithArc:g(m).map(function(p){var x=Math.abs(p.endAngle-p.startAngle);return $a({},p.data,{arc:{index:p.index,startAngle:p.startAngle,endAngle:p.endAngle,innerRadius:l===p.data.id?i-c:i,outerRadius:l===p.data.id?s+h:s,thickness:s-i,padAngle:p.padAngle,angle:x,angleDeg:O1(x)}})}),legendData:t.map(function(p){return{id:p.id,label:p.label,color:p.color,hidden:d.includes(p.id),data:p}})}},[g,t,d,l,i,c,s,h]),y=_.legendData,v=w.useRef(f);return w.useEffect(function(){typeof v.current=="function"&&v.current(y)},[v,y]),_},o8e=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,s=w.useState(i||r===void 0?null:r),a=s[0],o=s[1];return{activeId:i?t:a,setActiveId:w.useCallback(function(l){n&&n(l),i||o(l)},[i,n,o])}},a8e=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,s=i===void 0?De.innerRadius:i,a=e.startAngle,o=a===void 0?De.startAngle:a,l=e.endAngle,c=l===void 0?De.endAngle:l,h=e.padAngle,d=h===void 0?De.padAngle:h,f=e.sortByValue,g=f===void 0?De.sortByValue:f,_=e.cornerRadius,y=_===void 0?De.cornerRadius:_,v=e.fit,m=v===void 0?De.fit:v,p=e.activeInnerRadiusOffset,x=p===void 0?De.activeInnerRadiusOffset:p,b=e.activeOuterRadiusOffset,S=b===void 0?De.activeOuterRadiusOffset:b,C=e.activeId,E=e.onActiveIdChange,k=e.defaultActiveId,T=e.forwardLegendData,R=o8e({activeId:C,onActiveIdChange:E,defaultActiveId:k}),M=R.activeId,L=R.setActiveId,D=w.useState([]),N=D[0],P=D[1],I=w.useMemo(function(){var j,A=Math.min(n,r)/2,F=A*Math.min(s,1),H=n/2,B=r/2;if(m){var G=e8e(H,B,A,o-90,c-90),Q=G.points,Y=EF(G,r8e),W=Math.min(n/Y.width,r/Y.height),$={width:Y.width*W,height:Y.height*W};$.x=(n-$.width)/2,$.y=(r-$.height)/2,H=(H-Y.x)/Y.width*Y.width*W+$.x,B=(B-Y.y)/Y.height*Y.height*W+$.y,j={box:Y,ratio:W,points:Q},A*=W,F*=W}return{centerX:H,centerY:B,radius:A,innerRadius:F,debug:j}},[n,r,s,o,c,m]),z=s8e({data:t,startAngle:o,endAngle:c,innerRadius:I.innerRadius,outerRadius:I.radius,padAngle:d,sortByValue:g,activeId:M,activeInnerRadiusOffset:x,activeOuterRadiusOffset:S,hiddenIds:N,forwardLegendData:T}),O=w.useCallback(function(j){P(function(A){return A.indexOf(j)>-1?A.filter(function(F){return F!==j}):[].concat(A,[j])})},[]);return $a({arcGenerator:t8e({cornerRadius:y,padAngle:Kr(d)}),activeId:M,setActiveId:L,toggleSerie:O},z,I)},l8e=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,s=e.radius,a=e.innerRadius;return w.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:s,innerRadius:a}},[t,n,r,i,s,a])},c8e=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,s=e.borderColor,a=e.isInteractive,o=e.onClick,l=e.onMouseEnter,c=e.onMouseMove,h=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,g=e.transitionMode,_=lk(),y=_.showTooltipFromEvent,v=_.hideTooltip,m=w.useMemo(function(){if(a)return function(S,C){o==null||o(S,C)}},[a,o]),p=w.useMemo(function(){if(a)return function(S,C){y(w.createElement(f,{datum:S}),C),d(S.id),l==null||l(S,C)}},[a,y,d,l,f]),x=w.useMemo(function(){if(a)return function(S,C){y(w.createElement(f,{datum:S}),C),c==null||c(S,C)}},[a,y,c,f]),b=w.useMemo(function(){if(a)return function(S,C){v(),d(null),h==null||h(S,C)}},[a,v,d,h]);return u.jsx(ZDe,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:s,transitionMode:g,onClick:m,onMouseEnter:p,onMouseMove:x,onMouseLeave:b})},u8e=["isInteractive","animate","motionConfig","theme","renderWrapper"],d8e=function(e){var t=e.data,n=e.id,r=n===void 0?De.id:n,i=e.value,s=i===void 0?De.value:i,a=e.valueFormat,o=e.sortByValue,l=o===void 0?De.sortByValue:o,c=e.layers,h=c===void 0?De.layers:c,d=e.startAngle,f=d===void 0?De.startAngle:d,g=e.endAngle,_=g===void 0?De.endAngle:g,y=e.padAngle,v=y===void 0?De.padAngle:y,m=e.fit,p=m===void 0?De.fit:m,x=e.innerRadius,b=x===void 0?De.innerRadius:x,S=e.cornerRadius,C=S===void 0?De.cornerRadius:S,E=e.activeInnerRadiusOffset,k=E===void 0?De.activeInnerRadiusOffset:E,T=e.activeOuterRadiusOffset,R=T===void 0?De.activeOuterRadiusOffset:T,M=e.width,L=e.height,D=e.margin,N=e.colors,P=N===void 0?De.colors:N,I=e.borderWidth,z=I===void 0?De.borderWidth:I,O=e.borderColor,j=O===void 0?De.borderColor:O,A=e.enableArcLabels,F=A===void 0?De.enableArcLabels:A,H=e.arcLabel,B=H===void 0?De.arcLabel:H,G=e.arcLabelsSkipAngle,Q=G===void 0?De.arcLabelsSkipAngle:G,Y=e.arcLabelsTextColor,W=Y===void 0?De.arcLabelsTextColor:Y,$=e.arcLabelsRadiusOffset,V=$===void 0?De.arcLabelsRadiusOffset:$,U=e.arcLabelsComponent,X=e.enableArcLinkLabels,q=X===void 0?De.enableArcLinkLabels:X,re=e.arcLinkLabel,ne=re===void 0?De.arcLinkLabel:re,le=e.arcLinkLabelsSkipAngle,ve=le===void 0?De.arcLinkLabelsSkipAngle:le,ae=e.arcLinkLabelsOffset,Ee=ae===void 0?De.arcLinkLabelsOffset:ae,Me=e.arcLinkLabelsDiagonalLength,xe=Me===void 0?De.arcLinkLabelsDiagonalLength:Me,we=e.arcLinkLabelsStraightLength,se=we===void 0?De.arcLinkLabelsStraightLength:we,ee=e.arcLinkLabelsThickness,ie=ee===void 0?De.arcLinkLabelsThickness:ee,ce=e.arcLinkLabelsTextOffset,K=ce===void 0?De.arcLinkLabelsTextOffset:ce,te=e.arcLinkLabelsTextColor,oe=te===void 0?De.arcLinkLabelsTextColor:te,he=e.arcLinkLabelsColor,_e=he===void 0?De.arcLinkLabelsColor:he,ge=e.arcLinkLabelComponent,ye=e.defs,ze=ye===void 0?De.defs:ye,Oe=e.fill,je=Oe===void 0?De.fill:Oe,Le=e.isInteractive,pt=Le===void 0?De.isInteractive:Le,Te=e.onClick,Ie=e.onMouseEnter,Xe=e.onMouseMove,rn=e.onMouseLeave,nt=e.tooltip,mt=nt===void 0?De.tooltip:nt,Gt=e.activeId,sn=e.onActiveIdChange,Mt=e.defaultActiveId,Ot=e.transitionMode,It=Ot===void 0?De.transitionMode:Ot,pn=e.legends,_t=pn===void 0?De.legends:pn,on=e.forwardLegendData,Je=e.role,Ge=Je===void 0?De.role:Je,He=o5(M,L,D),gt=He.outerWidth,en=He.outerHeight,tn=He.margin,Rn=He.innerWidth,hl=He.innerHeight,Ne=i8e({data:t,id:r,value:s,valueFormat:a,colors:P}),Pe=a8e({data:Ne,width:Rn,height:hl,fit:p,innerRadius:b,startAngle:f,endAngle:_,padAngle:v,sortByValue:l,cornerRadius:C,activeInnerRadiusOffset:k,activeOuterRadiusOffset:R,activeId:Gt,onActiveIdChange:sn,defaultActiveId:Mt,forwardLegendData:on}),st=Pe.dataWithArc,Rt=Pe.legendData,ut=Pe.arcGenerator,Kt=Pe.centerX,Ct=Pe.centerY,Yt=Pe.radius,Go=Pe.innerRadius,fl=Pe.setActiveId,Kn=Pe.toggleSerie,wu=nB(ze,st,je),ke={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};h.includes("arcs")&&(ke.arcs=u.jsx(c8e,{center:[Kt,Ct],data:st,arcGenerator:ut,borderWidth:z,borderColor:j,isInteractive:pt,onClick:Te,onMouseEnter:Ie,onMouseMove:Xe,onMouseLeave:rn,setActiveId:fl,tooltip:mt,transitionMode:It},"arcs")),q&&h.includes("arcLinkLabels")&&(ke.arcLinkLabels=u.jsx(YDe,{center:[Kt,Ct],data:st,label:ne,skipAngle:ve,offset:Ee,diagonalLength:xe,straightLength:se,strokeWidth:ie,textOffset:K,textColor:oe,linkColor:_e,component:ge},"arcLinkLabels")),F&&h.includes("arcLabels")&&(ke.arcLabels=u.jsx(zDe,{center:[Kt,Ct],data:st,label:B,radiusOffset:V,skipAngle:Q,textColor:W,transitionMode:It,component:U},"arcLabels")),_t.length>0&&h.includes("legends")&&(ke.legends=u.jsx(n8e,{width:Rn,height:hl,data:Rt,legends:_t,toggleSerie:Kn},"legends"));var os=l8e({dataWithArc:st,arcGenerator:ut,centerX:Kt,centerY:Ct,radius:Yt,innerRadius:Go});return u.jsx(l5,{width:gt,height:en,margin:tn,defs:wu,role:Ge,children:h.map(function(An,IH){return ke[An]!==void 0?ke[An]:typeof An=="function"?u.jsx(w.Fragment,{children:w.createElement(An,os)},IH):null})})},h8e=function(e){var t=e.isInteractive,n=t===void 0?De.isInteractive:t,r=e.animate,i=r===void 0?De.animate:r,s=e.motionConfig,a=s===void 0?De.motionConfig:s,o=e.theme,l=e.renderWrapper,c=EF(e,u8e);return u.jsx(P1,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:u.jsx(d8e,$a({isInteractive:n},c))})};const f8e=1.4,El=e=>Ns(e).darker(f8e).toString(),$p="#A97CD2",vn={player:{label:"Player",description:"Player left by quitting the game, leaving the server or other normal means.",color:"#39E673",border:El("#39E673"),expected:!0},resource:{label:"Resource",description:"Player kicked out of the server by a resource.",color:"#406FE6",border:El("#406FE6"),expected:!0},timeout:{label:"Timeout",description:"Player connection timed out due to networking issues or client crash.",color:"#F0E38B",border:El("#F0E38B"),expected:!1},crash:{label:"Crash",description:"Player left due to a game crash, but was still able to inform the server the crash reason.",color:"#FF913F",border:El("#FF913F"),expected:!1},security:{label:"Security",description:"Player kicked out of the server due to suspect behavior such as sending too many commands or losing connection to the Cfx.re backend services.",color:"#FF3E26",border:El("#FF3E26"),expected:!1},unknown:{label:"Unknown",description:"Player left the server for an unknown reason.",color:"#F13BF7",border:El("#F13BF7"),expected:!1}},wA=Object.keys(vn).filter(e=>vn[e].expected),p8e=Object.keys(vn).filter(e=>!vn[e].expected),SA=({centerX:e,centerY:t,dataWithArc:n,innerRadius:r,active:i})=>{if(i)return u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:e,cy:t,r:r*.95,fill:i.color}),u.jsxs("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:[i.label,":"]}),u.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:cr(i.data.count)})]});{const s=w.useMemo(()=>n.reduce((a,o)=>a+o.data.count,0),[n]);return u.jsxs(u.Fragment,{children:[u.jsx("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:"Total:"}),u.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:cr(s)})]})}},m8e=w.memo(({data:e,activeId:t,setActiveId:n,width:r,height:i})=>{const s=B1(),[a,o]=w.useState(!1),l=w.useCallback(c=>{if(!t)return SA(c);const h=c.dataWithArc.find(d=>d.id===t);return SA({...c,active:h})},[t]);return!r||!i?null:u.jsx(h8e,{data:e,height:i,width:r,theme:{text:{fontSize:"13px",fontWeight:600}},activeId:t,onActiveIdChange:n,margin:{top:8,right:8,bottom:8,left:8},innerRadius:.6,padAngle:1.75,cornerRadius:4,activeOuterRadiusOffset:6,borderWidth:1,borderColor:s?void 0:{from:"data.border"},valueFormat:".1%",enableArcLinkLabels:!1,layers:["arcs","arcLabels","arcLinkLabels",l],arcLabelsSkipAngle:20,arcLabelsTextColor:{from:"color",modifiers:[["darker",2.5]]},onClick:(c,h)=>o(d=>!d),onMouseEnter:(c,h)=>o(!1),onMouseLeave:(c,h)=>{a&&n(c.id),h.preventDefault()},colors:{datum:"data.color"},tooltip:()=>null,sortByValue:!0})});function g8e(){const[e,t]=w.useState(null),[n,r]=w.useState({width:0,height:0}),i=et(Pv),s=sS(),a=w.useMemo(()=>{if(!(i!=null&&i.summaryLast6h)||s().isExpired)return null;if(!i.summaryLast6h.length)return"not_enough_data";const h=i.summaryLast6h.reduce((d,f)=>d+f[1],0);return i.summaryLast6h.map(([d,f])=>{var g,_,y;return{id:d,label:((g=vn[d])==null?void 0:g.label)??d,count:f,value:f/h,color:((_=vn[d])==null?void 0:_.color)??$p,border:((y=vn[d])==null?void 0:y.border)??$p}})},[i==null?void 0:i.summaryLast6h]),o=w.useMemo(()=>!(i!=null&&i.summaryLast6h)||s().isExpired||!i.summaryLast6h.length?null:i.summaryLast6h.map(([h,d])=>{var f,g,_;return{id:h,label:((f=vn[h])==null?void 0:f.label)??h,color:((g=vn[h])==null?void 0:g.color)??$p,border:((_=vn[h])==null?void 0:_.border)??$p}}),[i==null?void 0:i.summaryLast6h]);let l=null;return typeof a=="object"&&a!==null?l=u.jsx(m8e,{data:a,activeId:e,setActiveId:t,width:n.width,height:n.height}):typeof a=="string"?l=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:u.jsx("p",{className:"max-w-80",children:"No players have disconnected from the server in the last 6 hours."})}):l=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:u.jsx(Zt,{className:"animate-spin size-16 text-muted-foreground"})}),u.jsxs("div",{className:"col-span-3 sm:col-span-2 2xl:col-span-3 py-2 md:rounded-xl border bg-card shadow-sm flex flex-col min-w-64 h-[20rem] max-h-[20rem]",children:[u.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Player drop cause (last 6h)"}),u.jsx("div",{className:"hidden sm:block",children:u.jsx(ig,{})})]}),u.jsx(Vh,{onDebouncedResize:r,children:l}),o&&u.jsx("div",{className:"px-4 mx-auto flex flex-wrap justify-center gap-2",children:o.map(c=>u.jsxs("div",{"data-active":e===c.id,className:"flex items-center cursor-pointer hover:underline data-[active=true]:underline",onClick:()=>t(e===c.id?null:c.id),children:[u.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:c.color,borderColor:c.border}}),u.jsx("span",{className:"text-sm",children:c.label})]},c.id))})]})}const Bp=(e,t)=>`translate(${e}, ${t})`;function v8e({svgRef:e,canvasRef:t,setRenderError:n,size:{width:r,height:i},margins:s,isDarkMode:a,bucketLabels:o,dataStart:l,dataEnd:c,lifespans:h,cursorSetter:d}){Qn(e).selectAll("*").remove();const f=Qn(e);if(f.empty())throw new Error("SVG selection failed.");const g=Qn(t);if(g.empty())throw new Error("Canvas selection failed.");if(!(t!=null&&t.getContext))throw new Error("Canvas not supported.");let _=!0;console.log("From:",l.toISOString()),console.log("To:",c.toISOString()),console.log("Window:",u0(c.getTime()-l.getTime())),console.log("Number of lifespans:",h.length);const y=i-s.top-s.bottom,v=r-s.left-s.right;f.append("clipPath").attr("id","fullPerfChartClipPath").append("rect").attr("x",0).attr("y",s.top).attr("width",v).attr("height",i);const m=f.append("g").attr("clip-path","url(#fullPerfChartClipPath)").attr("transform",Bp(s.left,0)),p=Vk().domain([l,c]).range([0,v]),x=Q0().domain(o).range([i-s.bottom,0]),b=X9(a?c$:l$).domain([0,1]),S=Qs(h,ie=>Qs(ie.log,ce=>ce.players)),C=Qs(h,ie=>Qs(ie.log,ce=>ce.fxsMemory)),E=Qs(h,ie=>Qs(ie.log,ce=>ce.nodeMemory)),k=Math.ceil((S+1)/5)*5,T=[i-s.bottom,s.top],R=co([0,k],T);co([0,C],T),co([0,E],T);const M=co([382,1350],[7,16]),L=ZB(p).ticks(M(r)),D=f.append("g").attr("transform",Bp(s.left,i-s.bottom)).attr("class","time-axis").call(L),N=wje(x);f.append("g").attr("class","buckets-axis").attr("transform",Bp(r-s.right+s.axis,s.top)).call(N);const P=k<=7?Mk(k+1):null,I=eF(R).tickFormat(ie=>ie.toString()).tickValues(P);f.append("g").attr("class","players-axis").attr("transform",Bp(s.left-s.axis,0)).call(I);let z=[];const O=o.map(ie=>Math.floor(x(ie))),j=Math.ceil(x.bandwidth()),A=Ns(b(0)).darker(1.15).formatHsl(),F=()=>{const ie=g.node();if(!ie)return n("Canvas node not found.");const ce=ie.getContext("2d");if(!ce)return n("Canvas 2d context not found.");_&&console.time("drawing canvas heatmap"),ce.clearRect(0,0,v,y),ce.fillStyle=a?"#281C2B":"#E4D4FA",ce.fillRect(0,0,v,y),z=[];let K=0,te=0;for(const oe of h){const{bootTime:he,closeTime:_e,log:ge}=oe,ye=p(he||ge[0].start),ze=p(_e||ge.at(-1).end),Oe=ze-ye;if(!(ze<0||ye>v)&&!(Oe<5)){K++;for(const je of oe.log){const Le=Math.floor(p(je.start)),Te=Math.floor(p(je.end))-Le;if(Te){z.push(je);for(let Ie=0;Ie<je.weightedPerf.length;Ie++){const Xe=je.weightedPerf[Ie];ce.fillStyle=Xe>.001?b(Xe):A,ce.fillRect(Le,O[Ie],Te,j),te++}}}}}_&&(console.log("Canvas heatmap finished drawing:",{lifespanCount:K,snapCount:z.length,rectCount:te}),console.timeEnd("drawing canvas heatmap"))};F();const H=ie=>{const ce=ie.bootTime?p(ie.bootTime):p(ie.log[0].start),K=ie.closeTime?p(ie.closeTime):p(ie.log.at(-1).end),te=K-ce;return te<5||K<0+s.left||ce>v+s.left?[]:[{...ie,lifespanStartX:ce,lifespanEndX:K,lifespanWidth:te}]},B=ie=>{const ce=v$(K=>p(K.end),K=>R(K.players));ie.selectAll("path.players-line-bg").data(H).join("path").attr("class","players-line-bg").each((K,te,oe)=>{Qn(oe[te]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","black").attr("stroke-width",6).attr("d",ce(K.log))}),ie.selectAll("path.players-line").data(H).join("path").attr("class","players-line").each((K,te,oe)=>{Qn(oe[te]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","rgb(204, 203, 203)").attr("stroke-width",2).attr("d",ce(K.log))})};m.selectAll("g.lifespan").data(h).join("g").attr("class","lifespan").call(B);const G=m.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),Q=m.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),Y=m.append("circle").attr("class","cursorDot").attr("fill","red").attr("r",4),W=m.append("rect").attr("class","cursorTextBg").attr("fill","black").attr("rx",5).attr("ry",5).attr("stroke","rgba(216, 245, 19, 0.35)").attr("stroke-width",1),$=m.append("text").attr("class","cursorText font-mono").attr("fill","rgba(216, 245, 19)").attr("font-size",16),V=$.node(),U=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),Y.attr("cx",-99).attr("cy",-99),Q.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),$.attr("x",-99).attr("y",-99),W.attr("x",-99).attr("y",-99),d(void 0)};U();const X=20*60*1e3,q=Lf(ie=>ie.end).center,re=ie=>{if(!z.length)return;const ce=p.invert(ie),K=q(z,ce);if(K===-1)return;const te=z[K];if(Math.abs(te.end.getTime()-ce.getTime())<X)return{snapIndex:K,snapData:te}};let ne=null;const le=(ie,ce)=>{const K=re(ie);if(!K)return ne=null,U();const{snapIndex:te,snapData:oe}=K;if(te===ne)return;ne=te,d(oe);const he={x:Math.round(p(oe.end))+.5,y:Math.round(R(oe.players))+.5,val:oe.players};G.attr("x1",he.x).attr("y1",0).attr("x2",he.x).attr("y2",y),Q.attr("x1",0).attr("y1",he.y).attr("x2",v).attr("y2",he.y),Y.attr("cx",he.x).attr("cy",he.y);const _e=he.val.toString(),ge=he.x<50,ye=he.y<50;if($.text(_e).attr("x",ge?he.x+20:he.x-15).attr("y",ye?he.y+15:he.y-15).attr("text-anchor",ge?"start":"end").attr("dominant-baseline",ye?"hanging":"baseline"),!V)return;const ze=V.getBBox(),Oe=6,je=2;W.attr("x",Math.round(ze.x)-Oe-.5).attr("y",Math.round(ze.y)-je-.5).attr("width",Math.round(ze.width)+Oe*2).attr("height",Math.round(ze.height)+je*2)};let ve=!1,ae;const Ee=20;m.append("rect").attr("x",0).attr("y",0).attr("width",v).attr("height",y).attr("fill","transparent").on("mousemove",function(ie){const[ce,K]=li(ie);ve?(clearTimeout(ae),ae=setTimeout(()=>{le(ce)},Ee)):(ve=!0,le(ce),setTimeout(()=>{ve=!1},Ee))}),f.on("mouseleave",function(){setTimeout(()=>{U()},150)});let Me=!1;const we=Un(20,({transform:ie})=>{if(ie.k===1&&ie.x===0){if(!Me)return;Me=!1}else Me=!0;p.range([parseFloat(ie.applyX(0).toFixed(6)),parseFloat(ie.applyX(v).toFixed(6))]),L.scale(ie.rescaleX(p).range([0,v])),D.call(L),m.selectAll("g.lifespan").call(B),U(),F()},{noLeading:!1,noTrailing:!1}),se=[[0,s.top],[v,i-s.top]],ee=CDe().scaleExtent([1,12]).translateExtent(se).extent(se).on("zoom",we);f.call(ee),_=!1}const y8e=w.memo(({threadName:e,apiData:t,apiDataAge:n,width:r,height:i,isDarkMode:s})=>{const a=tt(rS),o=w.useRef(null),l=w.useRef(null),[c,h]=w.useState(""),[d,f]=w.useState(0),g=mK(),_={top:8,right:50,bottom:30,left:40,axis:1},y=w.useMemo(()=>{if(!t)return null;const v=MDe(t.threadPerfLog,m=>{const p=bF(t.boundaries);return wF(m.buckets,p)});return v?{...v,bucketLabels:t.boundaries.map(Cm),cursorSetter:m=>{if(!m)return g(void 0);g({threadName:e,snap:m})}}:null},[t,n,e,s,c]);return w.useEffect(()=>{if(!y)a(void 0);else{const v=RDe(y.lifespans,24,n);a(v)}},[y,n]),w.useEffect(()=>{if(!(!y||!o.current||!l.current||!r||!i)&&y.lifespans.length)try{console.groupCollapsed("Drawing full performance chart:"),console.time("drawFullPerfChart"),v8e({svgRef:o.current,canvasRef:l.current,setRenderError:h,size:{width:r,height:i},margins:_,isDarkMode:s,...y}),f(0),h(""),console.timeEnd("drawFullPerfChart")}catch(v){h(v.message??"Unknown error.")}finally{console.groupEnd()}},[y,r,i,o,l,c]),!r||!i?null:c?u.jsxs("div",{className:"absolute inset-0 p-4 flex flex-col gap-4 items-center justify-center text-center text-lg font-mono text-destructive-inline",children:["Render Error: ",c,u.jsx("br",{}),u.jsxs(Ae,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(v=>v+1),h("")},children:["Retry",d?` (${d})`:""]})]}):u.jsxs(u.Fragment,{children:[u.jsx("svg",{ref:o,width:r,height:i,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),u.jsx("canvas",{ref:l,width:r-_.left-_.right,height:i-_.top-_.bottom,style:{zIndex:0,position:"absolute",top:`${_.top}px`,left:`${_.left}px`}})]})});function x8e({error:e}){const t={bad_request:"Chart data loading failed: bad request.",invalid_thread_name:"Chart data loading failed: invalid thread name.",data_unavailable:"Chart data loading failed: data not yet available.",not_enough_data:u.jsxs("p",{className:"text-center",children:[u.jsx("strong",{children:"There is not enough data to display the chart just yet."}),u.jsx("br",{}),u.jsx("span",{className:"text-base italic",children:"The chart requires at least 30 minutes of server runtime data to be available."})]})};return typeof e=="string"?u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-muted-foreground",children:t[e]??"Unknown BackendApiError"}):u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-destructive-inline",children:["Error: ",e.message??"Unknown Error"]})}function _8e(){const[e,t]=w.useState({width:0,height:0}),[n,r]=w.useState("svMain"),[i,s]=w.useState(""),[a,o]=w.useState(0),l=B1(),c=wt({method:"GET",path:"/perfChartData/:thread/"}),h=Kc(`/perfChartData/${n}`,async()=>{s("");const f=await c({pathParams:{thread:n}});if(!f)throw new Error("empty_response");return"fail_reason"in f?(s(f.fail_reason),null):(o(Date.now()),f)},{revalidateOnMount:!0,revalidateOnFocus:!1,refreshInterval:60*1e3});let d=null;return h.data?d=u.jsx(y8e,{threadName:n,apiData:h.data,apiDataAge:a,width:e.width,height:e.height,isDarkMode:l}):h.isLoading?d=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:u.jsx(Zt,{className:"animate-spin size-16 text-muted-foreground"})}):(i||h.error)&&(d=u.jsx(x8e,{error:i||h.error})),u.jsxs("div",{className:"w-full h-[28rem] pt-2 md:rounded-xl border bg-card shadow-sm flex flex-col fill-primary",children:[u.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Server performance"}),u.jsxs("div",{className:"flex gap-4",children:[u.jsxs(Pn,{defaultValue:n,onValueChange:r,children:[u.jsx(kn,{className:"w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:"svMain",className:"cursor-pointer",children:"svMain"}),u.jsx(be,{value:"svSync",className:"cursor-pointer",children:"svSync"}),u.jsx(be,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),u.jsx("div",{className:"hidden xs:block",children:u.jsx(DK,{})})]})]}),u.jsx(Vh,{onDebouncedResize:t,children:d})]})}const b8e=w.memo(({uptimePct:e,medianPlayerCount:t,fxsMemory:n,nodeMemory:r})=>{const i=e?e.toFixed(2)+"%":"--",s=t?Math.ceil(t):"--",a=n?n.toFixed(2)+"MB":"--";let o=null,l="--";if(r){const c=Math.ceil(r.used/r.limit*100);l=r.used.toFixed(2)+"MB ("+c+"%)",c>85?o="text-destructive":c>70&&(o="text-warning")}return u.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-1 gap-4 h-full pb-2 text-muted-foreground",children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx(GD,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:i}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"Uptime 24h"})]})]}),u.jsxs("div",{className:"flex items-center",children:[u.jsx(MY,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:s}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"Median Players 24h"})]})]}),u.jsxs("div",{className:"flex items-center",children:[u.jsx(A3,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:a}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"FXServer Memory"})]})]}),u.jsxs("div",{className:J("flex items-center",o??"text-muted-foreground"),title:r?`${r.used.toFixed(2)}MB / ${r.limit}MB`:"",children:[u.jsx(A3,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:J("text-center sm:text-right text-xl",o??"text-primary"),children:l}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"Node.js Memory"})]})]})]})});function w8e(){const e=et(rS),t=et(Ov),n=et(Iv),r=sS(),i=w.useMemo(()=>{const o=r();if(!t||o.isExpired)return null;if(n&&n.snap){const l=bc(n.snap.end,"2-digit","2-digit"),c=wc(n.snap.end,"short"),h=vh(n.snap.end)?l:`${l} - ${c}`;return{fxsMemory:n.snap.fxsMemory,nodeMemory:t.nodeMemory&&n.snap.nodeMemory?{used:n.snap.nodeMemory,limit:t.nodeMemory.limit}:null,titleTimeIndicator:u.jsxs(u.Fragment,{children:["(",u.jsx("span",{className:"text-xs text-warning-inline font-mono",children:h}),")"]})}}else return{fxsMemory:t.fxsMemory,nodeMemory:t.nodeMemory,titleTimeIndicator:o.isStale?"(minutes ago)":"(live)"}},[t,n]);let s=null,a=null;return i?(s=i.titleTimeIndicator,a=u.jsx(b8e,{fxsMemory:i.fxsMemory,medianPlayerCount:e==null?void 0:e.medianPlayerCount,uptimePct:e==null?void 0:e.uptimePct,nodeMemory:i.nodeMemory})):a=u.jsx("div",{className:"size-full flex flex-col items-center justify-center",children:u.jsx(Zt,{className:"animate-spin size-16 text-muted-foreground"})}),u.jsxs("div",{className:"col-span-3 sm:col-span-1 2xl:col-span-2 min-w-52 py-2 px-4 flex flex-col md:rounded-xl border shadow-sm bg-card",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:["Server stats ",s]}),u.jsx("div",{className:"hidden xs:block",children:u.jsx(JK,{})})]}),a]})}function $f({children:e}){return u.jsx("div",{className:"flex items-center justify-center min-h-[16.5rem] text-xl p1 text-muted-foreground",children:e})}function Ba({msg:e}){return u.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[u.jsx(Zt,{className:"inline animate-spin h-5"})," ",e]})}function S8e(){const e=w.useRef(null),t=pK();return w.useEffect(()=>(e.current=K2(["dashboard"]),e.current.on("connect",()=>{console.log("Dashboard Socket.IO Connected.")}),e.current.on("disconnect",n=>{console.log("Dashboard Socket.IO Disonnected:",n)}),e.current.on("error",n=>{console.log("Dashboard Socket.IO",n)}),e.current.on("dashboard",function(n){t(n)}),()=>{var n,r;(n=e.current)==null||n.removeAllListeners(),(r=e.current)==null||r.disconnect()}),[]),u.jsxs("div",{className:"w-full min-w-96 flex flex-col gap-4",children:[u.jsxs("div",{className:"w-full grid grid-cols-3 2xl:grid-cols-8 gap-4",children:[u.jsx(g8e,{}),u.jsx(w8e,{}),u.jsx(DDe,{})]}),u.jsx(_8e,{})]})}function C8e(){const e=et(tS),t=$o()[1];return e===ks.Setup?(t("/server/setup"),null):e===ks.Deployer?(t("/server/deployer"),null):e!==ks.Ready?u.jsx("div",{className:"size-full",children:u.jsx($f,{children:u.jsx(Ba,{msg:`Unknown Config State: ${String(e)}`})})}):u.jsx(S8e,{})}function Vd({isError:e}){return e?u.jsxs("div",{className:"h-full min-h-28 flex flex-col items-center justify-center gap-2 text-destructive-inline",children:[u.jsx(HD,{className:"size-16 opacity-75"}),u.jsx("span",{children:"Error loading data."})]}):u.jsx("div",{className:"h-full min-h-28 flex items-center justify-center text-muted-foreground",children:u.jsx(Zt,{className:"animate-spin size-16 opacity-75"})})}function Bf({message:e}){return u.jsx("div",{className:"h-full min-h-28 px-4 py-6 flex items-center justify-center text-xl tracking-wider text-muted-foreground/75",children:e})}const CA=e=>{const t=e.indexOf("/");if(t===-1)return{name:e};const n=e.substring(t+1);return{name:e.substring(0,t),version:n||void 0}},k8e=(e,t)=>{const n=e.map(CA),r=t.map(CA),i=new Set(n.map(c=>c.name)),s=new Set(r.map(c=>c.name)),a=n.filter(c=>!s.has(c.name)).map(c=>c!=null&&c.version?`${c.name}/${c.version}`:c.name),o=r.filter(c=>!i.has(c.name)).map(c=>c!=null&&c.version?`${c.name}/${c.version}`:c.name),l=n.filter(c=>s.has(c.name)).map(c=>{const h=r.find(d=>d.name===c.name);return{resName:c.name,oldVer:c.version??"???",newVer:(h==null?void 0:h.version)??"???"}});return{removed:a,added:o,updated:l}},kA=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122,E8e=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(;n>0&&(kA(t.charCodeAt(n))||!kA(t.charCodeAt(n-1)));)n--;return n<=1?!1:t.slice(0,n)},T8e=e=>e.map((t,n)=>{const r=n===0?!1:E8e(e[n-1],t);return{prefix:r,suffix:r?t.slice(r.length):t}}),M8e=(e,t,n)=>{if(e.length<=t)return{filteredIn:e,filteredOut:!1};const r=e.map(([o,l])=>l).sort((o,l)=>l-o)[t-1];let i=0,s=0;const a=[];for(let o=0;o<e.length;o++){const[l,c]=e[o];(n?c>=r:o<t)?a.push([l,c]):(i++,s+=c)}return{filteredIn:a,filteredOut:!!i&&{count:s,types:i}}};function R8e({datum:e,isLast:t,isOdd:n}){let r=null;return e.prefix?r=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-muted-foreground/50",children:e.prefix}),u.jsx("span",{children:e.suffix})]}):r=e.suffix,u.jsxs("tr",{className:J("font-mono text-sm group",!t&&"border-b",n&&"bg-secondary/15","hover:bg-secondary/35"),children:[u.jsx("td",{className:"min-w-[4ch] px-2 py-1 border-r text-right",title:"Percent of all crashes",children:e.pctStr??"--"}),u.jsx("td",{className:"min-w-[4ch] px-2 py-1 border-r text-right",title:"Crash count",children:e.cntStr??"--"}),u.jsx("td",{className:"px-2 py-1 attempt-word-wrap line-clamp-4",children:r})]})}function A8e({crashTypes:e,crashesGroupReasons:t,crashesTargetLimit:n,setCrashesTargetLimit:r}){if(!e.length)return u.jsx(Bf,{message:"No player crashes within this time window."});const i=w.useMemo(()=>{t?e.sort((d,f)=>d[0].localeCompare(f[0])):e.sort((d,f)=>f[1]-d[1]);const s=e.reduce((d,[,f])=>d+f,0),{filteredIn:a,filteredOut:o}=n?M8e(e,n,t):{filteredIn:e,filteredOut:!1},l=T8e(a.map(([d,f])=>d)),c=[];let h=0;for(let d=0;d<a.length;d++){const[f,g]=a[d];h+=g;const _=g/s;c.push({key:f,pctStr:cr(_*100,1)+"%",cntStr:cr(g),...l[d]})}return{display:c,displayPct:cr(h/s*100,1)+"%",filteredOut:o&&{...o,countPct:cr(o.count/s*100,1)+"%"}}},[e,t,n,r]);return u.jsxs("table",{className:"w-full px-4 pt-2",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b text-muted-foreground/75",children:[u.jsx("th",{className:"min-w-[4ch] px-2 py-1 border-r text-right",children:"%"}),u.jsx("th",{className:"min-w-[4ch] px-2 py-1 border-r text-right",children:"Count"}),u.jsx("th",{className:"px-2 py-1",children:"Crash Reason"})]})}),u.jsxs("tbody",{children:[i.display.map((s,a)=>u.jsx(R8e,{datum:s,isOdd:a%2===0,isLast:!i.filteredOut&&a===i.display.length-1},s.key)),i.filteredOut?u.jsx("tr",{children:u.jsxs("td",{colSpan:3,className:J("text-center px-4 py-2 text-muted-foreground",i.display.length%2===0&&"bg-secondary/15","hover:bg-secondary/35"),children:["Showing the top ",i.display.length," out of ",cr(e.length)," reasons which account for ",i.displayPct," of all crashes. ",u.jsx("br",{}),"The remaining ",cr(i.filteredOut.types)," reasons account for ",i.filteredOut.countPct," of all crashes. "," ",u.jsx("button",{className:"text-accent hover:underline",onClick:()=>r(0),children:"Show All!"})]})}):null]})]})}function k5({children:e}){return u.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-destructive-inline/60 dark:bg-destructive-inline/90",children:e})}function E5({children:e}){return u.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-success-inline/60 dark:bg-success-inline/90",children:e})}function j8e({children:e}){return u.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-warning/60 dark:bg-warning/90",children:e})}function L8e({change:e}){return u.jsxs(u.Fragment,{children:["Switched from ",u.jsx(k5,{children:e.oldVersion})," to ",u.jsx(E5,{children:e.newVersion})]})}function D8e({change:e}){return u.jsxs(u.Fragment,{children:["Switched from ",u.jsx(k5,{children:e.oldVersion})," to ",u.jsx(E5,{children:e.newVersion})]})}function N8e({change:e}){const t=w.useMemo(()=>k8e(e.resRemoved,e.resAdded),[e.resRemoved,e.resAdded]);let n=null;t.removed.length&&(n=u.jsxs("p",{children:["Removed: ",t.removed.map((s,a,o)=>u.jsxs(w.Fragment,{children:[u.jsx(k5,{children:s}),a<o.length-1?", ":"."]},s))]}));let r=null;t.added.length&&(r=u.jsxs("p",{children:["Added: ",t.added.map((s,a,o)=>u.jsxs(w.Fragment,{children:[u.jsx(E5,{children:s}),a<o.length-1?", ":"."]},s))]}));let i=null;return t.updated.length&&(i=u.jsxs("p",{children:["Updated: ",t.updated.map((s,a,o)=>u.jsxs(w.Fragment,{children:[u.jsxs(j8e,{children:[s.resName," ",s.oldVer," -> ",s.newVer]}),a<o.length-1?", ":"."]},a))]})),u.jsxs(u.Fragment,{children:[n,r,i]})}function P8e({changes:e}){const t={fxsChanged:"Changed FXServer version",gameChanged:"Changed game version",resourcesChanged:"Changed boot resources"},n=w.useMemo(()=>e.sort((r,i)=>r.ts-i.ts),[e]);return e.length?u.jsx("div",{className:"md:grid md:grid-cols-[auto_minmax(0,1fr)] gap-4 md:px-4 pt-2 ",children:n.map((r,i)=>u.jsxs(w.Fragment,{children:[u.jsx("div",{className:"hidden mx-auto md:flex items-center gap-4 divide-y",children:u.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-1 rounded-lg text-xs font-medium bg-muted",children:[u.jsx("span",{children:aP(r.ts,"medium")}),u.jsx("span",{children:Aoe(r.ts)})]})}),u.jsxs("div",{className:J("flex-1 col-span-2 md:col-span-1 px-2 md:px-0 py-2 md:py-0",i%2===0&&"bg-secondary/25 md:bg-transparent"),children:[u.jsxs("div",{className:"flex flex-wrap-reverse justify-between",children:[u.jsx("h3",{className:"flex-grow inline text-lg font-semibold",children:r.type in t?t[r.type]:r.type}),u.jsx("div",{className:"md:hidden mx-auto",children:u.jsx("span",{className:"border-muted-foreground border rounded px-2 py-0.5 font-normal text-xs text-muted-foreground",children:vs(r.ts,"medium","short")})})]}),u.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[r.type==="fxsChanged"&&u.jsx(L8e,{change:r}),r.type==="gameChanged"&&u.jsx(D8e,{change:r}),r.type==="resourcesChanged"&&u.jsx(N8e,{change:r})]})]})]},i))}):u.jsx(Bf,{message:"No environmental changes within this time window."})}var[q1,COe]=In("Tooltip",[eu]),G1=eu(),TF="TooltipProvider",O8e=700,Pw="tooltip.open",[I8e,T5]=q1(TF),MF=e=>{const{__scopeTooltip:t,delayDuration:n=O8e,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,[a,o]=w.useState(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),u.jsx(I8e,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),o(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(h=>{l.current=h},[]),disableHoverableContent:i,children:s})};MF.displayName=TF;var K1="Tooltip",[$8e,Y1]=q1(K1),RF=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=T5(K1,e.__scopeTooltip),c=G1(t),[h,d]=w.useState(null),f=Rr(),g=w.useRef(0),_=a??l.disableHoverableContent,y=o??l.delayDuration,v=w.useRef(!1),[m=!1,p]=Zr({prop:r,defaultProp:i,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(Pw))):l.onClose(),s==null||s(E)}}),x=w.useMemo(()=>m?v.current?"delayed-open":"instant-open":"closed",[m]),b=w.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,p(!0)},[p]),S=w.useCallback(()=>{window.clearTimeout(g.current),g.current=0,p(!1)},[p]),C=w.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,p(!0),g.current=0},y)},[y,p]);return w.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),u.jsx(sC,{...c,children:u.jsx($8e,{scope:t,contentId:f,open:m,stateAttribute:x,trigger:h,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?C():b()},[l.isOpenDelayed,C,b]),onTriggerLeave:w.useCallback(()=>{_?S():(window.clearTimeout(g.current),g.current=0)},[S,_]),onOpen:b,onClose:S,disableHoverableContent:_,children:n})})};RF.displayName=K1;var Ow="TooltipTrigger",AF=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Y1(Ow,n),s=T5(Ow,n),a=G1(n),o=w.useRef(null),l=Fe(t,o,i.onTriggerChange),c=w.useRef(!1),h=w.useRef(!1),d=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),u.jsx(oC,{asChild:!0,...a,children:u.jsx(Ce.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:fe(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:fe(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:fe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:fe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:fe(e.onBlur,i.onClose),onClick:fe(e.onClick,i.onClose)})})});AF.displayName=Ow;var B8e="TooltipPortal",[kOe,F8e]=q1(B8e,{forceMount:void 0}),Oc="TooltipContent",jF=w.forwardRef((e,t)=>{const n=F8e(Oc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=Y1(Oc,e.__scopeTooltip);return u.jsx(fn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(LF,{side:i,...s,ref:t}):u.jsx(z8e,{side:i,...s,ref:t})})}),z8e=w.forwardRef((e,t)=>{const n=Y1(Oc,e.__scopeTooltip),r=T5(Oc,e.__scopeTooltip),i=w.useRef(null),s=Fe(t,i),[a,o]=w.useState(null),{trigger:l,onClose:c}=n,h=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{o(null),d(!1)},[d]),g=w.useCallback((_,y)=>{const v=_.currentTarget,m={x:_.clientX,y:_.clientY},p=V8e(m,v.getBoundingClientRect()),x=q8e(m,p),b=G8e(y.getBoundingClientRect()),S=Y8e([...x,...b]);o(S),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&h){const _=v=>g(v,h),y=v=>g(v,l);return l.addEventListener("pointerleave",_),h.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",y)}}},[l,h,g,f]),w.useEffect(()=>{if(a){const _=y=>{const v=y.target,m={x:y.clientX,y:y.clientY},p=(l==null?void 0:l.contains(v))||(h==null?void 0:h.contains(v)),x=!K8e(m,a);p?f():x&&(f(),c())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,h,a,c,f]),u.jsx(LF,{...e,ref:s})}),[H8e,W8e]=q1(K1,{isInside:!1}),LF=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=Y1(Oc,n),c=G1(n),{onClose:h}=l;return w.useEffect(()=>(document.addEventListener(Pw,h),()=>document.removeEventListener(Pw,h)),[h]),w.useEffect(()=>{if(l.trigger){const d=f=>{const g=f.target;g!=null&&g.contains(l.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,h]),u.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:u.jsxs(aC,{"data-state":l.stateAttribute,...c,...o,ref:t,style:{...o.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)"},children:[u.jsx(X2,{children:r}),u.jsx(H8e,{scope:n,isInside:!0,children:u.jsx(lP,{id:l.contentId,role:"tooltip",children:i||r})})]})})});jF.displayName=Oc;var DF="TooltipArrow",U8e=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=G1(n);return W8e(DF,n).isInside?null:u.jsx(lC,{...i,...r,ref:t})});U8e.displayName=DF;function V8e(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function q8e(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 G8e(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 K8e(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s].x,l=t[s].y,c=t[a].x,h=t[a].y;l>r!=h>r&&n<(c-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function Y8e(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),X8e(t)}function X8e(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 s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.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 s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.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)}var J8e=MF,Q8e=RF,Z8e=AF,NF=jF;const PF=J8e,ws=Q8e,Ss=Z8e,Fi=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(NF,{ref:r,sideOffset:t,className:J("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}));Fi.displayName=NF.displayName;function eNe({dropTypes:e}){let{totalDrops:t,categories:n}=w.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,s in vn&&(i[s]={label:vn[s].label,tooltip:vn[s].description,color:vn[s].color,count:a});return{totalDrops:r,categories:Object.entries(i)}},[e]);return n.length?u.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>u.jsxs(ws,{children:[u.jsx(Ss,{asChild:!0,children:u.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[u.jsx("span",{className:"text-xl tracking-wider border-b-2 font-semibold",style:{borderColor:i.color},children:i.label}),u.jsxs("span",{children:[cr(i.count)," ",u.jsxs("small",{className:"opacity-75",children:["(",cr(i.count/t*100,1),"%)"]})]})]},r)}),u.jsx(Fi,{className:"max-w-96 text-center",children:u.jsx("p",{children:i.tooltip})})]}))}):u.jsx(Bf,{message:"No player drops within this time window."})}function tNe({resKicks:e}){let{totalKicks:t,resources:n}=w.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,i[s]={label:s,count:a};return{totalKicks:r,resources:Object.entries(i)}},[e]);return n.length?u.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>u.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[u.jsx("span",{className:"text-lg tracking-wider border-b-2",children:i.label}),u.jsxs("span",{className:"text-sm",children:[cr(i.count)," ",u.jsxs("small",{className:"opacity-75",children:["(",cr(i.count/t*100,1),"%)"]})]})]},r))}):u.jsx(Bf,{message:"No players kicked by resources within this time window."})}function nNe({isError:e}){return u.jsxs("div",{className:"space-y-1",children:[u.jsx("div",{className:"text-center space-x-2 text-sm text-muted-foreground",children:u.jsx("span",{children:"Loading..."})}),u.jsxs("div",{className:"pb-2 md:rounded-xl border bg-cardx shadow-sm flex flex-col",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b md:rounded-t-[inherit] bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(FD,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Overview"})]})}),u.jsx("div",{className:"px-4 py-2 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:u.jsx(Vd,{isError:e})}),u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(qD,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]})}),u.jsx("div",{className:"px-4 pt-2 pb-4",children:u.jsx(Vd,{isError:e})}),u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(WD,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),u.jsx("div",{className:"px-4 pt-2 pb-4 space-y-4",children:u.jsx(Vd,{isError:e})})]})]})}const rNe=function({windowStart:t,windowEnd:n,windowData:r,rangeSelected:i,displayLod:s}){const[a,o]=w.useState(50),[l,c]=w.useState(!1),h=new Date(t),d=new Date(n),f=!vh(h)||!vh(h),g=bc(h,"2-digit","2-digit"),_=wc(h,"short"),y=f?`${g} - ${_}`:g,v=bc(d,"2-digit","2-digit"),m=wc(d,"short"),p=f?`${v} - ${m}`:v;return u.jsxs("div",{className:"space-y-1",children:[u.jsx("div",{className:J("text-center space-x-2 text-sm text-muted-foreground",i&&"font-semibold text-primary"),children:u.jsxs("span",{children:["Period from ",u.jsx(Ue,{title:h.toISOString(),children:y})," to ",u.jsx(Ue,{title:d.toISOString(),children:p}),"."]})}),u.jsxs("div",{className:"md:rounded-xl border shadow-sm flex flex-col",children:[u.jsxs("div",{className:"rounded-t-[inherit]",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b rounded-t-[inherit] bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(FD,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Period Overview"})]})}),u.jsx(eNe,{dropTypes:r.dropTypes})]}),u.jsxs("div",{className:"pb-4",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(ID,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Resource Kicks"})]})}),u.jsx(tNe,{resKicks:r.resKicks})]}),u.jsxs("div",{className:"pb-4",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(WD,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),u.jsx(P8e,{changes:r.changes})]}),u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between flex-shrink px-1 sm:px-4 border-t border-b bg-secondary/35",children:[u.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(qD,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(Pn,{value:a.toString(),onValueChange:x=>o(parseInt(x)),children:[u.jsx(kn,{className:"w-32 h-6 px-3 py-1 text-sm",children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:"50",className:"cursor-pointer",children:"Top ~50"}),u.jsx(be,{value:"100",className:"cursor-pointer",children:"Top ~100"}),u.jsx(be,{value:"0",className:"cursor-pointer",children:"Show All"})]})]}),u.jsxs(Pn,{value:l.toString(),onValueChange:x=>c(x==="true"),children:[u.jsx(kn,{className:"w-36 h-6 px-3 py-1 text-sm",children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:"false",className:"cursor-pointer",children:"Sort by Count"}),u.jsx(be,{value:"true",className:"cursor-pointer",children:"Group Reasons"})]})]})]})]}),u.jsx(A8e,{crashTypes:r.crashTypes,crashesGroupReasons:l,crashesTargetLimit:a,setCrashesTargetLimit:o})]})]})]})},iNe=w.memo(rNe),Hx=(e,t)=>`translate(${e}, ${t})`;function sNe({legendRef:e,svgRef:t,canvasRef:n,setRenderError:r,size:{width:i,height:s},rangeSelected:a,rangeSetter:o,margins:l,isDarkMode:c,chartName:h,data:d}){Qn(t).selectAll("*").remove();const f=Qn(t);if(f.empty())throw new Error("SVG selection failed.");const g=Qn(n);if(g.empty())throw new Error("Canvas selection failed.");if(!(n!=null&&n.getContext))throw new Error("Canvas not supported.");let _=!0;console.log("From:",d.startDate.toISOString()),console.log("To:",d.endDate.toISOString()),console.log("Window:",u0(d.startDate.getTime()-d.endDate.getTime())),console.log("Number of intervals:",d.log.length);const y=s-l.top-l.bottom,v=i-l.left-l.right;console.log("Drawable area:",v,y);const m=f.append("g").attr("transform",Hx(l.left,l.top)),p=Vk([d.startDate,d.endDate],[0,v]),x=d.maxDrops<10?d.maxDrops+1:d.maxDrops,b=co([0,x],[s-l.bottom,l.top]),S=co([382,1350],[7,16]),C=ZB(p).ticks(S(i));m.append("g").attr("transform",Hx(0,y)).attr("class","time-axis").call(C);const E=x<=7?Mk(x+1):null,k=eF(b).ticks(s>200?6:4).tickFormat(se=>cr(se)).tickValues(E),T=f.append("g").attr("class","counts-axis").attr("transform",Hx(l.left-l.axis,0)).call(k),R=d.displayLod==="day"?24:1,M=new Date(d.startDate.getTime()+R*60*60*1e3),L=p(M)-p(d.startDate),D=Math.floor(L/2),N=d.displayLod==="day"?12:0,P=c?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.35)",I=c?"#00000035":"#00000007",z=c?"#FFFFFFE0":"#000000D0",O=se=>b(se)-l.top;(()=>{var ie,ce;const se=g.node();if(!se)return r("Canvas node not found.");const ee=se.getContext("2d");if(!ee)return r("Canvas 2d context not found.");if(!L)return r("Cannot render with zero interval width.");_&&console.time("drawing canvas timeline"),ee.clearRect(0,0,v,y),ee.fillStyle=I,ee.fillRect(0,0,v,y),ee.strokeStyle=P,ee.setLineDash([2,2]);try{const K=T.selectAll("g.tick").nodes();for(const te of K){const oe=te==null?void 0:te.getAttribute("transform");if(!oe)continue;const he=Math.round(+oe.split(",")[1].replace(")","")-l.top)+.5;ee.beginPath(),ee.moveTo(0,he),ee.lineTo(v,he),ee.stroke()}}catch(K){console.error("Error drawing horizontal ticks:",K)}ee.setLineDash([]),ee.lineWidth=1;for(const K of d.log){const te=p(K.startDate);if(te<0||te>v)continue;const he=Math.round(te)-D+N,_e=te-he,ge=Math.round(L+_e)+1-D-N;if(ge<1)continue;let ye=0,ze=y+1;for(const[Oe,je]of K.drops){if(!je)continue;const Le=ze-1,pt=O(ye+je)+1,Te=Le-pt,Ie=Math.max(Math.floor(Te),Te>.8?1:0);ye+=je,!(Ie<1)&&(ze=Le-Ie,ee.fillStyle=((ie=vn[Oe])==null?void 0:ie.color)??"white",ee.fillRect(he,Le,ge,-Ie),ee.strokeStyle=((ce=vn[Oe])==null?void 0:ce.border)??"black",ee.strokeRect(he+.5,Le+.5,ge-1,-Ie-1))}if(K.changes){ee.fillStyle=z;const Oe=Math.round(he-.5+ge/2)+.5,je=ze-6,Le=3;ee.beginPath(),ee.moveTo(Oe,je-Le),ee.lineTo(Oe+Le,je),ee.lineTo(Oe,je+Le),ee.lineTo(Oe-Le,je),ee.closePath(),ee.fill()}}_&&console.timeEnd("drawing canvas timeline")})();let A=null,F=!1,H;const B=`chartMask-${h}`,G=m.append("line").attr("stroke",c?"rgba(216, 245, 19, 0.75)":"rgba(62, 70, 5, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3,3"),Y=m.append("defs").append("mask").attr("id",B),W=Y.append("rect").attr("width",v).attr("height",y).attr("fill","white").attr("class","transition-opacity").attr("opacity","0"),$=Y.append("rect").attr("height",y).attr("fill","black");m.append("rect").attr("width",v).attr("height",y).attr("fill",c?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0.35)").attr("mask",`url(#${B})`);const V=(se,ee)=>{if(typeof se!="number"||typeof ee!="number"||se<0&&ee<0||se>v&&ee>v){W.attr("opacity","0");return}const ie=Math.floor(se),ce=Math.floor(ee);$.attr("x",Math.min(ie,ce)+.5-D).attr("width",Math.abs(ce-ie)+L+.5),W.attr("opacity","1")},U=se=>{if(!Array.isArray(se)||se.length!==2)return o(null);se[0].getTime()<=se[1].getTime()?o({startDate:new Date(se[0]),endDate:new Date(se[1])}):o({startDate:new Date(se[1]),endDate:new Date(se[0])})},X=(se=!1)=>{A=null,F=!1,se&&(V(),a&&U(null))},q=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),e.style.opacity="0",clearTimeout(H)};q(),a&&(console.log("Upsream range selected:",a.startDate.toISOString(),a.endDate.toISOString()),V(p(a.startDate),p(a.endDate)));const re=Lf(se=>se.startDate).center,ne=se=>{const ee=p.invert(se),ie=re(d.log,ee);if(ie===-1)return;const ce=d.log[ie],K=ce.startDate.getTime();return{datum:ce,datumStartTs:K,datumStartX:p(ce.startDate),dataumIndex:ie}};let le=null;const ve=se=>{var ze;const ee=ne(se);if(!ee)return;const{datum:ie,datumStartX:ce,dataumIndex:K}=ee;if(K===le)return;if(le=K,A)return F=!0,V(A.x,ce);const te=e.querySelectorAll("span[data-category]");for(const Oe of te){const je=Oe.getAttribute("data-category");if(!je)continue;const Le=((ze=ie.drops.find(([pt])=>pt===je))==null?void 0:ze[1])??0;Oe.textContent=cr(Le)}const oe=e.querySelector("div.change-flag");oe&&(ie.changes?(oe.style.display="block",oe.textContent=ie.changes>1?`${ie.changes} CHANGES`:"1 CHANGE"):(oe.style.display="none",oe.textContent=""));let he=!1;e.style.opacity==="0"&&(e.style.transitionProperty="opacity",he=!0);const _e=e.clientWidth;let ge=ce-_e-10+l.left;ge<l.left&&(ge=ce+10+l.left),e.style.left=`${ge}px`,e.style.opacity="1",he&&setTimeout(()=>{e.style.transitionProperty="all"},0);const ye=Math.round(ce+L/2)+.5-D;G.attr("x1",ye).attr("y1",0).attr("x2",ye).attr("y2",y)},ae=se=>{const ee=ne(se);ee&&(q(),A={x:ee.datumStartX,datum:ee.datum},V(ee.datumStartX))},Ee=se=>{if(!A)return X(!0);const ee=ne(se);if(!ee||!F&&A.datum.startDate.getTime()===ee.datum.startDate.getTime())return X(!0);console.log("PlayerDrops range selected:",A.datum.startDate,ee.datum.startDate),clearTimeout(H),U([A.datum.startDate,ee.datum.startDate]),X()},Me=()=>{setTimeout(()=>{X(!!A),q()},150)};let xe=!1;const we=20;m.append("rect").attr("width",v).attr("height",y).attr("fill","transparent").on("mousemove",function(se){const[ee]=li(se);xe?(clearTimeout(H),H=setTimeout(()=>{ve(ee)},we)):(xe=!0,ve(ee),setTimeout(()=>{xe=!1},we))}).on("mousedown",function(se){const[ee]=li(se);ae(ee)}).on("mouseup",function(se){const[ee]=li(se);Ee(ee)}),f.on("mouseleave",Me),_=!1}const oNe=w.memo(({categories:e})=>e.slice().reverse().map(n=>u.jsxs("div",{className:"flex items-center text-sm",children:[u.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:vn[n].color,borderColor:vn[n].border}}),u.jsxs("span",{className:"tracking-wider",children:[vn[n].label,":"]}),u.jsx("div",{className:"flex-grow text-right font-semibold min-w-[3ch] text-muted-foreground",children:u.jsx("span",{"data-category":n})})]},n)));function aNe({chartData:e,chartName:t,width:n,height:r,rangeSelected:i,rangeSetter:s}){const a=w.useRef(null),o=w.useRef(null),l=w.useRef(null),[c,h]=w.useState(""),[d,f]=w.useState(0),g=B1(),_={top:8,right:8,bottom:24,left:42,axis:1};return w.useEffect(()=>{if(!(!e||!l.current||!a.current||!o.current||!n||!r)&&e.log.length)try{console.groupCollapsed(`Drawing player ${t} drops:`),console.time(`drawDropsTimeline-${t}`),sNe({chartName:t,legendRef:l.current,svgRef:a.current,canvasRef:o.current,size:{width:n,height:r},rangeSelected:i,margins:_,isDarkMode:g,data:e,setRenderError:h,rangeSetter:s}),f(0),h(""),console.timeEnd(`drawDropsTimeline-${t}`)}catch(y){h(y.message??"Unknown error.")}finally{console.groupEnd()}},[e,t,n,r,i,s,g,l,a,o,c]),!n||!r?null:c?u.jsxs("div",{className:"absolute inset-0 p-4 flex flex-col gap-4 items-center justify-center text-center text-lg font-mono text-destructive-inline",children:["Render Error: ",c,u.jsx("br",{}),u.jsxs(Ae,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(y=>y+1),h("")},children:["Retry",d?` (${d})`:""]})]}):e.maxDrops?u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:l,style:{zIndex:2,position:"absolute",top:"12px",opacity:0},className:"p-2 rounded-md border shadow-lg dark:bg-zinc-800/90 bg-zinc-200/90 pointer-events-none transition-all",children:[u.jsx(oNe,{categories:e.categoriesSorted}),u.jsx("div",{className:"change-flag w-full mt-1 bg-card/75 rounded-md border text-center text-xs tracking-wider"})]}),u.jsx("svg",{ref:a,width:n,height:r,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),u.jsx("canvas",{ref:o,width:n-_.left-_.right,height:r-_.top-_.bottom,style:{zIndex:0,position:"absolute",top:`${_.top}px`,left:`${_.left}px`}})]}):u.jsx(Bf,{message:"No players disconnected from your server recently."})}const EA=w.memo(aNe),lNe=(e,t,n)=>{const r=n.getTime(),i=e.findIndex(p=>new Date(p.hour).getTime()>=r),s=e.slice(i);if(s.length===0)return null;const a=Object.fromEntries(wA.map(p=>[p,0])),o=Object.fromEntries(p8e.map(p=>[p,0]));let l=s;if(t==="day"){l=[];let p,x;for(const b of s){const S=new Date(b.hour).getDate();if(!x)p=S,x={hour:b.hour,changes:0,dropTypes:[]};else if(S!==p){l.push(x),p=S,x=ta(b);continue}x.changes+=b.changes;for(const[C,E]of b.dropTypes.slice()){const k=x.dropTypes.find(([T])=>T===C);k?k[1]+=E:x.dropTypes.push([C,E])}}x&&l.push(x)}let c=0,h=0;const d=[];for(const p of l){const x=[],b=[];let S=0,C=0;for(const[E,k]of p.dropTypes)wA.includes(E)?(S+=k,x.push([E,k]),a[E]+=k):(C+=k,b.push([E,k]),o[E]+=k);c=Math.max(c,S),h=Math.max(h,C),d.push({changes:p.changes,expectedDrops:x,unexpectedDrops:b})}const f=Object.entries(a).sort((p,x)=>x[1]-p[1]),g=Object.fromEntries(f.map(([p,x],b)=>[p,b])),_=Object.entries(o).sort((p,x)=>x[1]-p[1]),y=Object.fromEntries(_.map(([p,x],b)=>[p,b])),v=[],m=[];for(let p=0;p<l.length;p++){const x=l[p],b=d[p];if(!b)continue;const S=new Date(x.hour);v.push({startDate:S,changes:b.changes,drops:b.expectedDrops.sort(([C],[E])=>g[C]-g[E])}),m.push({startDate:S,changes:b.changes,drops:b.unexpectedDrops.sort(([C],[E])=>y[C]-y[E])})}return{expectedSeries:v,expectedSeriesMax:c,expectedCategoriesSorted:f.map(([p,x])=>p),unexpectedSeries:m,unexpectedSeriesMax:h,unexpectedCategoriesSorted:_.map(([p,x])=>p)}},cNe=w.memo(({isError:e,dataTs:t,summaryData:n,rangeSelected:r,rangeSetter:i,displayLod:s,setDisplayLod:a})=>{const[o,l]=w.useState({width:0,height:0}),[c,h]=w.useState({width:0,height:0}),d=w.useMemo(()=>{if(!n||!t)return;const f=new Date(t),g=new Date(t);s==="day"?(f.setHours(-(14*24)-12,-15,0,0),g.setHours(12,0,0,0)):(f.setHours(f.getHours()-7*24,-45,0,0),g.setMinutes(30,0,0));const _=lNe(n,s,f);if(!_)return;const y={displayLod:s,startDate:f,endDate:g};return{expected:{...y,maxDrops:_.expectedSeriesMax,categoriesSorted:_.expectedCategoriesSorted,log:_.expectedSeries},unexpected:{...y,maxDrops:_.unexpectedSeriesMax,categoriesSorted:_.unexpectedCategoriesSorted,log:_.unexpectedSeries}}},[n,s]);return u.jsxs("div",{className:"md:rounded-xl border bg-card shadow-sm flex flex-col",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-b rounded-t-[inherit] bg-secondary/35",children:[u.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(ig,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Expected Player Drops"})]}),u.jsxs(Pn,{defaultValue:s,onValueChange:a,children:[u.jsx(kn,{className:"w-32 h-6 px-3 py-1 text-sm",children:u.jsx(On,{placeholder:"Filter by admin"})}),u.jsxs(En,{className:"px-0",children:[u.jsx(be,{value:"day",className:"cursor-pointer",children:"Days"}),u.jsx(be,{value:"hour",className:"cursor-pointer",children:"Hours"})]})]})]}),u.jsx("div",{className:"h-32 max-h-32",children:u.jsx(Vh,{onDebouncedResize:l,children:d?u.jsx(EA,{chartData:d.expected,chartName:"expected",width:o.width,height:o.height,rangeSelected:r,rangeSetter:i}):u.jsx(Vd,{isError:e})})}),u.jsx("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center py-2 gap-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(ig,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Unexpected Player Drops"})]})}),u.jsx("div",{className:"h-52 max-h-52",children:u.jsx(Vh,{onDebouncedResize:h,children:d?u.jsx(EA,{chartData:d.unexpected,chartName:"unexpected",width:c.width,height:c.height,rangeSelected:r,rangeSetter:i}):u.jsx(Vd,{isError:e})})})]})}),uNe=w.memo(cNe),dNe=(e,t)=>{if(!e){const i=t==="day"?14:7;return{queryKey:"detailedDaysAgo="+i,queryParams:{detailedDaysAgo:i}}}const n=new Date(e.endDate);t==="day"?n.setHours(23,59,59,999):n.setMinutes(59,59,999);const r=`${e.startDate.toISOString()},${n.toISOString()}`;return{queryKey:"detailedWindow="+r,queryParams:{detailedWindow:r}}};function hNe(){var c,h;const[e,t]=w.useState("hour"),[n,r]=w.useState(null),{queryKey:i,queryParams:s}=dNe(n,e),a=wt({method:"GET",path:"/playerDropsData"}),o=Kc(`/playerDropsData?${i}`,async()=>{const d=await a({queryParams:s});if(!d)throw new Error("empty_response");if("fail_reason"in d)throw new Error(d.fail_reason);return d},{revalidateOnFocus:!1}),l=d=>{t(d),r(null)};return u.jsxs("div",{className:"w-full space-y-8",children:[u.jsx(uNe,{isError:!!o.error,dataTs:(c=o.data)==null?void 0:c.ts,summaryData:(h=o.data)==null?void 0:h.summary,rangeSelected:n,rangeSetter:r,displayLod:e,setDisplayLod:l}),o.data&&!o.isValidating?u.jsx(iNe,{windowStart:o.data.detailed.windowStart,windowEnd:o.data.detailed.windowEnd,windowData:o.data.detailed.windowData,rangeSelected:n,displayLod:e}):u.jsx(nNe,{isError:!!o.error})]})}var M5="Tabs",[fNe,EOe]=In(M5,[tu]),OF=tu(),[pNe,R5]=fNe(M5),IF=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...c}=e,h=Ha(o),[d,f]=Zr({prop:r,onChange:i,defaultProp:s});return u.jsx(pNe,{scope:n,baseId:Rr(),value:d,onValueChange:f,orientation:a,dir:h,activationMode:l,children:u.jsx(Ce.div,{dir:h,"data-orientation":a,...c,ref:t})})});IF.displayName=M5;var $F="TabsList",BF=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=R5($F,n),a=OF(n);return u.jsx(cC,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:u.jsx(Ce.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});BF.displayName=$F;var FF="TabsTrigger",zF=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=R5(FF,n),o=OF(n),l=UF(a.baseId,r),c=VF(a.baseId,r),h=r===a.value;return u.jsx(uC,{asChild:!0,...o,focusable:!i,active:h,children:u.jsx(Ce.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:t,onMouseDown:fe(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:fe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const d=a.activationMode!=="manual";!h&&!i&&d&&a.onValueChange(r)})})})});zF.displayName=FF;var HF="TabsContent",WF=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=R5(HF,n),l=UF(o.baseId,r),c=VF(o.baseId,r),h=r===o.value,d=w.useRef(h);return w.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),u.jsx(fn,{present:i||h,children:({present:f})=>u.jsx(Ce.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&s})})});WF.displayName=HF;function UF(e,t){return`${e}-trigger-${t}`}function VF(e,t){return`${e}-content-${t}`}var mNe=IF,qF=BF,GF=zF,KF=WF;const YF=mNe,A5=w.forwardRef(({className:e,...t},n)=>u.jsx(qF,{ref:n,className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));A5.displayName=qF.displayName;const lv=w.forwardRef(({className:e,...t},n)=>u.jsx(GF,{ref:n,className:J("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}));lv.displayName=GF.displayName;const X1=w.forwardRef(({className:e,...t},n)=>u.jsx(KF,{ref:n,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));X1.displayName=KF.displayName;const XF=Symbol("Settings:ResetConfig"),ht=(e,t,n=void 0)=>({scope:e,key:t,isAdvanced:n}),al=(e,t)=>{const n=typeof t.configValue=="function"?t.configValue(e[t.configName]):t.configValue;return{...e,[t.configName]:n}},ll=e=>Object.fromEntries(Object.keys(e).map(t=>[t,void 0])),gNe=(e,t,n,r,i)=>{const s=()=>{var h,d,f,g;const o=(d=(h=r==null?void 0:r.storedConfigs)==null?void 0:h[n.scope])==null?void 0:d[n.key],l=(g=(f=r==null?void 0:r.defaultConfigs)==null?void 0:f[n.scope])==null?void 0:g[n.key];return{storedValue:o,defaultValue:l,initialValue:o??l}},a=s();return r&&i({configName:t,configValue:a.initialValue}),{scope:n.scope,key:n.key,isAdvanced:n.isAdvanced??!1,eid:`tab-${e}:config:${n.key}`,defaultValue:a.defaultValue,initialValue:a.initialValue,state:{set:o=>i({configName:t,configValue:o}),discard:()=>i({configName:t,configValue:s().initialValue}),default:()=>i({configName:t,configValue:s().defaultValue})},hasChanged:o=>r!==void 0&&!fg(o,s().initialValue)}},cl=(e,t,n,r)=>Object.fromEntries(Object.entries(t).map(([i,s])=>[i,gNe(e,i,s,n,r)])),ul=(e,t,n,r)=>{var o,l;const i={},s={};let a=!1;console.groupCollapsed("Settings Diffing:");for(const[c,h]of Object.entries(e)){if(h.isAdvanced&&!r)continue;let d=c in n?n[c]:t[c];d===void 0&&(d=XF),typeof d=="string"&&(d=d.trim()),i[o=h.scope]??(i[o]={}),i[h.scope][h.key]=d;const f=h.hasChanged(d);console.log(f,h.scope,h.key,{initial:h.initialValue,current:d}),f&&(a=!0,s[l=h.scope]??(s[l]={}),s[h.scope][h.key]=d)}return console.log("Final changedConfigs:",s),console.groupEnd(),{hasChanges:a,localConfigs:i,changedConfigs:s}};function vNe({tab:e,pageCtx:t}){return"cards"in e?u.jsx("div",{id:`tab-${e.ctx.tabId}`,className:"space-y-4",children:e.cards.map(({ctx:n,Component:r})=>u.jsx(r,{pageCtx:t,cardCtx:n},n.cardId))}):u.jsx(e.Component,{pageCtx:t,cardCtx:e.ctx},e.ctx.tabId)}var j5="Switch",[yNe,TOe]=In(j5),[xNe,_Ne]=yNe(j5),JF=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:h,...d}=e,[f,g]=w.useState(null),_=Fe(t,x=>g(x)),y=w.useRef(!1),v=f?h||!!f.closest("form"):!0,[m=!1,p]=Zr({prop:i,defaultProp:s,onChange:c});return u.jsxs(xNe,{scope:n,checked:m,disabled:o,children:[u.jsx(Ce.button,{type:"button",role:"switch","aria-checked":m,"aria-required":a,"data-state":ez(m),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:_,onClick:fe(e.onClick,x=>{p(b=>!b),v&&(y.current=x.isPropagationStopped(),y.current||x.stopPropagation())})}),v&&u.jsx(bNe,{control:f,bubbles:!y.current,name:r,value:l,checked:m,required:a,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});JF.displayName=j5;var QF="SwitchThumb",ZF=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=_Ne(QF,n);return u.jsx(Ce.span,{"data-state":ez(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});ZF.displayName=QF;var bNe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=w.useRef(null),a=ff(n),o=n0(t);return w.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ez(e){return e?"checked":"unchecked"}var tz=JF,wNe=ZF;const nz=w.forwardRef(({className:e,...t},n)=>u.jsx(tz,{className:J("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:u.jsx(wNe,{className:J("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));nz.displayName=tz.displayName;const SNe=$s("peer",{variants:{variant:{default:"",checkedGreen:"data-[state=unchecked]:bg-input data-[state=checked]:bg-success",checkedYellow:"data-[state=unchecked]:bg-input data-[state=checked]:bg-warning",checkedRed:"data-[state=unchecked]:bg-input data-[state=checked]:bg-destructive",uncheckedGreen:"data-[state=unchecked]:bg-success data-[state=checked]:bg-input",uncheckedYellow:"data-[state=unchecked]:bg-warning data-[state=checked]:bg-input",uncheckedRed:"data-[state=unchecked]:bg-destructive data-[state=checked]:bg-input",redGreen:"data-[state=unchecked]:bg-destructive data-[state=checked]:bg-success",greenRed:"data-[state=unchecked]:bg-success data-[state=checked]:bg-destructive"}},defaultVariants:{variant:"default"}}),ur=w.forwardRef(({id:e,checkedLabel:t,uncheckedLabel:n,variant:r,className:i,...s},a)=>u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(nz,{id:e,className:J(i,SNe({variant:r})),ref:a,...s}),u.jsx("div",{className:"text-sm font-medium leading-none tracking-wide text-muted-foreground select-none hidden peer-data-[state=checked]:inline",children:t}),u.jsx("div",{className:"text-sm font-medium leading-none tracking-wide text-muted-foreground select-none hidden peer-data-[state=unchecked]:inline",children:n})]}));ur.displayName="SwitchText";function CNe(){return u.jsx("span",{className:"tracking-widest text-2xs text-destructive-inline opacity-65 group-hover/cfgCardItem:opacity-100",children:"REQUIRED"})}function kNe(){return u.jsx("span",{className:"tracking-widest text-2xs text-info-inline opacity-0 group-hover/cfgCardItem:opacity-85 group-hover/cfgCardItem:dark:opacity-35",children:"OPTIONAL"})}function ENe(){return u.jsx("span",{className:"rounded-sm bg-accent text-accent-foreground text-2xs tracking-wider font-semibold leading-snug pb-0.5 px-0.5 w-fit mt-0.5",children:"NEW"})}function ot({children:e,className:t}){return u.jsx("div",{className:J("text-sm text-muted-foreground",t),children:e})}function at({label:e,htmlFor:t,required:n,showOptional:r,showNew:i,showIf:s,children:a}){return s!==void 0&&!s?null:u.jsxs("div",{className:"max-w-4xl space-y-2 sm:grid sm:grid-cols-8 sm:gap-4 sm:space-y-0 sm:items-start group/cfgCardItem",children:[u.jsx("div",{className:"sm:col-span-2",children:u.jsxs(_n,{className:"flex flex-col text-sm font-medium leading-6",htmlFor:t,children:[e,i&&u.jsx(ENe,{}),n&&u.jsx(CNe,{}),r&&u.jsx(kNe,{})]})}),u.jsx("div",{className:"sm:col-span-6 space-y-2",children:a})]})}function L5(){return u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("hr",{className:"w-full border-t"})}),u.jsx("div",{className:"relative flex justify-center tracking-wider text-xs",children:u.jsx("span",{className:"bg-background px-2 text-muted-foreground/75",children:"Advanced Options"})})]})}function TNe({loading:e,error:t,message:n}){let r;if(e)r=u.jsx(Zt,{className:"animate-spin size-20 opacity-75"});else if(t)r=u.jsxs(u.Fragment,{children:[u.jsx(HD,{className:"size-16 opacity-75 text-destructive-inline"}),u.jsx("span",{className:"max-w-4xl text-xl text-destructive-inline",children:t})]});else if(n)r=u.jsx("span",{className:"max-w-4xl text-2xl tracking-wider text-muted-foreground/75",children:n});else return null;return u.jsx("div",{className:"absolute inset-0 z-10 min-h-20 px-4 py-6 rounded-[inherit] dark:bg-black/25 backdrop-blur-sm flex flex-col items-center justify-center gap-2 text-center",children:r})}function dl({cardCtx:e,pageCtx:t,advancedVisible:n,advancedSetter:r,onClickSave:i,children:s}){var l;const[a]=E0(),o=((l=t.cardPendingSave)==null?void 0:l.cardId)===e.cardId;return u.jsx("div",{id:`tab-${e.cardId}`,"data-show-advanced":n,className:"group/card",children:u.jsxs(jv,{className:"xs:x bg-transparent max-xs:rounded-none max-xs:shadow-none",children:[u.jsxs("ol",{className:"bg-muted/50 border-b p-4 flex flex-wrap items-center gap-1 sm:gap-2.5 select-none text-sm text-muted-foreground tracking-wide",children:[e.tabName!==e.cardName?u.jsxs(u.Fragment,{children:[u.jsx("li",{children:e.tabName}),u.jsx(cS,{className:"size-3.5 mt-0.5 inline align-text-top opacity-75"}),u.jsxs("li",{children:[e.cardName," Settings"]})]}):u.jsxs("li",{children:[e.tabName," Settings"]}),o&&u.jsx("li",{className:"text-warning-inline italic tracking-wide",children:"(unsaved changes)"})]}),u.jsxs("div",{className:"relative rounded-b-[inherit]",children:[u.jsxs(Uc,{className:"space-y-6 pt-6 bg-transparent overflow-x-clip",ref:a,children:[s,u.jsxs("div",{className:"flex flex-wrap-reverse justify-center xs:justify-start gap-2",children:[u.jsxs(Ae,{size:"xs",disabled:!o||t.isReadOnly,onClick:i,children:["Save ",e.cardName," Settings",t.isSaving&&u.jsx(Zt,{className:"h-3.5 mt-0.5 inline animate-spin"})]}),n!==void 0&&r?u.jsxs(Ae,{size:"xs",variant:"muted",onClick:()=>r(!n),children:[n?"Discard":"Show"," Advanced",n?u.jsx(uS,{className:"size-4 ml-1.5"}):u.jsx(Ua,{className:"size-4 ml-1.5"})]}):null]})]}),u.jsx(TNe,{loading:t.isLoading,error:t.swrError})]})]})})}const TA={checkingEnabled:ht("banlist","enabled"),rejectionMessage:ht("banlist","rejectionMessage"),requiredHwids:ht("banlist","requiredHwidMatches",!0)};function MNe({cardCtx:e,pageCtx:t}){const[n,r]=w.useState(!1),[i,s]=w.useReducer(al,null,()=>ll(TA)),a=w.useMemo(()=>cl(e.cardId,TA,t.apiData,s),[t.apiData,s]);w.useEffect(()=>{c()},[i]),w.useEffect(()=>{n||Object.values(a).forEach(d=>d.isAdvanced&&d.state.discard())},[n]);const o=w.useRef(null),l={toUi:d=>d?d.toString():void 0,toCfg:d=>d?parseInt(d):void 0},c=()=>{var g;const d={rejectionMessage:(g=o.current)==null?void 0:g.textArea.value},f=ul(a,i,d,n);return t.setCardPendingSave(f.hasChanges?e:null),f},h=()=>{var g;const{hasChanges:d,localConfigs:f}=c();if(d){if((g=f.banlist)!=null&&g.rejectionMessage&&f.banlist.rejectionMessage.length>512)return We.error({title:"The Ban Rejection Message is too big.",md:!0,msg:"The message must be 512 characters or less."});t.saveChanges(e,f)}};return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:h,advancedVisible:n,advancedSetter:r,children:[u.jsxs(at,{label:"Ban Checking",children:[u.jsx(ur,{id:a.checkingEnabled.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:i.checkingEnabled,onCheckedChange:a.checkingEnabled.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Enable checking for ban status on player join. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," txAdmin bans will not work if this option is disabled."]})]}),u.jsxs(at,{label:"Ban Templates",children:[u.jsx(xi,{asChild:!0,href:"/settings/ban-templates",children:u.jsxs(Ae,{size:"sm",variant:"secondary",disabled:t.isReadOnly,children:[u.jsx(dY,{className:"size-4 mr-1.5 inline-block"})," Edit Ban Templates"]})}),u.jsx(ot,{children:"Configure ban reasons and durations that will appear as dropdown options when banning a player. This is useful for common reasons that happen frequently, like violation of your server rules."})]}),u.jsxs(at,{label:"Ban Rejection Message",htmlFor:a.rejectionMessage.eid,showOptional:!0,children:[u.jsx(_f,{id:a.rejectionMessage.eid,ref:o,placeholder:"You can join http://discord.gg/example to appeal this ban.",defaultValue:a.rejectionMessage.initialValue,onInput:c,autoComplete:"off",minHeight:60,maxHeight:180,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Optional message to display to a player on the rejection message that shows when they try to connect while being banned. ",u.jsx("br",{}),"If you have a ban appeal process, you can use this field to inform the players."]})]}),n&&u.jsx(L5,{}),u.jsxs(at,{label:"Required Ban HWID Matches",htmlFor:a.requiredHwids.eid,showIf:n,children:[u.jsxs(Pn,{value:l.toUi(i.requiredHwids),onValueChange:d=>a.requiredHwids.state.set(l.toCfg(d)),disabled:t.isReadOnly,children:[u.jsx(kn,{id:a.requiredHwids.eid,children:u.jsx(On,{placeholder:"Select..."})}),u.jsxs(En,{children:[u.jsx(be,{value:"1",children:"1 - recommended"}),u.jsx(be,{value:"2",children:"2 - lax"}),u.jsx(be,{value:"3",children:"3 - very lax"}),u.jsx(be,{value:"4",children:"4 - virtually disabled"}),u.jsx(be,{value:"0",children:"Disable HWID Bans"})]})]}),u.jsxs(ot,{children:["This option configures how many HWID tokens must match between a player and an existing ban for the player join to be blocked, or can disable HWID Bans entirely. ",u.jsx("br",{}),"Since Hardware ID Tokens are not guaranteed to be unique, there is the possibility of tokens from two players matching without them being related to each other. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Most players have 3 to 6 HWID tokens."]})]})]})}const MA=e=>{try{return JSON.stringify(JSON.parse(e),null,4)}catch{return e}},RA={botEnabled:ht("discordBot","enabled"),botToken:ht("discordBot","token"),discordGuild:ht("discordBot","guild"),warningsChannel:ht("discordBot","warningsChannel"),embedJson:ht("discordBot","embedJson"),embedConfigJson:ht("discordBot","embedConfigJson")};function RNe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(al,null,()=>ll(RA)),i=w.useMemo(()=>cl(e.cardId,RA,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{c()},[n]);const s=w.useRef(null),a=w.useRef(null),o=w.useRef(null),l=d=>{if(d===void 0)return;const f=d.trim();return f.length?f:null},c=()=>{var g,_,y;const d={botToken:l((g=s.current)==null?void 0:g.value),discordGuild:l((_=a.current)==null?void 0:_.value),warningsChannel:l((y=o.current)==null?void 0:y.value)},f=ul(i,n,d,!1);return t.setCardPendingSave(f.hasChanges?e:null),f},h=()=>{var g,_,y,v,m;const{hasChanges:d,localConfigs:f}=c();if(d){if((g=f.discordBot)!=null&&g.enabled){if(!((_=f.discordBot)!=null&&_.token))return We.error("You must provide a Discord Bot Token to enable the bot.");if(!((y=f.discordBot)!=null&&y.guild))return We.error("You must provide a Server ID to enable the bot.");if(!((v=f.discordBot)!=null&&v.embedJson)||!((m=f.discordBot)!=null&&m.embedConfigJson))return We.error("You must provide both the Embed JSON and Config JSON to enable the bot.")}t.saveChanges(e,f)}};return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:h,children:[u.jsxs(at,{label:"Discord Bot",children:[u.jsx(ur,{id:i.botEnabled.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:n.botEnabled,onCheckedChange:i.botEnabled.state.set,disabled:t.isReadOnly}),u.jsx(ot,{children:"Enable Discord Integration."})]}),u.jsxs(at,{label:"Token",htmlFor:i.botToken.eid,required:n.botEnabled,children:[u.jsx(yt,{id:i.botToken.eid,ref:s,defaultValue:i.botToken.initialValue,onInput:c,disabled:t.isReadOnly,placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx",maxLength:96,autoComplete:"off",className:"blur-input",required:!0}),u.jsxs(ot,{children:["To get a token and the bot to join your server, follow these two guides:",u.jsx(yn,{href:"https://discordjs.guide/preparations/setting-up-a-bot-application.html",children:"Setting up a bot application"})," and ",u.jsx(yn,{href:"https://discordjs.guide/preparations/adding-your-bot-to-servers.html",children:"Adding your bot to servers"})," ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Do not reuse the same token for another bot. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," The bot requires the ",u.jsx("strong",{children:"Server Members"})," intent, which can be set at the",u.jsx(yn,{href:"https://discord.com/developers/applications",children:"Discord Developer Portal"}),"."]})]}),u.jsxs(at,{label:"Guild/Server ID",htmlFor:i.discordGuild.eid,required:n.botEnabled,children:[u.jsx(yt,{id:i.discordGuild.eid,ref:a,defaultValue:i.discordGuild.initialValue,onInput:c,disabled:t.isReadOnly,placeholder:"000000000000000000"}),u.jsxs(ot,{children:["The ID of the Discord Server (also known as Discord Guild). ",u.jsx("br",{}),"To get the Server ID, go to Discord's settings and",u.jsx(yn,{href:"https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png",children:" enable developer mode"}),', then right-click on the guild icon select "Copy ID".']})]}),u.jsxs(at,{label:"Warnings Channel ID",htmlFor:i.warningsChannel.eid,showOptional:!0,children:[u.jsx(yt,{id:i.warningsChannel.eid,ref:o,defaultValue:i.warningsChannel.initialValue,onInput:c,disabled:t.isReadOnly,placeholder:"000000000000000000"}),u.jsxs(ot,{children:["The ID of the channel to send Announcements (eg server restarts). ",u.jsx("br",{}),"You can leave it blank to disable this feature. ",u.jsx("br",{}),"To get the channel ID, go to Discord's settings and",u.jsx(yn,{href:"https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png",children:" enable developer mode"}),', then right-click on the channel name and select "Copy ID".']})]}),u.jsxs(at,{label:"Status Embed JSON",htmlFor:i.embedJson.eid,required:n.botEnabled,children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(Ec,{id:i.embedJson.eid,placeholder:"{}",value:MA(n.embedJson??""),onChange:d=>i.embedJson.state.set(d.target.value),autoComplete:"off",style:{minHeight:512},disabled:t.isReadOnly,spellCheck:!1}),u.jsxs("div",{className:"w-full flex flex-wrap justify-between gap-6",children:[u.jsxs(Ae,{className:"grow",variant:"outline",onClick:()=>i.embedJson.state.discard(),disabled:t.isReadOnly,children:[u.jsx(yr,{className:"mr-2 h-4 w-4"})," Discard Changes"]}),u.jsxs(Ae,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",onClick:()=>i.embedJson.state.default(),disabled:t.isReadOnly,children:[u.jsx(Y_,{className:"mr-2 h-4 w-4"})," Reset to Default"]})]})]}),u.jsxs(ot,{children:["The server status embed is customizable by editing the JSON above. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Use the command ",u.jsx(Ue,{children:"/status add"}),' on a channel that the bot has the "Send Message" permission to setup the embed.']})]}),u.jsxs(at,{label:"Status Config JSON",htmlFor:i.embedConfigJson.eid,required:n.botEnabled,children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(Ec,{id:i.embedConfigJson.eid,placeholder:"{}",value:MA(n.embedConfigJson??""),onChange:d=>i.embedConfigJson.state.set(d.target.value),autoComplete:"off",style:{minHeight:512},disabled:t.isReadOnly,spellCheck:!1}),u.jsxs("div",{className:"w-full flex flex-wrap justify-between gap-6",children:[u.jsxs(Ae,{className:"grow",variant:"outline",onClick:()=>i.embedConfigJson.state.discard(),disabled:t.isReadOnly,children:[u.jsx(yr,{className:"mr-2 h-4 w-4"})," Discard Changes"]}),u.jsxs(Ae,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",onClick:()=>i.embedConfigJson.state.default(),disabled:t.isReadOnly,children:[u.jsx(Y_,{className:"mr-2 h-4 w-4"})," Reset to Default"]})]})]}),u.jsxs(ot,{children:["The server status embed is customizable by editing the JSON above. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Use the command ",u.jsx(Ue,{children:"/status add"}),' on a channel that the bot has the "Send Message" permission to setup the embed.']})]})]})}function ANe({value:e,label24h:t,label12h:n}){return u.jsx(be,{value:e,className:"group/timeOption",children:u.jsxs("div",{className:"flex justify-around gap-2 items-center",children:[u.jsx("div",{className:"font-medium min-w-[2ch]",children:t}),u.jsx("div",{className:"text-muted-foreground group-focus/timeOption:text-primary-foreground group-focus/timeOption:dark:text-primary text-sm min-w-[5ch] text-right",children:n})]})})}function jNe({title:e,isOpen:t,onClose:n,onSubmit:r}){const[i,s]=w.useState("00"),[a,o]=w.useState("00"),l=`timeinput-${w.useId()}`,c=`timeinput-${w.useId()}`,h=()=>{r(`${i}:${a}`),s("00"),o("00"),n()},d=w.useMemo(()=>Array.from({length:24},(f,g)=>{const _=g.toString().padStart(2,"0"),y=g<12?"AM":"PM",v=g%12||12;return{value:_,label24h:_,label12h:`${v} ${y}`}}),[]);return u.jsx(Xa,{open:t,onOpenChange:n,children:u.jsxs(Wo,{className:"sm:max-w-sm",onBlur:()=>console.log("blur",Math.random()),children:[u.jsx(Uo,{children:u.jsx(Vo,{children:e})}),u.jsx("div",{className:"grid gap-4 py-4",children:u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{className:"flex flex-col space-y-1.5",children:[u.jsx(_n,{htmlFor:l,className:"text-sm font-medium",children:"Hour"}),u.jsxs(Pn,{onValueChange:s,value:i,children:[u.jsx(kn,{id:l,children:u.jsx(On,{placeholder:"Select hour"})}),u.jsx(En,{children:d.map(f=>u.jsx(ANe,{...f},f.value))})]})]}),u.jsxs("div",{className:"flex flex-col space-y-1.5",children:[u.jsx(_n,{htmlFor:c,className:"text-sm font-medium",children:"Minute"}),u.jsxs(Pn,{onValueChange:o,value:a,children:[u.jsx(kn,{id:c,children:u.jsx(On,{placeholder:"Select minute"})}),u.jsxs(En,{onBlur:f=>f.preventDefault(),children:[u.jsx(be,{value:"00",children:"00"}),u.jsx(be,{value:"05",children:"05"}),u.jsx(be,{value:"10",children:"10"}),u.jsx(be,{value:"15",children:"15"}),u.jsx(be,{value:"20",children:"20"}),u.jsx(be,{value:"25",children:"25"}),u.jsx(be,{value:"30",children:"30"}),u.jsx(be,{value:"35",children:"35"}),u.jsx(be,{value:"40",children:"40"}),u.jsx(be,{value:"45",children:"45"}),u.jsx(be,{value:"50",children:"50"}),u.jsx(be,{value:"55",children:"55"})]})]})]})]})}),u.jsx(xf,{children:u.jsx(Ae,{onClick:h,children:"Add Time"})})]})})}function AA(e){return Array.from(new Set(e)).sort((n,r)=>{const[i,s]=n.split(":").map(Number),[a,o]=r.split(":").map(Number);return i-a||s-o})}function LNe({restartTimes:e,setRestartTimes:t,disabled:n}){const[r,i]=w.useState(!1),[s]=E0(),a=d=>{!e||n||t(f=>AA([...f??[],d]))},o=d=>{!e||n||t(f=>AA((f??[]).filter((g,_)=>_!==d)))},l=d=>{!e||n||t(d)},c=()=>{n||t([])},h=J("text-muted-foreground",n&&"opacity-50 cursor-not-allowed");return u.jsxs("div",{className:"py-3 px-2 min-h-[4.5rem] flex items-center border rounded-lg",children:[u.jsxs("div",{className:J("w-full flex items-center gap-2",n&&"cursor-not-allowed"),children:[u.jsxs("div",{className:"flex flex-wrap gap-2 grow",ref:s,children:[e&&e.length===0&&u.jsxs("div",{className:"text-sm text-muted-foreground",children:[u.jsxs("span",{children:["No schedule set. Click on the ",u.jsx("strong",{children:"+"})," button to add a time."]}),u.jsxs("p",{children:["Presets: ",u.jsxs("a",{onClick:()=>l(["00:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["1x",u.jsx("span",{className:h,children:"/day"})]}),", ",u.jsxs("a",{onClick:()=>l(["00:00","12:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["2x",u.jsx("span",{className:h,children:"/day"})]}),", ",u.jsxs("a",{onClick:()=>l(["00:00","08:00","16:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["3x",u.jsx("span",{className:h,children:"/day"})]}),", ",u.jsxs("a",{onClick:()=>l(["00:00","06:00","12:00","18:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["4x",u.jsx("span",{className:h,children:"/day"})]})]})]}),e&&e.map((d,f)=>u.jsxs("div",{className:"flex items-center space-x-1 bg-secondary text-secondary-foreground px-3 py-1 rounded-md select-none",children:[u.jsx("span",{className:"font-mono",children:d}),!n&&u.jsx("button",{onClick:()=>o(f),className:"ml-2 text-secondary-foreground/50 hover:text-destructive","aria-label":"Remove",disabled:n,children:u.jsx(yr,{className:"size-4"})})]},d))]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Ae,{onClick:()=>i(!0),variant:"secondary",size:"xs",className:"w-10 hover:bg-primary hover:text-primary-foreground","aria-label":"Add",disabled:n,children:u.jsx(hS,{className:"h-4"})}),u.jsx(Ae,{onClick:()=>c(),variant:"muted",size:"xs",className:"w-10 hover:bg-destructive hover:text-destructive-foreground","aria-label":"Clear",disabled:n||!e||e.length===0,children:u.jsx(TY,{className:"h-3.5"})})]})]}),u.jsx(jNe,{title:"Add Restart Time",isOpen:r,onClose:()=>i(!1),onSubmit:a})]})}const DNe=e=>e?`${e.replace(/\/$/,"")}/CFXDefault`:window.txConsts.isWindows?"C:/Users/Admin/Desktop/CFXDefault":"/root/fivem/txData/CFXDefault";function NNe(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(window.txConsts.serverTimezone!==e)return u.jsxs(ot,{className:"text-destructive-inline",children:[u.jsx("strong",{children:"Warning:"})," Your server timezone is set to ",u.jsx(Ue,{children:window.txConsts.serverTimezone}),", but your browser timezone is ",u.jsx(Ue,{children:e}),". Make sure to configure the time according to the server timezone."]})}catch(e){console.error(e)}return null}const jA={dataPath:ht("server","dataPath"),restarterSchedule:ht("restarter","schedule"),quietMode:ht("server","quiet"),cfgPath:ht("server","cfgPath",!0),startupArgs:ht("server","startupArgs",!0),onesync:ht("server","onesync",!0),autoStart:ht("server","autoStart",!0),resourceTolerance:ht("restarter","resourceStartingTolerance",!0)};function PNe({cardCtx:e,pageCtx:t}){var k,T,R;const[n,r]=w.useState(!1),[i,s]=w.useState(!1),{hasPerm:a}=rr(),o=$o()[1],l=ef(),[c,h]=w.useReducer(al,null,()=>ll(jA)),d=w.useMemo(()=>cl(e.cardId,jA,t.apiData,h),[t.apiData,h]);w.useEffect(()=>{x()},[c]),w.useEffect(()=>{n||Object.values(d).forEach(M=>M.isAdvanced&&M.state.discard())},[n]);const f=w.useRef(null),g=w.useRef(null),_=w.useRef(null),y=(k=t.apiData)==null?void 0:k.forceQuietMode,v={toUi:M=>M?M.toString():void 0,toCfg:M=>M?parseInt(M):void 0},m={toUi:M=>M?M.join(" "):"",toCfg:M=>M?M.trim().split(/\s+/):[]},p=M=>{if(M===void 0)return;const L=M.trim();return L.length?L:null},x=()=>{var P,I,z;let M;_.current&&(M=m.toCfg(_.current.value));let L;(P=f.current)!=null&&P.value&&(L=f.current.value.replace(/\\/g,"/").replace(/\/\/+/,"/"),L.endsWith("/")&&(L=L.slice(0,-1)));const D={dataPath:p((I=f.current)==null?void 0:I.value),cfgPath:(z=g.current)==null?void 0:z.value,startupArgs:M},N=ul(d,c,D,n);return t.setCardPendingSave(N.hasChanges?e:null),N},b=()=>{var D,N;const{hasChanges:M,localConfigs:L}=x();if(M){if(!((D=L.server)!=null&&D.dataPath))return We.error({title:"The Server Data Folder is required.",md:!0,msg:'If you want to return to the Setup page, click on the "Reset" button instead.'});if(L.server.cfgPath!==void 0&&!L.server.cfgPath)return We.error({title:"The CFG File Path is required.",md:!0,msg:"The value should probably be `server.cfg`."});if(Array.isArray((N=L.server)==null?void 0:N.startupArgs)&&L.server.startupArgs.some(P=>P.toLowerCase()==="onesync"))return We.error({title:"You cannot set OneSync in Startup Arguments.",md:!0,msg:"Please use the selectbox below it."});t.saveChanges(e,L)}},S=w.useMemo(()=>{var M;return DNe((M=t.apiData)==null?void 0:M.dataPath)},[t.apiData]),C=wt({method:"POST",path:"/settings/resetServerDataPath",throwGenericErrors:!0}),E=()=>{l({title:"Reset Server Data Path",message:u.jsxs(u.Fragment,{children:["Are you sure you want to reset the server data path? ",u.jsx("br",{}),u.jsx("br",{}),u.jsx("strong",{children:"This will not delete any resource files or database"}),", but just reset the txAdmin configuration, allowing you to go back to the Setup page. ",u.jsx("br",{}),"If you want, you can set the path back to the current value later. ",u.jsx("br",{}),u.jsx("br",{}),u.jsx("strong",{className:"text-warning-inline",children:"Warning:"})," take note of the current path before proceeding, so you can set it back later if you need to. Current path:",u.jsx(yt,{value:d.dataPath.initialValue,className:"mt-2",readOnly:!0})]}),onConfirm:()=>{s(!0),C({toastLoadingMessage:"Resetting server data path...",success:(M,L)=>{M.type==="success"&&o("/server/setup")},finally:()=>s(!1)})}})};return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:b,advancedVisible:n,advancedSetter:r,children:[u.jsxs(at,{label:"Server Data Folder",htmlFor:d.dataPath.eid,required:!0,children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx(yt,{id:d.dataPath.eid,ref:f,defaultValue:d.dataPath.initialValue,placeholder:S,onInput:x,disabled:t.isReadOnly,required:!0}),u.jsxs(Ae,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",disabled:t.isReadOnly||!a("all_permissions")||i,onClick:E,children:[u.jsx(pS,{className:"mr-2 h-4 w-4"})," Reset"]})]}),u.jsxs(ot,{children:["The full path of the folder that ",u.jsx("strong",{children:"contains"})," the ",u.jsx(Ue,{children:"resources"})," folder, usually it's the same place that contains your ",u.jsx(Ue,{children:"server.cfg"}),". ",u.jsx("br",{}),"Resetting this value will allow you to go back to the Setup page, without deleting any files.",((T=t.apiData)==null?void 0:T.dataPath)&&((R=t.apiData)==null?void 0:R.hasCustomDataPath)&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),u.jsxs("span",{className:"text-warning-inline",children:[window.txConsts.hostConfigSource,": This path should start with ",u.jsx(Ue,{children:t.apiData.dataPath})," ."]})]})]})]}),u.jsxs(at,{label:"Restart Schedule",showOptional:!0,children:[u.jsx(LNe,{restartTimes:c.restarterSchedule,setRestartTimes:d.restarterSchedule.state.set,disabled:t.isReadOnly}),u.jsx(NNe,{}),u.jsxs(ot,{children:["At which times of day to restart the server. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Make sure your schedule matches your server time and not your local time."]})]}),u.jsxs(at,{label:"Quiet Mode",children:[u.jsx(ur,{id:d.quietMode.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:y||c.quietMode,onCheckedChange:d.quietMode.state.set,disabled:t.isReadOnly||y}),u.jsxs(ot,{children:["Do not print FXServer's output to the terminal. ",u.jsx("br",{}),"You will still be able to use the Live Console.",y&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),u.jsxs("span",{className:"text-warning-inline",children:[window.txConsts.hostConfigSource,": This setting is locked and cannot be changed."]})]})]})]}),n&&u.jsx(L5,{}),u.jsxs(at,{label:"CFG File Path",htmlFor:d.cfgPath.eid,showIf:n,required:!0,children:[u.jsx(yt,{id:d.cfgPath.eid,ref:g,defaultValue:d.cfgPath.initialValue,placeholder:"server.cfg",onInput:x,disabled:t.isReadOnly,required:!0}),u.jsxs(ot,{children:["The path to your server config file, probably named ",u.jsx(Ue,{children:"server.cfg"}),". ",u.jsx("br",{}),"This can either be absolute, or relative to the Server Data folder."]})]}),u.jsxs(at,{label:"Startup Arguments",htmlFor:d.startupArgs.eid,showIf:n,children:[u.jsx(yt,{id:d.startupArgs.eid,ref:_,defaultValue:m.toUi(d.startupArgs.initialValue),placeholder:"--trace-warning",onInput:x,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Additional command-line arguments to pass to the FXServer instance such as NodeJS CLI flags. ",u.jsx("br",{}),u.jsx("strong",{children:"Warning:"})," You almost certainly should not use this option, commands and convars should be placed in your ",u.jsx(Ue,{children:"server.cfg"})," instead."]})]}),u.jsxs(at,{label:"OneSync",htmlFor:d.onesync.eid,showIf:n,children:[u.jsxs(Pn,{value:c.onesync,onValueChange:d.onesync.state.set,disabled:t.isReadOnly,children:[u.jsx(kn,{id:d.onesync.eid,children:u.jsx(On,{placeholder:"Select OneSync option"})}),u.jsxs(En,{children:[u.jsx(be,{value:"on",children:"On (recommended)"}),u.jsx(be,{value:"legacy",children:"Legacy"}),u.jsx(be,{value:"off",children:"Off"})]})]}),u.jsxs(ot,{children:["Most servers should be using ",u.jsx("strong",{children:"OneSync On"}),". ",u.jsx("br",{}),"The other options are considered deprecated and should not be used unless you know what you're doing. For more information, please read the ",u.jsx(yn,{href:"https://docs.fivem.net/docs/scripting-reference/onesync/",children:"documentation"}),"."]})]}),u.jsxs(at,{label:"Autostart",showIf:n,children:[u.jsx(ur,{id:d.autoStart.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:c.autoStart,onCheckedChange:d.autoStart.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Start the server automatically after ",u.jsx("strong",{children:"txAdmin"})," starts."]})]}),u.jsxs(at,{label:"Resource Starting Tolerance",htmlFor:d.resourceTolerance.eid,showIf:n,children:[u.jsxs(Pn,{value:v.toUi(c.resourceTolerance),onValueChange:M=>d.resourceTolerance.state.set(v.toCfg(M)),disabled:t.isReadOnly,children:[u.jsx(kn,{id:d.resourceTolerance.eid,children:u.jsx(On,{placeholder:"Select..."})}),u.jsxs(En,{children:[u.jsx(be,{value:"90",children:"1.5 minutes (default)"}),u.jsx(be,{value:"180",children:"3 minutes"}),u.jsx(be,{value:"300",children:"5 minutes"}),u.jsx(be,{value:"600",children:"10 minutes"})]})]}),u.jsxs(ot,{children:["At server boot, how much time to wait for any single resource to start before restarting the server. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," If you are getting ",u.jsx(Ue,{children:"failed to start in time"})," errors, increase this value."]})]})]})}const LA={menuEnabled:ht("gameFeatures","menuEnabled"),alignRight:ht("gameFeatures","menuAlignRight"),pageKey:ht("gameFeatures","menuPageKey"),playerModePtfx:ht("gameFeatures","playerModePtfx")};function ONe({cardCtx:e,pageCtx:t}){const[n,r]=w.useState(!1),[i,s]=w.useReducer(al,null,()=>ll(LA)),a=w.useMemo(()=>cl(e.cardId,LA,t.apiData,s),[t.apiData,s]);w.useEffect(()=>{o()},[i]),w.useEffect(()=>{n||Object.values(a).forEach(h=>h.isAdvanced&&h.state.discard())},[n]);const o=()=>{const d=ul(a,i,{},n);return t.setCardPendingSave(d.hasChanges?e:null),d},l=()=>{const{hasChanges:h,localConfigs:d}=o();h&&t.saveChanges(e,d)},c=h=>{h.metaKey||h.preventDefault(),["Escape","Backspace"].includes(h.code)?a.pageKey.state.set("Tab"):a.pageKey.state.set(h.code)};return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:l,advancedVisible:n,advancedSetter:r,children:[u.jsxs(at,{label:"Game Menu",children:[u.jsx(ur,{id:a.menuEnabled.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:i.menuEnabled,onCheckedChange:a.menuEnabled.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["When enabled, admins will be able to open the menu by typing ",u.jsx(Ue,{children:"/tx"})," or using the keybind configured in the FiveM/RedM settings."]})]}),u.jsxs(at,{label:"Align Menu Right",children:[u.jsx(ur,{id:a.alignRight.eid,checkedLabel:"Right aligned",uncheckedLabel:"Left aligned",checked:i.alignRight,onCheckedChange:a.alignRight.state.set,disabled:t.isReadOnly}),u.jsx(ot,{children:"Move menu to the right side of the screen."})]}),u.jsxs(at,{label:"Menu Page Switch Key",htmlFor:a.pageKey.eid,required:!0,children:[u.jsx(yt,{id:a.pageKey.eid,value:i.pageKey,placeholder:"click here and use the key to change",onKeyDown:c,className:"font-mono",readOnly:!0,onInput:o,disabled:t.isReadOnly}),u.jsxs(ot,{children:["The key used to to switch tabs in the menu. ",u.jsx("br",{}),"Click above and press any key to change the configuration. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," The default is ",u.jsx(Ue,{children:"Tab"}),", and you cannot use ",u.jsx(Ue,{children:"Escape"})," or ",u.jsx(Ue,{children:"Backspace"}),"."]})]}),n&&u.jsx(L5,{}),u.jsxs(at,{label:"Player Mode Change Effect",showIf:n,children:[u.jsx(ur,{id:a.playerModePtfx.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:i.playerModePtfx,onCheckedChange:a.playerModePtfx.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Play a particle effect and sound when an admin uses NoClip, God Mode, etc. ",u.jsx("br",{}),u.jsx("strong",{className:"text-warning-inline",children:"Warning:"})," This options help prevent admin abuse during PvP by making it visible/audible to all players that an admin is using a special mode. We recommend keeping it enabled."]})]})]})}const DA={hideAdminInPunishments:ht("gameFeatures","hideAdminInPunishments"),hideAdminInMessages:ht("gameFeatures","hideAdminInMessages"),hideDefaultAnnouncement:ht("gameFeatures","hideDefaultAnnouncement"),hideDefaultDirectMessage:ht("gameFeatures","hideDefaultDirectMessage"),hideDefaultWarning:ht("gameFeatures","hideDefaultWarning"),hideScheduledRestartWarnings:ht("gameFeatures","hideDefaultScheduledRestartWarning")};function INe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(al,null,()=>ll(DA)),i=w.useMemo(()=>cl(e.cardId,DA,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{s()},[n]);const s=()=>{const l=ul(i,n,{},!1);return t.setCardPendingSave(l.hasChanges?e:null),l},a=()=>{const{hasChanges:o,localConfigs:l}=s();o&&t.saveChanges(e,l)};return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:a,children:[u.jsxs(at,{label:"Hide Admin Name In Punishments",children:[u.jsx(ur,{id:i.hideAdminInPunishments.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideAdminInPunishments,onCheckedChange:i.hideAdminInPunishments.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Never show to the players the admin name on ",u.jsx("strong",{children:"Bans"})," or ",u.jsx("strong",{children:"Warns"}),". ",u.jsx("br",{}),"This information will still be available in the history and logs."]})]}),u.jsxs(at,{label:"Hide Admin Name In Messages",children:[u.jsx(ur,{id:i.hideAdminInMessages.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideAdminInMessages,onCheckedChange:i.hideAdminInMessages.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Do not show the admin name on ",u.jsx("strong",{children:"Announcements"})," or ",u.jsx("strong",{children:"DMs"}),". ",u.jsx("br",{}),"This information will still be available in the live console and logs."]})]}),u.jsxs(at,{label:"Hide Announcement Notifications",children:[u.jsx(ur,{id:i.hideDefaultAnnouncement.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideDefaultAnnouncement,onCheckedChange:i.hideDefaultAnnouncement.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Suppresses the display of announcements, allowing you to implement your own announcement via the event ",u.jsx(Ue,{children:"txAdmin:events:announcement"}),".",u.jsx(yn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsannouncement",children:"Documentation"})]})]}),u.jsxs(at,{label:"Hide Direct Message Notification",children:[u.jsx(ur,{id:i.hideDefaultDirectMessage.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideDefaultDirectMessage,onCheckedChange:i.hideDefaultDirectMessage.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Suppresses the display of direct messages, allowing you to implement your own direct message notification via the event ",u.jsx(Ue,{children:"txAdmin:events:playerDirectMessage"}),".",u.jsx(yn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsplayerdirectmessage",children:"Documentation"})]})]}),u.jsxs(at,{label:"Hide Warning Notification",children:[u.jsx(ur,{id:i.hideDefaultWarning.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideDefaultWarning,onCheckedChange:i.hideDefaultWarning.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Suppresses the display of warnings, allowing you to implement your own warning via the event ",u.jsx(Ue,{children:"txAdmin:events:playerWarned"}),".",u.jsx(yn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsplayerwarned",children:"Documentation"})]})]}),u.jsxs(at,{label:"Hide Scheduled Restart Warnings",children:[u.jsx(ur,{id:i.hideScheduledRestartWarnings.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:n.hideScheduledRestartWarnings,onCheckedChange:i.hideScheduledRestartWarnings.state.set,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Suppresses the display of scheduled restart warnings, allowing you to implement your own warning via the event ",u.jsx(Ue,{children:"txAdmin:events:scheduledRestart"}),".",u.jsx(yn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsscheduledrestart",children:"Documentation"})]})]})]})}const $Ne=()=>{const e=Array.isArray(window.txBrowserLocale)?window.txBrowserLocale[0]:window.txBrowserLocale;try{return new Intl.Locale(e).language}catch{}try{if(e.includes("-"))return e.split("-")[0]}catch{}},NA={serverName:ht("general","serverName"),language:ht("general","language")};function BNe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(al,null,()=>ll(NA)),i=w.useMemo(()=>cl(e.cardId,NA,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{a()},[n]);const s=w.useRef(null),a=()=>{var d;const c={serverName:(d=s.current)==null?void 0:d.value},h=ul(i,n,c,!1);return t.setCardPendingSave(h.hasChanges?e:null),h},o=()=>{var d,f,g;const{hasChanges:c,localConfigs:h}=a();if(c){if(!((d=h.general)!=null&&d.serverName))return We.error("The Server Name is required.");if(((g=(f=h.general)==null?void 0:f.serverName)==null?void 0:g.length)>18)return We.error("The Server Name is too big.");t.saveChanges(e,h)}},l=w.useMemo(()=>{var g,_;if(!((g=t.apiData)!=null&&g.locales))return null;const c=$Ne();let h,d,f=[];for(const y of(_=t.apiData)==null?void 0:_.locales)y.code==="en"?h=y:y.code===c?d={code:y.code,label:`${y.label} (browser)`}:f.push(y);return[h,d,"sep1",...f,"sep2",{code:"custom",label:"Custom (txData/locale.json)"}].filter(Boolean)},[t.apiData]);return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:o,children:[u.jsxs(at,{label:"Server Name",htmlFor:i.serverName.eid,required:!0,children:[u.jsx(yt,{id:i.serverName.eid,ref:s,defaultValue:i.serverName.initialValue,placeholder:"Example RP",onInput:a,disabled:t.isReadOnly}),u.jsxs(ot,{children:["A ",u.jsx("strong",{children:"short"})," server name to be used in the txAdmin interface and Server/Discord messages. ",u.jsx("br",{}),"The name must be between 1 and 18 characters."]})]}),u.jsxs(at,{label:"Language",htmlFor:i.language.eid,required:!0,children:[u.jsxs(Pn,{value:n.language,onValueChange:i.language.state.set,disabled:t.isReadOnly,children:[u.jsx(kn,{id:i.language.eid,children:u.jsx(On,{placeholder:"Select..."})}),u.jsx(En,{children:l==null?void 0:l.map(c=>typeof c=="object"?u.jsx(be,{value:c.code,children:c.label},c.code):u.jsx(EC,{},c))})]}),u.jsxs(ot,{children:["The language to use on Chat/Discord messages. ",u.jsx("br",{}),"You can customize the phrases/words by using the ",u.jsx(Ue,{children:"Custom"})," option. ",u.jsx("br",{}),"For more information, please read the ",u.jsx(yn,{href:"https://github.com/tabarra/txAdmin/blob/master/docs/translation.md",children:"documentation"}),"."]})]})]})}var D5="Radio",[FNe,rz]=In(D5),[zNe,HNe]=FNe(D5),iz=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:l,form:c,...h}=e,[d,f]=w.useState(null),g=Fe(t,v=>f(v)),_=w.useRef(!1),y=d?c||!!d.closest("form"):!0;return u.jsxs(zNe,{scope:n,checked:i,disabled:a,children:[u.jsx(Ce.button,{type:"button",role:"radio","aria-checked":i,"data-state":az(i),"data-disabled":a?"":void 0,disabled:a,value:o,...h,ref:g,onClick:fe(e.onClick,v=>{i||l==null||l(),y&&(_.current=v.isPropagationStopped(),_.current||v.stopPropagation())})}),y&&u.jsx(WNe,{control:d,bubbles:!_.current,name:r,value:o,checked:i,required:s,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});iz.displayName=D5;var sz="RadioIndicator",oz=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,s=HNe(sz,n);return u.jsx(fn,{present:r||s.checked,children:u.jsx(Ce.span,{"data-state":az(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});oz.displayName=sz;var WNe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=w.useRef(null),a=ff(n),o=n0(t);return w.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),u.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function az(e){return e?"checked":"unchecked"}var UNe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],N5="RadioGroup",[VNe,MOe]=In(N5,[tu,rz]),lz=tu(),cz=rz(),[qNe,GNe]=VNe(N5),uz=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:l,dir:c,loop:h=!0,onValueChange:d,...f}=e,g=lz(n),_=Ha(c),[y,v]=Zr({prop:s,defaultProp:i,onChange:d});return u.jsx(qNe,{scope:n,name:r,required:a,disabled:o,value:y,onValueChange:v,children:u.jsx(cC,{asChild:!0,...g,orientation:l,dir:_,loop:h,children:u.jsx(Ce.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":o?"":void 0,dir:_,...f,ref:t})})})});uz.displayName=N5;var dz="RadioGroupItem",hz=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,s=GNe(dz,n),a=s.disabled||r,o=lz(n),l=cz(n),c=w.useRef(null),h=Fe(t,c),d=s.value===i.value,f=w.useRef(!1);return w.useEffect(()=>{const g=y=>{UNe.includes(y.key)&&(f.current=!0)},_=()=>f.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",_)}},[]),u.jsx(uC,{asChild:!0,...o,focusable:!a,active:d,children:u.jsx(iz,{disabled:a,required:s.required,checked:d,...l,...i,name:s.name,ref:h,onCheck:()=>s.onValueChange(i.value),onKeyDown:fe(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:fe(i.onFocus,()=>{var g;f.current&&((g=c.current)==null||g.click())})})})});hz.displayName=dz;var KNe="RadioGroupIndicator",fz=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=cz(n);return u.jsx(oz,{...i,...r,ref:t})});fz.displayName=KNe;var pz=uz,mz=hz,YNe=fz;const gz=w.forwardRef(({className:e,...t},n)=>u.jsx(pz,{className:J("grid gap-2",e),...t,ref:n}));gz.displayName=pz.displayName;const vz=w.forwardRef(({className:e,...t},n)=>u.jsx(mz,{ref:n,className:J("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:u.jsx(YNe,{className:"flex items-center justify-center",children:u.jsx(BD,{className:"h-2.5 w-2.5 fill-current text-current"})})}));vz.displayName=mz.displayName;function ed(e){const t="radio"+w.useId();return u.jsx("div",{className:"group",children:u.jsxs(_n,{htmlFor:t,className:"flex items-center gap-3 border rounded-lg p-3 cursor-pointer hover:bg-card data-[state=checked]:border-primary/50 data-[state=checked]:bg-muted select-none","data-state":e.groupValue===e.value?"checked":"unchecked",children:[u.jsx(vz,{value:e.value,id:t}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"font-bold",children:e.title}),u.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]})]})})}const Fp="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",PA=/^\d{17,20}$/,Or={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:PA,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,regexValidFivemUsername:/^\w[\w.-]{1,18}\w$/,regexActionID:new RegExp(`^[${Fp}]{4}-[${Fp}]{4}$`),regexWhitelistReqID:new RegExp(`R[${Fp}]{4}`),regexDiscordSnowflake:PA,regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,actionIdAlphabet:Fp,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/},OA={whitelistMode:ht("whitelist","mode"),rejectionMessage:ht("whitelist","rejectionMessage"),discordRoles:ht("whitelist","discordRoles")};function XNe({cardCtx:e,pageCtx:t}){const[n,r]=w.useReducer(al,null,()=>ll(OA)),i=w.useMemo(()=>cl(e.cardId,OA,t.apiData,r),[t.apiData,r]);w.useEffect(()=>{l()},[n]);const s=w.useRef(null),a=w.useRef(null),o={toUi:h=>h?h.join(", "):"",toCfg:h=>h?h.split(/[,;]\s*/).map(d=>d.trim()).filter(d=>d.length):[]},l=()=>{var g;let h;a.current&&(h=o.toCfg(a.current.value));const d={rejectionMessage:(g=s.current)==null?void 0:g.textArea.value,discordRoles:h},f=ul(i,n,d,!1);return t.setCardPendingSave(f.hasChanges?e:null),f},c=()=>{var f,g,_,y,v,m,p,x,b;const{hasChanges:h,localConfigs:d}=l();if(h){if((f=d.whitelist)!=null&&f.rejectionMessage&&d.whitelist.rejectionMessage.length>512)return We.error({title:"The Whitelist Rejection Message is too big.",md:!0,msg:"The message must be 512 characters or less."});if(((g=d.whitelist)==null?void 0:g.mode)==="discordMember"||((_=d.whitelist)==null?void 0:_.mode)==="discordRoles"){if(((v=(y=t.apiData)==null?void 0:y.storedConfigs.discordBot)==null?void 0:v.enabled)!==!0)return We.warning({title:"Discord Bot is required.",msg:"You need to enable the Discord Bot in the Discord tab to use Discord-based whitelist modes."});if(((m=d.whitelist)==null?void 0:m.mode)==="discordRoles"&&(!Array.isArray((p=d.whitelist)==null?void 0:p.discordRoles)||!((x=d.whitelist)!=null&&x.discordRoles.length)))return We.warning({title:"Discord Roles are required.",msg:'You need to specify at least one Discord Role ID to use the "Discord Server Roles" whitelist mode.'})}if(Array.isArray((b=d.whitelist)==null?void 0:b.discordRoles)){const S=d.whitelist.discordRoles.filter(C=>!Or.regexDiscordSnowflake.test(C)).map(C=>`- \`${C.slice(0,20)}\``);if(S.length)return We.error({title:"Invalid Discord Role ID(s).",md:!0,msg:`The following Discord Role ID(s) are invalid: 
`+S.join(`
`)})}t.saveChanges(e,d)}};return u.jsxs(dl,{cardCtx:e,pageCtx:t,onClickSave:c,children:[u.jsx(at,{label:"Whitelist Mode",children:u.jsxs(gz,{value:n.whitelistMode,onValueChange:i.whitelistMode.state.set,disabled:t.isReadOnly,children:[u.jsx(ed,{groupValue:n.whitelistMode,value:"disabled",title:"Disabled",desc:"No whitelist status will be checked by txAdmin."}),u.jsx(ed,{groupValue:n.whitelistMode,value:"adminOnly",title:"Admin-only (maintenance mode)",desc:u.jsxs(u.Fragment,{children:["Will only allow server join if your ",u.jsx(Ue,{children:"fivem:"})," or ",u.jsx(Ue,{children:"discord:"})," identifiers are attached to a txAdmin administrator. Also known as maintenance mode."]})}),u.jsx(ed,{groupValue:n.whitelistMode,value:"discordMember",title:"Discord Server Member",desc:u.jsxs(u.Fragment,{children:["Checks if the player joining has a ",u.jsx(Ue,{children:"discord:"})," identifier and is present in the Discord server configured in the Discord Tab."]})}),u.jsx(ed,{groupValue:n.whitelistMode,value:"discordRoles",title:"Discord Server Roles",desc:u.jsxs(u.Fragment,{children:["Checks if the player joining has a ",u.jsx(Ue,{children:"discord:"})," identifier and is present in the Discord server configured in the Discord Tab and has at least one of the roles specified below."]})}),u.jsx(ed,{groupValue:n.whitelistMode,value:"approvedLicense",title:"Approved License",desc:u.jsxs(u.Fragment,{children:["The player ",u.jsx(Ue,{children:"license:"})," identifier must be whitelisted by a txAdmin administrator. This can be done through the ",u.jsx(yn,{href:"/whitelist",children:"Whitelist page"}),", or the ",u.jsx(Ue,{children:"/whitelist"})," Discord bot slash command."]})})]})}),u.jsxs(at,{label:"Whitelist Rejection Message",htmlFor:i.rejectionMessage.eid,showOptional:!0,children:[u.jsx(_f,{id:i.rejectionMessage.eid,ref:s,placeholder:"Please join http://discord.gg/example and request to be whitelisted.",defaultValue:i.rejectionMessage.initialValue,onInput:l,autoComplete:"off",minHeight:60,maxHeight:180,disabled:t.isReadOnly}),u.jsxs(ot,{children:["Optional message to display to a player on the rejection message that shows when they try to connect while not being whitelisted. ",u.jsx("br",{}),"If you have a Discord whitelisting process, include here a invite link."]})]}),u.jsxs(at,{label:"Whitelisted Discord Roles",htmlFor:i.discordRoles.eid,children:[u.jsx(yt,{id:i.discordRoles.eid,ref:a,defaultValue:o.toUi(i.discordRoles.initialValue),placeholder:"000000000000000000, 000000000000000000",onInput:l,disabled:t.isReadOnly}),u.jsxs(ot,{children:["The ID of the Discord roles that are whitelisted to join the server. ",u.jsx("br",{}),"This field supports multiple roles, separated by comma. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"}),' Requires the whitelist mode to be set to "Discord Server Roles".']})]})]})}const JNe=[{name:"General",Component:BNe},{name:"FXServer",Component:PNe},{name:"Bans",Component:MNe},{name:"Whitelist",Component:XNe},{name:"Discord",Component:RNe},{name:"Game",cards:[{name:"Menu",Component:ONe},{name:"Notifications",Component:INe}]}],IA=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"-"),zp=JNe.map(e=>{const t={tabId:IA(e.name),tabName:e.name};return"cards"in e&&e.cards?{ctx:t,cards:e.cards.map(n=>({ctx:{...t,cardId:`${t.tabId}-${IA(n.name)}`,cardName:n.name,cardTitle:`${t.tabName} ${n.name}`},Component:n.Component}))}:{ctx:{...t,cardId:t.tabId,cardName:t.tabName,cardTitle:t.tabName},Component:e.Component}});function QNe(){var _;const[e,t]=w.useState(null),[n,r]=w.useState(!1),i=ef(),{hasPerm:s}=rr(),[a,o]=w.useState(()=>{var v,m;const y=(v=window.location)==null?void 0:v.hash.slice(1);return((m=zp.find(p=>p.ctx.tabId===y))==null?void 0:m.ctx.tabId)??zp[0].ctx.tabId}),l=wt({method:"GET",path:"/settings/configs",throwGenericErrors:!0}),c=wt({method:"POST",path:"/settings/configs/:card",throwGenericErrors:!0}),h=Kc("/settings/configs",async()=>{const y=await l({});if(!y)throw new Error("No data returned");return y},{revalidateOnMount:!0,revalidateOnFocus:!1}),d=async(y,v)=>{if(n)return;const m=We.loading(`Saving ${y.cardTitle} settings...`,{id:"settingsSave"});r(!0);try{if(!h.data)throw new Error("Cannot save changes without swr.data.");const p=[];for(const[b,S]of Object.entries(v))for(const[C,E]of Object.entries(S))E===XF&&p.push(`${b}.${C}`);const x=await c({pathParams:{card:y.cardId},data:{resetKeys:p,changes:v},timeout:y.cardId==="discord"?pg.REALLY_REALLY_LONG:pg.LONG,toastId:m});if(!x)throw new Error("empty_response");if(x.type==="error")return;if(!x.stored)throw new Error("no_stored_data");if(!x.changelog)throw new Error("no_changelog_data");h.mutate({...h.data,storedConfigs:x.stored,changelog:x.changelog},!1),t(null)}catch(p){We.error({title:`Error saving ${y.cardTitle} settings:`,msg:p.message},{id:m})}finally{r(!1)}},f=y=>{t(null),o(y),sne(y)},g=y=>{e&&y&&y!==(e==null?void 0:e.tabId)?i({title:"Discard Changes",actionLabel:"Discard",confirmBtnVariant:"destructive",message:u.jsxs(u.Fragment,{children:["You have unsaved changes in the ",u.jsx("strong",{children:e.cardTitle})," tab. ",u.jsx("br",{}),"Are you sure you want to discard them?"]}),onConfirm:()=>{f(y)}}):f(y)};return u.jsxs("div",{className:"w-full mb-10",children:[u.jsx(zO,{title:"Settings",icon:u.jsx(fS,{}),children:u.jsx(iue,{changelogData:(_=h==null?void 0:h.data)==null?void 0:_.changelog})}),u.jsx("div",{className:"px-0 xs:px-3 md:px-0 flex flex-row gap-2 w-full",children:u.jsxs(YF,{value:a,onValueChange:g,className:"w-full",children:[u.jsx(A5,{className:"max-xs:sticky max-xs:top-navbarvh z-10 flex-wrap h-[unset] max-xs:w-full max-xs:rounded-none",children:zp.map(y=>u.jsx(lv,{value:y.ctx.tabId,className:"hover:text-primary",children:y.ctx.tabName},y.ctx.tabId))}),zp.map(y=>u.jsx(X1,{value:y.ctx.tabId,className:"mt-6",children:u.jsx(vNe,{tab:y,pageCtx:{apiData:h.data,isReadOnly:h.isLoading||n||!h.data||!s("settings.write"),isLoading:h.isLoading,isSaving:n,swrError:h.error?h.error.message:void 0,cardPendingSave:e,setCardPendingSave:t,saveChanges:d}})},y.ctx.tabId))]})})]})}function ZNe({permission:e}){return u.jsxs(ws,{children:[u.jsx(Ss,{className:"underline decoration-dotted cursor-help tracking-wider",children:"permission"}),u.jsx(Fi,{children:e})]})}function e7e({pageName:e,permission:t}){let n;return t==="master"?n=u.jsxs(u.Fragment,{children:["You need to be the Master account to view the ",u.jsx("strong",{className:"text-accent",children:e})," page."]}):n=u.jsxs(u.Fragment,{children:["You don't have the required ",u.jsx(ZNe,{permission:t})," to view the ",u.jsx("strong",{className:"text-accent",children:e})," page. ",u.jsx("br",{}),"Please contact your server owner if you believe this is an error."]}),u.jsx("div",{className:"w-full px-4 pt-[7.5vh] flex items-start justify-center bg-background",children:u.jsxs("div",{className:"mx-auto max-w-xl text-center border border-destructive/50 rounded-lg p-6 bg-destructive-hint/15 space-y-4",children:[u.jsxs("h1",{className:"text-2xl font-bold tracking-tight text-destructive",children:[u.jsx(UD,{className:"size-6 mr-2 mt-0.5 inline align-text-top"}),"Access Denied"]}),u.jsx("p",{className:"mt-4 text-sm text-primary/90 tracking-wide",children:n}),u.jsx(Ae,{variant:"outline",size:"sm",asChild:!0,children:u.jsx(xi,{href:"/",children:"Return to Dashboard"})})]})})}const t7e=[{path:"/players",title:"Players",Page:u.jsx(qoe,{})},{path:"/history",title:"History",Page:u.jsx(Tae,{})},{path:"/insights/player-drops",title:"Player Drops",Page:u.jsx(hNe,{})},{path:"/whitelist",title:"Whitelist",Page:u.jsx(Mi,{legacyUrl:"whitelist"})},{path:"/admins",title:"Admins",Page:u.jsx(Mi,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",permission:"settings.view",Page:u.jsx(QNe,{})},{path:"/system/master-actions",title:"Master Actions",Page:u.jsx(Mi,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",Page:u.jsx(Mi,{legacyUrl:"diagnostics"})},{path:"/system/console-log",title:"Console Log",permission:"txadmin.log.view",Page:u.jsx(_T,{pageName:"console"})},{path:"/system/action-log",title:"Action Log",permission:"txadmin.log.view",Page:u.jsx(_T,{pageName:"action"})},{path:"/",title:"Dashboard",Page:u.jsx(C8e,{})},{path:"/server/console",title:"Live Console",permission:"console.view",Page:u.jsx(Mne,{})},{path:"/server/resources",title:"Resources",Page:u.jsx(Mi,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",permission:"server.log.view",Page:u.jsx(Mi,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",permission:"server.cfg.editor",Page:u.jsx(Mi,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",permission:"master",Page:u.jsx(Mi,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",permission:"master",Page:u.jsx(Mi,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",permission:"all_permissions",Page:u.jsx(Mi,{legacyUrl:"advanced"})},{path:"/settings/ban-templates",title:"Ban Templates",Page:u.jsx(lue,{})},{path:"/ban-identifiers",title:"Ban Identifiers",Page:u.jsx(due,{})}];function n7e(e){const{hasPerm:t}=rr();wD()(e.title);const r=e.permission&&!t(e.permission)?u.jsx(e7e,{pageName:e.title,permission:e.permission}):e.Page;return u.jsx(na,{path:e.path,children:r})}function r7e(){return u.jsxs(wL,{children:[t7e.map(e=>u.jsx(n7e,{...e},e.path)),!1,u.jsx(na,{component:_K})]})}function i7e(){const e=tt(_D),t=et(xD);return u.jsx(lj,{FallbackComponent:YG,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),F2("/"),e(!1)},children:u.jsx(r7e,{})},t)}var bu="NavigationMenu",[P5,yz,s7e]=lf(bu),[Iw,o7e,a7e]=lf(bu),[O5,ROe]=In(bu,[s7e,a7e]),[l7e,ni]=O5(bu),[c7e,u7e]=O5(bu),xz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,delayDuration:a=200,skipDelayDuration:o=300,orientation:l="horizontal",dir:c,...h}=e,[d,f]=w.useState(null),g=Fe(t,T=>f(T)),_=Ha(c),y=w.useRef(0),v=w.useRef(0),m=w.useRef(0),[p,x]=w.useState(!0),[b="",S]=Zr({prop:r,onChange:T=>{const R=T!=="",M=o>0;R?(window.clearTimeout(m.current),M&&x(!1)):(window.clearTimeout(m.current),m.current=window.setTimeout(()=>x(!0),o)),i==null||i(T)},defaultProp:s}),C=w.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>S(""),150)},[S]),E=w.useCallback(T=>{window.clearTimeout(v.current),S(T)},[S]),k=w.useCallback(T=>{b===T?window.clearTimeout(v.current):y.current=window.setTimeout(()=>{window.clearTimeout(v.current),S(T)},a)},[b,S,a]);return w.useEffect(()=>()=>{window.clearTimeout(y.current),window.clearTimeout(v.current),window.clearTimeout(m.current)},[]),u.jsx(bz,{scope:n,isRootMenu:!0,value:b,dir:_,orientation:l,rootNavigationMenu:d,onTriggerEnter:T=>{window.clearTimeout(y.current),p?k(T):E(T)},onTriggerLeave:()=>{window.clearTimeout(y.current),C()},onContentEnter:()=>window.clearTimeout(v.current),onContentLeave:C,onItemSelect:T=>{S(R=>R===T?"":T)},onItemDismiss:()=>S(""),children:u.jsx(Ce.nav,{"aria-label":"Main","data-orientation":l,dir:_,...h,ref:g})})});xz.displayName=bu;var _z="NavigationMenuSub",d7e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",...o}=e,l=ni(_z,n),[c="",h]=Zr({prop:r,onChange:i,defaultProp:s});return u.jsx(bz,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>h(d),onItemSelect:d=>h(d),onItemDismiss:()=>h(""),children:u.jsx(Ce.div,{"data-orientation":a,...o,ref:t})})});d7e.displayName=_z;var bz=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:s,children:a,value:o,onItemSelect:l,onItemDismiss:c,onTriggerEnter:h,onTriggerLeave:d,onContentEnter:f,onContentLeave:g}=e,[_,y]=w.useState(null),[v,m]=w.useState(new Map),[p,x]=w.useState(null);return u.jsx(l7e,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:ff(o),baseId:Rr(),dir:i,orientation:s,viewport:_,onViewportChange:y,indicatorTrack:p,onIndicatorTrackChange:x,onTriggerEnter:Et(h),onTriggerLeave:Et(d),onContentEnter:Et(f),onContentLeave:Et(g),onItemSelect:Et(l),onItemDismiss:Et(c),onViewportContentChange:w.useCallback((b,S)=>{m(C=>(C.set(b,S),new Map(C)))},[]),onViewportContentRemove:w.useCallback(b=>{m(S=>S.has(b)?(S.delete(b),new Map(S)):S)},[]),children:u.jsx(P5.Provider,{scope:t,children:u.jsx(c7e,{scope:t,items:v,children:a})})})},wz="NavigationMenuList",Sz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=ni(wz,n),s=u.jsx(Ce.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ce.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(P5.Slot,{scope:n,children:i.isRootMenu?u.jsx(Dz,{asChild:!0,children:s}):s})})});Sz.displayName=wz;var Cz="NavigationMenuItem",[h7e,kz]=O5(Cz),Ez=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,s=Rr(),a=r||s||"LEGACY_REACT_AUTO_VALUE",o=w.useRef(null),l=w.useRef(null),c=w.useRef(null),h=w.useRef(()=>{}),d=w.useRef(!1),f=w.useCallback((_="start")=>{if(o.current){h.current();const y=Bw(o.current);y.length&&B5(_==="start"?y:y.reverse())}},[]),g=w.useCallback(()=>{if(o.current){const _=Bw(o.current);_.length&&(h.current=x7e(_))}},[]);return u.jsx(h7e,{scope:n,value:a,triggerRef:l,contentRef:o,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:g,onContentFocusOutside:g,children:u.jsx(Ce.li,{...i,ref:t})})});Ez.displayName=Cz;var $w="NavigationMenuTrigger",Tz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,s=ni($w,e.__scopeNavigationMenu),a=kz($w,e.__scopeNavigationMenu),o=w.useRef(null),l=Fe(o,a.triggerRef,t),c=Pz(s.baseId,a.value),h=Oz(s.baseId,a.value),d=w.useRef(!1),f=w.useRef(!1),g=a.value===s.value;return u.jsxs(u.Fragment,{children:[u.jsx(P5.ItemSlot,{scope:n,value:a.value,children:u.jsx(Nz,{asChild:!0,children:u.jsx(Ce.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":F5(g),"aria-expanded":g,"aria-controls":h,...i,ref:l,onPointerEnter:fe(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:fe(e.onPointerMove,cv(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(s.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:fe(e.onPointerLeave,cv(()=>{r||(s.onTriggerLeave(),d.current=!1)})),onClick:fe(e.onClick,()=>{s.onItemSelect(a.value),f.current=g}),onKeyDown:fe(e.onKeyDown,_=>{const v={horizontal:"ArrowDown",vertical:s.dir==="rtl"?"ArrowLeft":"ArrowRight"}[s.orientation];g&&_.key===v&&(a.onEntryKeyDown(),_.preventDefault())})})})}),g&&u.jsxs(u.Fragment,{children:[u.jsx(lP,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:_=>{const y=a.contentRef.current,v=_.relatedTarget,m=v===o.current,p=y==null?void 0:y.contains(v);(m||!p)&&a.onFocusProxyEnter(m?"start":"end")}}),s.viewport&&u.jsx("span",{"aria-owns":h})]})]})});Tz.displayName=$w;var f7e="NavigationMenuLink",$A="navigationMenu.linkSelect",Mz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...s}=e;return u.jsx(Nz,{asChild:!0,children:u.jsx(Ce.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...s,ref:t,onClick:fe(e.onClick,a=>{const o=a.target,l=new CustomEvent($A,{bubbles:!0,cancelable:!0});if(o.addEventListener($A,c=>i==null?void 0:i(c),{once:!0}),Zm(o,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(km,{bubbles:!0,cancelable:!0});Zm(o,c)}},{checkForDefaultPrevented:!1})})})});Mz.displayName=f7e;var I5="NavigationMenuIndicator",Rz=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(I5,e.__scopeNavigationMenu),s=!!i.value;return i.indicatorTrack?uL.createPortal(u.jsx(fn,{present:n||s,children:u.jsx(p7e,{...r,ref:t})}),i.indicatorTrack):null});Rz.displayName=I5;var p7e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=ni(I5,n),s=yz(n),[a,o]=w.useState(null),[l,c]=w.useState(null),h=i.orientation==="horizontal",d=!!i.value;w.useEffect(()=>{var y;const _=(y=s().find(v=>v.value===i.value))==null?void 0:y.ref.current;_&&o(_)},[s,i.value]);const f=()=>{a&&c({size:h?a.offsetWidth:a.offsetHeight,offset:h?a.offsetLeft:a.offsetTop})};return Fw(a,f),Fw(i.indicatorTrack,f),l?u.jsx(Ce.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...h?{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}),Ic="NavigationMenuContent",Az=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ni(Ic,e.__scopeNavigationMenu),s=kz(Ic,e.__scopeNavigationMenu),a=Fe(s.contentRef,t),o=s.value===i.value,l={value:s.value,triggerRef:s.triggerRef,focusProxyRef:s.focusProxyRef,wasEscapeCloseRef:s.wasEscapeCloseRef,onContentFocusOutside:s.onContentFocusOutside,onRootContentClose:s.onRootContentClose,...r};return i.viewport?u.jsx(m7e,{forceMount:n,...l,ref:a}):u.jsx(fn,{present:n||o,children:u.jsx(jz,{"data-state":F5(o),...l,ref:a,onPointerEnter:fe(e.onPointerEnter,i.onContentEnter),onPointerLeave:fe(e.onPointerLeave,cv(i.onContentLeave)),style:{pointerEvents:!o&&i.isRootMenu?"none":void 0,...l.style}})})});Az.displayName=Ic;var m7e=w.forwardRef((e,t)=>{const n=ni(Ic,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return ln(()=>{r(e.value,{ref:t,...e})},[e,t,r]),ln(()=>()=>i(e.value),[e.value,i]),null}),km="navigationMenu.rootContentDismiss",jz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:s,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:l,...c}=e,h=ni(Ic,n),d=w.useRef(null),f=Fe(d,t),g=Pz(h.baseId,r),_=Oz(h.baseId,r),y=yz(n),v=w.useRef(null),{onItemDismiss:m}=h;w.useEffect(()=>{const x=d.current;if(h.isRootMenu&&x){const b=()=>{var S;m(),o(),x.contains(document.activeElement)&&((S=i.current)==null||S.focus())};return x.addEventListener(km,b),()=>x.removeEventListener(km,b)}},[h.isRootMenu,e.value,i,m,o]);const p=w.useMemo(()=>{const b=y().map(R=>R.value);h.dir==="rtl"&&b.reverse();const S=b.indexOf(h.value),C=b.indexOf(h.previousValue),E=r===h.value,k=C===b.indexOf(r);if(!E&&!k)return v.current;const T=(()=>{if(S!==C){if(E&&C!==-1)return S>C?"from-end":"from-start";if(k&&S!==-1)return S>C?"to-start":"to-end"}return null})();return v.current=T,T},[h.previousValue,h.value,h.dir,y,r]);return u.jsx(Dz,{asChild:!0,children:u.jsx(Jc,{id:_,"aria-labelledby":g,"data-motion":p,"data-orientation":h.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var b;const x=new Event(km,{bubbles:!0,cancelable:!0});(b=d.current)==null||b.dispatchEvent(x)},onFocusOutside:fe(e.onFocusOutside,x=>{var S;l();const b=x.target;(S=h.rootNavigationMenu)!=null&&S.contains(b)&&x.preventDefault()}),onPointerDownOutside:fe(e.onPointerDownOutside,x=>{var E;const b=x.target,S=y().some(k=>{var T;return(T=k.ref.current)==null?void 0:T.contains(b)}),C=h.isRootMenu&&((E=h.viewport)==null?void 0:E.contains(b));(S||C||!h.isRootMenu)&&x.preventDefault()}),onKeyDown:fe(e.onKeyDown,x=>{var C;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const E=Bw(x.currentTarget),k=document.activeElement,T=E.findIndex(L=>L===k),M=x.shiftKey?E.slice(0,T).reverse():E.slice(T+1,E.length);B5(M)?x.preventDefault():(C=s.current)==null||C.focus()}}),onEscapeKeyDown:fe(e.onEscapeKeyDown,x=>{a.current=!0})})})}),$5="NavigationMenuViewport",Lz=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=!!ni($5,e.__scopeNavigationMenu).value;return u.jsx(fn,{present:n||s,children:u.jsx(g7e,{...r,ref:t})})});Lz.displayName=$5;var g7e=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,s=ni($5,n),a=Fe(t,s.onViewportChange),o=u7e(Ic,e.__scopeNavigationMenu),[l,c]=w.useState(null),[h,d]=w.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,g=l?(l==null?void 0:l.height)+"px":void 0,_=!!s.value,y=_?s.value:s.previousValue;return Fw(h,()=>{h&&c({width:h.offsetWidth,height:h.offsetHeight})}),u.jsx(Ce.div,{"data-state":F5(_),"data-orientation":s.orientation,...i,ref:a,style:{pointerEvents:!_&&s.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":g,...i.style},onPointerEnter:fe(e.onPointerEnter,s.onContentEnter),onPointerLeave:fe(e.onPointerLeave,cv(s.onContentLeave)),children:Array.from(o.items).map(([m,{ref:p,forceMount:x,...b}])=>{const S=y===m;return u.jsx(fn,{present:x||S,children:u.jsx(jz,{...b,ref:Qh(p,C=>{S&&C&&d(C)})})},m)})})}),v7e="FocusGroup",Dz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=ni(v7e,n);return u.jsx(Iw.Provider,{scope:n,children:u.jsx(Iw.Slot,{scope:n,children:u.jsx(Ce.div,{dir:i.dir,...r,ref:t})})})}),BA=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],y7e="FocusGroupItem",Nz=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=o7e(n),s=ni(y7e,n);return u.jsx(Iw.ItemSlot,{scope:n,children:u.jsx(Ce.button,{...r,ref:t,onKeyDown:fe(e.onKeyDown,a=>{if(["Home","End",...BA].includes(a.key)){let l=i().map(d=>d.ref.current);if([s.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),BA.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>B5(l)),a.preventDefault()}})})})});function Bw(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 B5(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function x7e(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 Fw(e,t){const n=Et(t);ln(()=>{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 F5(e){return e?"open":"closed"}function Pz(e,t){return`${e}-trigger-${t}`}function Oz(e,t){return`${e}-content-${t}`}function cv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Iz=xz,$z=Sz,_7e=Ez,Bz=Tz,b7e=Mz,Fz=Rz,zz=Az,Hz=Lz;const zw=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Iz,{ref:r,className:J("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,u.jsx(qz,{})]}));zw.displayName=Iz.displayName;const Hw=w.forwardRef(({className:e,...t},n)=>u.jsx($z,{ref:n,className:J("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));Hw.displayName=$z.displayName;const Wz=_7e,w7e=$s("group inline-flex h-10 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors 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"),Uz=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Bz,{ref:r,className:J(w7e(),"group",e),...n,children:[t," ",u.jsx(Ua,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));Uz.displayName=Bz.displayName;const Vz=w.forwardRef(({className:e,...t},n)=>u.jsx(zz,{ref:n,className:J("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}));Vz.displayName=zz.displayName;const S7e=b7e,qz=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{className:J("absolute left-0 top-full flex justify-center"),children:u.jsx(Hz,{className:J("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})}));qz.displayName=Hz.displayName;const C7e=w.forwardRef(({className:e,...t},n)=>u.jsx(Fz,{ref:n,className:J("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:u.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));C7e.displayName=Fz.displayName;function k7e(e,t){const n=et(_D),r=Bv(),i=Wv(),s=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 u.jsx(xi,{ref:t,href:e.href,onClick:s,className:e.className,children:e.children})}const z5=w.forwardRef(k7e);function Hn({href:e,children:t,className:n,disabled:r}){const[i]=Mv(e);return r?u.jsxs(ws,{children:[u.jsx(Ss,{className:"cursor-help",children:u.jsx(Ae,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),u.jsxs(Fi,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",u.jsx("br",{}),"to access this page."]})]}):u.jsx(z5,{href:e,isActive:i,className:J(Zh({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function Ww({href:e,children:t,className:n}){const[r]=Mv(e);return u.jsx(z5,{href:e,isActive:r,className:n,children:t})}const FA=$s("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 _d(e){const[t]=Mv(e.href);return u.jsx(S7e,{asChild:!0,active:t,children:e.disabled?u.jsxs(ws,{children:[u.jsx(Ss,{className:"cursor-help",children:u.jsx("a",{className:J(FA({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),u.jsxs(Fi,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",u.jsx("br",{}),"to access this page."]})]}):u.jsx(z5,{href:e.href,isActive:t,className:J(FA({variant:t?"secondary":"default"}),e.className),children:e.children})})}function Tl(e){return u.jsx(Wz,{children:u.jsx(_d,{href:e.href,disabled:e.disabled,className:e.className,children:e.children})})}function E7e(){const{hasPerm:e}=rr();return u.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[u.jsx(zw,{children:u.jsxs(Hw,{children:[u.jsx(Tl,{href:"/players",children:"Players"}),u.jsx(Tl,{href:"/history",children:"History"}),u.jsx(Tl,{href:"/insights/player-drops",children:"Player Drops"}),u.jsx(Tl,{href:"/whitelist",children:"Whitelist"}),u.jsx(Tl,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),u.jsx(Tl,{href:"/settings",disabled:!e("settings.view"),children:"Settings"})]})}),u.jsx(zw,{children:u.jsx(Hw,{className:"aaaaaaaaaaa",children:u.jsxs(Wz,{children:[u.jsx(Uz,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),u.jsxs(Vz,{className:"flex flex-col gap-2 p-4 list-none",children:[u.jsx(_d,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),u.jsx(_d,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),u.jsx(_d,{className:"w-36 justify-start",href:"/system/console-log",disabled:!e("txadmin.log.view"),children:"Console Log"}),u.jsx(_d,{className:"w-36 justify-start",href:"/system/action-log",disabled:!e("txadmin.log.view"),children:"Action Log"})]})]})})})]})}const zA=["#de87ff","#4ad63b","#8625c2","#81da23","#7135ce","#b1d408","#3953eb","#5ab000","#ad30ce","#01a91e","#e533cd","#00ad3f","#ff2ebe","#00d577","#d800ab","#71dd65","#5836c0","#97d947","#0044cd","#c3cf23","#6369ff","#c8c200","#015fe8","#fcbc01","#ba69ff","#afd440","#d669ff","#1c7a00","#ff5ee8","#5a9300","#a0009e","#70dc85","#f301a0","#00a75d","#f4006b","#69dba1","#b20084","#b8a900","#0178f1","#e4b100","#0266d2","#e49700","#0277d8","#f27b00","#0091e0","#dd2b00","#00d1db","#d80029","#50dbc0","#ff409c","#00702b","#ff8ff6","#386500","#bd88ff","#617700","#948eff","#db7d00","#3f49a4","#ff7c29","#24509c","#ffb14a","#6b3b9a","#e2c45f","#872b84","#019967","#ce0073","#007144","#ff76d0","#4d5e00","#82a3ff","#ff6434","#5aceff","#b93600","#81b5ff","#9c3700","#00a7b6","#ff4a61","#01a79e","#ff4b77","#007f6b","#b1003c","#b4d086","#92266c","#887b00","#d2b0ff","#ac6500","#005f9e","#ff794e","#007db0","#ff695a","#017574","#a6111d","#abc6ff","#975100","#b0bcff","#966800","#ffabed","#265e33","#ff77af","#375b3a","#a7004d","#cbc98f","#972063","#f7bb73","#005a83","#ff915a","#5f487e","#5e5800","#e1b9e9","#6b4e0b","#ff9cc5","#4a582a","#ff8792","#83986d","#873464","#d0b58b","#6f4274","#feb595","#893650","#dba98f","#952f28","#b093bc","#ff8d79","#a06a80","#7e432c","#e8b0cc","#9c6e57","#ff9fa8"],T7e=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()},M7e=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 zA[Math.abs(t)%zA.length]};function Gz({username:e,profilePicture:t,className:n}){return u.jsxs(zS,{className:J("bg-zinc-200 dark:bg-zinc-800 transition-colors text-zinc-200",n),children:[t&&u.jsx(HS,{src:t,alt:e}),u.jsx(WS,{className:n,style:{backgroundColor:M7e(e)},delayMs:t?1e3:void 0,children:T7e(e)})]})}function Kz(e){return GL({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 H5({style:e,className:t}){const n=w.useId(),r=w.useId();return u.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1115 288",children:[u.jsxs("mask",{id:n,fill:"#fff",children:[u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"})]}),u.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),u.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[u.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),u.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function R7e({style:e,className:t}){const n=w.useId(),r=w.useId();return u.jsxs("svg",{className:t,style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 288 288",children:[u.jsx("mask",{id:n,fill:"#fff",children:u.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"})}),u.jsx("rect",{fill:`url(#${r})`,mask:`url(#${n})`,width:"100%",height:"100%"}),u.jsxs("linearGradient",{id:r,gradientTransform:"rotate(90)",children:[u.jsx("stop",{offset:"0.2",stopColor:"#5BBE83"}),u.jsx("stop",{offset:"1",stopColor:"#00888F"})]})]})}function A7e(){const e=et($v),t=et(mD);return u.jsxs("div",{className:"flex justify-start",children:[u.jsx("h1",{className:"line-clamp-1 text-base break-all",children:t}),u.jsxs("span",{children:[": ",u.jsx("span",{className:"font-mono",title:"players connected",children:e})]})]})}const W5=`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 j7e({className:e}){const{setIsSheetOpen:t}=r8();return u.jsxs("button",{className:J(W5,e),title:"Server Menu",onClick:()=>t(!0),children:[u.jsx(aY,{className:"h-6 w-6 sm:h-5 sm:w-5"}),u.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function L7e({className:e}){const{setIsSheetOpen:t}=n8();return u.jsxs("button",{className:J(W5,e),title:"Global Menu",onClick:()=>t(!0),children:[u.jsx(oY,{className:"h-6 w-6 sm:h-5 sm:w-5"}),u.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function D7e({className:e}){const{setIsSheetOpen:t}=i8(),n=et($v);return u.jsxs("button",{className:J(W5,e),title:"Global Menu",onClick:()=>t(!0),children:[u.jsx(hY,{className:"h-6 w-6 sm:h-5 sm:w-5"}),u.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",u.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function N7e(){const{authData:e,logout:t}=Ga(),{theme:n,setTheme:r}=IB(),{setAccountModalOpen:i}=gS();if(!e)return null;const s=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},o=()=>{Xc("https://discord.gg/uAmsGa2")},l=()=>t();return u.jsxs(ec,{children:[u.jsxs(tc,{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:[u.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),u.jsx(Gz,{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})]}),u.jsxs(ma,{children:[window.txConsts.isWebInterface&&u.jsxs(Bi,{className:"cursor-pointer",onClick:s,children:[u.jsxs("span",{className:"hidden dark:flex items-center",children:[u.jsx(kY,{className:"mr-2 h-4 w-4"}),"Light Mode"]}),u.jsxs("span",{className:"flex dark:hidden items-center",children:[u.jsx(lY,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})]}),u.jsxs(Bi,{className:"cursor-pointer",onClick:a,children:[u.jsx(eY,{className:"mr-2 h-4 w-4"}),"Your Account"]}),u.jsxs(Bi,{className:"cursor-pointer",onClick:o,children:[u.jsx(Kz,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&u.jsxs(u.Fragment,{children:[u.jsx(aa,{}),u.jsxs(Bi,{className:"cursor-pointer",onClick:l,children:[u.jsx(rY,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function P7e(){return u.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 shadow-lg md:shadow-sm`,children:u.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[u.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[u.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:u.jsx(Ww,{href:"/",children:u.jsx(H5,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),u.jsx(Ww,{href:"/",className:"hidden sm:max-xl:block",children:u.jsx(R7e,{className:"h-8 w-8 lg:h-10 lg:w-10 hover:scale-105 hover:brightness-110"})}),u.jsx("div",{className:"lg:hidden",children:u.jsx(A7e,{})}),u.jsx("nav",{className:"hidden lg:block flex-grow",children:u.jsx(E7e,{})})]}),u.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[u.jsx(j7e,{className:"lg:hidden"}),u.jsx(L7e,{className:"lg:hidden"}),u.jsx(D7e,{className:"xl:hidden"}),u.jsx(N7e,{})]})]})})}function O7e(){return et(mD)}function I7e({txConfigState:e}){const[t]=$o(),[n,r]=w.useState(""),i=w.useRef("");return w.useEffect(()=>{let s="";if(e===ks.Setup&&!t.startsWith("/server/setup")?(s="/server/setup",i.current="Go to the setup page!"):e===ks.Deployer&&!t.startsWith("/server/deployer")?(s="/server/deployer",i.current="Go to the deployer page!"):s="",s){const a=setTimeout(()=>{r(s)},500);return()=>clearTimeout(a)}else{r("");return}},[t,e]),u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[u.jsx(zD,{className:"h-12 w-12 opacity-75 animate-pulse"}),u.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?u.jsx(yn,{href:n,className:"animate-toastbar-enter",children:i.current}):u.jsx(yn,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||u.jsx(u.Fragment,{children:" "})})]})}function $7e(){const e=et(tS),{hasPerm:t}=rr(),n=e!==ks.Ready;return u.jsxs("div",{className:"relative",children:[n&&u.jsx(I7e,{txConfigState:e}),u.jsxs("div",{className:J(n&&"opacity-0 pointer-events-none"),children:[u.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight line-clamp-1",children:u.jsx(O7e,{})}),u.jsxs("div",{className:"space-y-1 select-none",children:[u.jsxs(Hn,{href:"/",children:[u.jsx(tY,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),u.jsxs(Hn,{href:"/server/console",disabled:!t("console.view"),children:[u.jsx(bY,{className:"mr-2 h-4 w-4"}),"Live Console"]}),u.jsxs(Hn,{href:"/server/resources",children:[u.jsx(ID,{className:"mr-2 h-4 w-4"}),"Resources"]}),u.jsxs(Hn,{href:"/server/server-log",disabled:!t("server.log.view"),children:[u.jsx(qK,{className:"mr-2 h-4 w-4"}),"Server Log"]}),u.jsxs(Hn,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[u.jsx(KK,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&u.jsxs(Hn,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[u.jsx(VK,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function B7e({style:e}){return u.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:u.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 F7e({style:e}){return u.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:u.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 td=$s(`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 z7e(){const e=et(tS),t=et(gD),n=ef(),r=tf(),i=Wv(),{hasPerm:s}=rr(),a=wt({method:"POST",path:"/fxserver/controls"}),o=wt({method:"POST",path:"/fxserver/commands"}),l=y=>{const v={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},m=`${v[y]}...`,p=()=>{i(),a({data:{action:y},toastLoadingMessage:m,timeout:pg.LONG})};y==="start"?p():n({title:v[y],message:`Are you sure you want to ${y} the server?`,onConfirm:p})},c=()=>{l(t.isIdle?"start":"stop")},h=()=>{t.isChildAlive&&l("restart")},d=()=>{t.isChildAlive&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:y=>{i(),o({data:{action:"admin_broadcast",parameter:y},toastLoadingMessage:"Sending announcement..."})}})},f=()=>{t.isChildAlive&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:y=>{i(),o({data:{action:"kick_all",parameter:y},toastLoadingMessage:"Kicking players..."})}})},g=s("control.server"),_=s("announcement");return e!==ks.Ready?u.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):u.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[u.jsxs(ws,{children:[u.jsx(Ss,{asChild:!0,children:t.isIdle?u.jsxs("div",{className:"relative flex flex-grow inset-0",children:[u.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),u.jsx("button",{onClick:c,className:J(td({type:"success"}),"relative"),disabled:!g,children:u.jsx(pY,{className:"h-5"})})]}):u.jsx("button",{onClick:c,className:td({type:"destructive"}),disabled:!g,children:u.jsx(fY,{className:"h-5"})})}),u.jsx(Fi,{className:J(!g&&"text-destructive-inline text-center"),children:g?u.jsx("p",{children:t.isIdle?"Start the server! 🚀":"Stop the server"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to control the server."]})})]}),u.jsxs(ws,{children:[u.jsx(Ss,{asChild:!0,children:u.jsx("button",{onClick:h,className:J(td({type:"warning"})),disabled:!g||!t.isChildAlive,children:u.jsx(Y_,{className:"h-5"})})}),u.jsx(Fi,{className:J(!g&&"text-destructive-inline text-center"),children:g?u.jsx("p",{children:"Restart Server"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to control the server."]})})]}),u.jsxs(ws,{children:[u.jsx(Ss,{asChild:!0,children:u.jsx("button",{onClick:f,className:td(),disabled:!g||!t.isChildAlive,children:u.jsx(B7e,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),u.jsx(Fi,{className:J(!g&&"text-destructive-inline text-center"),children:g?u.jsx("p",{children:"Kick All Players"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to control the server."]})})]}),u.jsxs(ws,{children:[u.jsx(Ss,{asChild:!0,children:u.jsx("button",{onClick:d,className:td(),disabled:!_||!t.isChildAlive,children:u.jsx(sY,{className:"h-5"})})}),u.jsx(Fi,{className:J(!_&&"text-destructive-inline text-center"),children:_?u.jsx("p",{children:"Send Announcement"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to send an Announcement."]})})]})]})}const HA=$s("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 Hp({children:e,tooltip:t,type:n}){return t?u.jsxs(ws,{children:[u.jsx(Ss,{asChild:!0,children:u.jsx("span",{className:HA({type:n}),children:e})}),u.jsx(Fi,{side:"right",children:typeof t=="string"?u.jsx("p",{children:t}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{children:t.title}),u.jsx("p",{className:J("text-xs tracking-wider text-muted-foreground whitespace-pre-wrap",n==="warning"&&"text-warning-inline"),children:t.description})]})})]}):u.jsx("span",{className:HA({type:n}),children:e})}const Wp={[cd.Disabled]:{text:"DISABLED",color:"default",description:"Discord bot is disabled."},[cd.Starting]:{text:"STARTING",color:"warning",description:"Discord bot is starting."},[cd.Ready]:{text:"READY",color:"default",description:"Discord bot is ready."},[cd.Error]:{text:"ERROR",color:"destructive",description:"Discord bot is in an error state."}};function H7e(){const e=vD();let t="--",n="--",r="--",i="default",s="--",a="--",o="--",l="--",c="default",h="--",d="--",f="default";return e&&(e.server.uptime>0&&(s=u0(e.server.uptime,{units:["d","h","m"],delimiter:" "}),a="Time since the server came online."),t=e.server.health,r=e.server.healthReason,e.server.health===Yl.ONLINE?(i="success",n="Resources running, accepting connections."):e.server.health===Yl.PARTIAL?(i="warning",n="Resources not running or not accepting connections."):e.server.health===Yl.OFFLINE?(i="destructive",n="Server is offline."):(i="destructive",n="Unknown server status."),e.server.whitelist==="disabled"?(o="DISABLED",l="Anyone can join."):e.server.whitelist==="adminOnly"?(o="ADMIN",c="warning",l="Only admins can join."):e.server.whitelist==="discordMember"?(o="MEMBER",l="Only Discord server members can join."):e.server.whitelist==="discordRoles"?(o="ROLES",l="Only Discord server members with the specified roles can join."):e.server.whitelist==="approvedLicense"&&(o="LICENSE",l="Only players with an approved license can join."),e.discord in Wp?(h=Wp[e.discord].text,f=Wp[e.discord].color,d=Wp[e.discord].description):(h=`CODE-${e.discord}`,f="destructive",d="Unknown status code")),u.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",u.jsx(Hp,{tooltip:{title:n,description:r},type:i,children:t})]}),u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Uptime:",u.jsx(Hp,{tooltip:a,children:s})]}),u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Whitelist:",u.jsx(Hp,{tooltip:l,type:c,children:o})]}),u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",u.jsx(Hp,{tooltip:d,type:f,children:h})]})]})}const Yz=Intl.DateTimeFormat().resolvedOptions().timeZone,W7e=u.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",u.jsx("b",{children:window.txConsts.serverTimezone})," ",u.jsx("br",{}),"Your timezone: ",u.jsx("b",{children:Yz})," ",u.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),WA={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:["Possible formats: ",u.jsx("br",{}),u.jsxs("ul",{className:"list-disc ml-4",children:[u.jsxs("li",{children:[u.jsx(Ue,{children:"+MM"})," relative time in minutes (example: ",u.jsx(Ue,{children:"+15"})," for 15 minutes from now.)"]}),u.jsxs("li",{children:[u.jsx(Ue,{children:"HH:MM"})," absolute 24-hour time (example: ",u.jsx(Ue,{children:"23:30"})," for 11:30 PM.)"]})]})]}),Yz!==window.txConsts.serverTimezone&&W7e]}),placeholder:"+15",required:!0,isWide:!0},U7e=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 V7e(){const e=Wv(),t=tf(),{hasPerm:n}=rr(),r=wt({method:"POST",path:"/fxserver/schedule"}),i=vD();if(!i)return u.jsxs("div",{children:[u.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),u.jsx("span",{className:"font-light text-muted-foreground italic",children:"loading..."})]});const{scheduler:s}=i;let a="nothing scheduled",o="text-muted-foreground italic",l=!1,c=!1,h=!1;const d=typeof s.nextRelativeMs=="number";if(d){const p=s.nextIsTemp?"(temp)":"",x=kg(s.nextRelativeMs,{units:["h","m"]}),b=s.nextRelativeMs<6e4;b?(l=!0,a=`right now ${p}`):a=`in ${x} ${p}`,s.nextSkip?(o="text-muted-foreground line-through",b||(h=!0)):(o="text-warning-inline",b||(c=!0))}const f=p=>{if(e(),p.includes(",")){We.error({title:"Invalid scheduled restart time.",msg:`It looks like you are trying to schedule multiple restart times, which can only be done in the Settings page.
This input is for just the next (not persistent) restart.`},{duration:1e4});return}if(!U7e(p)){We.error(`Invalid schedule time: ${p}`);return}r({data:{action:"setNextTempSchedule",parameter:p},toastLoadingMessage:"Scheduling server restart..."})},g=()=>{t({...WA,onSubmit:f,submitLabel:"Edit"})},_=()=>{t({...WA,onSubmit:f,submitLabel:"Schedule"})},y=()=>{e(),r({data:{action:"setNextSkip",parameter:!0},toastLoadingMessage:"Cancelling next server restart..."})},v=()=>{e(),r({data:{action:"setNextSkip",parameter:!1},toastLoadingMessage:"Enabling next server restart..."})},m=n("control.server");return u.jsxs("div",{children:[u.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),u.jsx("span",{className:J("font-light",o),children:a}),u.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[d?u.jsxs(Ae,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!m||l,onClick:g,children:[u.jsx(uY,{className:"h-4 w-4 mr-1"})," Edit"]}):u.jsxs(Ae,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!m||l,onClick:_,children:[u.jsx(BK,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),c&&u.jsxs(Ae,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:y,disabled:!m,children:[u.jsx(FK,{className:"h-4 w-4 mr-1"})," Cancel"]}),h&&u.jsxs(Ae,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:v,disabled:!m,children:[u.jsx($K,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}function Xz({isSheet:e}){return u.jsxs("aside",{className:J("flex flex-col gap-4 z-10",e?"px-4 py-6":"tx-sidebar hidden lg:flex"),children:[u.jsx("div",{className:J(!e&&"rounded-xl border bg-card text-card-foreground shadow-sm p-4"),children:u.jsx($7e,{})}),u.jsx("hr",{className:e?"block":"hidden"}),u.jsxs("div",{className:J(!e&&"rounded-xl border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[u.jsx(z7e,{}),u.jsx(H7e,{}),u.jsx(V7e,{})]}),u.jsx("hr",{className:e?"block":"hidden"}),window.txConsts.adsData.main?u.jsxs("a",{href:window.txConsts.adsData.main.url,onClick:dh,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:[u.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]`}),u.jsx("img",{className:"rounded-xl max-w-sidebar max-h-[80px] m-auto",src:window.txConsts.adsData.main.img})]}):null,window.txConsts.isWebInterface?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:[u.jsxs("span",{className:J("text-muted-foreground",window.txConsts.txaVersion.includes("-")&&"text-destructive-inline font-semibold"),children:["tx: ",u.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",u.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]}),u.jsxs("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",onClick:dh,target:"_blank",className:"text-muted-foreground hover:text-accent",children:["© 2019-",new Date().getUTCFullYear()," Tabarra"]})]}):null]})}function q7e(){const t=et($v).toLocaleString("en-US");return u.jsxs("div",{className:"w-full flex justify-between items-center",children:[u.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:u.jsx(mS,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),u.jsxs("div",{className:"flex flex-col items-end",children:[u.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),u.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const G7e=new Set([9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]),UA=(e,t=35)=>{const n=[...e].map(s=>(s.codePointAt(0)??0).toString(16)),r=[];let i=0;for(let s=0;s<n.length;s++)if(!r.includes(n[s])){if(i+n[s].length>t)break;r.push(n[s]),i+=n[s].length+1}return r},K7e=e=>{const t=e.codePointAt(0);return t>=127744&&t<=128511||t>=128512&&t<=128591||t>=128640&&t<=128767||t>=128768&&t<=128895||t>=128896&&t<=129023||t>=129024&&t<=129279||t>=129280&&t<=129535||t>=129536&&t<=129647||t>=129648&&t<=129791||t>=9728&&t<=9983||t>=9984&&t<=10175},Y7e=(e,t=36)=>{let n="",r="",i=0,s="",a=0;const o=[...e];for(let l=0;l<o.length&&!(a>=t);l++){const c=o[l],h=c.codePointAt(0),d=G7e.has(h);if(!n.length&&d)continue;const f=c===r;if(f&&i>=(d?1:3))continue;let g=!1;if(d&&!((h===65038||h===65039)&&K7e(r))){s||(s=c,g=!0);continue}if(!g&&s){if(a>=t-1)break;n+=s,a++,s=""}r=c,i=f?i+1:1,n+=c,a++}return n},VA=String.fromCodePoint(8709,8203),X7e=e=>{if(!e)return{displayName:VA+"EMPTY NAME",displayNameEmpty:!0,pureName:"emptyname",pureNameEmpty:!0};const t=[o=>o.substring(0,128),o=>o.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,""),o=>o.replace(/\^\d/ig,""),o=>o.replace(/[\p{Control}\u200E\u2067]/ug,""),o=>o.replace(/[\uA980-\uA9DF\u239B-\u23AD\u534D\u5350\u1000-\u109F\u0B80-\u0BFF\uFDFD\u2E3B]/ug,""),o=>o.replace(/[\u{12000}-\u{123FF}\u{12400}-\u{1247F}\u{12480}-\u{1254F}\u{1D000}-\u{1D0FF}]/gu,""),o=>o.replace(new RegExp("(^\\p{Nonspacing_Mark}+)|(\\p{Nonspacing_Mark}{3,})","ug"),(l,c,h)=>{if(c)return"";if(h)return h.substring(0,2)}),Y7e];let n=e;for(const o of t){const l=o(n);if(l.length)n=l;else{const c=UA(n);return{displayName:`${VA}${c.join(" ").toUpperCase()}`,displayNameEmpty:!0,pureName:c.join(""),pureNameEmpty:!0}}}const r=n,i=[o=>o.normalize("NFKC"),o=>o.replace(/[^\p{Letter}\p{Number}]/gu,""),o=>o.toLocaleLowerCase()];let s=n;for(const o of i){const l=o(s);if(l.length)s=l;else{const c=UA(s);return{displayName:r,displayNameEmpty:!1,pureName:c.join(""),pureNameEmpty:!0}}}return{displayName:r,displayNameEmpty:!1,pureName:s,pureNameEmpty:!1}};function J7e({filterString:e,setFilterString:t}){const n=w.useRef(null);return yi("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),u.jsx("div",{className:"pt-2 px-2 flex gap-2",children:u.jsxs("div",{className:"relative w-full",children:[u.jsx(yt,{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?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:()=>t(""),children:u.jsx(yr,{})}):u.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:u.jsx(Ue,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const Q7e=w.memo(J7e);function Z7e({virtualItem:e,player:t,modalOpener:n}){return u.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[u.jsx("div",{className:"pid-block leading-[1.7]",children:u.jsx("span",{className:"pid-badge",children:t.netid})}),u.jsx("span",{className:"pname",children:t.displayName})]})}function ePe(){const e=et(oS),t=et(yD),n=qv(),r=w.useRef(null),[i,s]=w.useState(""),a=w.useMemo(()=>{const d=X7e(i).pureName;return d!=="emptyname"?e.filter(f=>f.pureName.includes(d)||f.netid.toString().includes(d)):e},[e,i]),o=w.useMemo(()=>{var g;const d=((g=e.at(-1))==null?void 0:g.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(d))+1+1}ch; }`},[e]),l=bC({isScrollingResetDelay:0,count:a.length,getScrollElement:()=>{var d;return(d=r.current)==null?void 0:d.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),c=l.getVirtualItems(),h=d=>{t&&n({mutex:t,netid:d})};return u.jsxs(u.Fragment,{children:[u.jsx(Q7e,{filterString:i,setFilterString:s}),u.jsxs("div",{className:J("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."]}),u.jsx("div",{className:J("text-center m-6 text-muted-foreground tracking-wider italic",c.length?"hidden":"block"),children:e.length&&i?u.jsxs("p",{children:["No players to show.",u.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):u.jsxs("p",{children:["No players online.",u.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),u.jsx("style",{children:o}),u.jsx(Qr,{className:"h-full select-none",ref:r,children:u.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:c.map(d=>u.jsx(Z7e,{virtualItem:d,player:a[d.index],modalOpener:h},d.key))})})]})}function Jz({isSheet:e}){return u.jsxs("aside",{className:J("flex flex-col z-10",e?"w-full h-screen":"tx-sidebar hidden xl:flex gap-4 h-contentvh"),children:[u.jsx("div",{className:J("text-card-foreground shrink-0 p-4",e?"pr-12 border-b":"rounded-xl border bg-card"),children:u.jsx(q7e,{})}),u.jsx("div",{className:J("flex flex-col gap-2 flex-grow overflow-hidden",!e&&"min-h-[480px] rounded-xl border bg-card text-card-foreground shadow-sm"),children:u.jsx(ePe,{})})]})}const U5=jC,tPe=LC,Qz=w.forwardRef(({className:e,...t},n)=>u.jsx(mf,{className:J("fixed inset-0 z-50 bg-black/80  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}));Qz.displayName=mf.displayName;const nPe=$s("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"}}),J1=w.forwardRef(({side:e="right",className:t,children:n,...r},i)=>u.jsxs(tPe,{children:[u.jsx(Qz,{}),u.jsxs(gf,{ref:i,className:J(nPe({side:e}),t),...r,children:[n,u.jsxs(_0,{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:[u.jsx(yr,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));J1.displayName=gf.displayName;const Zz=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});Zz.displayName="SheetHeader";const eH=w.forwardRef(({className:e,...t},n)=>u.jsx(vf,{ref:n,className:J("text-lg font-semibold text-foreground",e),...t}));eH.displayName=vf.displayName;const rPe=w.forwardRef(({className:e,...t},n)=>u.jsx(yf,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));rPe.displayName=yf.displayName;function iPe(){const{isSheetOpen:e,setIsSheetOpen:t}=n8(),{hasPerm:n}=rr();return u.jsx(U5,{open:e,onOpenChange:t,children:u.jsx(J1,{side:"left",className:"p-0 flex flex-col gap-0 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:u.jsxs(Qr,{className:"h-full px-6 [&_svg]:shrink-0",children:[u.jsx(Zz,{children:u.jsx(eH,{className:"py-6",children:u.jsx(Ww,{href:"/",children:u.jsx(H5,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),u.jsxs("div",{className:"mb-4",children:[u.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),u.jsxs("div",{className:"flex flex-wrap flex-row xs:grid grid-cols-2 gap-4",children:[u.jsxs(Hn,{href:"/players",children:[u.jsx(mS,{className:"mr-2 h-4 w-4"}),"Players"]}),u.jsxs(Hn,{href:"/history",children:[u.jsx(vY,{className:"mr-2 h-4 w-4"}),"History"]}),u.jsxs(Hn,{href:"/insights/player-drops",children:[u.jsx(ig,{className:"mr-2 h-4 w-4"}),"Player Drops"]}),u.jsxs(Hn,{href:"/whitelist",children:[u.jsx(zK,{className:"mr-2 h-4 w-4"}),"Whitelist"]}),u.jsxs(Hn,{href:"/admins",disabled:!n("manage.admins"),children:[u.jsx(wY,{className:"mr-2 h-4 w-4"}),"Admins"]}),u.jsxs(Hn,{href:"/settings",disabled:!n("settings.view"),children:[u.jsx(xY,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),u.jsxs("div",{className:"flex flex-wrap flex-row xs:grid grid-cols-2 gap-4",children:[u.jsxs(Hn,{href:"/system/master-actions",children:[u.jsx(jY,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),u.jsxs(Hn,{href:"/system/diagnostics",children:[u.jsx(NK,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),u.jsxs(Hn,{href:"/system/console-log",disabled:!n("txadmin.log.view"),children:[u.jsx(og,{className:"mr-2 h-4 w-4"}),"Console Log"]}),u.jsxs(Hn,{href:"/system/action-log",disabled:!n("txadmin.log.view"),children:[u.jsx(og,{className:"mr-2 h-4 w-4"}),"Action Log"]})]})]})]})})})}function sPe(){const{isSheetOpen:e,setIsSheetOpen:t}=r8();return u.jsx(U5,{open:e,onOpenChange:t,children:u.jsx(J1,{side:"left",className:"w-full xs:w-3/4 p-0",onOpenAutoFocus:n=>n.preventDefault(),children:u.jsx(Qr,{className:"h-full",children:u.jsx(Xz,{isSheet:!0})})})})}function oPe(){const{isSheetOpen:e,setIsSheetOpen:t}=i8();return u.jsx(U5,{open:e,onOpenChange:t,children:u.jsx(J1,{side:"right",className:"w-full xs:w-3/4 p-0",onOpenAutoFocus:n=>n.preventDefault(),children:u.jsx(Qr,{className:"h-full",children:u.jsx(Jz,{isSheet:!0})})})})}function aPe(){return u.jsxs(u.Fragment,{children:[u.jsx(iPe,{}),u.jsx(sPe,{}),u.jsx(oPe,{})]})}const tH=Qe(!1),nH=Qe(window.txConsts.fxsOutdated),rH=Qe(window.txConsts.txaOutdated);function lPe(){const[e,t]=mr(tH),[n,r]=mr(nH),[i,s]=mr(rH);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:s}}const cPe=()=>tt(tH),uPe=()=>{const e=tt(nH),t=tt(rH);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},iH="tsUpdateDismissed",dPe=12*60*60*1e3,hPe=48*60*60*1e3,fPe=()=>{const e=localStorage.getItem(iH);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},pPe=e=>{const t=fPe(),n=Date.now();return!t||t+(e?dPe:hPe)<n};function Wx({titleIcon:e,title:t,description:n,isImportant:r,canPostpone:i}){const[s,a]=w.useState(0),o=()=>{a(Math.random())},l=()=>{localStorage.setItem(iH,Date.now().toString()),o()};return w.useEffect(()=>{const c=setInterval(()=>{o()},6e4);return()=>clearInterval(c)},[]),i&&!pPe(r)?null:u.jsx("div",{className:"fixed top-navbarvh w-full flex justify-center z-40",children:u.jsxs("div",{className:J("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:[u.jsxs("h2",{className:"text-md group-hover:font-medium",children:[e,t]}),u.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,u.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&u.jsxs(Ae,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[u.jsx(TK,{className:"h-[0.9rem] mr-1"})," Postpone"]}),u.jsx(Ae,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:u.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[u.jsx(Kz,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function mPe(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=lPe();return e?u.jsx(Wx,{titleIcon:u.jsx(WK,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:u.jsxs(u.Fragment,{children:["The connection to the txAdmin server has been lost. ",u.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?u.jsx(Wx,{titleIcon:u.jsx(M3,{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?u.jsx(Wx,{titleIcon:u.jsx(M3,{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}var sH="AlertDialog",[gPe,AOe]=In(sH,[qP]),zs=qP(),oH=e=>{const{__scopeAlertDialog:t,...n}=e,r=zs(t);return u.jsx(jC,{...r,...n,modal:!0})};oH.displayName=sH;var vPe="AlertDialogTrigger",yPe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=zs(n);return u.jsx(Iae,{...i,...r,ref:t})});yPe.displayName=vPe;var xPe="AlertDialogPortal",aH=e=>{const{__scopeAlertDialog:t,...n}=e,r=zs(t);return u.jsx(LC,{...r,...n})};aH.displayName=xPe;var _Pe="AlertDialogOverlay",lH=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=zs(n);return u.jsx(mf,{...i,...r,ref:t})});lH.displayName=_Pe;var lc="AlertDialogContent",[bPe,wPe]=gPe(lc),cH=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=zs(n),a=w.useRef(null),o=Fe(t,a),l=w.useRef(null);return u.jsx(Dae,{contentName:lc,titleName:uH,docsSlug:"alert-dialog",children:u.jsx(bPe,{scope:n,cancelRef:l,children:u.jsxs(gf,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:fe(i.onOpenAutoFocus,c=>{var h;c.preventDefault(),(h=l.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(X2,{children:r}),u.jsx(CPe,{contentRef:a})]})})})});cH.displayName=lc;var uH="AlertDialogTitle",dH=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=zs(n);return u.jsx(vf,{...i,...r,ref:t})});dH.displayName=uH;var hH="AlertDialogDescription",fH=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=zs(n);return u.jsx(yf,{...i,...r,ref:t})});fH.displayName=hH;var SPe="AlertDialogAction",pH=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=zs(n);return u.jsx(_0,{...i,...r,ref:t})});pH.displayName=SPe;var mH="AlertDialogCancel",gH=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=wPe(mH,n),s=zs(n),a=Fe(t,i);return u.jsx(_0,{...s,...r,ref:a})});gH.displayName=mH;var CPe=({contentRef:e})=>{const t=`\`${lc}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${lc}\` by passing a \`${hH}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${lc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},kPe=oH,EPe=aH,vH=lH,yH=cH,xH=pH,_H=gH,bH=dH,wH=fH;const TPe=kPe,MPe=EPe,SH=w.forwardRef(({className:e,...t},n)=>u.jsx(vH,{className:J("fixed inset-0 z-50 bg-black/80  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}));SH.displayName=vH.displayName;const CH=w.forwardRef(({className:e,...t},n)=>u.jsxs(MPe,{children:[u.jsx(SH,{}),u.jsx(yH,{ref:n,className:J("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})]}));CH.displayName=yH.displayName;const kH=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});kH.displayName="AlertDialogHeader";const EH=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});EH.displayName="AlertDialogFooter";const TH=w.forwardRef(({className:e,...t},n)=>u.jsx(bH,{ref:n,className:J("text-lg font-semibold","attempt-word-wrap",e),...t}));TH.displayName=bH.displayName;const MH=w.forwardRef(({className:e,...t},n)=>u.jsx(wH,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));MH.displayName=wH.displayName;const RH=w.forwardRef(({className:e,...t},n)=>u.jsx(xH,{ref:n,className:J(Zh(),e),...t}));RH.displayName=xH.displayName;const AH=w.forwardRef(({className:e,...t},n)=>u.jsx(_H,{ref:n,className:J(Zh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));AH.displayName=_H.displayName;function RPe(){const e=w.useRef(null),t=BY(),n=$Y(),r=()=>{t.isOpen&&(n(),t.onCancel&&t.onCancel())},i=()=>{t.isOpen&&(n(),t.onConfirm())},s=o=>{o.preventDefault(),o.key==="Enter"||o.key==="NumpadEnter"?i():(o.key==="Backspace"||o.key==="Escape")&&r()},a=o=>{o||r()};return gV(e,r),u.jsx(TPe,{open:t.isOpen,onOpenChange:a,children:u.jsxs(CH,{ref:e,onOpenAutoFocus:o=>{var l;o.preventDefault(),o.target&&"querySelector"in o.target&&typeof o.target.querySelector=="function"&&((l=o.target.querySelector("[data-autofocus]"))==null||l.focus())},children:[u.jsxs(kH,{children:[u.jsx(TH,{children:t.title}),u.jsx(MH,{children:t.message})]}),u.jsxs(EH,{children:[u.jsx(AH,{children:t.cancelLabel??"Cancel"}),u.jsx(RH,{"data-autofocus":!0,onKeyDown:s,onClick:i,className:J(Zh({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}function APe(){const e=w.useRef(null),t=zY(),n=FY(),r=()=>{var o,l;if(!t.isOpen)return;n();const a=((o=e.current)==null?void 0:o.value)??((l=e.current)==null?void 0:l.textArea.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},s=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return u.jsx(Xa,{open:t.isOpen,onOpenChange:s,children:u.jsx(Wo,{className:J(t.isWide&&"md:max-w-2xl"),children:u.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[u.jsxs(Uo,{children:[u.jsx(Vo,{children:t.title}),u.jsx(cO,{children:t.message})]}),t.isMultiline?u.jsx(_f,{autoFocus:!0,ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required,minHeight:100,maxHeight:240}):u.jsx(yt,{autoFocus:!0,ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),u.jsxs(xf,{className:"gap-2 flex-col",children:[u.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,o)=>u.jsxs(Ae,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[u.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},o))}),u.jsx(Ae,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}const jPe=w.memo(function(){const{authData:e,setAuthData:t}=Ga(),{setAccountModalTab:n}=gS(),r=ZD(),i=wt({method:"POST",path:"/auth/changePassword"}),[s,a]=w.useState(""),[o,l]=w.useState(""),[c,h]=w.useState(""),[d,f]=w.useState(""),[g,_]=w.useState(!1),y=v=>{if(v==null||v.preventDefault(),!!e){if(f(""),o.length<Or.adminPasswordMinLength||o.length>Or.adminPasswordMaxLength){f(`The password must be between ${Or.adminPasswordMinLength} and ${Or.adminPasswordMaxLength} digits long.`);return}else if(o!==c){f("The passwords do not match.");return}_(!0),i({data:{newPassword:o,oldPassword:e.isTempPassword?void 0:s},error:m=>{_(!1),f(m)},success:m=>{_(!1),"success"in m?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(We.success("Password changed successfully!"),r()):f(m.error)}})}};if(e)return u.jsx(X1,{value:"password",tabIndex:void 0,children:u.jsxs("form",{onSubmit:y,children:[e.isTempPassword?u.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. ",u.jsx("br",{}),u.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):u.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."}),u.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&u.jsxs("div",{className:"space-y-1",children:[u.jsx(_n,{htmlFor:"current-password",children:"Current Password"}),u.jsx(yt,{id:"current-password",placeholder:"Enter current password",type:"password",value:s,autoFocus:!0,required:!0,onChange:v=>{a(v.target.value),f("")}})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(_n,{htmlFor:"new-password",children:"New Password"}),u.jsx(yt,{id:"new-password",autoComplete:"new-password",placeholder:"Enter new password",type:"password",value:o,autoFocus:e.isTempPassword,required:!0,onChange:v=>{l(v.target.value),f("")}})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(_n,{htmlFor:"confirm-password",children:"Confirm Password"}),u.jsx(yt,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:v=>{h(v.target.value),f("")}})]})]}),d&&u.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:d}),u.jsx(Ae,{className:"w-full",type:"submit",disabled:g,children:g?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})});function LPe(){const e=oN(),[t,n]=w.useState(""),[r,i]=w.useState(""),[s,a]=w.useState(""),[o,l]=w.useState(!1),c=ZD(),[h,d]=w.useState(!1),f=Kc("/auth/getIdentifiers",()=>e("/auth/getIdentifiers"),{revalidateOnMount:!0,revalidateOnFocus:!1});w.useEffect(()=>{f.data&&(n(f.data.cfxreId),i(f.data.discordId))},[f.data]),w.useEffect(()=>{var m;a(((m=f.error)==null?void 0:m.message)??"")},[f.error]);const g=wt({method:"POST",path:"/auth/changeIdentifiers"}),_=m=>{m==null||m.preventDefault(),a(""),d(!0),g({data:{cfxreId:t,discordId:r},error:p=>{a(p)},success:p=>{d(!1),"success"in p?(We.success("Identifiers changed successfully!"),c()):a(p.error)}})},y=async()=>{if(!t)return;const m=t.trim();if(/^\d+$/.test(m))n(`fivem:${m}`);else if(m.startsWith("fivem:"))t!==m&&n(m);else{try{l(!0);const p=await Eo(`https://forum.cfx.re/u/${m}.json`);p.user&&typeof p.user.id=="number"?n(`fivem:${p.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)}},v=()=>{if(!r)return;const m=r.trim();/^\d+$/.test(m)?i(`discord:${m}`):r!==m&&i(m)};return u.jsx(X1,{value:"identifiers",tabIndex:void 0,children:u.jsxs("form",{onSubmit:_,children:[u.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",u.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",u.jsx("strong",{children:"In Game Menu"})," and the ",u.jsx("strong",{children:"Discord Bot"}),". ",u.jsx("br",{}),u.jsx("strong",{children:"It is recommended that you configure at least one."})]}),u.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsxs(_n,{htmlFor:"cfxreId",children:["FiveM identifier ",u.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),u.jsx(yt,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:f.isLoading||o?"loading...":t,disabled:f.isLoading||o,autoFocus:!0,onBlur:y,onChange:m=>{n(m.target.value),a("")}}),u.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. ",u.jsx("br",{}),"You can also type in your ",u.jsx(yn,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",u.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsxs(_n,{htmlFor:"discordId",children:["Discord identifier ",u.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),u.jsx(yt,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:f.isLoading?"loading...":r,disabled:f.isLoading,onBlur:v,onChange:m=>{i(m.target.value),a("")}}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",u.jsx(yn,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",u.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),s&&u.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:s}),u.jsx(Ae,{className:"w-full",type:"submit",disabled:!f||h,children:h?"Saving...":"Save Changes"})]})})}function DPe(){const{authData:e}=Ga(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=gS();w.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const s=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return u.jsx(Xa,{open:t,onOpenChange:s,children:u.jsxs(Wo,{className:"sm:max-w-lg",tabIndex:void 0,children:[u.jsx(Uo,{children:u.jsx(Vo,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),u.jsxs(YF,{defaultValue:"password",value:r,onValueChange:i,children:[u.jsxs(A5,{className:"grid w-full grid-cols-2 mb-4",children:[u.jsx(lv,{value:"password",children:"Password"}),u.jsx(lv,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),u.jsx(jPe,{}),u.jsx(LPe,{})]})]})})}const NPe=5*60;function cc({tsFetch:e,tsObject:t,serverTime:n,className:r,isDateOnly:i,dateStyle:s,timeStyle:a}){const o=n-e,l=n-t,c=e-l,h=()=>{We.warning(`This means that the server clock is ${Math.abs(o)} seconds ${o>0?"ahead":"behind"} your computer time. Make sure both your computer and the server have their clocks synchronized.`)},d=i?aP(c,s??"medium"):vs(c,s??"medium",a??"short");return u.jsxs("span",{className:r,title:vs(c,"long","long"),children:[d,Math.abs(o)>NPe&&u.jsx("button",{className:"ml-1 text-warning-inline",onClick:h,children:"(clock drift)"})]})}function qA({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?u.jsxs("span",{className:J("h-max 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"]}):u.jsxs("span",{className:J("h-max 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 GA=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function PPe({playerRef:e,player:t,refreshModalData:n}){const r=w.useRef(null),[i,s]=w.useState(t.notesLog??""),[a,o]=w.useState(GA(t.notes)),l=wt({method:"POST",path:"/player/save_note"}),c=()=>{var d;s("Saving..."),l({queryParams:e,data:{note:(d=r.current)==null?void 0:d.value.trim()},success:f=>{"error"in f?s(f.error):n()}})},h=d=>{d.key==="Enter"&&!d.shiftKey&&!window.txIsMobile?(d.preventDefault(),c()):o(GA(d.currentTarget.value))};return u.jsxs(u.Fragment,{children:[u.jsxs(_n,{htmlFor:"playerNotes",children:["Notes: ",u.jsx("span",{className:"text-muted-foreground",children:i})]}),u.jsx(Ec,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>s("Press enter to save."),onKeyDown:h,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&&u.jsx("div",{className:"mt-2 w-full",children:u.jsx(Ae,{variant:"outline",size:"xs",onClick:c,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function OPe({playerRef:e,player:t,serverTime:n,tsFetch:r,setSelectedTab:i,refreshModalData:s}){const{hasPerm:a}=rr(),o=wt({method:"POST",path:"/player/whitelist"}),l=t.sessionTime?kg(t.sessionTime*6e4,{units:["h","m"]}):"--",c=t.tsLastConnection?u.jsx(cc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsLastConnection,tsFetch:r,isDateOnly:!0}):"--",h=t.playTime?kg(t.playTime*6e4,{units:["d","h","m"]}):"--",d=t.tsJoined?u.jsx(cc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsJoined,tsFetch:r,isDateOnly:!0}):"--",f=t.tsWhitelisted?u.jsx(cc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsWhitelisted,tsFetch:r,isDateOnly:!0}):"not yet",g=t.actionHistory.filter(m=>m.type==="ban"&&!m.revokedAt).length,_=t.actionHistory.filter(m=>m.type==="warn"&&!m.revokedAt).length,y=()=>{o({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(m,p)=>{"success"in m&&s()}})},v=w.useMemo(()=>{if(!t||!n)return;let m;for(const p of t.actionHistory)if(!(p.type!=="ban"||p.revokedAt))if(p.exp)p.exp>=n&&(m=Math.max(m??0,p.exp));else return"This player is permanently banned.";if(m!==void 0)return`This player is banned until ${vs(m,"short","short")}`},[t,n]);return u.jsxs("div",{className:"p-1",children:[v?u.jsxs("div",{className:"w-full p-2 pr-3 mb-1 flex items-center justify-between space-x-4 rounded-lg border shadow-lg transition-all text-black/75 dark:text-white/90 border-warning/70 bg-warning-hint",children:[u.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:u.jsx(UD,{className:"size-5 text-warning"})}),u.jsx("div",{className:"flex-grow text-sm font-medium",children:v})]}):null,u.jsxs("dl",{className:"pb-2",children:[t.isConnected&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:h})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:d})]}),!t.isConnected&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),u.jsx("dd",{className:"text-sm leading-6 mt-0",children:f}),u.jsx("dd",{className:"text-right",children:u.jsx(Ae,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:y,disabled:!a("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Sanctions"}),u.jsxs("dd",{className:"text-sm leading-6 mt-0 flex flex-wrap gap-2",children:[u.jsx(qA,{type:"Ban",count:g}),u.jsx(qA,{type:"Warn",count:_})]}),u.jsx("dd",{className:"text-right",children:u.jsx(Ae,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{i("History")},children:"View"})})]})]}),u.jsx(PPe,{player:t,playerRef:e,refreshModalData:s})]})}const KA=()=>u.jsx("span",{className:"opacity-0",children:`
`}),IPe=["fivem:xxxxxxx","license:xxxxxxxxxxxxxx","discord:xxxxxxxxxxxxxxxxxx","etc..."].join(`
`),$Pe=["2:xxxxxxxxxxxxxx...","4:xxxxxxxxxxxxxx...","5:xxxxxxxxxxxxxx...","etc..."].join(`
`);function uv({list:e,highlighted:t,type:n,src:r,onWipeIds:i}){const[s,a]=E0(),o=w.useRef(null),l=w.useRef(null),[c,h]=w.useState(null),[d,f]=w.useState(!1),g=Array.isArray(t)&&t.length,_=g?t.sort((M,L)=>M.localeCompare(L)):e.sort((M,L)=>M.localeCompare(L)),y=g?e.filter(M=>!t.includes(M)).sort((M,L)=>M.localeCompare(L)):[],v=_.length||y.length,m=ef(),p=tf(),x=n==="hwid",b=x?"HWID":"ID",S=`This ${r} has no ${b}s.`,C=Array.isArray(c),E=M=>C&&c.includes(M);w.useEffect(()=>{if(d){const M=setTimeout(()=>{f(!1)},2750);return()=>{clearTimeout(M)}}},[d]);const k=()=>{if(!i)return;const M=x?`${b}s`:`${b}s (except license)`;m({title:`Wipe ${r} ${b}s`,message:u.jsxs("p",{children:["Are you sure you want wipe all ",M," of this ",r,"? ",u.jsx("br",{}),u.jsx("strong",{children:"This action cannot be undone."})]}),onConfirm:i})},T=()=>{p({title:`Compare ${b}s`,message:u.jsxs("p",{children:["Paste in a list of ",b,"s to compare with the current list. ",u.jsx("br",{}),"Separate each ",b," with a new line or comma."]}),placeholder:x?$Pe:IPe,submitLabel:"Compare",required:!0,isMultiline:!0,isWide:!0,onSubmit:M=>{console.log(M);const L=M.split(/[\n\s,;]+/).map(D=>D.trim()).filter(D=>D.length).filter(D=>D.length&&e.includes(D));h(L)}})},R=()=>{if(!o.current)throw new Error("divRef.current undefined");if(!v)return;const M=[..._,...y].join(`\r
`);WL(M,o.current).then(L=>{L!==!1?f({msg:"Copied!",success:!0}):We.error("Failed to copy to clipboard :(")}).catch(L=>{We.error({title:"Failed to copy to clipboard:",msg:L.message}),f({msg:"Error :(",success:!1})})};return u.jsxs("div",{children:[u.jsxs("div",{className:"flex justify-between items-center pb-1",ref:o,children:[u.jsxs("h3",{className:"text-xl",children:[x?"Hardware IDs":"Player Identifiers",C&&c.length?u.jsxs("span",{className:"ml-2 text-sm font-normal italic text-success-inline",children:["(",c.length," matches found)"]}):null]}),u.jsx("div",{ref:s,className:J("w-24 min-h-6 flex justify-end gap-2.5",!v&&"hidden"),children:d?u.jsx("span",{ref:l,className:J("w-full text-center text-sm select-none pointer-events-none animate-toastbar-enter",d.success?"text-success-inline":"text-destructive-inline"),children:d.msg}):u.jsxs(u.Fragment,{children:[i&&u.jsx("button",{onClick:k,title:"Wipe all IDs except license.",children:u.jsx(KD,{className:"h-5 opacity-50 hover:opacity-100 hover:text-destructive"})}),u.jsx("button",{onClick:T,title:"Compare IDs.",children:u.jsx(nY,{className:"h-6 opacity-50 hover:opacity-100 hover:text-primary"})}),u.jsx("button",{onClick:R,title:"Copy IDs to clipboard.",children:u.jsx(UK,{className:"h-5 opacity-50 hover:opacity-100 hover:text-primary"})})]})})]}),u.jsxs("div",{className:"relative border rounded",children:[u.jsxs("p",{className:J("font-mono break-all whitespace-pre-wrap rounded-[inherit] divide-y divide-border/50 text-muted-foreground",v&&x?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:[!v&&u.jsx("span",{className:"block px-1 opacity-50 italic",children:S}),_.map(M=>u.jsxs("span",{className:J("block px-1 font-semibold",C&&(E(M)?"text-success-inline font-semibold":"opacity-50")),children:[M,u.jsx(KA,{})]},M)),y.map(M=>u.jsxs("span",{className:J("block px-1 opacity-50",E(M)&&"opacity-100 text-success-inline font-semibold"),children:[M,u.jsx(KA,{})]},M))]}),C&&!c.length&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"absolute inset-0 dark:bg-black/25 rounded-[inherit] backdrop-blur-sm flex items-center justify-center p-4",children:u.jsxs("span",{className:"text-xl tracking-wider text-warning-inline",children:["No matching ",b," found."]})}),u.jsxs("button",{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100",onClick:()=>h(null),children:[u.jsx(yr,{className:"h-8 w-8 sm:h-6 sm:w-6"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})]})}function BPe({player:e,refreshModalData:t}){return u.jsx(PF,{children:u.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[u.jsx(uv,{type:"id",src:"player",list:(e==null?void 0:e.oldIds)??[],highlighted:e.ids}),u.jsx(uv,{type:"hwid",src:"player",list:(e==null?void 0:e.oldHwids)??[],highlighted:e.hwids})]})})}function FPe({action:e,serverTime:t,modalOpener:n}){let r,i,s;if(e.type==="ban"?(i="border-destructive",s=`BANNED by ${e.author}`):e.type==="warn"&&(i="border-warning",s=`WARNED by ${e.author}`),e.revokedBy){i="";const a=vs(e.revokedAt??0,"medium","short");r=`Revoked by ${e.revokedBy} on ${a}.`}else if(typeof e.exp=="number"){const a=vs(e.exp,"medium","short");r=e.exp<t?`Expired on ${a}.`:`Expires in ${a}.`}return u.jsxs("div",{onClick:()=>{n(e.id)},className:J("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30 cursor-pointer",i),children:[u.jsxs("div",{className:"flex w-full justify-between",children:[u.jsx("strong",{className:"text-sm text-muted-foreground",children:s}),u.jsxs("small",{className:"text-right text-2xs space-x-1",children:[u.jsx(Ue,{className:"tracking-widest",children:e.id}),u.jsx("span",{className:"opacity-75 cursor-help",title:vs(e.ts,"long","long"),children:vs(e.ts,"medium","short")})]})]}),u.jsx("span",{className:"text-sm",children:e.reason}),r&&u.jsx("small",{className:"block text-xs opacity-75",children:r})]})}function zPe({actionHistory:e,serverTime:t,refreshModalData:n}){const r=OS();if(!e.length)return u.jsx($f,{children:"No bans/warns found."});const i=a=>{r(a)},s=[...e].reverse();return u.jsx("div",{className:"flex flex-col gap-1 p-1",children:s.map(a=>u.jsx(FPe,{action:a,serverTime:t,modalOpener:i},a.id))})}function HPe({playerRef:e,banTemplates:t}){const n=w.useRef(null),[r,i]=w.useState(!1),{hasPerm:s}=rr(),a=_S(),o=wt({method:"POST",path:"/player/ban",throwGenericErrors:!0});if(!s("players.ban"))return u.jsx($f,{children:"You don't have permission to ban players."});const l=()=>{if(!n.current)return;const{reason:c,duration:h}=n.current.getData();if(!c||c.length<3){We.warning("The reason must be at least 3 characters long."),n.current.focusReason();return}i(!0),o({queryParams:e,data:{reason:c,duration:h},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},success:d=>{i(!1),a()},error:d=>{i(!1)}})};return u.jsxs("div",{className:"grid gap-4 p-1",children:[u.jsx(qO,{ref:n,banTemplates:t,disabled:r,onNavigateAway:()=>{a()}}),u.jsx("div",{className:"flex place-content-end",children:u.jsx(Ae,{size:"sm",variant:"destructive",disabled:r,onClick:l,children:r?u.jsxs("span",{className:"flex items-center leading-relaxed",children:[u.jsx(Zt,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function WPe({playerRef:e,player:t}){const{hasPerm:n}=rr(),r=tf(),i=_S(),s=$o()[1],[a]=Mv("/admins"),o=Bv(),l=Wv(),c=wt({method:"POST",path:"/player/message"}),h=wt({method:"POST",path:"/player/kick"}),d=wt({method:"POST",path:"/player/warn"}),f=m=>{"success"in m&&(i(),l())},g=()=>{if(!t)return;const m=new URLSearchParams;m.set("autofill","true"),m.set("name",t.pureName);for(const p of t.ids)p.startsWith("discord:")?m.set("discord",p):p.startsWith("fivem:")&&m.set("citizenfx",p);s(`/admins?${m.toString()}`),console.log("isAlreadyInAdminPage",a),a&&o(),i(),l()},_=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:m=>{c({queryParams:e,data:{message:m},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:f})}})},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:m=>{h({queryParams:e,data:{reason:m},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:f})}})},v=()=>{t&&r({title:`Warn ${t.displayName}`,message:u.jsxs("p",{children:["Type below the warn reason. ",u.jsx("br",{}),"Offline players will receive  the warning when they come back online."]}),placeholder:"The reason for the warn, rule violated, etc.",submitLabel:"Send",required:!0,onSubmit:m=>{d({queryParams:e,data:{reason:m},genericHandler:{successMsg:"Warning sent."},toastLoadingMessage:"Sending warning...",success:f})}})};return u.jsxs(xf,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[u.jsxs(Ae,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.ids.length,onClick:g,className:"pl-2 sm:mr-auto",children:[u.jsx(VD,{className:"h-5 mr-1"})," Give Admin"]}),u.jsxs(Ae,{variant:"outline",size:"sm",disabled:!n("players.direct_message")||!t||!t.isConnected,onClick:_,className:"pl-2",children:[u.jsx(iY,{className:"h-5 mr-1"})," DM"]}),u.jsxs(Ae,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:y,className:"pl-2",children:[u.jsx(F7e,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),u.jsxs(Ae,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t,onClick:v,className:"pl-2",children:[u.jsx(ag,{className:"h-5 mr-1"})," Warn"]})]})}const nd=[{title:"Info",icon:u.jsx(dS,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:u.jsx(ZK,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:u.jsx(og,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:u.jsx(sg,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function UPe(){const{isModalOpen:e,closeModal:t,playerRef:n}=HY(),[r,i]=w.useState(nd[0].title),[s,a]=w.useState(0),[o,l]=w.useState(void 0),[c,h]=w.useState(""),[d,f]=w.useState(0),g=wt({method:"GET",path:"/player",abortOnUnmount:!0}),_=()=>{a(s+1)};w.useEffect(()=>{n&&(l(void 0),h(""),g({queryParams:n,success:p=>{"error"in p?h(p.error):(l(p),f(Math.round(Date.now()/1e3)),!("license"in n)&&p.player.license&&Vv(p.player.license))},error:p=>{h(p)}}))},[n,s]),w.useEffect(()=>{e||setTimeout(()=>{i(nd[0].title)},200)},[e]);const y=p=>{e&&!p&&t()},v=p=>{if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();const x=nd.findIndex(C=>C.title===r),b=p.key==="ArrowUp"?x-1:x+1,S=nd[b];if(S){i(S.title);const C=document.getElementById(`player-modal-tab-${S.title}`);C&&C.focus()}}};let m;return o?o.player.netid?m=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-success-inline font-mono mr-2",children:["[",o.player.netid,"]"]}),o.player.displayName]}):m=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-destructive-inline font-mono mr-2",children:"[OFF]"}),o.player.displayName]}):c?m=u.jsx("span",{className:"text-destructive-inline",children:"Error!"}):m=u.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),u.jsx(Xa,{open:e,onOpenChange:y,children:u.jsxs(Wo,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[u.jsx(Uo,{className:"px-4 py-3 border-b",children:u.jsx(Vo,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:m})}),u.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[u.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:nd.map(p=>u.jsxs(Ae,{id:`player-modal-tab-${p.title}`,variant:r===p.title?"secondary":"ghost",className:J("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",p.className),onClick:()=>i(p.title),onKeyDown:v,children:[p.icon," ",p.title]},p.title))}),u.jsx(Qr,{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:o?u.jsxs(u.Fragment,{children:[r==="Info"&&u.jsx(OPe,{playerRef:n,player:o.player,serverTime:o.serverTime,tsFetch:d,setSelectedTab:i,refreshModalData:_}),r==="History"&&u.jsx(zPe,{actionHistory:o.player.actionHistory,serverTime:o.serverTime,refreshModalData:_}),r==="IDs"&&u.jsx(BPe,{player:o.player,refreshModalData:_}),r==="Ban"&&u.jsx(HPe,{banTemplates:o.banTemplates,playerRef:n})]}):u.jsx($f,{children:c?u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):u.jsx(Ba,{msg:"Loading..."})})})]}),u.jsx(WPe,{playerRef:n,player:o==null?void 0:o.player})]})})}function VPe(){const e=BS(),t=Yte(),n=w.useRef(0),r=cPe(),i=hK(),s=vK(),a=uPe();return w.useEffect(()=>{const o=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=K2(o);return l.on("connect",()=>{console.log("Main Socket.IO Connected."),r(!1)}),l.on("disconnect",c=>{console.log("Main Socket.IO Disonnected:",c);const h=n.current+1;n.current=h,setTimeout(()=>{n.current===h&&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(){e("main socketio","got refreshToUpdate",xc.UPDATED)}),l.on("txAdminShuttingDown",function(){e("main socketio","got txAdminShuttingDown",xc.SHUTDOWN)}),l.on("status",function(c){i(c)}),l.on("playerlist",function(c){window.txConsts.isWebInterface&&s(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 qPe({action:e}){return u.jsxs("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:[u.jsx(uv,{type:"id",src:"action",list:e.ids}),u.jsx(uv,{type:"hwid",src:"action",list:"hwids"in e&&e.hwids?e.hwids:[]})]})}const GPe=e=>{if(!e)return 3;const t=e.trim().split(`
`).length+1;return Math.min(Math.max(t,3),16)};function KPe({actionReason:e}){const t=w.useRef(null),[n,r]=w.useState(GPe(e));return u.jsxs(u.Fragment,{children:[u.jsx(_n,{htmlFor:"actionReason",children:"Reason:"}),u.jsx(Ec,{ref:t,id:"actionReason",className:"w-full mt-1",readOnly:!0,value:e,style:{height:`${1+1.25*n}rem`}})]})}function YPe({action:e,serverTime:t,tsFetch:n}){const r=qv();let i;if(e.type==="ban")if(e.expiration===!1)i=u.jsx("span",{className:"text-destructive-inline",children:"Never"});else if(e.expiration>t){const d=kg((t-e.expiration)*1e3,{units:["mo","w","d","h","m"]});i=u.jsxs("span",{className:"text-warning-inline",children:["In ",d]})}else i=u.jsx(cc,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.expiration,tsFetch:n});let s;e.type==="warn"&&e.acked?s=u.jsx("span",{className:"opacity-75",children:"Yes"}):s=u.jsx("span",{className:"text-warning-inline",children:"Not yet"});let a;e.revocation.timestamp?a=u.jsxs("span",{className:"text-warning-inline",children:["By ",e.revocation.author," on ",u.jsx(cc,{isDateOnly:!0,className:"cursor-help",serverTime:t,tsObject:e.revocation.timestamp,tsFetch:n})]}):a=u.jsx("span",{className:"opacity-75",children:"No"});const o=e.playerName!==!1?u.jsx("span",{children:e.playerName}):u.jsx("span",{className:"italic opacity-75",children:"unknown player"}),l=e.ids.filter(d=>d.startsWith("license:")),c=l.length===1?l[0].split(":")[1]:!1,h=()=>{c&&r({license:c})};return u.jsxs("div",{className:"px-1 mb-1 md:mb-4",children:[u.jsxs("dl",{className:"pb-2",children:[u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Date/Time"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:u.jsx(cc,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.timestamp,tsFetch:n})})]}),e.type==="ban"&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Expiration"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:i})]}),e.type==="warn"&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player Accepted"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:s})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Revoked"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:a})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Admin"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:e.author})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2x mt-0",children:o}),u.jsx("dd",{className:"text-right",children:u.jsx(Ae,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:h,disabled:!c,children:"View"})})]})]}),u.jsx(KPe,{actionReason:e.reason})]})}function XPe({action:e,refreshModalData:t}){const[n,r]=w.useState(!1),{hasPerm:i}=rr(),s=wt({method:"POST",path:"/history/revokeAction"}),a=e.type.charAt(0).toUpperCase()+e.type.slice(1),o=()=>{r(!0),s({data:{actionId:e.id},toastLoadingMessage:`Revoking ${e.type}...`,genericHandler:{successMsg:`${a} revoked.`},success:d=>{r(!1),"success"in d&&t()}})},l=!!e.revocation.timestamp,c=i(e.type==="warn"?"players.warn":"players.ban"),h=l?`${e.type} revoked`:c?`Revoke ${a}`:"Revoke (no permission)";return u.jsx("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("h3",{className:"text-xl",children:["Revoke ",a]}),u.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.",u.jsxs("ul",{className:"list-disc list-inside pt-1",children:[e.type==="ban"&&u.jsx("li",{children:"The player will be able to rejoin the server."}),u.jsx("li",{children:"The player will not be notified of the revocation."}),u.jsxs("li",{children:["This ",e.type," will not be removed from the player history."]}),u.jsx("li",{children:"The revocation cannot be undone!"})]})]}),u.jsx(Ae,{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:o,children:n?u.jsxs("span",{className:"flex items-center leading-relaxed",children:[u.jsx(Zt,{className:"inline animate-spin h-4"})," Revoking..."]}):h})]})})}const rd=[{title:"Info",icon:u.jsx(dS,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:u.jsx(og,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Revoke",icon:u.jsx(pS,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function JPe(){const{isModalOpen:e,closeModal:t,actionRef:n}=mte(),[r,i]=w.useState(rd[0].title),[s,a]=w.useState(0),[o,l]=w.useState(void 0),[c,h]=w.useState(""),[d,f]=w.useState(0),g=wt({method:"GET",path:"/history/action",abortOnUnmount:!0}),_=()=>{a(s+1)};w.useEffect(()=>{n&&(l(void 0),h(""),g({queryParams:{id:n},success:p=>{"error"in p?h(p.error):(l(p),f(Math.round(Date.now()/1e3)))},error:p=>{h(p)}}))},[n,s]),w.useEffect(()=>{e||setTimeout(()=>{i(rd[0].title)},200)},[e]);const y=p=>{e&&!p&&t()},v=p=>{if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();const x=rd.findIndex(C=>C.title===r),b=p.key==="ArrowUp"?x-1:x+1,S=rd[b];if(S){i(S.title);const C=document.getElementById(`action-modal-tab-${S.title}`);C&&C.focus()}}};let m;if(o){const p=o.action.playerName!==!1?u.jsx("span",{children:o.action.playerName}):u.jsx("span",{className:"italic opacity-75",children:"unknown player"});if(o.action.type==="ban")m=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-destructive-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Banned ",p]});else if(o.action.type==="warn")m=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-warning-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Warned ",p]});else throw new Error(`Unknown action type: ${o.action.type}`)}else c?m=u.jsx("span",{className:"text-destructive-inline",children:"Error!"}):m=u.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."});return u.jsx(Xa,{open:e,onOpenChange:y,children:u.jsxs(Wo,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[u.jsx(Uo,{className:"px-4 py-3 border-b",children:u.jsx(Vo,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:m})}),u.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[u.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:rd.map(p=>u.jsxs(Ae,{id:`action-modal-tab-${p.title}`,variant:r===p.title?"secondary":"ghost",className:J("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",p.className),onClick:()=>i(p.title),onKeyDown:v,children:[p.icon," ",p.title]},p.title))}),u.jsx(Qr,{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:o?u.jsxs(u.Fragment,{children:[r==="Info"&&u.jsx(YPe,{action:o.action,serverTime:o.serverTime,tsFetch:d}),r==="IDs"&&u.jsx(qPe,{action:o.action}),r==="Revoke"&&u.jsx(XPe,{action:o.action,refreshModalData:_})]}):u.jsx($f,{children:c?u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):u.jsx(Ba,{msg:"Loading..."})})})]})]})})}function QPe(){const e=BS(),t=IY(),n=qv(),r=OS(),i=WTe();return yi("message",s=>{s.data.type==="logoutNotice"?e("child iframe","got logoutNotice"):s.data.type==="openAccountModal"?t():s.data.type==="openPlayerModal"?n(s.data.ref):s.data.type==="navigateToPage"?F2(s.data.href):s.data.type==="globalHotkey"&&s.data.action==="toggleLightMode"&&i()}),w.useEffect(()=>{const s=new URL(window.location.toString()),a=s.searchParams.get(X_),o=s.searchParams.get(lb);if(!(!a&&!o)){if(a){if(a.includes("#")){const[l,c]=a.split("#"),h=parseInt(c);if(l.length&&c.length&&!isNaN(h))return n({mutex:l,netid:h})}else if(a.length)return n({license:a})}else if(o&&o.length)return r(o);s.searchParams.delete(X_),s.searchParams.delete(lb),window.history.replaceState({},"",s)}},[]),yi("keydown",SD),u.jsx(u.Fragment,{children:u.jsxs(PF,{delayDuration:300,disableHoverableContent:!0,children:[u.jsx(P7e,{}),u.jsxs("div",{className:"md:px-3 min-h-full pt-[var(--page-pt)] pb-[var(--page-pb)] w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[u.jsx(Xz,{}),u.jsx("main",{className:"flex flex-1 min-h-contentvh min-w-[360px]",children:u.jsx(i7e,{})}),window.txConsts.isWebInterface&&u.jsx(Jz,{})]}),u.jsx(aPe,{}),u.jsx(mPe,{}),u.jsx(RPe,{}),u.jsx(APe,{}),u.jsx(fte,{}),u.jsx(DPe,{}),u.jsx(UPe,{}),u.jsx(JPe,{}),u.jsx(VPe,{})]})})}function ZPe(){const e=w.useRef(!1),{authData:t,setAuthData:n}=Ga(),[r,i]=w.useState(mg),[s,a]=w.useState(!1),o=async()=>{try{a(!0);const l=await Eo("/auth/cfxre/callback",{method:"POST",body:{redirectUri:window.location.href}});"errorCode"in l||"errorTitle"in l?i(l):n(l)}catch(l){i(af(l))}finally{a(!1)}};return w.useEffect(()=>{if(t||e.current)return;e.current=!0;const l=mg();if(l){i(l);return}o()},[]),r?u.jsx(of,{error:r}):s?u.jsx(Ba,{msg:"Logging in..."}):u.jsx(Ba,{})}function eOe(){const e=w.useRef(null),[t,n]=w.useState(!1),[r,i]=w.useState(),[s,a]=w.useState(!1),[o,l]=w.useState(!1),[c,h]=w.useState(),d=async()=>{var g;try{a(!1),i(void 0),l(!0);const _=await Eo("/auth/addMaster/pin",{method:"POST",body:{pin:((g=e.current)==null?void 0:g.value)||"0000",origin:window.location.origin}});"error"in _?_.error==="master_already_set"?(n(!0),h({errorCode:_.error})):(a(!0),i(_.error)):(n(!0),console.log("Redirecting to",_.authUrl),window.location.href=_.authUrl)}catch(_){a(!0);const{errorTitle:y,errorMessage:v}=af(_);i(`${y}: ${v}`)}finally{l(!1)}};if(w.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(i("Auto-filled ✔"),e.current.value=window.location.hash.substring(1))},[]),c)return u.jsx(of,{error:c});const f=o||t;return u.jsxs("form",{onSubmit:g=>{g==null||g.preventDefault(),d()},className:"w-full",children:[u.jsxs(Lv,{className:"space-y-1",children:[u.jsx(Y2,{className:"text-3xl",children:"No Cfx.re account linked"}),u.jsx(UL,{className:"text-base text-muted-foreground",children:"Type in the PIN from the terminal."})]}),u.jsxs(Uc,{className:"grid gap-2",children:[u.jsx("span",{className:J("text-center",s?"text-destructive":"text-success"),children:r??u.jsx(u.Fragment,{children:" "})}),u.jsx(yt,{className:J("text-2xl text-center font-mono tracking-[0.25em] p-2",r&&(s?"border-acctext-destructive text-destructive":"border-succtext-success text-success")),id:"frm-pin",type:"text",ref:e,minLength:4,maxLength:4,placeholder:"0000",autoComplete:"off",onFocus:g=>{var _;a(!1),i(void 0),(_=g.target)==null||_.select()},onChange:g=>{g.target.value.length===4&&d()},disabled:f,required:!0})]}),u.jsx(Jh,{children:u.jsxs(Ae,{className:"w-full",disabled:f,children:[f&&u.jsx(Zt,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}var V5="Checkbox",[tOe,jOe]=In(V5),[nOe,rOe]=tOe(V5),jH=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:h,...d}=e,[f,g]=w.useState(null),_=Fe(t,b=>g(b)),y=w.useRef(!1),v=f?h||!!f.closest("form"):!0,[m=!1,p]=Zr({prop:i,defaultProp:s,onChange:c}),x=w.useRef(m);return w.useEffect(()=>{const b=f==null?void 0:f.form;if(b){const S=()=>p(x.current);return b.addEventListener("reset",S),()=>b.removeEventListener("reset",S)}},[f,p]),u.jsxs(nOe,{scope:n,state:m,disabled:o,children:[u.jsx(Ce.button,{type:"button",role:"checkbox","aria-checked":bo(m)?"mixed":m,"aria-required":a,"data-state":NH(m),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:_,onKeyDown:fe(e.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:fe(e.onClick,b=>{p(S=>bo(S)?!0:!S),v&&(y.current=b.isPropagationStopped(),y.current||b.stopPropagation())})}),v&&u.jsx(iOe,{control:f,bubbles:!y.current,name:r,value:l,checked:m,required:a,disabled:o,form:h,style:{transform:"translateX(-100%)"},defaultChecked:bo(s)?!1:s})]})});jH.displayName=V5;var LH="CheckboxIndicator",DH=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=rOe(LH,n);return u.jsx(fn,{present:r||bo(s.state)||s.state===!0,children:u.jsx(Ce.span,{"data-state":NH(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});DH.displayName=LH;var iOe=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...s}=e,a=w.useRef(null),o=ff(n),l=n0(t);w.useEffect(()=>{const h=a.current,d=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&g){const _=new Event("click",{bubbles:r});h.indeterminate=bo(n),g.call(h,bo(n)?!1:n),h.dispatchEvent(_)}},[o,n,r]);const c=w.useRef(bo(n)?!1:n);return u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function bo(e){return e==="indeterminate"}function NH(e){return bo(e)?"indeterminate":e?"checked":"unchecked"}var PH=jH,sOe=DH;const OH=w.forwardRef(({className:e,...t},n)=>u.jsx(PH,{ref:n,className:J("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:u.jsx(sOe,{className:J("flex items-center justify-center text-current"),children:u.jsx(lS,{className:"h-4 w-4"})})}));OH.displayName=PH.displayName;function oOe({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=Ga(),i=w.useRef(null),s=w.useRef(null),a=w.useRef(null),o=w.useRef(null),[l,c]=w.useState(),[h,d]=w.useState(),[f,g]=w.useState(!1),_=async(v,m)=>{try{g(!0);const p=await Eo("/auth/addMaster/save",{method:"POST",body:{discordId:m,password:v}});"error"in p?p.error==="master_already_set"?d({errorCode:p.error}):p.error==="invalid_session"?d({errorCode:p.error,returnTo:"/addMaster/pin"}):c(p.error):(window.txConsts.hasMasterAccount=!0,r(p))}catch(p){const{errorTitle:x,errorMessage:b}=af(p);c(`${x}: ${b}`)}finally{g(!1)}},y=v=>{var S,C,E,k,T;v==null||v.preventDefault(),c(void 0);let m,p=(C=(S=i.current)==null?void 0:S.value)==null?void 0:C.trim();if(typeof p=="string"&&p.length>0){if(p.startsWith("discord:")&&(p=p.substring(8),i.current.value=p),!Or.validIdentifierParts.discord.test(p)){c(`The Discord ID needs to be the numeric "User ID" instead of the username.
 You can also leave it blank.`);return}m=p}if(((E=o.current)==null?void 0:E.value)!=="on"){c("You MUST agree to the terms.");return}const x=((k=s.current)==null?void 0:k.value)||"",b=((T=a.current)==null?void 0:T.value)||"";if(x.length<Or.adminPasswordMinLength||x.length>Or.adminPasswordMaxLength){c(`The password must be between ${Or.adminPasswordMinLength} and ${Or.adminPasswordMaxLength} characters long.`);return}else if(x!==b){c("The passwords do not match.");return}_(x,m)};return w.useEffect(()=>{try{const v=localStorage.getItem("authCredsAutofill");if(v){const[m,p]=JSON.parse(v);s.current.value=p??"",a.current.value=p??""}}catch(v){console.error("Passwords autofill failed",v)}},[]),h?u.jsx(of,{error:h}):u.jsxs("form",{onSubmit:y,className:"w-full text-left",children:[u.jsxs(Uc,{className:"pt-6 flex flex-col gap-4",children:[u.jsxs("div",{children:["Cfx.re account",u.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:[u.jsx(Gz,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),u.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[u.jsx("span",{className:"text-2xl",children:t})," ",u.jsx("br",{}),u.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),u.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex flex-row justify-between items-center",children:[u.jsx(Ld,{htmlFor:"frm-discord",children:"Discord ID"}),u.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),u.jsx(yt,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:i,placeholder:"000000000000000000",disabled:f})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex flex-row justify-between items-center",children:[u.jsx(Ld,{htmlFor:"frm-password",children:"Backup Password"}),u.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",Or.adminPasswordMinLength,"~",Or.adminPasswordMaxLength," digits)"]})]}),u.jsx(yt,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:s,placeholder:"password",disabled:f,required:!0})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(Ld,{htmlFor:"frm-password2",children:"Confirm Password"}),u.jsx(yt,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:a,placeholder:"password",disabled:f,required:!0})]}),u.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[u.jsx(OH,{id:"terms",ref:o,required:!0}),u.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 ",u.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"})," as well as the ",u.jsx("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"txAdmin License"}),"."]})]})]}),u.jsxs(Jh,{className:"flex-col gap-2",children:[u.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:l}),u.jsxs(Ae,{className:"w-full",disabled:f,children:[f&&u.jsx(Zt,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function aOe(){const e=w.useRef(!1),[t,n]=w.useState(),[r,i]=w.useState(mg),[s,a]=w.useState(!1),o=async()=>{try{a(!0);const l=await Eo("/auth/addMaster/callback",{method:"POST",body:{redirectUri:window.location.href}});"errorCode"in l||"errorTitle"in l?i(l):n(l)}catch(l){i(af(l))}finally{a(!1)}};return w.useEffect(()=>{if(t||e.current)return;e.current=!0;const l=mg();if(l){i(l);return}o()},[]),t?u.jsx(oOe,{...t}):r?u.jsx(of,{error:{...r,returnTo:"/addMaster/pin"}}):s?u.jsx(Ba,{msg:"Authenticating..."}):u.jsx(Ba,{})}function Up({children:e}){return u.jsx("div",{className:"text-center",children:e})}function lOe(){const e=UTe(window.txConsts.providerLogo);return u.jsx("div",{className:"min-h-screen flex items-center justify-center pattern-dots",children:u.jsxs("div",{className:"w-full min-w-[20rem] xs:max-w-[25rem] my-4 xs:mx-4",children:[e?u.jsx("img",{className:"max-w-36 xs:max-w-56 max-h-16 xs:max-h-24 m-auto",src:e,alt:window.txConsts.providerName}):u.jsx(H5,{className:"w-36 xs:w-52 mx-auto"}),u.jsx(jv,{className:"min-h-80 mt-4 xs:mt-8 mb-4 flex items-center justify-center bg-card/40 rounded-none xs:rounded-lg",children:u.jsxs(wL,{children:[u.jsx(na,{path:"/login",children:u.jsx(rne,{})}),u.jsx(na,{path:"/login/callback",children:u.jsx(Up,{children:u.jsx(ZPe,{})})}),u.jsx(na,{path:"/addMaster/pin",children:u.jsx(Up,{children:u.jsx(eOe,{})})}),u.jsx(na,{path:"/addMaster/callback",children:u.jsx(Up,{children:u.jsx(aOe,{})})}),u.jsx(na,{path:"/:fullPath*",children:u.jsx(Up,{children:u.jsx(of,{error:{errorTitle:"404 | Not Found",errorMessage:"Something went wrong."}})})})]})}),u.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[window.txConsts.adsData.login?u.jsxs("a",{href:window.txConsts.adsData.login.url,onClick:dh,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100
                            dark:brightness-90 dark:hover:brightness-110`,children:[u.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]`}),u.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:window.txConsts.adsData.login.img})]}):null,u.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:dh,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:[u.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]`}),u.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),u.jsxs("div",{className:"text-center text-muted-foreground text-sm font-light",children:["tx: ",u.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",u.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})]})})}function cOe({children:e}){const{theme:t,setTheme:n}=IB();return w.useEffect(()=>{const r=s=>{const a=s.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]),u.jsx(u.Fragment,{children:e})}var q5={exports:{}};q5.exports=G5;var uOe=q5.exports.isMobile=G5;q5.exports.default=G5;const dOe=/(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,hOe=/CrOS/,fOe=/android|ipad|playbook|silk/i;function G5(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=dOe.test(t)&&!hOe.test(t)||!!e.tablet&&fOe.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=()=>{},console.info=()=>{},console.warn=()=>{},console.error=()=>{},console.debug=()=>{},console.table=()=>{},console.group=()=>{},console.groupEnd=()=>{},console.groupCollapsed=()=>{},console.time=()=>{},console.timeEnd=()=>{},console.timeLog=()=>{});try{window.txIsMobile=uOe({tablet:!0})}catch{window.txIsMobile=!1}try{window.txBrowserLocale=(window==null?void 0:window.nuiSystemLanguages)??navigator.language??"en"}catch{window.txBrowserLocale="en"}try{const e=Intl.DateTimeFormat(window.txBrowserLocale,{hour:"numeric"}).resolvedOptions().hour12;window.txBrowserHour12=e??!0}catch{window.txBrowserHour12=!0}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 pOe=["/login","/addMaster"],YA=e=>pOe.some(t=>e.startsWith(t));function mOe(){et(Xte),et(yK);const e=Gte();return w.useEffect(()=>{if(e){const n=new URLSearchParams(window.location.search).get("r");n?ine(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):YA(window.location.pathname)&&window.history.replaceState(null,"","/")}else!window.txConsts.hasMasterAccount&&!window.location.pathname.startsWith("/addMaster")?(console.log("No master account detected. Redirecting to addMaster page."),window.history.replaceState(null,"","/addMaster/pin")):YA(window.location.pathname)||(console.log("User is not authenticated. Redirecting to login page."),US())},[e]),e?u.jsx(QPe,{}):u.jsx(lOe,{})}Ux.createRoot(document.getElementById("root")).render(u.jsx(w.StrictMode,{children:u.jsx(lj,{FallbackComponent:KG,children:u.jsx(cOe,{children:u.jsx(mOe,{})})})}));
//# sourceMappingURL=index-f9doidst.v800.js.map
